@loreai/gateway 0.14.0 → 0.14.1

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.cjs ADDED
@@ -0,0 +1,1042 @@
1
+ "use strict";var _ge=Object.create;var NE=Object.defineProperty;var gge=Object.getOwnPropertyDescriptor;var hge=Object.getOwnPropertyNames;var Ege=Object.getPrototypeOf,Tge=Object.prototype.hasOwnProperty;var I=(e,t)=>()=>(e&&(t=e(e=0)),t);var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ft=(e,t)=>{for(var n in t)NE(e,n,{get:t[n],enumerable:!0})},XV=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of hge(t))!Tge.call(e,r)&&r!==n&&NE(e,r,{get:()=>t[r],enumerable:!(o=gge(t,r))||o.enumerable});return e};var U=(e,t,n)=>(n=e!=null?_ge(Ege(e)):{},XV(t||!e||!e.__esModule?NE(n,"default",{value:e,enumerable:!0}):n,e)),hC=e=>XV(NE({},"__esModule",{value:!0}),e);var Sge,Age,yge,Rge,l=I(()=>{"use strict";if(typeof globalThis.Bun>"u"){let r=function(c){let u=e.createServer(async(d,p)=>{try{let f=`http://${c.hostname}:${c.port}${d.url}`,m=d.method==="GET"||d.method==="HEAD"?null:t.toWeb(d),_=new Request(f,{method:d.method,headers:d.headers,body:m,duplex:"half"}),h=await c.fetch(_),E=[];if(h.headers.forEach((T,R)=>{E.push([R,T])}),p.writeHead(h.status,Object.fromEntries(E)),h.body){let T=h.body.getReader();try{for(;;){let{done:R,value:C}=await T.read();if(R)break;p.write(C)}}finally{T.releaseLock()}}p.end()}catch(f){console.error("[lore] polyfill: request handler error:",f),p.headersSent||p.writeHead(500,{"content-type":"application/json"}),p.end(JSON.stringify({error:"Internal server error"}))}});return u.listen(c.port,c.hostname),{stop:()=>u.close(),get port(){let d=u.address();return typeof d=="object"&&d!==null?d.port:c.port}}},i=function(c){return n.zstdCompressSync(c)},s=function(c){return n.zstdDecompressSync(c)},a=function(c){try{let u=process.platform==="win32"?"where":"which";return o.execFileSync(u,[c],{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim().split(`
2
+ `)[0]||null}catch{return null}};Sge=r,Age=i,yge=s,Rge=a;let e=require("node:http"),{Readable:t}=require("node:stream"),n=require("node:zlib"),o=require("node:child_process");globalThis.Bun={serve:r,zstdCompressSync:i,zstdDecompressSync:s,which:a,main:null}}});var SP=S(RT=>{"use strict";l();Object.defineProperty(RT,"__esModule",{value:!0});RT.VERSION=void 0;RT.VERSION="1.9.1"});var MY=S(gd=>{"use strict";l();Object.defineProperty(gd,"__esModule",{value:!0});gd.isCompatible=gd._makeCompatibilityCheck=void 0;var DSe=SP(),PY=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function xY(e){let t=new Set([e]),n=new Set,o=e.match(PY);if(!o)return()=>!1;let r={major:+o[1],minor:+o[2],patch:+o[3],prerelease:o[4]};if(r.prerelease!=null)return function(c){return c===e};function i(a){return n.add(a),!1}function s(a){return t.add(a),!0}return function(c){if(t.has(c))return!0;if(n.has(c))return!1;let u=c.match(PY);if(!u)return i(c);let d={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return d.prerelease!=null||r.major!==d.major?i(c):r.major===0?r.minor===d.minor&&r.patch<=d.patch?s(c):i(c):r.minor<=d.minor?s(c):i(c)}}gd._makeCompatibilityCheck=xY;gd.isCompatible=xY(DSe.VERSION)});var su=S(Ia=>{"use strict";l();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.unregisterGlobal=Ia.getGlobal=Ia.registerGlobal=void 0;var hd=SP(),kSe=MY(),USe=hd.VERSION.split(".")[0],a_=Symbol.for(`opentelemetry.js.api.${USe}`),c_=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};function $Se(e,t,n,o=!1){var r;let i=c_[a_]=(r=c_[a_])!==null&&r!==void 0?r:{version:hd.VERSION};if(!o&&i[e]){let s=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(s.stack||s.message),!1}if(i.version!==hd.VERSION){let s=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${hd.VERSION}`);return n.error(s.stack||s.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${hd.VERSION}.`),!0}Ia.registerGlobal=$Se;function BSe(e){var t,n;let o=(t=c_[a_])===null||t===void 0?void 0:t.version;if(!(!o||!(0,kSe.isCompatible)(o)))return(n=c_[a_])===null||n===void 0?void 0:n[e]}Ia.getGlobal=BSe;function GSe(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${hd.VERSION}.`);let n=c_[a_];n&&delete n[e]}Ia.unregisterGlobal=GSe});var LY=S(IT=>{"use strict";l();Object.defineProperty(IT,"__esModule",{value:!0});IT.DiagComponentLogger=void 0;var jSe=su(),AP=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return u_("debug",this._namespace,t)}error(...t){return u_("error",this._namespace,t)}info(...t){return u_("info",this._namespace,t)}warn(...t){return u_("warn",this._namespace,t)}verbose(...t){return u_("verbose",this._namespace,t)}};IT.DiagComponentLogger=AP;function u_(e,t,n){let o=(0,jSe.getGlobal)("diag");if(o)return o[e](t,...n)}});var bT=S(l_=>{"use strict";l();Object.defineProperty(l_,"__esModule",{value:!0});l_.DiagLogLevel=void 0;var VSe;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(VSe=l_.DiagLogLevel||(l_.DiagLogLevel={}))});var wY=S(NT=>{"use strict";l();Object.defineProperty(NT,"__esModule",{value:!0});NT.createLogLevelDiagLogger=void 0;var Ss=bT();function FSe(e,t){e<Ss.DiagLogLevel.NONE?e=Ss.DiagLogLevel.NONE:e>Ss.DiagLogLevel.ALL&&(e=Ss.DiagLogLevel.ALL),t=t||{};function n(o,r){let i=t[o];return typeof i=="function"&&e>=r?i.bind(t):function(){}}return{error:n("error",Ss.DiagLogLevel.ERROR),warn:n("warn",Ss.DiagLogLevel.WARN),info:n("info",Ss.DiagLogLevel.INFO),debug:n("debug",Ss.DiagLogLevel.DEBUG),verbose:n("verbose",Ss.DiagLogLevel.VERBOSE)}}NT.createLogLevelDiagLogger=FSe});var au=S(CT=>{"use strict";l();Object.defineProperty(CT,"__esModule",{value:!0});CT.DiagAPI=void 0;var HSe=LY(),zSe=wY(),DY=bT(),OT=su(),qSe="diag",yP=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(r){return function(...i){let s=(0,OT.getGlobal)("diag");if(s)return s[r](...i)}}let n=this,o=(r,i={logLevel:DY.DiagLogLevel.INFO})=>{var s,a,c;if(r===n){let p=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((s=p.stack)!==null&&s!==void 0?s:p.message),!1}typeof i=="number"&&(i={logLevel:i});let u=(0,OT.getGlobal)("diag"),d=(0,zSe.createLogLevelDiagLogger)((a=i.logLevel)!==null&&a!==void 0?a:DY.DiagLogLevel.INFO,r);if(u&&!i.suppressOverrideMessage){let p=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";u.warn(`Current logger will be overwritten from ${p}`),d.warn(`Current logger will overwrite one already registered from ${p}`)}return(0,OT.registerGlobal)("diag",d,n,!0)};n.setLogger=o,n.disable=()=>{(0,OT.unregisterGlobal)(qSe,n)},n.createComponentLogger=r=>new HSe.DiagComponentLogger(r),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}};CT.DiagAPI=yP});var kY=S(vT=>{"use strict";l();Object.defineProperty(vT,"__esModule",{value:!0});vT.BaggageImpl=void 0;var RP=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let o=new e(this._entries);return o._entries.set(t,n),o}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let o of t)n._entries.delete(o);return n}clear(){return new e}};vT.BaggageImpl=RP});var UY=S(PT=>{"use strict";l();Object.defineProperty(PT,"__esModule",{value:!0});PT.baggageEntryMetadataSymbol=void 0;PT.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")});var IP=S(Ed=>{"use strict";l();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.baggageEntryMetadataFromString=Ed.createBaggage=void 0;var YSe=au(),WSe=kY(),KSe=UY(),ZSe=YSe.DiagAPI.instance();function JSe(e={}){return new WSe.BaggageImpl(new Map(Object.entries(e)))}Ed.createBaggage=JSe;function XSe(e){return typeof e!="string"&&(ZSe.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:KSe.baggageEntryMetadataSymbol,toString(){return e}}}Ed.baggageEntryMetadataFromString=XSe});var d_=S(Td=>{"use strict";l();Object.defineProperty(Td,"__esModule",{value:!0});Td.ROOT_CONTEXT=Td.createContextKey=void 0;function QSe(e){return Symbol.for(e)}Td.createContextKey=QSe;var bP=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=o=>n._currentContext.get(o),n.setValue=(o,r)=>{let i=new e(n._currentContext);return i._currentContext.set(o,r),i},n.deleteValue=o=>{let r=new e(n._currentContext);return r._currentContext.delete(o),r}}};Td.ROOT_CONTEXT=new bP});var $Y=S(As=>{"use strict";l();Object.defineProperty(As,"__esModule",{value:!0});As.DiagConsoleLogger=As._originalConsoleMethods=void 0;var NP=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];As._originalConsoleMethods={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(As._originalConsoleMethods[t]=console[t])}var OP=class{constructor(){function t(n){return function(...o){let r=As._originalConsoleMethods[n];if(typeof r!="function"&&(r=As._originalConsoleMethods.log),typeof r!="function"&&console&&(r=console[n],typeof r!="function"&&(r=console.log)),typeof r=="function")return r.apply(console,o)}}for(let n=0;n<NP.length;n++)this[NP[n].n]=t(NP[n].c)}};As.DiagConsoleLogger=OP});var CP=S(Se=>{"use strict";l();Object.defineProperty(Se,"__esModule",{value:!0});Se.createNoopMeter=Se.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=Se.NOOP_OBSERVABLE_GAUGE_METRIC=Se.NOOP_OBSERVABLE_COUNTER_METRIC=Se.NOOP_UP_DOWN_COUNTER_METRIC=Se.NOOP_HISTOGRAM_METRIC=Se.NOOP_GAUGE_METRIC=Se.NOOP_COUNTER_METRIC=Se.NOOP_METER=Se.NoopObservableUpDownCounterMetric=Se.NoopObservableGaugeMetric=Se.NoopObservableCounterMetric=Se.NoopObservableMetric=Se.NoopHistogramMetric=Se.NoopGaugeMetric=Se.NoopUpDownCounterMetric=Se.NoopCounterMetric=Se.NoopMetric=Se.NoopMeter=void 0;var xT=class{constructor(){}createGauge(t,n){return Se.NOOP_GAUGE_METRIC}createHistogram(t,n){return Se.NOOP_HISTOGRAM_METRIC}createCounter(t,n){return Se.NOOP_COUNTER_METRIC}createUpDownCounter(t,n){return Se.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(t,n){return Se.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(t,n){return Se.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(t,n){return Se.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}};Se.NoopMeter=xT;var cu=class{};Se.NoopMetric=cu;var MT=class extends cu{add(t,n){}};Se.NoopCounterMetric=MT;var LT=class extends cu{add(t,n){}};Se.NoopUpDownCounterMetric=LT;var wT=class extends cu{record(t,n){}};Se.NoopGaugeMetric=wT;var DT=class extends cu{record(t,n){}};Se.NoopHistogramMetric=DT;var Sd=class{addCallback(t){}removeCallback(t){}};Se.NoopObservableMetric=Sd;var kT=class extends Sd{};Se.NoopObservableCounterMetric=kT;var UT=class extends Sd{};Se.NoopObservableGaugeMetric=UT;var $T=class extends Sd{};Se.NoopObservableUpDownCounterMetric=$T;Se.NOOP_METER=new xT;Se.NOOP_COUNTER_METRIC=new MT;Se.NOOP_GAUGE_METRIC=new wT;Se.NOOP_HISTOGRAM_METRIC=new DT;Se.NOOP_UP_DOWN_COUNTER_METRIC=new LT;Se.NOOP_OBSERVABLE_COUNTER_METRIC=new kT;Se.NOOP_OBSERVABLE_GAUGE_METRIC=new UT;Se.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new $T;function eAe(){return Se.NOOP_METER}Se.createNoopMeter=eAe});var BY=S(p_=>{"use strict";l();Object.defineProperty(p_,"__esModule",{value:!0});p_.ValueType=void 0;var tAe;(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(tAe=p_.ValueType||(p_.ValueType={}))});var vP=S(Ad=>{"use strict";l();Object.defineProperty(Ad,"__esModule",{value:!0});Ad.defaultTextMapSetter=Ad.defaultTextMapGetter=void 0;Ad.defaultTextMapGetter={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}};Ad.defaultTextMapSetter={set(e,t,n){e!=null&&(e[t]=n)}}});var GY=S(BT=>{"use strict";l();Object.defineProperty(BT,"__esModule",{value:!0});BT.NoopContextManager=void 0;var nAe=d_(),PP=class{active(){return nAe.ROOT_CONTEXT}with(t,n,o,...r){return n.call(o,...r)}bind(t,n){return n}enable(){return this}disable(){return this}};BT.NoopContextManager=PP});var f_=S(GT=>{"use strict";l();Object.defineProperty(GT,"__esModule",{value:!0});GT.ContextAPI=void 0;var rAe=GY(),xP=su(),jY=au(),MP="context",oAe=new rAe.NoopContextManager,LP=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return(0,xP.registerGlobal)(MP,t,jY.DiagAPI.instance())}active(){return this._getContextManager().active()}with(t,n,o,...r){return this._getContextManager().with(t,n,o,...r)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return(0,xP.getGlobal)(MP)||oAe}disable(){this._getContextManager().disable(),(0,xP.unregisterGlobal)(MP,jY.DiagAPI.instance())}};GT.ContextAPI=LP});var wP=S(m_=>{"use strict";l();Object.defineProperty(m_,"__esModule",{value:!0});m_.TraceFlags=void 0;var iAe;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(iAe=m_.TraceFlags||(m_.TraceFlags={}))});var jT=S(Si=>{"use strict";l();Object.defineProperty(Si,"__esModule",{value:!0});Si.INVALID_SPAN_CONTEXT=Si.INVALID_TRACEID=Si.INVALID_SPANID=void 0;var sAe=wP();Si.INVALID_SPANID="0000000000000000";Si.INVALID_TRACEID="00000000000000000000000000000000";Si.INVALID_SPAN_CONTEXT={traceId:Si.INVALID_TRACEID,spanId:Si.INVALID_SPANID,traceFlags:sAe.TraceFlags.NONE}});var FT=S(VT=>{"use strict";l();Object.defineProperty(VT,"__esModule",{value:!0});VT.NonRecordingSpan=void 0;var aAe=jT(),DP=class{constructor(t=aAe.INVALID_SPAN_CONTEXT){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}};VT.NonRecordingSpan=DP});var $P=S(gr=>{"use strict";l();Object.defineProperty(gr,"__esModule",{value:!0});gr.getSpanContext=gr.setSpanContext=gr.deleteSpan=gr.setSpan=gr.getActiveSpan=gr.getSpan=void 0;var cAe=d_(),uAe=FT(),lAe=f_(),kP=(0,cAe.createContextKey)("OpenTelemetry Context Key SPAN");function UP(e){return e.getValue(kP)||void 0}gr.getSpan=UP;function dAe(){return UP(lAe.ContextAPI.getInstance().active())}gr.getActiveSpan=dAe;function VY(e,t){return e.setValue(kP,t)}gr.setSpan=VY;function pAe(e){return e.deleteValue(kP)}gr.deleteSpan=pAe;function fAe(e,t){return VY(e,new uAe.NonRecordingSpan(t))}gr.setSpanContext=fAe;function mAe(e){var t;return(t=UP(e))===null||t===void 0?void 0:t.spanContext()}gr.getSpanContext=mAe});var zT=S(Ai=>{"use strict";l();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.wrapSpanContext=Ai.isSpanContextValid=Ai.isValidSpanId=Ai.isValidTraceId=void 0;var FY=jT(),_Ae=FT(),HT=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 HY(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let o=0;o<e.length;o+=4)n+=(HT[e.charCodeAt(o)]|0)+(HT[e.charCodeAt(o+1)]|0)+(HT[e.charCodeAt(o+2)]|0)+(HT[e.charCodeAt(o+3)]|0);return n===t}function zY(e){return HY(e,32)&&e!==FY.INVALID_TRACEID}Ai.isValidTraceId=zY;function qY(e){return HY(e,16)&&e!==FY.INVALID_SPANID}Ai.isValidSpanId=qY;function gAe(e){return zY(e.traceId)&&qY(e.spanId)}Ai.isSpanContextValid=gAe;function hAe(e){return new _Ae.NonRecordingSpan(e)}Ai.wrapSpanContext=hAe});var VP=S(qT=>{"use strict";l();Object.defineProperty(qT,"__esModule",{value:!0});qT.NoopTracer=void 0;var EAe=f_(),YY=$P(),BP=FT(),TAe=zT(),GP=EAe.ContextAPI.getInstance(),jP=class{startSpan(t,n,o=GP.active()){if(!!n?.root)return new BP.NonRecordingSpan;let i=o&&(0,YY.getSpanContext)(o);return SAe(i)&&(0,TAe.isSpanContextValid)(i)?new BP.NonRecordingSpan(i):new BP.NonRecordingSpan}startActiveSpan(t,n,o,r){let i,s,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(i=n,a=o):(i=n,s=o,a=r);let c=s??GP.active(),u=this.startSpan(t,i,c),d=(0,YY.setSpan)(c,u);return GP.with(d,a,void 0,u)}};qT.NoopTracer=jP;function SAe(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}});var HP=S(YT=>{"use strict";l();Object.defineProperty(YT,"__esModule",{value:!0});YT.ProxyTracer=void 0;var AAe=VP(),yAe=new AAe.NoopTracer,FP=class{constructor(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}startSpan(t,n,o){return this._getTracer().startSpan(t,n,o)}startActiveSpan(t,n,o,r){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):yAe}};YT.ProxyTracer=FP});var WY=S(WT=>{"use strict";l();Object.defineProperty(WT,"__esModule",{value:!0});WT.NoopTracerProvider=void 0;var RAe=VP(),zP=class{getTracer(t,n,o){return new RAe.NoopTracer}};WT.NoopTracerProvider=zP});var YP=S(KT=>{"use strict";l();Object.defineProperty(KT,"__esModule",{value:!0});KT.ProxyTracerProvider=void 0;var IAe=HP(),bAe=WY(),NAe=new bAe.NoopTracerProvider,qP=class{getTracer(t,n,o){var r;return(r=this.getDelegateTracer(t,n,o))!==null&&r!==void 0?r:new IAe.ProxyTracer(this,t,n,o)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:NAe}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getTracer(t,n,o)}};KT.ProxyTracerProvider=qP});var KY=S(__=>{"use strict";l();Object.defineProperty(__,"__esModule",{value:!0});__.SamplingDecision=void 0;var OAe;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(OAe=__.SamplingDecision||(__.SamplingDecision={}))});var ZY=S(g_=>{"use strict";l();Object.defineProperty(g_,"__esModule",{value:!0});g_.SpanKind=void 0;var CAe;(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(CAe=g_.SpanKind||(g_.SpanKind={}))});var JY=S(h_=>{"use strict";l();Object.defineProperty(h_,"__esModule",{value:!0});h_.SpanStatusCode=void 0;var vAe;(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(vAe=h_.SpanStatusCode||(h_.SpanStatusCode={}))});var XY=S(yd=>{"use strict";l();Object.defineProperty(yd,"__esModule",{value:!0});yd.validateValue=yd.validateKey=void 0;var WP="[_0-9a-z-*/]",PAe=`[a-z]${WP}{0,255}`,xAe=`[a-z0-9]${WP}{0,240}@[a-z]${WP}{0,13}`,MAe=new RegExp(`^(?:${PAe}|${xAe})$`),LAe=/^[ -~]{0,255}[!-~]$/,wAe=/,|=/;function DAe(e){return MAe.test(e)}yd.validateKey=DAe;function kAe(e){return LAe.test(e)&&!wAe.test(e)}yd.validateValue=kAe});var rW=S(ZT=>{"use strict";l();Object.defineProperty(ZT,"__esModule",{value:!0});ZT.TraceStateImpl=void 0;var QY=XY(),eW=32,UAe=512,tW=",",nW="=",KP=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let o=this._clone();return o._internalState.has(t)&&o._internalState.delete(t),o._internalState.set(t,n),o}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+nW+this.get(n)),t),[]).join(tW)}_parse(t){t.length>UAe||(this._internalState=t.split(tW).reduceRight((n,o)=>{let r=o.trim(),i=r.indexOf(nW);if(i!==-1){let s=r.slice(0,i),a=r.slice(i+1,o.length);(0,QY.validateKey)(s)&&(0,QY.validateValue)(a)&&n.set(s,a)}return n},new Map),this._internalState.size>eW&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,eW))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};ZT.TraceStateImpl=KP});var oW=S(JT=>{"use strict";l();Object.defineProperty(JT,"__esModule",{value:!0});JT.createTraceState=void 0;var $Ae=rW();function BAe(e){return new $Ae.TraceStateImpl(e)}JT.createTraceState=BAe});var iW=S(XT=>{"use strict";l();Object.defineProperty(XT,"__esModule",{value:!0});XT.context=void 0;var GAe=f_();XT.context=GAe.ContextAPI.getInstance()});var sW=S(QT=>{"use strict";l();Object.defineProperty(QT,"__esModule",{value:!0});QT.diag=void 0;var jAe=au();QT.diag=jAe.DiagAPI.instance()});var aW=S(Rd=>{"use strict";l();Object.defineProperty(Rd,"__esModule",{value:!0});Rd.NOOP_METER_PROVIDER=Rd.NoopMeterProvider=void 0;var VAe=CP(),eS=class{getMeter(t,n,o){return VAe.NOOP_METER}};Rd.NoopMeterProvider=eS;Rd.NOOP_METER_PROVIDER=new eS});var uW=S(tS=>{"use strict";l();Object.defineProperty(tS,"__esModule",{value:!0});tS.MetricsAPI=void 0;var FAe=aW(),ZP=su(),cW=au(),JP="metrics",XP=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return(0,ZP.registerGlobal)(JP,t,cW.DiagAPI.instance())}getMeterProvider(){return(0,ZP.getGlobal)(JP)||FAe.NOOP_METER_PROVIDER}getMeter(t,n,o){return this.getMeterProvider().getMeter(t,n,o)}disable(){(0,ZP.unregisterGlobal)(JP,cW.DiagAPI.instance())}};tS.MetricsAPI=XP});var lW=S(nS=>{"use strict";l();Object.defineProperty(nS,"__esModule",{value:!0});nS.metrics=void 0;var HAe=uW();nS.metrics=HAe.MetricsAPI.getInstance()});var dW=S(rS=>{"use strict";l();Object.defineProperty(rS,"__esModule",{value:!0});rS.NoopTextMapPropagator=void 0;var QP=class{inject(t,n){}extract(t,n){return t}fields(){return[]}};rS.NoopTextMapPropagator=QP});var fW=S(yi=>{"use strict";l();Object.defineProperty(yi,"__esModule",{value:!0});yi.deleteBaggage=yi.setBaggage=yi.getActiveBaggage=yi.getBaggage=void 0;var zAe=f_(),qAe=d_(),ex=(0,qAe.createContextKey)("OpenTelemetry Baggage Key");function pW(e){return e.getValue(ex)||void 0}yi.getBaggage=pW;function YAe(){return pW(zAe.ContextAPI.getInstance().active())}yi.getActiveBaggage=YAe;function WAe(e,t){return e.setValue(ex,t)}yi.setBaggage=WAe;function KAe(e){return e.deleteValue(ex)}yi.deleteBaggage=KAe});var gW=S(iS=>{"use strict";l();Object.defineProperty(iS,"__esModule",{value:!0});iS.PropagationAPI=void 0;var tx=su(),ZAe=dW(),mW=vP(),oS=fW(),JAe=IP(),_W=au(),nx="propagation",XAe=new ZAe.NoopTextMapPropagator,rx=class e{constructor(){this.createBaggage=JAe.createBaggage,this.getBaggage=oS.getBaggage,this.getActiveBaggage=oS.getActiveBaggage,this.setBaggage=oS.setBaggage,this.deleteBaggage=oS.deleteBaggage}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return(0,tx.registerGlobal)(nx,t,_W.DiagAPI.instance())}inject(t,n,o=mW.defaultTextMapSetter){return this._getGlobalPropagator().inject(t,n,o)}extract(t,n,o=mW.defaultTextMapGetter){return this._getGlobalPropagator().extract(t,n,o)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,tx.unregisterGlobal)(nx,_W.DiagAPI.instance())}_getGlobalPropagator(){return(0,tx.getGlobal)(nx)||XAe}};iS.PropagationAPI=rx});var hW=S(sS=>{"use strict";l();Object.defineProperty(sS,"__esModule",{value:!0});sS.propagation=void 0;var QAe=gW();sS.propagation=QAe.PropagationAPI.getInstance()});var AW=S(aS=>{"use strict";l();Object.defineProperty(aS,"__esModule",{value:!0});aS.TraceAPI=void 0;var ox=su(),EW=YP(),TW=zT(),Id=$P(),SW=au(),ix="trace",sx=class e{constructor(){this._proxyTracerProvider=new EW.ProxyTracerProvider,this.wrapSpanContext=TW.wrapSpanContext,this.isSpanContextValid=TW.isSpanContextValid,this.deleteSpan=Id.deleteSpan,this.getSpan=Id.getSpan,this.getActiveSpan=Id.getActiveSpan,this.getSpanContext=Id.getSpanContext,this.setSpan=Id.setSpan,this.setSpanContext=Id.setSpanContext}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=(0,ox.registerGlobal)(ix,this._proxyTracerProvider,SW.DiagAPI.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return(0,ox.getGlobal)(ix)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){(0,ox.unregisterGlobal)(ix,SW.DiagAPI.instance()),this._proxyTracerProvider=new EW.ProxyTracerProvider}};aS.TraceAPI=sx});var yW=S(cS=>{"use strict";l();Object.defineProperty(cS,"__esModule",{value:!0});cS.trace=void 0;var eye=AW();cS.trace=eye.TraceAPI.getInstance()});var K=S(me=>{"use strict";l();Object.defineProperty(me,"__esModule",{value:!0});me.trace=me.propagation=me.metrics=me.diag=me.context=me.INVALID_SPAN_CONTEXT=me.INVALID_TRACEID=me.INVALID_SPANID=me.isValidSpanId=me.isValidTraceId=me.isSpanContextValid=me.createTraceState=me.TraceFlags=me.SpanStatusCode=me.SpanKind=me.SamplingDecision=me.ProxyTracerProvider=me.ProxyTracer=me.defaultTextMapSetter=me.defaultTextMapGetter=me.ValueType=me.createNoopMeter=me.DiagLogLevel=me.DiagConsoleLogger=me.ROOT_CONTEXT=me.createContextKey=me.baggageEntryMetadataFromString=void 0;var tye=IP();Object.defineProperty(me,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return tye.baggageEntryMetadataFromString}});var RW=d_();Object.defineProperty(me,"createContextKey",{enumerable:!0,get:function(){return RW.createContextKey}});Object.defineProperty(me,"ROOT_CONTEXT",{enumerable:!0,get:function(){return RW.ROOT_CONTEXT}});var nye=$Y();Object.defineProperty(me,"DiagConsoleLogger",{enumerable:!0,get:function(){return nye.DiagConsoleLogger}});var rye=bT();Object.defineProperty(me,"DiagLogLevel",{enumerable:!0,get:function(){return rye.DiagLogLevel}});var oye=CP();Object.defineProperty(me,"createNoopMeter",{enumerable:!0,get:function(){return oye.createNoopMeter}});var iye=BY();Object.defineProperty(me,"ValueType",{enumerable:!0,get:function(){return iye.ValueType}});var IW=vP();Object.defineProperty(me,"defaultTextMapGetter",{enumerable:!0,get:function(){return IW.defaultTextMapGetter}});Object.defineProperty(me,"defaultTextMapSetter",{enumerable:!0,get:function(){return IW.defaultTextMapSetter}});var sye=HP();Object.defineProperty(me,"ProxyTracer",{enumerable:!0,get:function(){return sye.ProxyTracer}});var aye=YP();Object.defineProperty(me,"ProxyTracerProvider",{enumerable:!0,get:function(){return aye.ProxyTracerProvider}});var cye=KY();Object.defineProperty(me,"SamplingDecision",{enumerable:!0,get:function(){return cye.SamplingDecision}});var uye=ZY();Object.defineProperty(me,"SpanKind",{enumerable:!0,get:function(){return uye.SpanKind}});var lye=JY();Object.defineProperty(me,"SpanStatusCode",{enumerable:!0,get:function(){return lye.SpanStatusCode}});var dye=wP();Object.defineProperty(me,"TraceFlags",{enumerable:!0,get:function(){return dye.TraceFlags}});var pye=oW();Object.defineProperty(me,"createTraceState",{enumerable:!0,get:function(){return pye.createTraceState}});var ax=zT();Object.defineProperty(me,"isSpanContextValid",{enumerable:!0,get:function(){return ax.isSpanContextValid}});Object.defineProperty(me,"isValidTraceId",{enumerable:!0,get:function(){return ax.isValidTraceId}});Object.defineProperty(me,"isValidSpanId",{enumerable:!0,get:function(){return ax.isValidSpanId}});var cx=jT();Object.defineProperty(me,"INVALID_SPANID",{enumerable:!0,get:function(){return cx.INVALID_SPANID}});Object.defineProperty(me,"INVALID_TRACEID",{enumerable:!0,get:function(){return cx.INVALID_TRACEID}});Object.defineProperty(me,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return cx.INVALID_SPAN_CONTEXT}});var bW=iW();Object.defineProperty(me,"context",{enumerable:!0,get:function(){return bW.context}});var NW=sW();Object.defineProperty(me,"diag",{enumerable:!0,get:function(){return NW.diag}});var OW=lW();Object.defineProperty(me,"metrics",{enumerable:!0,get:function(){return OW.metrics}});var CW=hW();Object.defineProperty(me,"propagation",{enumerable:!0,get:function(){return CW.propagation}});var vW=yW();Object.defineProperty(me,"trace",{enumerable:!0,get:function(){return vW.trace}});me.default={context:bW.context,diag:NW.diag,metrics:OW.metrics,propagation:CW.propagation,trace:vW.trace}});var PW=S(E_=>{"use strict";l();Object.defineProperty(E_,"__esModule",{value:!0});E_.SeverityNumber=void 0;var fye;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(fye=E_.SeverityNumber||(E_.SeverityNumber={}))});var lS=S(bd=>{"use strict";l();Object.defineProperty(bd,"__esModule",{value:!0});bd.NOOP_LOGGER=bd.NoopLogger=void 0;var uS=class{emit(t){}};bd.NoopLogger=uS;bd.NOOP_LOGGER=new uS});var xW=S(Ri=>{"use strict";l();Object.defineProperty(Ri,"__esModule",{value:!0});Ri.API_BACKWARDS_COMPATIBILITY_VERSION=Ri.makeGetter=Ri._global=Ri.GLOBAL_LOGS_API_KEY=void 0;Ri.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Ri._global=globalThis;function mye(e,t,n){return o=>o===e?t:n}Ri.makeGetter=mye;Ri.API_BACKWARDS_COMPATIBILITY_VERSION=1});var ux=S(Nd=>{"use strict";l();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.NOOP_LOGGER_PROVIDER=Nd.NoopLoggerProvider=void 0;var _ye=lS(),dS=class{getLogger(t,n,o){return new _ye.NoopLogger}};Nd.NoopLoggerProvider=dS;Nd.NOOP_LOGGER_PROVIDER=new dS});var MW=S(pS=>{"use strict";l();Object.defineProperty(pS,"__esModule",{value:!0});pS.ProxyLogger=void 0;var gye=lS(),lx=class{constructor(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):gye.NOOP_LOGGER}};pS.ProxyLogger=lx});var LW=S(fS=>{"use strict";l();Object.defineProperty(fS,"__esModule",{value:!0});fS.ProxyLoggerProvider=void 0;var hye=ux(),Eye=MW(),dx=class{getLogger(t,n,o){var r;return(r=this._getDelegateLogger(t,n,o))!==null&&r!==void 0?r:new Eye.ProxyLogger(this,t,n,o)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:hye.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(t,n,o)}};fS.ProxyLoggerProvider=dx});var DW=S(mS=>{"use strict";l();Object.defineProperty(mS,"__esModule",{value:!0});mS.LogsAPI=void 0;var oo=xW(),Tye=ux(),wW=LW(),px=class e{constructor(){this._proxyLoggerProvider=new wW.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return oo._global[oo.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(oo._global[oo.GLOBAL_LOGS_API_KEY]=(0,oo.makeGetter)(oo.API_BACKWARDS_COMPATIBILITY_VERSION,t,Tye.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=oo._global[oo.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(oo._global,oo.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,o){return this.getLoggerProvider().getLogger(t,n,o)}disable(){delete oo._global[oo.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new wW.ProxyLoggerProvider}};mS.LogsAPI=px});var fx=S(Ii=>{"use strict";l();Object.defineProperty(Ii,"__esModule",{value:!0});Ii.logs=Ii.NoopLogger=Ii.NOOP_LOGGER=Ii.SeverityNumber=void 0;var Sye=PW();Object.defineProperty(Ii,"SeverityNumber",{enumerable:!0,get:function(){return Sye.SeverityNumber}});var kW=lS();Object.defineProperty(Ii,"NOOP_LOGGER",{enumerable:!0,get:function(){return kW.NOOP_LOGGER}});Object.defineProperty(Ii,"NoopLogger",{enumerable:!0,get:function(){return kW.NoopLogger}});var Aye=DW();Ii.logs=Aye.LogsAPI.getInstance()});var UW=S(Od=>{"use strict";l();Object.defineProperty(Od,"__esModule",{value:!0});Od.disableInstrumentations=Od.enableInstrumentations=void 0;function yye(e,t,n,o){for(let r=0,i=e.length;r<i;r++){let s=e[r];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),o&&s.setLoggerProvider&&s.setLoggerProvider(o),s.getConfig().enabled||s.enable()}}Od.enableInstrumentations=yye;function Rye(e){e.forEach(t=>t.disable())}Od.disableInstrumentations=Rye});var GW=S(_S=>{"use strict";l();Object.defineProperty(_S,"__esModule",{value:!0});_S.registerInstrumentations=void 0;var $W=K(),Iye=fx(),BW=UW();function bye(e){let t=e.tracerProvider||$W.trace.getTracerProvider(),n=e.meterProvider||$W.metrics.getMeterProvider(),o=e.loggerProvider||Iye.logs.getLoggerProvider(),r=e.instrumentations?.flat()??[];return(0,BW.enableInstrumentations)(r,t,n,o),()=>{(0,BW.disableInstrumentations)(r)}}_S.registerInstrumentations=bye});var KW=S(gS=>{"use strict";l();Object.defineProperty(gS,"__esModule",{value:!0});gS.satisfies=void 0;var hx=K(),zW=/^(?: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-]+)*))?$/,Oye={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Cye(e,t,n){if(!vye(e))return hx.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let o=Lye(e);if(!o)return!1;let r=[],i=qW(o,t,r,n);return i&&!n?.includePrerelease?xye(o,r):i}gS.satisfies=Cye;function vye(e){return typeof e=="string"&&zW.test(e)}function qW(e,t,n,o){if(t.includes("||")){let r=t.trim().split("||");for(let i of r)if(mx(e,i,n,o))return!0;return!1}else if(t.includes(" - "))t=eRe(t,o);else if(t.includes(" ")){let r=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of r)if(!mx(e,i,n,o))return!1;return!0}return mx(e,t,n,o)}function mx(e,t,n,o){if(t=Mye(t,o),t.includes(" "))return qW(e,t,n,o);{let r=wye(t);return n.push(r),Pye(e,r)}}function Pye(e,t){if(t.invalid)return!1;if(!t.version||gx(t.version))return!0;let n=VW(e.versionSegments||[],t.versionSegments||[]);if(n===0){let o=e.prereleaseSegments||[],r=t.prereleaseSegments||[];!o.length&&!r.length?n=0:!o.length&&r.length?n=1:o.length&&!r.length?n=-1:n=VW(o,r)}return Oye[t.op]?.includes(n)}function xye(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function Mye(e,t){return e=e.trim(),e=Xye(e,t),e=Jye(e),e=Qye(e,t),e=e.trim(),e}function Jn(e){return!e||e.toLowerCase()==="x"||e==="*"}function Lye(e){let t=e.match(zW);if(!t){hx.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,o=t.groups.prerelease,r=t.groups.build,i=n.split("."),s=o?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:r}}function wye(e){if(!e)return{};let t=e.match(Nye);if(!t)return hx.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,o=t.groups.version,r=t.groups.prerelease,i=t.groups.build,s=o.split("."),a=r?.split(".");return n==="=="&&(n="="),{op:n||"=",version:o,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:i}}function gx(e){return e==="*"||e==="x"||e==="X"}function jW(e){let t=parseInt(e,10);return isNaN(t)?e:t}function Dye(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function kye(e,t){if(gx(e)||gx(t))return 0;let[n,o]=Dye(jW(e),jW(t));return n>o?1:n<o?-1:0}function VW(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let o=kye(e[n]||"0",t[n]||"0");if(o!==0)return o}return 0}var YW="[a-zA-Z0-9-]",WW="0|[1-9]\\d*",Uye=`\\d*[a-zA-Z-]${YW}*`,$ye="((?:<|>)?=?)",FW=`(?:${WW}|${Uye})`,Bye=`(?:-(${FW}(?:\\.${FW})*))`,HW=`${YW}+`,Gye=`(?:\\+(${HW}(?:\\.${HW})*))`,_x=`${WW}|x|X|\\*`,T_=`[v=\\s]*(${_x})(?:\\.(${_x})(?:\\.(${_x})(?:${Bye})?${Gye}?)?)?`,jye=`^${$ye}\\s*${T_}$`,Vye=new RegExp(jye),Fye=`^\\s*(${T_})\\s+-\\s+(${T_})\\s*$`,Hye=new RegExp(Fye),zye="(?:~>?)",qye=`^${zye}${T_}$`,Yye=new RegExp(qye),Wye="(?:\\^)",Kye=`^${Wye}${T_}$`,Zye=new RegExp(Kye);function Jye(e){let t=Yye;return e.replace(t,(n,o,r,i,s)=>{let a;return Jn(o)?a="":Jn(r)?a=`>=${o}.0.0 <${+o+1}.0.0-0`:Jn(i)?a=`>=${o}.${r}.0 <${o}.${+r+1}.0-0`:s?a=`>=${o}.${r}.${i}-${s} <${o}.${+r+1}.0-0`:a=`>=${o}.${r}.${i} <${o}.${+r+1}.0-0`,a})}function Xye(e,t){let n=Zye,o=t?.includePrerelease?"-0":"";return e.replace(n,(r,i,s,a,c)=>{let u;return Jn(i)?u="":Jn(s)?u=`>=${i}.0.0${o} <${+i+1}.0.0-0`:Jn(a)?i==="0"?u=`>=${i}.${s}.0${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.0${o} <${+i+1}.0.0-0`:c?i==="0"?s==="0"?u=`>=${i}.${s}.${a}-${c} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a}-${c} <${+i+1}.0.0-0`:i==="0"?s==="0"?u=`>=${i}.${s}.${a}${o} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a} <${+i+1}.0.0-0`,u})}function Qye(e,t){let n=Vye;return e.replace(n,(o,r,i,s,a,c)=>{let u=Jn(i),d=u||Jn(s),p=d||Jn(a),f=p;return r==="="&&f&&(r=""),c=t?.includePrerelease?"-0":"",u?r===">"||r==="<"?o="<0.0.0-0":o="*":r&&f?(d&&(s=0),a=0,r===">"?(r=">=",d?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",d?i=+i+1:s=+s+1),r==="<"&&(c="-0"),o=`${r+i}.${s}.${a}${c}`):d?o=`>=${i}.0.0${c} <${+i+1}.0.0-0`:p&&(o=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o})}function eRe(e,t){let n=Hye;return e.replace(n,(o,r,i,s,a,c,u,d,p,f,m,_)=>(Jn(i)?r="":Jn(s)?r=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Jn(a)?r=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?.includePrerelease?"-0":""}`,Jn(p)?d="":Jn(f)?d=`<${+p+1}.0.0-0`:Jn(m)?d=`<${p}.${+f+1}.0-0`:_?d=`<=${p}.${f}.${m}-${_}`:t?.includePrerelease?d=`<${p}.${f}.${+m+1}-0`:d=`<=${d}`,`${r} ${d}`.trim()))}});var Ex=S(hn=>{"use strict";l();Object.defineProperty(hn,"__esModule",{value:!0});hn.massUnwrap=hn.unwrap=hn.massWrap=hn.wrap=void 0;var Xn=console.error.bind(console);function S_(e,t,n){let o=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:o,writable:!0,value:n})}var tRe=(e,t,n)=>{if(!e||!e[t]){Xn("no original function "+String(t)+" to wrap");return}if(!n){Xn("no wrapper function"),Xn(new Error().stack);return}let o=e[t];if(typeof o!="function"||typeof n!="function"){Xn("original object and wrapper must be functions");return}let r=n(o,t);return S_(r,"__original",o),S_(r,"__unwrap",()=>{e[t]===r&&S_(e,t,o)}),S_(r,"__wrapped",!0),S_(e,t,r),r};hn.wrap=tRe;var nRe=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{Xn("must provide one or more modules to patch"),Xn(new Error().stack);return}if(!(t&&Array.isArray(t))){Xn("must provide one or more functions to wrap on modules");return}e.forEach(o=>{t.forEach(r=>{(0,hn.wrap)(o,r,n)})})};hn.massWrap=nRe;var rRe=(e,t)=>{if(!e||!e[t]){Xn("no function to unwrap."),Xn(new Error().stack);return}let n=e[t];if(!n.__unwrap)Xn("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};hn.unwrap=rRe;var oRe=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{Xn("must provide one or more modules to patch"),Xn(new Error().stack);return}if(!(t&&Array.isArray(t))){Xn("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(o=>{(0,hn.unwrap)(n,o)})})};hn.massUnwrap=oRe;function A_(e){e&&e.logger&&(typeof e.logger!="function"?Xn("new logger isn't a function, not replacing"):Xn=e.logger)}hn.default=A_;A_.wrap=hn.wrap;A_.massWrap=hn.massWrap;A_.unwrap=hn.unwrap;A_.massUnwrap=hn.massUnwrap});var ZW=S(ES=>{"use strict";l();Object.defineProperty(ES,"__esModule",{value:!0});ES.InstrumentationAbstract=void 0;var Tx=K(),iRe=fx(),hS=Ex(),Sx=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,o){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(o),this._diag=Tx.diag.createComponentLogger({namespace:t}),this._tracer=Tx.trace.getTracer(t,n),this._meter=Tx.metrics.getMeter(t,n),this._logger=iRe.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=hS.wrap;_unwrap=hS.unwrap;_massWrap=hS.massWrap;_massUnwrap=hS.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,o,r){if(t)try{t(o,r)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};ES.InstrumentationAbstract=Sx});var XW=S((Urt,JW)=>{l();var Cd=1e3,vd=Cd*60,Pd=vd*60,uu=Pd*24,sRe=uu*7,aRe=uu*365.25;JW.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return cRe(e);if(n==="number"&&isFinite(e))return t.long?lRe(e):uRe(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function cRe(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),o=(t[2]||"ms").toLowerCase();switch(o){case"years":case"year":case"yrs":case"yr":case"y":return n*aRe;case"weeks":case"week":case"w":return n*sRe;case"days":case"day":case"d":return n*uu;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Pd;case"minutes":case"minute":case"mins":case"min":case"m":return n*vd;case"seconds":case"second":case"secs":case"sec":case"s":return n*Cd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function uRe(e){var t=Math.abs(e);return t>=uu?Math.round(e/uu)+"d":t>=Pd?Math.round(e/Pd)+"h":t>=vd?Math.round(e/vd)+"m":t>=Cd?Math.round(e/Cd)+"s":e+"ms"}function lRe(e){var t=Math.abs(e);return t>=uu?TS(e,t,uu,"day"):t>=Pd?TS(e,t,Pd,"hour"):t>=vd?TS(e,t,vd,"minute"):t>=Cd?TS(e,t,Cd,"second"):e+" ms"}function TS(e,t,n,o){var r=t>=n*1.5;return Math.round(e/n)+" "+o+(r?"s":"")}});var Ax=S((Brt,QW)=>{l();function dRe(e){n.debug=n,n.default=n,n.coerce=c,n.disable=s,n.enable=r,n.enabled=a,n.humanize=XW(),n.destroy=u,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let p=0;for(let f=0;f<d.length;f++)p=(p<<5)-p+d.charCodeAt(f),p|=0;return n.colors[Math.abs(p)%n.colors.length]}n.selectColor=t;function n(d){let p,f=null,m,_;function h(...E){if(!h.enabled)return;let T=h,R=Number(new Date),C=R-(p||R);T.diff=C,T.prev=p,T.curr=R,p=R,E[0]=n.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let P=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(O,z)=>{if(O==="%%")return"%";P++;let ie=n.formatters[z];if(typeof ie=="function"){let $=E[P];O=ie.call(T,$),E.splice(P,1),P--}return O}),n.formatArgs.call(T,E),(T.log||n.log).apply(T,E)}return h.namespace=d,h.useColors=n.useColors(),h.color=n.selectColor(d),h.extend=o,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(m!==n.namespaces&&(m=n.namespaces,_=n.enabled(d)),_),set:E=>{f=E}}),typeof n.init=="function"&&n.init(h),h}function o(d,p){let f=n(this.namespace+(typeof p>"u"?":":p)+d);return f.log=this.log,f}function r(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let p=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let f of p)f[0]==="-"?n.skips.push(f.slice(1)):n.names.push(f)}function i(d,p){let f=0,m=0,_=-1,h=0;for(;f<d.length;)if(m<p.length&&(p[m]===d[f]||p[m]==="*"))p[m]==="*"?(_=m,h=f,m++):(f++,m++);else if(_!==-1)m=_+1,h++,f=h;else return!1;for(;m<p.length&&p[m]==="*";)m++;return m===p.length}function s(){let d=[...n.names,...n.skips.map(p=>"-"+p)].join(",");return n.enable(""),d}function a(d){for(let p of n.skips)if(i(d,p))return!1;for(let p of n.names)if(i(d,p))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){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}QW.exports=dRe});var e4=S((hr,SS)=>{l();hr.formatArgs=fRe;hr.save=mRe;hr.load=_Re;hr.useColors=pRe;hr.storage=gRe();hr.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();hr.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 pRe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function fRe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+SS.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(n++,r==="%c"&&(o=n))}),e.splice(o,0,t)}hr.log=console.debug||console.log||(()=>{});function mRe(e){try{e?hr.storage.setItem("debug",e):hr.storage.removeItem("debug")}catch{}}function _Re(){let e;try{e=hr.storage.getItem("debug")||hr.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function gRe(){try{return localStorage}catch{}}SS.exports=Ax()(hr);var{formatters:hRe}=SS.exports;hRe.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var n4=S((Vrt,t4)=>{"use strict";l();t4.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",o=t.indexOf(n+e),r=t.indexOf("--");return o!==-1&&(r===-1||o<r)}});var i4=S((Hrt,o4)=>{"use strict";l();var ERe=require("os"),r4=require("tty"),io=n4(),{env:nn}=process,ba;io("no-color")||io("no-colors")||io("color=false")||io("color=never")?ba=0:(io("color")||io("colors")||io("color=true")||io("color=always"))&&(ba=1);"FORCE_COLOR"in nn&&(nn.FORCE_COLOR==="true"?ba=1:nn.FORCE_COLOR==="false"?ba=0:ba=nn.FORCE_COLOR.length===0?1:Math.min(parseInt(nn.FORCE_COLOR,10),3));function yx(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Rx(e,t){if(ba===0)return 0;if(io("color=16m")||io("color=full")||io("color=truecolor"))return 3;if(io("color=256"))return 2;if(e&&!t&&ba===void 0)return 0;let n=ba||0;if(nn.TERM==="dumb")return n;if(process.platform==="win32"){let o=ERe.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in nn)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(o=>o in nn)||nn.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in nn)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(nn.TEAMCITY_VERSION)?1:0;if(nn.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in nn){let o=parseInt((nn.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(nn.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(nn.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(nn.TERM)||"COLORTERM"in nn?1:n}function TRe(e){let t=Rx(e,e&&e.isTTY);return yx(t)}o4.exports={supportsColor:TRe,stdout:yx(Rx(!0,r4.isatty(1))),stderr:yx(Rx(!0,r4.isatty(2)))}});var a4=S((rn,yS)=>{l();var SRe=require("tty"),AS=require("util");rn.init=ORe;rn.log=IRe;rn.formatArgs=yRe;rn.save=bRe;rn.load=NRe;rn.useColors=ARe;rn.destroy=AS.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");rn.colors=[6,2,3,4,5,1];try{let e=i4();e&&(e.stderr||e).level>=2&&(rn.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{}rn.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(r,i)=>i.toUpperCase()),o=process.env[t];return/^(yes|on|true|enabled)$/i.test(o)?o=!0:/^(no|off|false|disabled)$/i.test(o)?o=!1:o==="null"?o=null:o=Number(o),e[n]=o,e},{});function ARe(){return"colors"in rn.inspectOpts?!!rn.inspectOpts.colors:SRe.isatty(process.stderr.fd)}function yRe(e){let{namespace:t,useColors:n}=this;if(n){let o=this.color,r="\x1B[3"+(o<8?o:"8;5;"+o),i=` ${r};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
3
+ `).join(`
4
+ `+i),e.push(r+"m+"+yS.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=RRe()+t+" "+e[0]}function RRe(){return rn.inspectOpts.hideDate?"":new Date().toISOString()+" "}function IRe(...e){return process.stderr.write(AS.formatWithOptions(rn.inspectOpts,...e)+`
5
+ `)}function bRe(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function NRe(){return process.env.DEBUG}function ORe(e){e.inspectOpts={};let t=Object.keys(rn.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=rn.inspectOpts[t[n]]}yS.exports=Ax()(rn);var{formatters:s4}=yS.exports;s4.o=function(e){return this.inspectOpts.colors=this.useColors,AS.inspect(e,this.inspectOpts).split(`
6
+ `).map(t=>t.trim()).join(" ")};s4.O=function(e){return this.inspectOpts.colors=this.useColors,AS.inspect(e,this.inspectOpts)}});var c4=S((Yrt,Ix)=>{l();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ix.exports=e4():Ix.exports=a4()});var RS=S((Krt,u4)=>{"use strict";l();var bx=require("path").sep;u4.exports=function(e){var t=e.split(bx),n=t.lastIndexOf("node_modules");if(n!==-1&&t[n+1]){for(var o=t[n+1][0]==="@",r=o?t[n+1]+"/"+t[n+2]:t[n+1],i=o?3:2,s="",a=n+i-1,c=0;c<=a;c++)c===a?s+=t[c]:s+=t[c]+bx;for(var u="",d=t.length-1,p=n+i;p<=d;p++)p===d?u+=t[p]:u+=t[p]+bx;return{name:r,basedir:s,path:u}}}});var lu=S((Jrt,Cx)=>{"use strict";l();var xd=require("path"),jo=require("module"),wt=c4()("require-in-the-middle"),CRe=RS();Cx.exports=y_;Cx.exports.Hook=y_;var Nx,IS;if(jo.isBuiltin)IS=jo.isBuiltin;else if(jo.builtinModules)IS=e=>e.startsWith("node:")?!0:(Nx===void 0&&(Nx=new Set(jo.builtinModules)),Nx.has(e));else throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");var vRe=/([/\\]index)?(\.js)?$/,Ox=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(t,n){if(this._localCache.has(t))return!0;if(n)return!1;{let o=require.cache[t];return!!(o&&this._kRitmExports in o)}}get(t,n){let o=this._localCache.get(t);if(o!==void 0)return o;if(!n){let r=require.cache[t];return r&&r[this._kRitmExports]}}set(t,n,o){o?this._localCache.set(t,n):t in require.cache?require.cache[t][this._kRitmExports]=n:(wt('non-core module is unexpectedly not in require.cache: "%s"',t),this._localCache.set(t,n))}};function y_(e,t,n){if(!(this instanceof y_))return new y_(e,t,n);if(typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),typeof jo._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof jo._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues",process.version);return}this._cache=new Ox,this._unhooked=!1,this._origRequire=jo.prototype.require;let o=this,r=new Set,i=t?t.internals===!0:!1,s=Array.isArray(e);wt("registering require hook"),this._require=jo.prototype.require=function(c){return o._unhooked===!0?(wt("ignoring require call - module is soft-unhooked"),o._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return o._unhooked===!0?(wt("ignoring process.getBuiltinModule call - module is soft-unhooked"),o._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,u){let d=c[0],p=IS(d),f;if(p){if(f=d,d.startsWith("node:")){let R=d.slice(5);IS(R)&&(f=R)}}else{if(u)return wt("call to process.getBuiltinModule with unknown built-in id"),o._origGetBuiltinModule.apply(this,c);try{f=jo._resolveFilename(d,this)}catch(R){return wt('Module._resolveFilename("%s") threw %j, calling original Module.require',d,R.message),o._origRequire.apply(this,c)}}let m,_;if(wt("processing %s module require('%s'): %s",p===!0?"core":"non-core",d,f),o._cache.has(f,p)===!0)return wt("returning already patched cached module: %s",f),o._cache.get(f,p);let h=r.has(f);h===!1&&r.add(f);let E=u?o._origGetBuiltinModule.apply(this,c):o._origRequire.apply(this,c);if(h===!0)return wt("module is in the process of being patched already - ignoring: %s",f),E;if(r.delete(f),p===!0){if(s===!0&&e.includes(f)===!1)return wt("ignoring core module not on whitelist: %s",f),E;m=f}else if(s===!0&&e.includes(f)){let R=xd.parse(f);m=R.name,_=R.dir}else{let R=CRe(f);if(R===void 0)return wt("could not parse filename: %s",f),E;m=R.name,_=R.basedir;let C=PRe(R);wt("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",m,d,C,_);let P=!1;if(s){if(!d.startsWith(".")&&e.includes(d)&&(m=d,P=!0),!e.includes(m)&&!e.includes(C))return E;e.includes(C)&&C!==m&&(m=C,P=!0)}if(!P){let M;try{M=require.resolve(m,{paths:[_]})}catch{return wt("could not resolve module: %s",m),o._cache.set(f,E,p),E}if(M!==f)if(i===!0)m=m+xd.sep+xd.relative(_,f),wt("preparing to process require of internal file: %s",m);else return wt("ignoring require of non-main module file: %s",M),o._cache.set(f,E,p),E}}o._cache.set(f,E,p),wt("calling require hook: %s",m);let T=n(E,m,_);return o._cache.set(f,T,p),wt("returning module: %s",m),T}}y_.prototype.unhook=function(){this._unhooked=!0,this._require===jo.prototype.require?(jo.prototype.require=this._origRequire,wt("require unhook successful")):wt("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,wt("process.getBuiltinModule unhook successful")):wt("process.getBuiltinModule unhook unsuccessful"))};function PRe(e){let t=xd.sep!=="/"?e.path.split(xd.sep).join("/"):e.path;return xd.posix.join(e.name,t).replace(vRe,"")}});var l4=S(Na=>{"use strict";l();Object.defineProperty(Na,"__esModule",{value:!0});Na.ModuleNameTrie=Na.ModuleNameSeparator=void 0;Na.ModuleNameSeparator="/";var bS=class{hooks=[];children=new Map},vx=class{_trie=new bS;_counter=0;insert(t){let n=this._trie;for(let o of t.moduleName.split(Na.ModuleNameSeparator)){let r=n.children.get(o);r||(r=new bS,n.children.set(o,r)),n=r}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:o}={}){let r=this._trie,i=[],s=!0;for(let a of t.split(Na.ModuleNameSeparator)){let c=r.children.get(a);if(!c){s=!1;break}o||i.push(...c.hooks),r=c}return o&&s&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((a,c)=>a.insertedId-c.insertedId),i.map(({hook:a})=>a))}};Na.ModuleNameTrie=vx});var p4=S(NS=>{"use strict";l();Object.defineProperty(NS,"__esModule",{value:!0});NS.RequireInTheMiddleSingleton=void 0;var xRe=lu(),d4=require("path"),Px=l4(),MRe=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),xx=class e{_moduleNameTrie=new Px.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new xRe.Hook(null,{internals:!0},(t,n,o)=>{let r=LRe(n),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:s}of i)t=s(t,n,o);return t})}register(t,n){let o={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(o),o}static getInstance(){return MRe?new e:this._instance=this._instance??new e}};NS.RequireInTheMiddleSingleton=xx;function LRe(e){return d4.sep!==Px.ModuleNameSeparator?e.split(d4.sep).join(Px.ModuleNameSeparator):e}});var h4=S(R_=>{l();var f4=[],Mx=new WeakMap,m4=new WeakMap,_4=new Map,g4=[],wRe={set(e,t,n){let o=Mx.get(e),r=o&&o[t];return typeof r=="function"?r(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=m4.get(e)[t];if(typeof n=="function")return n()},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let o=Mx.get(e),r=o&&o[t];return typeof r=="function"?r(n.value):!0}};function DRe(e,t,n,o,r){_4.set(e,r),Mx.set(t,n),m4.set(t,o);let i=new Proxy(t,wRe);f4.forEach(s=>s(e,i,r)),g4.push([e,i,r])}R_.register=DRe;R_.importHooks=f4;R_.specifiers=_4;R_.toHook=g4});var kx=S((iot,Ld)=>{l();var E4=require("path"),kRe=RS(),{fileURLToPath:URe}=require("url"),{MessageChannel:$Re}=require("worker_threads"),{isBuiltin:Lx}=require("module");Lx||(Lx=()=>!0);var{importHooks:wx,specifiers:T4,toHook:BRe}=h4();function GRe(e,t){if(!(process.env.TURBOPACK??process.argv.includes("--turbo")))return!1;let o=e.slice(0,e.lastIndexOf("-"));return t.endsWith(o)}function S4(e){wx.push(e),BRe.forEach(([t,n,o])=>e(t,n,o))}function A4(e){let t=wx.indexOf(e);t>-1&&wx.splice(t,1)}function Md(e,t,n,o){let r=e(t,n,o);r&&r!==t&&"default"in t&&(t.default=r)}var Dx;function jRe(){let{port1:e,port2:t}=new $Re,n=0,o;Dx=a=>{n++,e.postMessage(a)},e.on("message",()=>{n--,o&&n<=0&&o()}).unref();function r(){let a=setInterval(()=>{},1e3),c=new Promise(u=>{o=u}).then(()=>{clearInterval(a)});return n===0&&o(),c}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:r}}function I_(e,t,n){if(!(this instanceof I_))return new I_(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let o=t?t.internals===!0:!1;Dx&&Array.isArray(e)&&Dx(e),this._iitmHook=(r,i,s)=>{let a=r,c=a.startsWith("node:"),u,d;if(c){let p=r.slice(5);Lx(p)&&(r=p)}else if(a.startsWith("file://")){let p=Error.stackTraceLimit;Error.stackTraceLimit=0;try{u=URe(r),r=u}catch{}if(Error.stackTraceLimit=p,u){let f=kRe(u);f&&(r=f.name,d=f.basedir)}}if(e)for(let p of e)if(u&&p===u)Md(n,i,u,void 0);else if(p===r){if(!d)Md(n,i,r,d);else if(d.endsWith(T4.get(a))||GRe(T4.get(a),d))Md(n,i,r,d);else if(o){let f=r+E4.sep+E4.relative(d,u);Md(n,i,f,d)}}else p===s&&Md(n,i,s,d);else Md(n,i,r,d)},S4(this._iitmHook)}I_.prototype.unhook=function(){A4(this._iitmHook)};Ld.exports=I_;Ld.exports.Hook=I_;Ld.exports.addHook=S4;Ld.exports.removeHook=A4;Ld.exports.createAddHookMessageChannel=jRe});var Ux=S(Oa=>{"use strict";l();Object.defineProperty(Oa,"__esModule",{value:!0});Oa.isWrapped=Oa.safeExecuteInTheMiddleAsync=Oa.safeExecuteInTheMiddle=void 0;function VRe(e,t,n){let o,r;try{r=e()}catch(i){o=i}finally{if(t(o,r),o&&!n)throw o;return r}}Oa.safeExecuteInTheMiddle=VRe;async function FRe(e,t,n){let o,r;try{r=await e()}catch(i){o=i}finally{if(await t(o,r),o&&!n)throw o;return r}}Oa.safeExecuteInTheMiddleAsync=FRe;function HRe(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}Oa.isWrapped=HRe});var I4=S(OS=>{"use strict";l();Object.defineProperty(OS,"__esModule",{value:!0});OS.InstrumentationBase=void 0;var b_=require("path"),y4=require("util"),zRe=KW(),$x=Ex(),qRe=ZW(),YRe=p4(),WRe=kx(),N_=K(),KRe=lu(),ZRe=require("fs"),JRe=Ux(),Bx=class extends qRe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=YRe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,o){super(t,n,o);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(t,n,o)=>{if((0,JRe.isWrapped)(t[n])&&this._unwrap(t,n),y4.types.isProxy(t)){let r=(0,$x.wrap)(Object.assign({},t),n,o);return Object.defineProperty(t,n,{value:r}),r}else return(0,$x.wrap)(t,n,o)};_unwrap=(t,n)=>y4.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,$x.unwrap)(t,n);_massWrap=(t,n,o)=>{if(t)Array.isArray(t)||(t=[t]);else{N_.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){N_.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(i=>{this._wrap(r,i,o)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{N_.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){N_.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(r=>{this._unwrap(o,r)})})};_warnOnPreloadedModules(){let t=globalThis.require;!t?.resolve||!t?.cache||this._modules.forEach(n=>{let{name:o}=n;try{let r=t.resolve(o);t.cache[r]?.loaded&&this._diag.warn(`Module ${o} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${o}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,ZRe.readFileSync)(b_.join(t,"package.json"),{encoding:"utf8"}),o=JSON.parse(n).version;return typeof o=="string"?o:void 0}catch{N_.diag.warn("Failed extracting version",t)}}_onRequire(t,n,o,r){if(!r)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(r);if(t.moduleVersion=i,t.name===o)return R4(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:r}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],a=b_.normalize(o);return s.filter(u=>u.name===a&&R4(u.supportedVersions,i,t.includePrerelease)).reduce((u,d)=>(d.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:d.name,baseDir:r}),d.patch(u,t.moduleVersion)):u),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,a,c)=>{if(!c&&b_.isAbsolute(a)){let u=b_.parse(a);a=u.name,c=u.dir}return this._onRequire(t,s,a,c)},o=(s,a,c)=>this._onRequire(t,s,a,c),r=b_.isAbsolute(t.name)?new KRe.Hook([t.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(t.name,o);this._hooks.push(r);let i=new WRe.Hook([t.name],{internals:!0},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};OS.InstrumentationBase=Bx;function R4(e,t,n){return typeof t>"u"?e.includes("*"):e.some(o=>(0,zRe.satisfies)(t,o,{includePrerelease:n}))}});var b4=S(CS=>{"use strict";l();Object.defineProperty(CS,"__esModule",{value:!0});CS.normalize=void 0;var XRe=require("path");Object.defineProperty(CS,"normalize",{enumerable:!0,get:function(){return XRe.normalize}})});var N4=S(wd=>{"use strict";l();Object.defineProperty(wd,"__esModule",{value:!0});wd.normalize=wd.InstrumentationBase=void 0;var QRe=I4();Object.defineProperty(wd,"InstrumentationBase",{enumerable:!0,get:function(){return QRe.InstrumentationBase}});var eIe=b4();Object.defineProperty(wd,"normalize",{enumerable:!0,get:function(){return eIe.normalize}})});var Gx=S(Dd=>{"use strict";l();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.normalize=Dd.InstrumentationBase=void 0;var O4=N4();Object.defineProperty(Dd,"InstrumentationBase",{enumerable:!0,get:function(){return O4.InstrumentationBase}});Object.defineProperty(Dd,"normalize",{enumerable:!0,get:function(){return O4.normalize}})});var C4=S(vS=>{"use strict";l();Object.defineProperty(vS,"__esModule",{value:!0});vS.InstrumentationNodeModuleDefinition=void 0;var jx=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,o,r,i){this.files=i||[],this.name=t,this.supportedVersions=n,this.patch=o,this.unpatch=r}};vS.InstrumentationNodeModuleDefinition=jx});var v4=S(PS=>{"use strict";l();Object.defineProperty(PS,"__esModule",{value:!0});PS.InstrumentationNodeModuleFile=void 0;var tIe=Gx(),Vx=class{name;supportedVersions;patch;unpatch;constructor(t,n,o,r){this.name=(0,tIe.normalize)(t),this.supportedVersions=n,this.patch=o,this.unpatch=r}};PS.InstrumentationNodeModuleFile=Vx});var P4=S(du=>{"use strict";l();Object.defineProperty(du,"__esModule",{value:!0});du.semconvStabilityFromStr=du.SemconvStability=void 0;var xS;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(xS=du.SemconvStability||(du.SemconvStability={}));function nIe(e,t){let n=xS.OLD,o=t?.split(",").map(r=>r.trim()).filter(r=>r!=="");for(let r of o??[])if(r.toLowerCase()===e+"/dup"){n=xS.DUPLICATE;break}else r.toLowerCase()===e&&(n=xS.STABLE);return n}du.semconvStabilityFromStr=nIe});var Pe=S(Gt=>{"use strict";l();Object.defineProperty(Gt,"__esModule",{value:!0});Gt.semconvStabilityFromStr=Gt.SemconvStability=Gt.safeExecuteInTheMiddleAsync=Gt.safeExecuteInTheMiddle=Gt.isWrapped=Gt.InstrumentationNodeModuleFile=Gt.InstrumentationNodeModuleDefinition=Gt.InstrumentationBase=Gt.registerInstrumentations=void 0;var rIe=GW();Object.defineProperty(Gt,"registerInstrumentations",{enumerable:!0,get:function(){return rIe.registerInstrumentations}});var oIe=Gx();Object.defineProperty(Gt,"InstrumentationBase",{enumerable:!0,get:function(){return oIe.InstrumentationBase}});var iIe=C4();Object.defineProperty(Gt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return iIe.InstrumentationNodeModuleDefinition}});var sIe=v4();Object.defineProperty(Gt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return sIe.InstrumentationNodeModuleFile}});var Fx=Ux();Object.defineProperty(Gt,"isWrapped",{enumerable:!0,get:function(){return Fx.isWrapped}});Object.defineProperty(Gt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return Fx.safeExecuteInTheMiddle}});Object.defineProperty(Gt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return Fx.safeExecuteInTheMiddleAsync}});var x4=P4();Object.defineProperty(Gt,"SemconvStability",{enumerable:!0,get:function(){return x4.SemconvStability}});Object.defineProperty(Gt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return x4.semconvStabilityFromStr}})});var v_=S(va=>{"use strict";l();Object.defineProperty(va,"__esModule",{value:!0});va.isTracingSuppressed=va.unsuppressTracing=va.suppressTracing=void 0;var fIe=K(),Yx=(0,fIe.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function mIe(e){return e.setValue(Yx,!0)}va.suppressTracing=mIe;function _Ie(e){return e.deleteValue(Yx)}va.unsuppressTracing=_Ie;function gIe(e){return e.getValue(Yx)===!0}va.isTracingSuppressed=gIe});var Wx=S(Ln=>{"use strict";l();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.BAGGAGE_MAX_TOTAL_LENGTH=Ln.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Ln.BAGGAGE_MAX_NAME_VALUE_PAIRS=Ln.BAGGAGE_HEADER=Ln.BAGGAGE_ITEMS_SEPARATOR=Ln.BAGGAGE_PROPERTIES_SEPARATOR=Ln.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Ln.BAGGAGE_KEY_PAIR_SEPARATOR="=";Ln.BAGGAGE_PROPERTIES_SEPARATOR=";";Ln.BAGGAGE_ITEMS_SEPARATOR=",";Ln.BAGGAGE_HEADER="baggage";Ln.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Ln.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Ln.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Kx=S(bi=>{"use strict";l();Object.defineProperty(bi,"__esModule",{value:!0});bi.parseKeyPairsIntoRecord=bi.parsePairKeyValue=bi.getKeyPairs=bi.serializeKeyPairs=void 0;var hIe=K(),kd=Wx();function EIe(e){return e.reduce((t,n)=>{let o=`${t}${t!==""?kd.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return o.length>kd.BAGGAGE_MAX_TOTAL_LENGTH?t:o},"")}bi.serializeKeyPairs=EIe;function TIe(e){return e.getAllEntries().map(([t,n])=>{let o=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(o+=kd.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),o})}bi.getKeyPairs=TIe;function U4(e){if(!e)return;let t=e.indexOf(kd.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),o=n.indexOf(kd.BAGGAGE_KEY_PAIR_SEPARATOR);if(o<=0)return;let r=n.substring(0,o).trim(),i=n.substring(o+1).trim();if(!r||!i)return;let s,a;try{s=decodeURIComponent(r),a=decodeURIComponent(i)}catch{return}let c;if(t!==-1&&t<e.length-1){let u=e.substring(t+1);c=(0,hIe.baggageEntryMetadataFromString)(u)}return{key:s,value:a,metadata:c}}bi.parsePairKeyValue=U4;function SIe(e){let t={};return typeof e=="string"&&e.length>0&&e.split(kd.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let o=U4(n);o!==void 0&&o.value.length>0&&(t[o.key]=o.value)}),t}bi.parseKeyPairsIntoRecord=SIe});var $4=S(MS=>{"use strict";l();Object.defineProperty(MS,"__esModule",{value:!0});MS.W3CBaggagePropagator=void 0;var Zx=K(),AIe=v_(),fu=Wx(),Jx=Kx(),Xx=class{inject(t,n,o){let r=Zx.propagation.getBaggage(t);if(!r||(0,AIe.isTracingSuppressed)(t))return;let i=(0,Jx.getKeyPairs)(r).filter(a=>a.length<=fu.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,fu.BAGGAGE_MAX_NAME_VALUE_PAIRS),s=(0,Jx.serializeKeyPairs)(i);s.length>0&&o.set(n,fu.BAGGAGE_HEADER,s)}extract(t,n,o){let r=o.get(n,fu.BAGGAGE_HEADER),i=Array.isArray(r)?r.join(fu.BAGGAGE_ITEMS_SEPARATOR):r;if(!i)return t;let s={};return i.length===0||(i.split(fu.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let u=(0,Jx.parsePairKeyValue)(c);if(u){let d={value:u.value};u.metadata&&(d.metadata=u.metadata),s[u.key]=d}}),Object.entries(s).length===0)?t:Zx.propagation.setBaggage(t,Zx.propagation.createBaggage(s))}fields(){return[fu.BAGGAGE_HEADER]}};MS.W3CBaggagePropagator=Xx});var B4=S(LS=>{"use strict";l();Object.defineProperty(LS,"__esModule",{value:!0});LS.AnchoredClock=void 0;var Qx=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};LS.AnchoredClock=Qx});var H4=S(Pa=>{"use strict";l();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.isAttributeValue=Pa.isAttributeKey=Pa.sanitizeAttributes=void 0;var G4=K();function yIe(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!j4(n)){G4.diag.warn(`Invalid attribute key: ${n}`);continue}let o=e[n];if(!V4(o)){G4.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(o)?t[n]=o.slice():t[n]=o}return t}Pa.sanitizeAttributes=yIe;function j4(e){return typeof e=="string"&&e!==""}Pa.isAttributeKey=j4;function V4(e){return e==null?!0:Array.isArray(e)?RIe(e):F4(typeof e)}Pa.isAttributeValue=V4;function RIe(e){let t;for(let n of e){if(n==null)continue;let o=typeof n;if(o!==t){if(!t){if(F4(o)){t=o;continue}return!1}return!1}}return!0}function F4(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var eM=S(wS=>{"use strict";l();Object.defineProperty(wS,"__esModule",{value:!0});wS.loggingErrorHandler=void 0;var IIe=K();function bIe(){return e=>{IIe.diag.error(NIe(e))}}wS.loggingErrorHandler=bIe;function NIe(e){return typeof e=="string"?e:JSON.stringify(OIe(e))}function OIe(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(o=>{if(t[o])return;let r=n[o];r&&(t[o]=String(r))}),n=Object.getPrototypeOf(n);return t}});var q4=S(Ud=>{"use strict";l();Object.defineProperty(Ud,"__esModule",{value:!0});Ud.globalErrorHandler=Ud.setGlobalErrorHandler=void 0;var CIe=eM(),z4=(0,CIe.loggingErrorHandler)();function vIe(e){z4=e}Ud.setGlobalErrorHandler=vIe;function PIe(e){try{z4(e)}catch{}}Ud.globalErrorHandler=PIe});var Z4=S(Ni=>{"use strict";l();Object.defineProperty(Ni,"__esModule",{value:!0});Ni.getStringListFromEnv=Ni.getBooleanFromEnv=Ni.getStringFromEnv=Ni.getNumberFromEnv=void 0;var Y4=K(),W4=require("util");function xIe(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Y4.diag.warn(`Unknown value ${(0,W4.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}Ni.getNumberFromEnv=xIe;function K4(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}Ni.getStringFromEnv=K4;function MIe(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Y4.diag.warn(`Unknown value ${(0,W4.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}Ni.getBooleanFromEnv=MIe;function LIe(e){return K4(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}Ni.getStringListFromEnv=LIe});var J4=S(DS=>{"use strict";l();Object.defineProperty(DS,"__esModule",{value:!0});DS._globalThis=void 0;DS._globalThis=globalThis});var X4=S(kS=>{"use strict";l();Object.defineProperty(kS,"__esModule",{value:!0});kS.VERSION=void 0;kS.VERSION="2.7.1"});var tM=S(US=>{"use strict";l();Object.defineProperty(US,"__esModule",{value:!0});US.createConstMap=void 0;function wIe(e){let t={},n=e.length;for(let o=0;o<n;o++){let r=e[o];r&&(t[String(r).toUpperCase().replace(/[-.]/g,"_")]=r)}return t}US.createConstMap=wIe});var V3=S(g=>{"use strict";l();Object.defineProperty(g,"__esModule",{value:!0});g.SEMATTRS_NET_HOST_CARRIER_ICC=g.SEMATTRS_NET_HOST_CARRIER_MNC=g.SEMATTRS_NET_HOST_CARRIER_MCC=g.SEMATTRS_NET_HOST_CARRIER_NAME=g.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=g.SEMATTRS_NET_HOST_CONNECTION_TYPE=g.SEMATTRS_NET_HOST_NAME=g.SEMATTRS_NET_HOST_PORT=g.SEMATTRS_NET_HOST_IP=g.SEMATTRS_NET_PEER_NAME=g.SEMATTRS_NET_PEER_PORT=g.SEMATTRS_NET_PEER_IP=g.SEMATTRS_NET_TRANSPORT=g.SEMATTRS_FAAS_INVOKED_REGION=g.SEMATTRS_FAAS_INVOKED_PROVIDER=g.SEMATTRS_FAAS_INVOKED_NAME=g.SEMATTRS_FAAS_COLDSTART=g.SEMATTRS_FAAS_CRON=g.SEMATTRS_FAAS_TIME=g.SEMATTRS_FAAS_DOCUMENT_NAME=g.SEMATTRS_FAAS_DOCUMENT_TIME=g.SEMATTRS_FAAS_DOCUMENT_OPERATION=g.SEMATTRS_FAAS_DOCUMENT_COLLECTION=g.SEMATTRS_FAAS_EXECUTION=g.SEMATTRS_FAAS_TRIGGER=g.SEMATTRS_EXCEPTION_ESCAPED=g.SEMATTRS_EXCEPTION_STACKTRACE=g.SEMATTRS_EXCEPTION_MESSAGE=g.SEMATTRS_EXCEPTION_TYPE=g.SEMATTRS_DB_SQL_TABLE=g.SEMATTRS_DB_MONGODB_COLLECTION=g.SEMATTRS_DB_REDIS_DATABASE_INDEX=g.SEMATTRS_DB_HBASE_NAMESPACE=g.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=g.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=g.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=g.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=g.SEMATTRS_DB_CASSANDRA_TABLE=g.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=g.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=g.SEMATTRS_DB_CASSANDRA_KEYSPACE=g.SEMATTRS_DB_MSSQL_INSTANCE_NAME=g.SEMATTRS_DB_OPERATION=g.SEMATTRS_DB_STATEMENT=g.SEMATTRS_DB_NAME=g.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=g.SEMATTRS_DB_USER=g.SEMATTRS_DB_CONNECTION_STRING=g.SEMATTRS_DB_SYSTEM=g.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=void 0;g.SEMATTRS_MESSAGING_DESTINATION_KIND=g.SEMATTRS_MESSAGING_DESTINATION=g.SEMATTRS_MESSAGING_SYSTEM=g.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=g.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=g.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=g.SEMATTRS_AWS_DYNAMODB_COUNT=g.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=g.SEMATTRS_AWS_DYNAMODB_SEGMENT=g.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=g.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=g.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=g.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=g.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=g.SEMATTRS_AWS_DYNAMODB_SELECT=g.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=g.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=g.SEMATTRS_AWS_DYNAMODB_LIMIT=g.SEMATTRS_AWS_DYNAMODB_PROJECTION=g.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=g.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=g.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=g.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=g.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=g.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=g.SEMATTRS_HTTP_CLIENT_IP=g.SEMATTRS_HTTP_ROUTE=g.SEMATTRS_HTTP_SERVER_NAME=g.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=g.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=g.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=g.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=g.SEMATTRS_HTTP_USER_AGENT=g.SEMATTRS_HTTP_FLAVOR=g.SEMATTRS_HTTP_STATUS_CODE=g.SEMATTRS_HTTP_SCHEME=g.SEMATTRS_HTTP_HOST=g.SEMATTRS_HTTP_TARGET=g.SEMATTRS_HTTP_URL=g.SEMATTRS_HTTP_METHOD=g.SEMATTRS_CODE_LINENO=g.SEMATTRS_CODE_FILEPATH=g.SEMATTRS_CODE_NAMESPACE=g.SEMATTRS_CODE_FUNCTION=g.SEMATTRS_THREAD_NAME=g.SEMATTRS_THREAD_ID=g.SEMATTRS_ENDUSER_SCOPE=g.SEMATTRS_ENDUSER_ROLE=g.SEMATTRS_ENDUSER_ID=g.SEMATTRS_PEER_SERVICE=void 0;g.DBSYSTEMVALUES_FILEMAKER=g.DBSYSTEMVALUES_DERBY=g.DBSYSTEMVALUES_FIREBIRD=g.DBSYSTEMVALUES_ADABAS=g.DBSYSTEMVALUES_CACHE=g.DBSYSTEMVALUES_EDB=g.DBSYSTEMVALUES_FIRSTSQL=g.DBSYSTEMVALUES_INGRES=g.DBSYSTEMVALUES_HANADB=g.DBSYSTEMVALUES_MAXDB=g.DBSYSTEMVALUES_PROGRESS=g.DBSYSTEMVALUES_HSQLDB=g.DBSYSTEMVALUES_CLOUDSCAPE=g.DBSYSTEMVALUES_HIVE=g.DBSYSTEMVALUES_REDSHIFT=g.DBSYSTEMVALUES_POSTGRESQL=g.DBSYSTEMVALUES_DB2=g.DBSYSTEMVALUES_ORACLE=g.DBSYSTEMVALUES_MYSQL=g.DBSYSTEMVALUES_MSSQL=g.DBSYSTEMVALUES_OTHER_SQL=g.SemanticAttributes=g.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=g.SEMATTRS_MESSAGE_COMPRESSED_SIZE=g.SEMATTRS_MESSAGE_ID=g.SEMATTRS_MESSAGE_TYPE=g.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=g.SEMATTRS_RPC_JSONRPC_ERROR_CODE=g.SEMATTRS_RPC_JSONRPC_REQUEST_ID=g.SEMATTRS_RPC_JSONRPC_VERSION=g.SEMATTRS_RPC_GRPC_STATUS_CODE=g.SEMATTRS_RPC_METHOD=g.SEMATTRS_RPC_SERVICE=g.SEMATTRS_RPC_SYSTEM=g.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=g.SEMATTRS_MESSAGING_KAFKA_PARTITION=g.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=g.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=g.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=g.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=g.SEMATTRS_MESSAGING_CONSUMER_ID=g.SEMATTRS_MESSAGING_OPERATION=g.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=g.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=g.SEMATTRS_MESSAGING_CONVERSATION_ID=g.SEMATTRS_MESSAGING_MESSAGE_ID=g.SEMATTRS_MESSAGING_URL=g.SEMATTRS_MESSAGING_PROTOCOL_VERSION=g.SEMATTRS_MESSAGING_PROTOCOL=g.SEMATTRS_MESSAGING_TEMP_DESTINATION=void 0;g.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=g.FaasDocumentOperationValues=g.FAASDOCUMENTOPERATIONVALUES_DELETE=g.FAASDOCUMENTOPERATIONVALUES_EDIT=g.FAASDOCUMENTOPERATIONVALUES_INSERT=g.FaasTriggerValues=g.FAASTRIGGERVALUES_OTHER=g.FAASTRIGGERVALUES_TIMER=g.FAASTRIGGERVALUES_PUBSUB=g.FAASTRIGGERVALUES_HTTP=g.FAASTRIGGERVALUES_DATASOURCE=g.DbCassandraConsistencyLevelValues=g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=g.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=g.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=g.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=g.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=g.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=g.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=g.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=g.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=g.DbSystemValues=g.DBSYSTEMVALUES_COCKROACHDB=g.DBSYSTEMVALUES_MEMCACHED=g.DBSYSTEMVALUES_ELASTICSEARCH=g.DBSYSTEMVALUES_GEODE=g.DBSYSTEMVALUES_NEO4J=g.DBSYSTEMVALUES_DYNAMODB=g.DBSYSTEMVALUES_COSMOSDB=g.DBSYSTEMVALUES_COUCHDB=g.DBSYSTEMVALUES_COUCHBASE=g.DBSYSTEMVALUES_REDIS=g.DBSYSTEMVALUES_MONGODB=g.DBSYSTEMVALUES_HBASE=g.DBSYSTEMVALUES_CASSANDRA=g.DBSYSTEMVALUES_COLDFUSION=g.DBSYSTEMVALUES_H2=g.DBSYSTEMVALUES_VERTICA=g.DBSYSTEMVALUES_TERADATA=g.DBSYSTEMVALUES_SYBASE=g.DBSYSTEMVALUES_SQLITE=g.DBSYSTEMVALUES_POINTBASE=g.DBSYSTEMVALUES_PERVASIVE=g.DBSYSTEMVALUES_NETEZZA=g.DBSYSTEMVALUES_MARIADB=g.DBSYSTEMVALUES_INTERBASE=g.DBSYSTEMVALUES_INSTANTDB=g.DBSYSTEMVALUES_INFORMIX=void 0;g.MESSAGINGOPERATIONVALUES_RECEIVE=g.MessagingDestinationKindValues=g.MESSAGINGDESTINATIONKINDVALUES_TOPIC=g.MESSAGINGDESTINATIONKINDVALUES_QUEUE=g.HttpFlavorValues=g.HTTPFLAVORVALUES_QUIC=g.HTTPFLAVORVALUES_SPDY=g.HTTPFLAVORVALUES_HTTP_2_0=g.HTTPFLAVORVALUES_HTTP_1_1=g.HTTPFLAVORVALUES_HTTP_1_0=g.NetHostConnectionSubtypeValues=g.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=g.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=g.NETHOSTCONNECTIONSUBTYPEVALUES_NR=g.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=g.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=g.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=g.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=g.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=g.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=g.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=g.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=g.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=g.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=g.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=g.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=g.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=g.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=g.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=g.NetHostConnectionTypeValues=g.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=g.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=g.NETHOSTCONNECTIONTYPEVALUES_CELL=g.NETHOSTCONNECTIONTYPEVALUES_WIRED=g.NETHOSTCONNECTIONTYPEVALUES_WIFI=g.NetTransportValues=g.NETTRANSPORTVALUES_OTHER=g.NETTRANSPORTVALUES_INPROC=g.NETTRANSPORTVALUES_PIPE=g.NETTRANSPORTVALUES_UNIX=g.NETTRANSPORTVALUES_IP=g.NETTRANSPORTVALUES_IP_UDP=g.NETTRANSPORTVALUES_IP_TCP=g.FaasInvokedProviderValues=g.FAASINVOKEDPROVIDERVALUES_GCP=g.FAASINVOKEDPROVIDERVALUES_AZURE=g.FAASINVOKEDPROVIDERVALUES_AWS=void 0;g.MessageTypeValues=g.MESSAGETYPEVALUES_RECEIVED=g.MESSAGETYPEVALUES_SENT=g.RpcGrpcStatusCodeValues=g.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=g.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=g.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=g.RPCGRPCSTATUSCODEVALUES_INTERNAL=g.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=g.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=g.RPCGRPCSTATUSCODEVALUES_ABORTED=g.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=g.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=g.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=g.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=g.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=g.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=g.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=g.RPCGRPCSTATUSCODEVALUES_UNKNOWN=g.RPCGRPCSTATUSCODEVALUES_CANCELLED=g.RPCGRPCSTATUSCODEVALUES_OK=g.MessagingOperationValues=g.MESSAGINGOPERATIONVALUES_PROCESS=void 0;var so=tM(),Q4="aws.lambda.invoked_arn",e2="db.system",t2="db.connection_string",n2="db.user",r2="db.jdbc.driver_classname",o2="db.name",i2="db.statement",s2="db.operation",a2="db.mssql.instance_name",c2="db.cassandra.keyspace",u2="db.cassandra.page_size",l2="db.cassandra.consistency_level",d2="db.cassandra.table",p2="db.cassandra.idempotence",f2="db.cassandra.speculative_execution_count",m2="db.cassandra.coordinator.id",_2="db.cassandra.coordinator.dc",g2="db.hbase.namespace",h2="db.redis.database_index",E2="db.mongodb.collection",T2="db.sql.table",S2="exception.type",A2="exception.message",y2="exception.stacktrace",R2="exception.escaped",I2="faas.trigger",b2="faas.execution",N2="faas.document.collection",O2="faas.document.operation",C2="faas.document.time",v2="faas.document.name",P2="faas.time",x2="faas.cron",M2="faas.coldstart",L2="faas.invoked_name",w2="faas.invoked_provider",D2="faas.invoked_region",k2="net.transport",U2="net.peer.ip",$2="net.peer.port",B2="net.peer.name",G2="net.host.ip",j2="net.host.port",V2="net.host.name",F2="net.host.connection.type",H2="net.host.connection.subtype",z2="net.host.carrier.name",q2="net.host.carrier.mcc",Y2="net.host.carrier.mnc",W2="net.host.carrier.icc",K2="peer.service",Z2="enduser.id",J2="enduser.role",X2="enduser.scope",Q2="thread.id",eK="thread.name",tK="code.function",nK="code.namespace",rK="code.filepath",oK="code.lineno",iK="http.method",sK="http.url",aK="http.target",cK="http.host",uK="http.scheme",lK="http.status_code",dK="http.flavor",pK="http.user_agent",fK="http.request_content_length",mK="http.request_content_length_uncompressed",_K="http.response_content_length",gK="http.response_content_length_uncompressed",hK="http.server_name",EK="http.route",TK="http.client_ip",SK="aws.dynamodb.table_names",AK="aws.dynamodb.consumed_capacity",yK="aws.dynamodb.item_collection_metrics",RK="aws.dynamodb.provisioned_read_capacity",IK="aws.dynamodb.provisioned_write_capacity",bK="aws.dynamodb.consistent_read",NK="aws.dynamodb.projection",OK="aws.dynamodb.limit",CK="aws.dynamodb.attributes_to_get",vK="aws.dynamodb.index_name",PK="aws.dynamodb.select",xK="aws.dynamodb.global_secondary_indexes",MK="aws.dynamodb.local_secondary_indexes",LK="aws.dynamodb.exclusive_start_table",wK="aws.dynamodb.table_count",DK="aws.dynamodb.scan_forward",kK="aws.dynamodb.segment",UK="aws.dynamodb.total_segments",$K="aws.dynamodb.count",BK="aws.dynamodb.scanned_count",GK="aws.dynamodb.attribute_definitions",jK="aws.dynamodb.global_secondary_index_updates",VK="messaging.system",FK="messaging.destination",HK="messaging.destination_kind",zK="messaging.temp_destination",qK="messaging.protocol",YK="messaging.protocol_version",WK="messaging.url",KK="messaging.message_id",ZK="messaging.conversation_id",JK="messaging.message_payload_size_bytes",XK="messaging.message_payload_compressed_size_bytes",QK="messaging.operation",e6="messaging.consumer_id",t6="messaging.rabbitmq.routing_key",n6="messaging.kafka.message_key",r6="messaging.kafka.consumer_group",o6="messaging.kafka.client_id",i6="messaging.kafka.partition",s6="messaging.kafka.tombstone",a6="rpc.system",c6="rpc.service",u6="rpc.method",l6="rpc.grpc.status_code",d6="rpc.jsonrpc.version",p6="rpc.jsonrpc.request_id",f6="rpc.jsonrpc.error_code",m6="rpc.jsonrpc.error_message",_6="message.type",g6="message.id",h6="message.compressed_size",E6="message.uncompressed_size";g.SEMATTRS_AWS_LAMBDA_INVOKED_ARN=Q4;g.SEMATTRS_DB_SYSTEM=e2;g.SEMATTRS_DB_CONNECTION_STRING=t2;g.SEMATTRS_DB_USER=n2;g.SEMATTRS_DB_JDBC_DRIVER_CLASSNAME=r2;g.SEMATTRS_DB_NAME=o2;g.SEMATTRS_DB_STATEMENT=i2;g.SEMATTRS_DB_OPERATION=s2;g.SEMATTRS_DB_MSSQL_INSTANCE_NAME=a2;g.SEMATTRS_DB_CASSANDRA_KEYSPACE=c2;g.SEMATTRS_DB_CASSANDRA_PAGE_SIZE=u2;g.SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL=l2;g.SEMATTRS_DB_CASSANDRA_TABLE=d2;g.SEMATTRS_DB_CASSANDRA_IDEMPOTENCE=p2;g.SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT=f2;g.SEMATTRS_DB_CASSANDRA_COORDINATOR_ID=m2;g.SEMATTRS_DB_CASSANDRA_COORDINATOR_DC=_2;g.SEMATTRS_DB_HBASE_NAMESPACE=g2;g.SEMATTRS_DB_REDIS_DATABASE_INDEX=h2;g.SEMATTRS_DB_MONGODB_COLLECTION=E2;g.SEMATTRS_DB_SQL_TABLE=T2;g.SEMATTRS_EXCEPTION_TYPE=S2;g.SEMATTRS_EXCEPTION_MESSAGE=A2;g.SEMATTRS_EXCEPTION_STACKTRACE=y2;g.SEMATTRS_EXCEPTION_ESCAPED=R2;g.SEMATTRS_FAAS_TRIGGER=I2;g.SEMATTRS_FAAS_EXECUTION=b2;g.SEMATTRS_FAAS_DOCUMENT_COLLECTION=N2;g.SEMATTRS_FAAS_DOCUMENT_OPERATION=O2;g.SEMATTRS_FAAS_DOCUMENT_TIME=C2;g.SEMATTRS_FAAS_DOCUMENT_NAME=v2;g.SEMATTRS_FAAS_TIME=P2;g.SEMATTRS_FAAS_CRON=x2;g.SEMATTRS_FAAS_COLDSTART=M2;g.SEMATTRS_FAAS_INVOKED_NAME=L2;g.SEMATTRS_FAAS_INVOKED_PROVIDER=w2;g.SEMATTRS_FAAS_INVOKED_REGION=D2;g.SEMATTRS_NET_TRANSPORT=k2;g.SEMATTRS_NET_PEER_IP=U2;g.SEMATTRS_NET_PEER_PORT=$2;g.SEMATTRS_NET_PEER_NAME=B2;g.SEMATTRS_NET_HOST_IP=G2;g.SEMATTRS_NET_HOST_PORT=j2;g.SEMATTRS_NET_HOST_NAME=V2;g.SEMATTRS_NET_HOST_CONNECTION_TYPE=F2;g.SEMATTRS_NET_HOST_CONNECTION_SUBTYPE=H2;g.SEMATTRS_NET_HOST_CARRIER_NAME=z2;g.SEMATTRS_NET_HOST_CARRIER_MCC=q2;g.SEMATTRS_NET_HOST_CARRIER_MNC=Y2;g.SEMATTRS_NET_HOST_CARRIER_ICC=W2;g.SEMATTRS_PEER_SERVICE=K2;g.SEMATTRS_ENDUSER_ID=Z2;g.SEMATTRS_ENDUSER_ROLE=J2;g.SEMATTRS_ENDUSER_SCOPE=X2;g.SEMATTRS_THREAD_ID=Q2;g.SEMATTRS_THREAD_NAME=eK;g.SEMATTRS_CODE_FUNCTION=tK;g.SEMATTRS_CODE_NAMESPACE=nK;g.SEMATTRS_CODE_FILEPATH=rK;g.SEMATTRS_CODE_LINENO=oK;g.SEMATTRS_HTTP_METHOD=iK;g.SEMATTRS_HTTP_URL=sK;g.SEMATTRS_HTTP_TARGET=aK;g.SEMATTRS_HTTP_HOST=cK;g.SEMATTRS_HTTP_SCHEME=uK;g.SEMATTRS_HTTP_STATUS_CODE=lK;g.SEMATTRS_HTTP_FLAVOR=dK;g.SEMATTRS_HTTP_USER_AGENT=pK;g.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH=fK;g.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED=mK;g.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH=_K;g.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED=gK;g.SEMATTRS_HTTP_SERVER_NAME=hK;g.SEMATTRS_HTTP_ROUTE=EK;g.SEMATTRS_HTTP_CLIENT_IP=TK;g.SEMATTRS_AWS_DYNAMODB_TABLE_NAMES=SK;g.SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY=AK;g.SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS=yK;g.SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY=RK;g.SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY=IK;g.SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ=bK;g.SEMATTRS_AWS_DYNAMODB_PROJECTION=NK;g.SEMATTRS_AWS_DYNAMODB_LIMIT=OK;g.SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET=CK;g.SEMATTRS_AWS_DYNAMODB_INDEX_NAME=vK;g.SEMATTRS_AWS_DYNAMODB_SELECT=PK;g.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES=xK;g.SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES=MK;g.SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE=LK;g.SEMATTRS_AWS_DYNAMODB_TABLE_COUNT=wK;g.SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD=DK;g.SEMATTRS_AWS_DYNAMODB_SEGMENT=kK;g.SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS=UK;g.SEMATTRS_AWS_DYNAMODB_COUNT=$K;g.SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT=BK;g.SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS=GK;g.SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES=jK;g.SEMATTRS_MESSAGING_SYSTEM=VK;g.SEMATTRS_MESSAGING_DESTINATION=FK;g.SEMATTRS_MESSAGING_DESTINATION_KIND=HK;g.SEMATTRS_MESSAGING_TEMP_DESTINATION=zK;g.SEMATTRS_MESSAGING_PROTOCOL=qK;g.SEMATTRS_MESSAGING_PROTOCOL_VERSION=YK;g.SEMATTRS_MESSAGING_URL=WK;g.SEMATTRS_MESSAGING_MESSAGE_ID=KK;g.SEMATTRS_MESSAGING_CONVERSATION_ID=ZK;g.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES=JK;g.SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES=XK;g.SEMATTRS_MESSAGING_OPERATION=QK;g.SEMATTRS_MESSAGING_CONSUMER_ID=e6;g.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY=t6;g.SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY=n6;g.SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP=r6;g.SEMATTRS_MESSAGING_KAFKA_CLIENT_ID=o6;g.SEMATTRS_MESSAGING_KAFKA_PARTITION=i6;g.SEMATTRS_MESSAGING_KAFKA_TOMBSTONE=s6;g.SEMATTRS_RPC_SYSTEM=a6;g.SEMATTRS_RPC_SERVICE=c6;g.SEMATTRS_RPC_METHOD=u6;g.SEMATTRS_RPC_GRPC_STATUS_CODE=l6;g.SEMATTRS_RPC_JSONRPC_VERSION=d6;g.SEMATTRS_RPC_JSONRPC_REQUEST_ID=p6;g.SEMATTRS_RPC_JSONRPC_ERROR_CODE=f6;g.SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE=m6;g.SEMATTRS_MESSAGE_TYPE=_6;g.SEMATTRS_MESSAGE_ID=g6;g.SEMATTRS_MESSAGE_COMPRESSED_SIZE=h6;g.SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE=E6;g.SemanticAttributes=(0,so.createConstMap)([Q4,e2,t2,n2,r2,o2,i2,s2,a2,c2,u2,l2,d2,p2,f2,m2,_2,g2,h2,E2,T2,S2,A2,y2,R2,I2,b2,N2,O2,C2,v2,P2,x2,M2,L2,w2,D2,k2,U2,$2,B2,G2,j2,V2,F2,H2,z2,q2,Y2,W2,K2,Z2,J2,X2,Q2,eK,tK,nK,rK,oK,iK,sK,aK,cK,uK,lK,dK,pK,fK,mK,_K,gK,hK,EK,TK,SK,AK,yK,RK,IK,bK,NK,OK,CK,vK,PK,xK,MK,LK,wK,DK,kK,UK,$K,BK,GK,jK,VK,FK,HK,zK,qK,YK,WK,KK,ZK,JK,XK,QK,e6,t6,n6,r6,o6,i6,s6,a6,c6,u6,l6,d6,p6,f6,m6,_6,g6,h6,E6]);var T6="other_sql",S6="mssql",A6="mysql",y6="oracle",R6="db2",I6="postgresql",b6="redshift",N6="hive",O6="cloudscape",C6="hsqldb",v6="progress",P6="maxdb",x6="hanadb",M6="ingres",L6="firstsql",w6="edb",D6="cache",k6="adabas",U6="firebird",$6="derby",B6="filemaker",G6="informix",j6="instantdb",V6="interbase",F6="mariadb",H6="netezza",z6="pervasive",q6="pointbase",Y6="sqlite",W6="sybase",K6="teradata",Z6="vertica",J6="h2",X6="coldfusion",Q6="cassandra",eZ="hbase",tZ="mongodb",nZ="redis",rZ="couchbase",oZ="couchdb",iZ="cosmosdb",sZ="dynamodb",aZ="neo4j",cZ="geode",uZ="elasticsearch",lZ="memcached",dZ="cockroachdb";g.DBSYSTEMVALUES_OTHER_SQL=T6;g.DBSYSTEMVALUES_MSSQL=S6;g.DBSYSTEMVALUES_MYSQL=A6;g.DBSYSTEMVALUES_ORACLE=y6;g.DBSYSTEMVALUES_DB2=R6;g.DBSYSTEMVALUES_POSTGRESQL=I6;g.DBSYSTEMVALUES_REDSHIFT=b6;g.DBSYSTEMVALUES_HIVE=N6;g.DBSYSTEMVALUES_CLOUDSCAPE=O6;g.DBSYSTEMVALUES_HSQLDB=C6;g.DBSYSTEMVALUES_PROGRESS=v6;g.DBSYSTEMVALUES_MAXDB=P6;g.DBSYSTEMVALUES_HANADB=x6;g.DBSYSTEMVALUES_INGRES=M6;g.DBSYSTEMVALUES_FIRSTSQL=L6;g.DBSYSTEMVALUES_EDB=w6;g.DBSYSTEMVALUES_CACHE=D6;g.DBSYSTEMVALUES_ADABAS=k6;g.DBSYSTEMVALUES_FIREBIRD=U6;g.DBSYSTEMVALUES_DERBY=$6;g.DBSYSTEMVALUES_FILEMAKER=B6;g.DBSYSTEMVALUES_INFORMIX=G6;g.DBSYSTEMVALUES_INSTANTDB=j6;g.DBSYSTEMVALUES_INTERBASE=V6;g.DBSYSTEMVALUES_MARIADB=F6;g.DBSYSTEMVALUES_NETEZZA=H6;g.DBSYSTEMVALUES_PERVASIVE=z6;g.DBSYSTEMVALUES_POINTBASE=q6;g.DBSYSTEMVALUES_SQLITE=Y6;g.DBSYSTEMVALUES_SYBASE=W6;g.DBSYSTEMVALUES_TERADATA=K6;g.DBSYSTEMVALUES_VERTICA=Z6;g.DBSYSTEMVALUES_H2=J6;g.DBSYSTEMVALUES_COLDFUSION=X6;g.DBSYSTEMVALUES_CASSANDRA=Q6;g.DBSYSTEMVALUES_HBASE=eZ;g.DBSYSTEMVALUES_MONGODB=tZ;g.DBSYSTEMVALUES_REDIS=nZ;g.DBSYSTEMVALUES_COUCHBASE=rZ;g.DBSYSTEMVALUES_COUCHDB=oZ;g.DBSYSTEMVALUES_COSMOSDB=iZ;g.DBSYSTEMVALUES_DYNAMODB=sZ;g.DBSYSTEMVALUES_NEO4J=aZ;g.DBSYSTEMVALUES_GEODE=cZ;g.DBSYSTEMVALUES_ELASTICSEARCH=uZ;g.DBSYSTEMVALUES_MEMCACHED=lZ;g.DBSYSTEMVALUES_COCKROACHDB=dZ;g.DbSystemValues=(0,so.createConstMap)([T6,S6,A6,y6,R6,I6,b6,N6,O6,C6,v6,P6,x6,M6,L6,w6,D6,k6,U6,$6,B6,G6,j6,V6,F6,H6,z6,q6,Y6,W6,K6,Z6,J6,X6,Q6,eZ,tZ,nZ,rZ,oZ,iZ,sZ,aZ,cZ,uZ,lZ,dZ]);var pZ="all",fZ="each_quorum",mZ="quorum",_Z="local_quorum",gZ="one",hZ="two",EZ="three",TZ="local_one",SZ="any",AZ="serial",yZ="local_serial";g.DBCASSANDRACONSISTENCYLEVELVALUES_ALL=pZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM=fZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM=mZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM=_Z;g.DBCASSANDRACONSISTENCYLEVELVALUES_ONE=gZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_TWO=hZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_THREE=EZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE=TZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_ANY=SZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL=AZ;g.DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL=yZ;g.DbCassandraConsistencyLevelValues=(0,so.createConstMap)([pZ,fZ,mZ,_Z,gZ,hZ,EZ,TZ,SZ,AZ,yZ]);var RZ="datasource",IZ="http",bZ="pubsub",NZ="timer",OZ="other";g.FAASTRIGGERVALUES_DATASOURCE=RZ;g.FAASTRIGGERVALUES_HTTP=IZ;g.FAASTRIGGERVALUES_PUBSUB=bZ;g.FAASTRIGGERVALUES_TIMER=NZ;g.FAASTRIGGERVALUES_OTHER=OZ;g.FaasTriggerValues=(0,so.createConstMap)([RZ,IZ,bZ,NZ,OZ]);var CZ="insert",vZ="edit",PZ="delete";g.FAASDOCUMENTOPERATIONVALUES_INSERT=CZ;g.FAASDOCUMENTOPERATIONVALUES_EDIT=vZ;g.FAASDOCUMENTOPERATIONVALUES_DELETE=PZ;g.FaasDocumentOperationValues=(0,so.createConstMap)([CZ,vZ,PZ]);var xZ="alibaba_cloud",MZ="aws",LZ="azure",wZ="gcp";g.FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD=xZ;g.FAASINVOKEDPROVIDERVALUES_AWS=MZ;g.FAASINVOKEDPROVIDERVALUES_AZURE=LZ;g.FAASINVOKEDPROVIDERVALUES_GCP=wZ;g.FaasInvokedProviderValues=(0,so.createConstMap)([xZ,MZ,LZ,wZ]);var DZ="ip_tcp",kZ="ip_udp",UZ="ip",$Z="unix",BZ="pipe",GZ="inproc",jZ="other";g.NETTRANSPORTVALUES_IP_TCP=DZ;g.NETTRANSPORTVALUES_IP_UDP=kZ;g.NETTRANSPORTVALUES_IP=UZ;g.NETTRANSPORTVALUES_UNIX=$Z;g.NETTRANSPORTVALUES_PIPE=BZ;g.NETTRANSPORTVALUES_INPROC=GZ;g.NETTRANSPORTVALUES_OTHER=jZ;g.NetTransportValues=(0,so.createConstMap)([DZ,kZ,UZ,$Z,BZ,GZ,jZ]);var VZ="wifi",FZ="wired",HZ="cell",zZ="unavailable",qZ="unknown";g.NETHOSTCONNECTIONTYPEVALUES_WIFI=VZ;g.NETHOSTCONNECTIONTYPEVALUES_WIRED=FZ;g.NETHOSTCONNECTIONTYPEVALUES_CELL=HZ;g.NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE=zZ;g.NETHOSTCONNECTIONTYPEVALUES_UNKNOWN=qZ;g.NetHostConnectionTypeValues=(0,so.createConstMap)([VZ,FZ,HZ,zZ,qZ]);var YZ="gprs",WZ="edge",KZ="umts",ZZ="cdma",JZ="evdo_0",XZ="evdo_a",QZ="cdma2000_1xrtt",e3="hsdpa",t3="hsupa",n3="hspa",r3="iden",o3="evdo_b",i3="lte",s3="ehrpd",a3="hspap",c3="gsm",u3="td_scdma",l3="iwlan",d3="nr",p3="nrnsa",f3="lte_ca";g.NETHOSTCONNECTIONSUBTYPEVALUES_GPRS=YZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_EDGE=WZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_UMTS=KZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA=ZZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0=JZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A=XZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT=QZ;g.NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA=e3;g.NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA=t3;g.NETHOSTCONNECTIONSUBTYPEVALUES_HSPA=n3;g.NETHOSTCONNECTIONSUBTYPEVALUES_IDEN=r3;g.NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B=o3;g.NETHOSTCONNECTIONSUBTYPEVALUES_LTE=i3;g.NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD=s3;g.NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP=a3;g.NETHOSTCONNECTIONSUBTYPEVALUES_GSM=c3;g.NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA=u3;g.NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN=l3;g.NETHOSTCONNECTIONSUBTYPEVALUES_NR=d3;g.NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA=p3;g.NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA=f3;g.NetHostConnectionSubtypeValues=(0,so.createConstMap)([YZ,WZ,KZ,ZZ,JZ,XZ,QZ,e3,t3,n3,r3,o3,i3,s3,a3,c3,u3,l3,d3,p3,f3]);var m3="1.0",_3="1.1",g3="2.0",h3="SPDY",E3="QUIC";g.HTTPFLAVORVALUES_HTTP_1_0=m3;g.HTTPFLAVORVALUES_HTTP_1_1=_3;g.HTTPFLAVORVALUES_HTTP_2_0=g3;g.HTTPFLAVORVALUES_SPDY=h3;g.HTTPFLAVORVALUES_QUIC=E3;g.HttpFlavorValues={HTTP_1_0:m3,HTTP_1_1:_3,HTTP_2_0:g3,SPDY:h3,QUIC:E3};var T3="queue",S3="topic";g.MESSAGINGDESTINATIONKINDVALUES_QUEUE=T3;g.MESSAGINGDESTINATIONKINDVALUES_TOPIC=S3;g.MessagingDestinationKindValues=(0,so.createConstMap)([T3,S3]);var A3="receive",y3="process";g.MESSAGINGOPERATIONVALUES_RECEIVE=A3;g.MESSAGINGOPERATIONVALUES_PROCESS=y3;g.MessagingOperationValues=(0,so.createConstMap)([A3,y3]);var R3=0,I3=1,b3=2,N3=3,O3=4,C3=5,v3=6,P3=7,x3=8,M3=9,L3=10,w3=11,D3=12,k3=13,U3=14,$3=15,B3=16;g.RPCGRPCSTATUSCODEVALUES_OK=R3;g.RPCGRPCSTATUSCODEVALUES_CANCELLED=I3;g.RPCGRPCSTATUSCODEVALUES_UNKNOWN=b3;g.RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT=N3;g.RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED=O3;g.RPCGRPCSTATUSCODEVALUES_NOT_FOUND=C3;g.RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS=v3;g.RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED=P3;g.RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED=x3;g.RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION=M3;g.RPCGRPCSTATUSCODEVALUES_ABORTED=L3;g.RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE=w3;g.RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED=D3;g.RPCGRPCSTATUSCODEVALUES_INTERNAL=k3;g.RPCGRPCSTATUSCODEVALUES_UNAVAILABLE=U3;g.RPCGRPCSTATUSCODEVALUES_DATA_LOSS=$3;g.RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED=B3;g.RpcGrpcStatusCodeValues={OK:R3,CANCELLED:I3,UNKNOWN:b3,INVALID_ARGUMENT:N3,DEADLINE_EXCEEDED:O3,NOT_FOUND:C3,ALREADY_EXISTS:v3,PERMISSION_DENIED:P3,RESOURCE_EXHAUSTED:x3,FAILED_PRECONDITION:M3,ABORTED:L3,OUT_OF_RANGE:w3,UNIMPLEMENTED:D3,INTERNAL:k3,UNAVAILABLE:U3,DATA_LOSS:$3,UNAUTHENTICATED:B3};var G3="SENT",j3="RECEIVED";g.MESSAGETYPEVALUES_SENT=G3;g.MESSAGETYPEVALUES_RECEIVED=j3;g.MessageTypeValues=(0,so.createConstMap)([G3,j3])});var F3=S(mu=>{"use strict";l();var DIe=mu&&mu.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),kIe=mu&&mu.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&DIe(t,e,n)};Object.defineProperty(mu,"__esModule",{value:!0});kIe(V3(),mu)});var m5=S(A=>{"use strict";l();Object.defineProperty(A,"__esModule",{value:!0});A.SEMRESATTRS_K8S_STATEFULSET_NAME=A.SEMRESATTRS_K8S_STATEFULSET_UID=A.SEMRESATTRS_K8S_DEPLOYMENT_NAME=A.SEMRESATTRS_K8S_DEPLOYMENT_UID=A.SEMRESATTRS_K8S_REPLICASET_NAME=A.SEMRESATTRS_K8S_REPLICASET_UID=A.SEMRESATTRS_K8S_CONTAINER_NAME=A.SEMRESATTRS_K8S_POD_NAME=A.SEMRESATTRS_K8S_POD_UID=A.SEMRESATTRS_K8S_NAMESPACE_NAME=A.SEMRESATTRS_K8S_NODE_UID=A.SEMRESATTRS_K8S_NODE_NAME=A.SEMRESATTRS_K8S_CLUSTER_NAME=A.SEMRESATTRS_HOST_IMAGE_VERSION=A.SEMRESATTRS_HOST_IMAGE_ID=A.SEMRESATTRS_HOST_IMAGE_NAME=A.SEMRESATTRS_HOST_ARCH=A.SEMRESATTRS_HOST_TYPE=A.SEMRESATTRS_HOST_NAME=A.SEMRESATTRS_HOST_ID=A.SEMRESATTRS_FAAS_MAX_MEMORY=A.SEMRESATTRS_FAAS_INSTANCE=A.SEMRESATTRS_FAAS_VERSION=A.SEMRESATTRS_FAAS_ID=A.SEMRESATTRS_FAAS_NAME=A.SEMRESATTRS_DEVICE_MODEL_NAME=A.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=A.SEMRESATTRS_DEVICE_ID=A.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=A.SEMRESATTRS_CONTAINER_IMAGE_TAG=A.SEMRESATTRS_CONTAINER_IMAGE_NAME=A.SEMRESATTRS_CONTAINER_RUNTIME=A.SEMRESATTRS_CONTAINER_ID=A.SEMRESATTRS_CONTAINER_NAME=A.SEMRESATTRS_AWS_LOG_STREAM_ARNS=A.SEMRESATTRS_AWS_LOG_STREAM_NAMES=A.SEMRESATTRS_AWS_LOG_GROUP_ARNS=A.SEMRESATTRS_AWS_LOG_GROUP_NAMES=A.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=A.SEMRESATTRS_AWS_ECS_TASK_REVISION=A.SEMRESATTRS_AWS_ECS_TASK_FAMILY=A.SEMRESATTRS_AWS_ECS_TASK_ARN=A.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=A.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=A.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=A.SEMRESATTRS_CLOUD_PLATFORM=A.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=A.SEMRESATTRS_CLOUD_REGION=A.SEMRESATTRS_CLOUD_ACCOUNT_ID=A.SEMRESATTRS_CLOUD_PROVIDER=void 0;A.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=A.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=A.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=A.CLOUDPLATFORMVALUES_AZURE_AKS=A.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=A.CLOUDPLATFORMVALUES_AZURE_VM=A.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=A.CLOUDPLATFORMVALUES_AWS_LAMBDA=A.CLOUDPLATFORMVALUES_AWS_EKS=A.CLOUDPLATFORMVALUES_AWS_ECS=A.CLOUDPLATFORMVALUES_AWS_EC2=A.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=A.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=A.CloudProviderValues=A.CLOUDPROVIDERVALUES_GCP=A.CLOUDPROVIDERVALUES_AZURE=A.CLOUDPROVIDERVALUES_AWS=A.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=A.SemanticResourceAttributes=A.SEMRESATTRS_WEBENGINE_DESCRIPTION=A.SEMRESATTRS_WEBENGINE_VERSION=A.SEMRESATTRS_WEBENGINE_NAME=A.SEMRESATTRS_TELEMETRY_AUTO_VERSION=A.SEMRESATTRS_TELEMETRY_SDK_VERSION=A.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=A.SEMRESATTRS_TELEMETRY_SDK_NAME=A.SEMRESATTRS_SERVICE_VERSION=A.SEMRESATTRS_SERVICE_INSTANCE_ID=A.SEMRESATTRS_SERVICE_NAMESPACE=A.SEMRESATTRS_SERVICE_NAME=A.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=A.SEMRESATTRS_PROCESS_RUNTIME_VERSION=A.SEMRESATTRS_PROCESS_RUNTIME_NAME=A.SEMRESATTRS_PROCESS_OWNER=A.SEMRESATTRS_PROCESS_COMMAND_ARGS=A.SEMRESATTRS_PROCESS_COMMAND_LINE=A.SEMRESATTRS_PROCESS_COMMAND=A.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=A.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=A.SEMRESATTRS_PROCESS_PID=A.SEMRESATTRS_OS_VERSION=A.SEMRESATTRS_OS_NAME=A.SEMRESATTRS_OS_DESCRIPTION=A.SEMRESATTRS_OS_TYPE=A.SEMRESATTRS_K8S_CRONJOB_NAME=A.SEMRESATTRS_K8S_CRONJOB_UID=A.SEMRESATTRS_K8S_JOB_NAME=A.SEMRESATTRS_K8S_JOB_UID=A.SEMRESATTRS_K8S_DAEMONSET_NAME=A.SEMRESATTRS_K8S_DAEMONSET_UID=void 0;A.TelemetrySdkLanguageValues=A.TELEMETRYSDKLANGUAGEVALUES_WEBJS=A.TELEMETRYSDKLANGUAGEVALUES_RUBY=A.TELEMETRYSDKLANGUAGEVALUES_PYTHON=A.TELEMETRYSDKLANGUAGEVALUES_PHP=A.TELEMETRYSDKLANGUAGEVALUES_NODEJS=A.TELEMETRYSDKLANGUAGEVALUES_JAVA=A.TELEMETRYSDKLANGUAGEVALUES_GO=A.TELEMETRYSDKLANGUAGEVALUES_ERLANG=A.TELEMETRYSDKLANGUAGEVALUES_DOTNET=A.TELEMETRYSDKLANGUAGEVALUES_CPP=A.OsTypeValues=A.OSTYPEVALUES_Z_OS=A.OSTYPEVALUES_SOLARIS=A.OSTYPEVALUES_AIX=A.OSTYPEVALUES_HPUX=A.OSTYPEVALUES_DRAGONFLYBSD=A.OSTYPEVALUES_OPENBSD=A.OSTYPEVALUES_NETBSD=A.OSTYPEVALUES_FREEBSD=A.OSTYPEVALUES_DARWIN=A.OSTYPEVALUES_LINUX=A.OSTYPEVALUES_WINDOWS=A.HostArchValues=A.HOSTARCHVALUES_X86=A.HOSTARCHVALUES_PPC64=A.HOSTARCHVALUES_PPC32=A.HOSTARCHVALUES_IA64=A.HOSTARCHVALUES_ARM64=A.HOSTARCHVALUES_ARM32=A.HOSTARCHVALUES_AMD64=A.AwsEcsLaunchtypeValues=A.AWSECSLAUNCHTYPEVALUES_FARGATE=A.AWSECSLAUNCHTYPEVALUES_EC2=A.CloudPlatformValues=A.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=A.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=A.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=A.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=void 0;var _u=tM(),H3="cloud.provider",z3="cloud.account.id",q3="cloud.region",Y3="cloud.availability_zone",W3="cloud.platform",K3="aws.ecs.container.arn",Z3="aws.ecs.cluster.arn",J3="aws.ecs.launchtype",X3="aws.ecs.task.arn",Q3="aws.ecs.task.family",eJ="aws.ecs.task.revision",tJ="aws.eks.cluster.arn",nJ="aws.log.group.names",rJ="aws.log.group.arns",oJ="aws.log.stream.names",iJ="aws.log.stream.arns",sJ="container.name",aJ="container.id",cJ="container.runtime",uJ="container.image.name",lJ="container.image.tag",dJ="deployment.environment",pJ="device.id",fJ="device.model.identifier",mJ="device.model.name",_J="faas.name",gJ="faas.id",hJ="faas.version",EJ="faas.instance",TJ="faas.max_memory",SJ="host.id",AJ="host.name",yJ="host.type",RJ="host.arch",IJ="host.image.name",bJ="host.image.id",NJ="host.image.version",OJ="k8s.cluster.name",CJ="k8s.node.name",vJ="k8s.node.uid",PJ="k8s.namespace.name",xJ="k8s.pod.uid",MJ="k8s.pod.name",LJ="k8s.container.name",wJ="k8s.replicaset.uid",DJ="k8s.replicaset.name",kJ="k8s.deployment.uid",UJ="k8s.deployment.name",$J="k8s.statefulset.uid",BJ="k8s.statefulset.name",GJ="k8s.daemonset.uid",jJ="k8s.daemonset.name",VJ="k8s.job.uid",FJ="k8s.job.name",HJ="k8s.cronjob.uid",zJ="k8s.cronjob.name",qJ="os.type",YJ="os.description",WJ="os.name",KJ="os.version",ZJ="process.pid",JJ="process.executable.name",XJ="process.executable.path",QJ="process.command",eX="process.command_line",tX="process.command_args",nX="process.owner",rX="process.runtime.name",oX="process.runtime.version",iX="process.runtime.description",sX="service.name",aX="service.namespace",cX="service.instance.id",uX="service.version",lX="telemetry.sdk.name",dX="telemetry.sdk.language",pX="telemetry.sdk.version",fX="telemetry.auto.version",mX="webengine.name",_X="webengine.version",gX="webengine.description";A.SEMRESATTRS_CLOUD_PROVIDER=H3;A.SEMRESATTRS_CLOUD_ACCOUNT_ID=z3;A.SEMRESATTRS_CLOUD_REGION=q3;A.SEMRESATTRS_CLOUD_AVAILABILITY_ZONE=Y3;A.SEMRESATTRS_CLOUD_PLATFORM=W3;A.SEMRESATTRS_AWS_ECS_CONTAINER_ARN=K3;A.SEMRESATTRS_AWS_ECS_CLUSTER_ARN=Z3;A.SEMRESATTRS_AWS_ECS_LAUNCHTYPE=J3;A.SEMRESATTRS_AWS_ECS_TASK_ARN=X3;A.SEMRESATTRS_AWS_ECS_TASK_FAMILY=Q3;A.SEMRESATTRS_AWS_ECS_TASK_REVISION=eJ;A.SEMRESATTRS_AWS_EKS_CLUSTER_ARN=tJ;A.SEMRESATTRS_AWS_LOG_GROUP_NAMES=nJ;A.SEMRESATTRS_AWS_LOG_GROUP_ARNS=rJ;A.SEMRESATTRS_AWS_LOG_STREAM_NAMES=oJ;A.SEMRESATTRS_AWS_LOG_STREAM_ARNS=iJ;A.SEMRESATTRS_CONTAINER_NAME=sJ;A.SEMRESATTRS_CONTAINER_ID=aJ;A.SEMRESATTRS_CONTAINER_RUNTIME=cJ;A.SEMRESATTRS_CONTAINER_IMAGE_NAME=uJ;A.SEMRESATTRS_CONTAINER_IMAGE_TAG=lJ;A.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT=dJ;A.SEMRESATTRS_DEVICE_ID=pJ;A.SEMRESATTRS_DEVICE_MODEL_IDENTIFIER=fJ;A.SEMRESATTRS_DEVICE_MODEL_NAME=mJ;A.SEMRESATTRS_FAAS_NAME=_J;A.SEMRESATTRS_FAAS_ID=gJ;A.SEMRESATTRS_FAAS_VERSION=hJ;A.SEMRESATTRS_FAAS_INSTANCE=EJ;A.SEMRESATTRS_FAAS_MAX_MEMORY=TJ;A.SEMRESATTRS_HOST_ID=SJ;A.SEMRESATTRS_HOST_NAME=AJ;A.SEMRESATTRS_HOST_TYPE=yJ;A.SEMRESATTRS_HOST_ARCH=RJ;A.SEMRESATTRS_HOST_IMAGE_NAME=IJ;A.SEMRESATTRS_HOST_IMAGE_ID=bJ;A.SEMRESATTRS_HOST_IMAGE_VERSION=NJ;A.SEMRESATTRS_K8S_CLUSTER_NAME=OJ;A.SEMRESATTRS_K8S_NODE_NAME=CJ;A.SEMRESATTRS_K8S_NODE_UID=vJ;A.SEMRESATTRS_K8S_NAMESPACE_NAME=PJ;A.SEMRESATTRS_K8S_POD_UID=xJ;A.SEMRESATTRS_K8S_POD_NAME=MJ;A.SEMRESATTRS_K8S_CONTAINER_NAME=LJ;A.SEMRESATTRS_K8S_REPLICASET_UID=wJ;A.SEMRESATTRS_K8S_REPLICASET_NAME=DJ;A.SEMRESATTRS_K8S_DEPLOYMENT_UID=kJ;A.SEMRESATTRS_K8S_DEPLOYMENT_NAME=UJ;A.SEMRESATTRS_K8S_STATEFULSET_UID=$J;A.SEMRESATTRS_K8S_STATEFULSET_NAME=BJ;A.SEMRESATTRS_K8S_DAEMONSET_UID=GJ;A.SEMRESATTRS_K8S_DAEMONSET_NAME=jJ;A.SEMRESATTRS_K8S_JOB_UID=VJ;A.SEMRESATTRS_K8S_JOB_NAME=FJ;A.SEMRESATTRS_K8S_CRONJOB_UID=HJ;A.SEMRESATTRS_K8S_CRONJOB_NAME=zJ;A.SEMRESATTRS_OS_TYPE=qJ;A.SEMRESATTRS_OS_DESCRIPTION=YJ;A.SEMRESATTRS_OS_NAME=WJ;A.SEMRESATTRS_OS_VERSION=KJ;A.SEMRESATTRS_PROCESS_PID=ZJ;A.SEMRESATTRS_PROCESS_EXECUTABLE_NAME=JJ;A.SEMRESATTRS_PROCESS_EXECUTABLE_PATH=XJ;A.SEMRESATTRS_PROCESS_COMMAND=QJ;A.SEMRESATTRS_PROCESS_COMMAND_LINE=eX;A.SEMRESATTRS_PROCESS_COMMAND_ARGS=tX;A.SEMRESATTRS_PROCESS_OWNER=nX;A.SEMRESATTRS_PROCESS_RUNTIME_NAME=rX;A.SEMRESATTRS_PROCESS_RUNTIME_VERSION=oX;A.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION=iX;A.SEMRESATTRS_SERVICE_NAME=sX;A.SEMRESATTRS_SERVICE_NAMESPACE=aX;A.SEMRESATTRS_SERVICE_INSTANCE_ID=cX;A.SEMRESATTRS_SERVICE_VERSION=uX;A.SEMRESATTRS_TELEMETRY_SDK_NAME=lX;A.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE=dX;A.SEMRESATTRS_TELEMETRY_SDK_VERSION=pX;A.SEMRESATTRS_TELEMETRY_AUTO_VERSION=fX;A.SEMRESATTRS_WEBENGINE_NAME=mX;A.SEMRESATTRS_WEBENGINE_VERSION=_X;A.SEMRESATTRS_WEBENGINE_DESCRIPTION=gX;A.SemanticResourceAttributes=(0,_u.createConstMap)([H3,z3,q3,Y3,W3,K3,Z3,J3,X3,Q3,eJ,tJ,nJ,rJ,oJ,iJ,sJ,aJ,cJ,uJ,lJ,dJ,pJ,fJ,mJ,_J,gJ,hJ,EJ,TJ,SJ,AJ,yJ,RJ,IJ,bJ,NJ,OJ,CJ,vJ,PJ,xJ,MJ,LJ,wJ,DJ,kJ,UJ,$J,BJ,GJ,jJ,VJ,FJ,HJ,zJ,qJ,YJ,WJ,KJ,ZJ,JJ,XJ,QJ,eX,tX,nX,rX,oX,iX,sX,aX,cX,uX,lX,dX,pX,fX,mX,_X,gX]);var hX="alibaba_cloud",EX="aws",TX="azure",SX="gcp";A.CLOUDPROVIDERVALUES_ALIBABA_CLOUD=hX;A.CLOUDPROVIDERVALUES_AWS=EX;A.CLOUDPROVIDERVALUES_AZURE=TX;A.CLOUDPROVIDERVALUES_GCP=SX;A.CloudProviderValues=(0,_u.createConstMap)([hX,EX,TX,SX]);var AX="alibaba_cloud_ecs",yX="alibaba_cloud_fc",RX="aws_ec2",IX="aws_ecs",bX="aws_eks",NX="aws_lambda",OX="aws_elastic_beanstalk",CX="azure_vm",vX="azure_container_instances",PX="azure_aks",xX="azure_functions",MX="azure_app_service",LX="gcp_compute_engine",wX="gcp_cloud_run",DX="gcp_kubernetes_engine",kX="gcp_cloud_functions",UX="gcp_app_engine";A.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS=AX;A.CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC=yX;A.CLOUDPLATFORMVALUES_AWS_EC2=RX;A.CLOUDPLATFORMVALUES_AWS_ECS=IX;A.CLOUDPLATFORMVALUES_AWS_EKS=bX;A.CLOUDPLATFORMVALUES_AWS_LAMBDA=NX;A.CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK=OX;A.CLOUDPLATFORMVALUES_AZURE_VM=CX;A.CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES=vX;A.CLOUDPLATFORMVALUES_AZURE_AKS=PX;A.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS=xX;A.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE=MX;A.CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE=LX;A.CLOUDPLATFORMVALUES_GCP_CLOUD_RUN=wX;A.CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE=DX;A.CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS=kX;A.CLOUDPLATFORMVALUES_GCP_APP_ENGINE=UX;A.CloudPlatformValues=(0,_u.createConstMap)([AX,yX,RX,IX,bX,NX,OX,CX,vX,PX,xX,MX,LX,wX,DX,kX,UX]);var $X="ec2",BX="fargate";A.AWSECSLAUNCHTYPEVALUES_EC2=$X;A.AWSECSLAUNCHTYPEVALUES_FARGATE=BX;A.AwsEcsLaunchtypeValues=(0,_u.createConstMap)([$X,BX]);var GX="amd64",jX="arm32",VX="arm64",FX="ia64",HX="ppc32",zX="ppc64",qX="x86";A.HOSTARCHVALUES_AMD64=GX;A.HOSTARCHVALUES_ARM32=jX;A.HOSTARCHVALUES_ARM64=VX;A.HOSTARCHVALUES_IA64=FX;A.HOSTARCHVALUES_PPC32=HX;A.HOSTARCHVALUES_PPC64=zX;A.HOSTARCHVALUES_X86=qX;A.HostArchValues=(0,_u.createConstMap)([GX,jX,VX,FX,HX,zX,qX]);var YX="windows",WX="linux",KX="darwin",ZX="freebsd",JX="netbsd",XX="openbsd",QX="dragonflybsd",e5="hpux",t5="aix",n5="solaris",r5="z_os";A.OSTYPEVALUES_WINDOWS=YX;A.OSTYPEVALUES_LINUX=WX;A.OSTYPEVALUES_DARWIN=KX;A.OSTYPEVALUES_FREEBSD=ZX;A.OSTYPEVALUES_NETBSD=JX;A.OSTYPEVALUES_OPENBSD=XX;A.OSTYPEVALUES_DRAGONFLYBSD=QX;A.OSTYPEVALUES_HPUX=e5;A.OSTYPEVALUES_AIX=t5;A.OSTYPEVALUES_SOLARIS=n5;A.OSTYPEVALUES_Z_OS=r5;A.OsTypeValues=(0,_u.createConstMap)([YX,WX,KX,ZX,JX,XX,QX,e5,t5,n5,r5]);var o5="cpp",i5="dotnet",s5="erlang",a5="go",c5="java",u5="nodejs",l5="php",d5="python",p5="ruby",f5="webjs";A.TELEMETRYSDKLANGUAGEVALUES_CPP=o5;A.TELEMETRYSDKLANGUAGEVALUES_DOTNET=i5;A.TELEMETRYSDKLANGUAGEVALUES_ERLANG=s5;A.TELEMETRYSDKLANGUAGEVALUES_GO=a5;A.TELEMETRYSDKLANGUAGEVALUES_JAVA=c5;A.TELEMETRYSDKLANGUAGEVALUES_NODEJS=u5;A.TELEMETRYSDKLANGUAGEVALUES_PHP=l5;A.TELEMETRYSDKLANGUAGEVALUES_PYTHON=d5;A.TELEMETRYSDKLANGUAGEVALUES_RUBY=p5;A.TELEMETRYSDKLANGUAGEVALUES_WEBJS=f5;A.TelemetrySdkLanguageValues=(0,_u.createConstMap)([o5,i5,s5,a5,c5,u5,l5,d5,p5,f5])});var _5=S(gu=>{"use strict";l();var UIe=gu&&gu.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),$Ie=gu&&gu.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&UIe(t,e,n)};Object.defineProperty(gu,"__esModule",{value:!0});$Ie(m5(),gu)});var g5=S(y=>{"use strict";l();Object.defineProperty(y,"__esModule",{value:!0});y.ATTR_EXCEPTION_TYPE=y.ATTR_EXCEPTION_STACKTRACE=y.ATTR_EXCEPTION_MESSAGE=y.ATTR_EXCEPTION_ESCAPED=y.ERROR_TYPE_VALUE_OTHER=y.ATTR_ERROR_TYPE=y.DOTNET_GC_HEAP_GENERATION_VALUE_POH=y.DOTNET_GC_HEAP_GENERATION_VALUE_LOH=y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2=y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1=y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0=y.ATTR_DOTNET_GC_HEAP_GENERATION=y.DB_SYSTEM_NAME_VALUE_POSTGRESQL=y.DB_SYSTEM_NAME_VALUE_MYSQL=y.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER=y.DB_SYSTEM_NAME_VALUE_MARIADB=y.ATTR_DB_SYSTEM_NAME=y.ATTR_DB_STORED_PROCEDURE_NAME=y.ATTR_DB_RESPONSE_STATUS_CODE=y.ATTR_DB_QUERY_TEXT=y.ATTR_DB_QUERY_SUMMARY=y.ATTR_DB_OPERATION_NAME=y.ATTR_DB_OPERATION_BATCH_SIZE=y.ATTR_DB_NAMESPACE=y.ATTR_DB_COLLECTION_NAME=y.ATTR_CODE_STACKTRACE=y.ATTR_CODE_LINE_NUMBER=y.ATTR_CODE_FUNCTION_NAME=y.ATTR_CODE_FILE_PATH=y.ATTR_CODE_COLUMN_NUMBER=y.ATTR_CLIENT_PORT=y.ATTR_CLIENT_ADDRESS=y.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED=y.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS=y.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE=y.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS=y.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK=y.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED=y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED=y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER=y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER=y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED=y.ATTR_ASPNETCORE_RATE_LIMITING_RESULT=y.ATTR_ASPNETCORE_RATE_LIMITING_POLICY=y.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE=y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED=y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED=y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED=y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED=y.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT=void 0;y.OTEL_STATUS_CODE_VALUE_ERROR=y.ATTR_OTEL_STATUS_CODE=y.ATTR_OTEL_SCOPE_VERSION=y.ATTR_OTEL_SCOPE_NAME=y.NETWORK_TYPE_VALUE_IPV6=y.NETWORK_TYPE_VALUE_IPV4=y.ATTR_NETWORK_TYPE=y.NETWORK_TRANSPORT_VALUE_UNIX=y.NETWORK_TRANSPORT_VALUE_UDP=y.NETWORK_TRANSPORT_VALUE_TCP=y.NETWORK_TRANSPORT_VALUE_QUIC=y.NETWORK_TRANSPORT_VALUE_PIPE=y.ATTR_NETWORK_TRANSPORT=y.ATTR_NETWORK_PROTOCOL_VERSION=y.ATTR_NETWORK_PROTOCOL_NAME=y.ATTR_NETWORK_PEER_PORT=y.ATTR_NETWORK_PEER_ADDRESS=y.ATTR_NETWORK_LOCAL_PORT=y.ATTR_NETWORK_LOCAL_ADDRESS=y.JVM_THREAD_STATE_VALUE_WAITING=y.JVM_THREAD_STATE_VALUE_TIMED_WAITING=y.JVM_THREAD_STATE_VALUE_TERMINATED=y.JVM_THREAD_STATE_VALUE_RUNNABLE=y.JVM_THREAD_STATE_VALUE_NEW=y.JVM_THREAD_STATE_VALUE_BLOCKED=y.ATTR_JVM_THREAD_STATE=y.ATTR_JVM_THREAD_DAEMON=y.JVM_MEMORY_TYPE_VALUE_NON_HEAP=y.JVM_MEMORY_TYPE_VALUE_HEAP=y.ATTR_JVM_MEMORY_TYPE=y.ATTR_JVM_MEMORY_POOL_NAME=y.ATTR_JVM_GC_NAME=y.ATTR_JVM_GC_ACTION=y.ATTR_HTTP_ROUTE=y.ATTR_HTTP_RESPONSE_STATUS_CODE=y.ATTR_HTTP_RESPONSE_HEADER=y.ATTR_HTTP_REQUEST_RESEND_COUNT=y.ATTR_HTTP_REQUEST_METHOD_ORIGINAL=y.HTTP_REQUEST_METHOD_VALUE_TRACE=y.HTTP_REQUEST_METHOD_VALUE_PUT=y.HTTP_REQUEST_METHOD_VALUE_POST=y.HTTP_REQUEST_METHOD_VALUE_PATCH=y.HTTP_REQUEST_METHOD_VALUE_OPTIONS=y.HTTP_REQUEST_METHOD_VALUE_HEAD=y.HTTP_REQUEST_METHOD_VALUE_GET=y.HTTP_REQUEST_METHOD_VALUE_DELETE=y.HTTP_REQUEST_METHOD_VALUE_CONNECT=y.HTTP_REQUEST_METHOD_VALUE_OTHER=y.ATTR_HTTP_REQUEST_METHOD=y.ATTR_HTTP_REQUEST_HEADER=void 0;y.ATTR_USER_AGENT_ORIGINAL=y.ATTR_URL_SCHEME=y.ATTR_URL_QUERY=y.ATTR_URL_PATH=y.ATTR_URL_FULL=y.ATTR_URL_FRAGMENT=y.ATTR_TELEMETRY_SDK_VERSION=y.ATTR_TELEMETRY_SDK_NAME=y.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS=y.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT=y.TELEMETRY_SDK_LANGUAGE_VALUE_RUST=y.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY=y.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON=y.TELEMETRY_SDK_LANGUAGE_VALUE_PHP=y.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS=y.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA=y.TELEMETRY_SDK_LANGUAGE_VALUE_GO=y.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG=y.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET=y.TELEMETRY_SDK_LANGUAGE_VALUE_CPP=y.ATTR_TELEMETRY_SDK_LANGUAGE=y.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS=y.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS=y.SIGNALR_TRANSPORT_VALUE_LONG_POLLING=y.ATTR_SIGNALR_TRANSPORT=y.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT=y.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE=y.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN=y.ATTR_SIGNALR_CONNECTION_STATUS=y.ATTR_SERVICE_VERSION=y.ATTR_SERVICE_NAMESPACE=y.ATTR_SERVICE_NAME=y.ATTR_SERVICE_INSTANCE_ID=y.ATTR_SERVER_PORT=y.ATTR_SERVER_ADDRESS=y.ATTR_OTEL_STATUS_DESCRIPTION=y.OTEL_STATUS_CODE_VALUE_OK=void 0;y.ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT="aspnetcore.diagnostics.exception.result";y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED="aborted";y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED="handled";y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED="skipped";y.ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED="unhandled";y.ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE="aspnetcore.diagnostics.handler.type";y.ATTR_ASPNETCORE_RATE_LIMITING_POLICY="aspnetcore.rate_limiting.policy";y.ATTR_ASPNETCORE_RATE_LIMITING_RESULT="aspnetcore.rate_limiting.result";y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED="acquired";y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER="endpoint_limiter";y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER="global_limiter";y.ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED="request_canceled";y.ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED="aspnetcore.request.is_unhandled";y.ATTR_ASPNETCORE_ROUTING_IS_FALLBACK="aspnetcore.routing.is_fallback";y.ATTR_ASPNETCORE_ROUTING_MATCH_STATUS="aspnetcore.routing.match_status";y.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE="failure";y.ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS="success";y.ATTR_ASPNETCORE_USER_IS_AUTHENTICATED="aspnetcore.user.is_authenticated";y.ATTR_CLIENT_ADDRESS="client.address";y.ATTR_CLIENT_PORT="client.port";y.ATTR_CODE_COLUMN_NUMBER="code.column.number";y.ATTR_CODE_FILE_PATH="code.file.path";y.ATTR_CODE_FUNCTION_NAME="code.function.name";y.ATTR_CODE_LINE_NUMBER="code.line.number";y.ATTR_CODE_STACKTRACE="code.stacktrace";y.ATTR_DB_COLLECTION_NAME="db.collection.name";y.ATTR_DB_NAMESPACE="db.namespace";y.ATTR_DB_OPERATION_BATCH_SIZE="db.operation.batch.size";y.ATTR_DB_OPERATION_NAME="db.operation.name";y.ATTR_DB_QUERY_SUMMARY="db.query.summary";y.ATTR_DB_QUERY_TEXT="db.query.text";y.ATTR_DB_RESPONSE_STATUS_CODE="db.response.status_code";y.ATTR_DB_STORED_PROCEDURE_NAME="db.stored_procedure.name";y.ATTR_DB_SYSTEM_NAME="db.system.name";y.DB_SYSTEM_NAME_VALUE_MARIADB="mariadb";y.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER="microsoft.sql_server";y.DB_SYSTEM_NAME_VALUE_MYSQL="mysql";y.DB_SYSTEM_NAME_VALUE_POSTGRESQL="postgresql";y.ATTR_DOTNET_GC_HEAP_GENERATION="dotnet.gc.heap.generation";y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN0="gen0";y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN1="gen1";y.DOTNET_GC_HEAP_GENERATION_VALUE_GEN2="gen2";y.DOTNET_GC_HEAP_GENERATION_VALUE_LOH="loh";y.DOTNET_GC_HEAP_GENERATION_VALUE_POH="poh";y.ATTR_ERROR_TYPE="error.type";y.ERROR_TYPE_VALUE_OTHER="_OTHER";y.ATTR_EXCEPTION_ESCAPED="exception.escaped";y.ATTR_EXCEPTION_MESSAGE="exception.message";y.ATTR_EXCEPTION_STACKTRACE="exception.stacktrace";y.ATTR_EXCEPTION_TYPE="exception.type";var BIe=e=>`http.request.header.${e}`;y.ATTR_HTTP_REQUEST_HEADER=BIe;y.ATTR_HTTP_REQUEST_METHOD="http.request.method";y.HTTP_REQUEST_METHOD_VALUE_OTHER="_OTHER";y.HTTP_REQUEST_METHOD_VALUE_CONNECT="CONNECT";y.HTTP_REQUEST_METHOD_VALUE_DELETE="DELETE";y.HTTP_REQUEST_METHOD_VALUE_GET="GET";y.HTTP_REQUEST_METHOD_VALUE_HEAD="HEAD";y.HTTP_REQUEST_METHOD_VALUE_OPTIONS="OPTIONS";y.HTTP_REQUEST_METHOD_VALUE_PATCH="PATCH";y.HTTP_REQUEST_METHOD_VALUE_POST="POST";y.HTTP_REQUEST_METHOD_VALUE_PUT="PUT";y.HTTP_REQUEST_METHOD_VALUE_TRACE="TRACE";y.ATTR_HTTP_REQUEST_METHOD_ORIGINAL="http.request.method_original";y.ATTR_HTTP_REQUEST_RESEND_COUNT="http.request.resend_count";var GIe=e=>`http.response.header.${e}`;y.ATTR_HTTP_RESPONSE_HEADER=GIe;y.ATTR_HTTP_RESPONSE_STATUS_CODE="http.response.status_code";y.ATTR_HTTP_ROUTE="http.route";y.ATTR_JVM_GC_ACTION="jvm.gc.action";y.ATTR_JVM_GC_NAME="jvm.gc.name";y.ATTR_JVM_MEMORY_POOL_NAME="jvm.memory.pool.name";y.ATTR_JVM_MEMORY_TYPE="jvm.memory.type";y.JVM_MEMORY_TYPE_VALUE_HEAP="heap";y.JVM_MEMORY_TYPE_VALUE_NON_HEAP="non_heap";y.ATTR_JVM_THREAD_DAEMON="jvm.thread.daemon";y.ATTR_JVM_THREAD_STATE="jvm.thread.state";y.JVM_THREAD_STATE_VALUE_BLOCKED="blocked";y.JVM_THREAD_STATE_VALUE_NEW="new";y.JVM_THREAD_STATE_VALUE_RUNNABLE="runnable";y.JVM_THREAD_STATE_VALUE_TERMINATED="terminated";y.JVM_THREAD_STATE_VALUE_TIMED_WAITING="timed_waiting";y.JVM_THREAD_STATE_VALUE_WAITING="waiting";y.ATTR_NETWORK_LOCAL_ADDRESS="network.local.address";y.ATTR_NETWORK_LOCAL_PORT="network.local.port";y.ATTR_NETWORK_PEER_ADDRESS="network.peer.address";y.ATTR_NETWORK_PEER_PORT="network.peer.port";y.ATTR_NETWORK_PROTOCOL_NAME="network.protocol.name";y.ATTR_NETWORK_PROTOCOL_VERSION="network.protocol.version";y.ATTR_NETWORK_TRANSPORT="network.transport";y.NETWORK_TRANSPORT_VALUE_PIPE="pipe";y.NETWORK_TRANSPORT_VALUE_QUIC="quic";y.NETWORK_TRANSPORT_VALUE_TCP="tcp";y.NETWORK_TRANSPORT_VALUE_UDP="udp";y.NETWORK_TRANSPORT_VALUE_UNIX="unix";y.ATTR_NETWORK_TYPE="network.type";y.NETWORK_TYPE_VALUE_IPV4="ipv4";y.NETWORK_TYPE_VALUE_IPV6="ipv6";y.ATTR_OTEL_SCOPE_NAME="otel.scope.name";y.ATTR_OTEL_SCOPE_VERSION="otel.scope.version";y.ATTR_OTEL_STATUS_CODE="otel.status_code";y.OTEL_STATUS_CODE_VALUE_ERROR="ERROR";y.OTEL_STATUS_CODE_VALUE_OK="OK";y.ATTR_OTEL_STATUS_DESCRIPTION="otel.status_description";y.ATTR_SERVER_ADDRESS="server.address";y.ATTR_SERVER_PORT="server.port";y.ATTR_SERVICE_INSTANCE_ID="service.instance.id";y.ATTR_SERVICE_NAME="service.name";y.ATTR_SERVICE_NAMESPACE="service.namespace";y.ATTR_SERVICE_VERSION="service.version";y.ATTR_SIGNALR_CONNECTION_STATUS="signalr.connection.status";y.SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN="app_shutdown";y.SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE="normal_closure";y.SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT="timeout";y.ATTR_SIGNALR_TRANSPORT="signalr.transport";y.SIGNALR_TRANSPORT_VALUE_LONG_POLLING="long_polling";y.SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS="server_sent_events";y.SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS="web_sockets";y.ATTR_TELEMETRY_SDK_LANGUAGE="telemetry.sdk.language";y.TELEMETRY_SDK_LANGUAGE_VALUE_CPP="cpp";y.TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET="dotnet";y.TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG="erlang";y.TELEMETRY_SDK_LANGUAGE_VALUE_GO="go";y.TELEMETRY_SDK_LANGUAGE_VALUE_JAVA="java";y.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS="nodejs";y.TELEMETRY_SDK_LANGUAGE_VALUE_PHP="php";y.TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON="python";y.TELEMETRY_SDK_LANGUAGE_VALUE_RUBY="ruby";y.TELEMETRY_SDK_LANGUAGE_VALUE_RUST="rust";y.TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT="swift";y.TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS="webjs";y.ATTR_TELEMETRY_SDK_NAME="telemetry.sdk.name";y.ATTR_TELEMETRY_SDK_VERSION="telemetry.sdk.version";y.ATTR_URL_FRAGMENT="url.fragment";y.ATTR_URL_FULL="url.full";y.ATTR_URL_PATH="url.path";y.ATTR_URL_QUERY="url.query";y.ATTR_URL_SCHEME="url.scheme";y.ATTR_USER_AGENT_ORIGINAL="user_agent.original"});var h5=S(B=>{"use strict";l();Object.defineProperty(B,"__esModule",{value:!0});B.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS=B.METRIC_KESTREL_UPGRADED_CONNECTIONS=B.METRIC_KESTREL_TLS_HANDSHAKE_DURATION=B.METRIC_KESTREL_REJECTED_CONNECTIONS=B.METRIC_KESTREL_QUEUED_REQUESTS=B.METRIC_KESTREL_QUEUED_CONNECTIONS=B.METRIC_KESTREL_CONNECTION_DURATION=B.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES=B.METRIC_KESTREL_ACTIVE_CONNECTIONS=B.METRIC_JVM_THREAD_COUNT=B.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC=B.METRIC_JVM_MEMORY_USED=B.METRIC_JVM_MEMORY_LIMIT=B.METRIC_JVM_MEMORY_COMMITTED=B.METRIC_JVM_GC_DURATION=B.METRIC_JVM_CPU_TIME=B.METRIC_JVM_CPU_RECENT_UTILIZATION=B.METRIC_JVM_CPU_COUNT=B.METRIC_JVM_CLASS_UNLOADED=B.METRIC_JVM_CLASS_LOADED=B.METRIC_JVM_CLASS_COUNT=B.METRIC_HTTP_SERVER_REQUEST_DURATION=B.METRIC_HTTP_CLIENT_REQUEST_DURATION=B.METRIC_DOTNET_TIMER_COUNT=B.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT=B.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT=B.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH=B.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET=B.METRIC_DOTNET_PROCESS_CPU_TIME=B.METRIC_DOTNET_PROCESS_CPU_COUNT=B.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS=B.METRIC_DOTNET_JIT_COMPILED_METHODS=B.METRIC_DOTNET_JIT_COMPILED_IL_SIZE=B.METRIC_DOTNET_JIT_COMPILATION_TIME=B.METRIC_DOTNET_GC_PAUSE_TIME=B.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE=B.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE=B.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE=B.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED=B.METRIC_DOTNET_GC_COLLECTIONS=B.METRIC_DOTNET_EXCEPTIONS=B.METRIC_DOTNET_ASSEMBLY_COUNT=B.METRIC_DB_CLIENT_OPERATION_DURATION=B.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS=B.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS=B.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION=B.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE=B.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS=B.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES=B.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS=void 0;B.METRIC_SIGNALR_SERVER_CONNECTION_DURATION=void 0;B.METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS="aspnetcore.diagnostics.exceptions";B.METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES="aspnetcore.rate_limiting.active_request_leases";B.METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS="aspnetcore.rate_limiting.queued_requests";B.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE="aspnetcore.rate_limiting.request.time_in_queue";B.METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION="aspnetcore.rate_limiting.request_lease.duration";B.METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS="aspnetcore.rate_limiting.requests";B.METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS="aspnetcore.routing.match_attempts";B.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration";B.METRIC_DOTNET_ASSEMBLY_COUNT="dotnet.assembly.count";B.METRIC_DOTNET_EXCEPTIONS="dotnet.exceptions";B.METRIC_DOTNET_GC_COLLECTIONS="dotnet.gc.collections";B.METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED="dotnet.gc.heap.total_allocated";B.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE="dotnet.gc.last_collection.heap.fragmentation.size";B.METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE="dotnet.gc.last_collection.heap.size";B.METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE="dotnet.gc.last_collection.memory.committed_size";B.METRIC_DOTNET_GC_PAUSE_TIME="dotnet.gc.pause.time";B.METRIC_DOTNET_JIT_COMPILATION_TIME="dotnet.jit.compilation.time";B.METRIC_DOTNET_JIT_COMPILED_IL_SIZE="dotnet.jit.compiled_il.size";B.METRIC_DOTNET_JIT_COMPILED_METHODS="dotnet.jit.compiled_methods";B.METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS="dotnet.monitor.lock_contentions";B.METRIC_DOTNET_PROCESS_CPU_COUNT="dotnet.process.cpu.count";B.METRIC_DOTNET_PROCESS_CPU_TIME="dotnet.process.cpu.time";B.METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET="dotnet.process.memory.working_set";B.METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH="dotnet.thread_pool.queue.length";B.METRIC_DOTNET_THREAD_POOL_THREAD_COUNT="dotnet.thread_pool.thread.count";B.METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT="dotnet.thread_pool.work_item.count";B.METRIC_DOTNET_TIMER_COUNT="dotnet.timer.count";B.METRIC_HTTP_CLIENT_REQUEST_DURATION="http.client.request.duration";B.METRIC_HTTP_SERVER_REQUEST_DURATION="http.server.request.duration";B.METRIC_JVM_CLASS_COUNT="jvm.class.count";B.METRIC_JVM_CLASS_LOADED="jvm.class.loaded";B.METRIC_JVM_CLASS_UNLOADED="jvm.class.unloaded";B.METRIC_JVM_CPU_COUNT="jvm.cpu.count";B.METRIC_JVM_CPU_RECENT_UTILIZATION="jvm.cpu.recent_utilization";B.METRIC_JVM_CPU_TIME="jvm.cpu.time";B.METRIC_JVM_GC_DURATION="jvm.gc.duration";B.METRIC_JVM_MEMORY_COMMITTED="jvm.memory.committed";B.METRIC_JVM_MEMORY_LIMIT="jvm.memory.limit";B.METRIC_JVM_MEMORY_USED="jvm.memory.used";B.METRIC_JVM_MEMORY_USED_AFTER_LAST_GC="jvm.memory.used_after_last_gc";B.METRIC_JVM_THREAD_COUNT="jvm.thread.count";B.METRIC_KESTREL_ACTIVE_CONNECTIONS="kestrel.active_connections";B.METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES="kestrel.active_tls_handshakes";B.METRIC_KESTREL_CONNECTION_DURATION="kestrel.connection.duration";B.METRIC_KESTREL_QUEUED_CONNECTIONS="kestrel.queued_connections";B.METRIC_KESTREL_QUEUED_REQUESTS="kestrel.queued_requests";B.METRIC_KESTREL_REJECTED_CONNECTIONS="kestrel.rejected_connections";B.METRIC_KESTREL_TLS_HANDSHAKE_DURATION="kestrel.tls_handshake.duration";B.METRIC_KESTREL_UPGRADED_CONNECTIONS="kestrel.upgraded_connections";B.METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS="signalr.server.active_connections";B.METRIC_SIGNALR_SERVER_CONNECTION_DURATION="signalr.server.connection.duration"});var E5=S($S=>{"use strict";l();Object.defineProperty($S,"__esModule",{value:!0});$S.EVENT_EXCEPTION=void 0;$S.EVENT_EXCEPTION="exception"});var We=S(Vo=>{"use strict";l();var jIe=Vo&&Vo.__createBinding||(Object.create?(function(e,t,n,o){o===void 0&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}):(function(e,t,n,o){o===void 0&&(o=n),e[o]=t[n]})),P_=Vo&&Vo.__exportStar||function(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&jIe(t,e,n)};Object.defineProperty(Vo,"__esModule",{value:!0});P_(F3(),Vo);P_(_5(),Vo);P_(g5(),Vo);P_(h5(),Vo);P_(E5(),Vo)});var T5=S(BS=>{"use strict";l();Object.defineProperty(BS,"__esModule",{value:!0});BS.ATTR_PROCESS_RUNTIME_NAME=void 0;BS.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var S5=S(jS=>{"use strict";l();Object.defineProperty(jS,"__esModule",{value:!0});jS.SDK_INFO=void 0;var VIe=X4(),GS=We(),FIe=T5();jS.SDK_INFO={[GS.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[FIe.ATTR_PROCESS_RUNTIME_NAME]:"node",[GS.ATTR_TELEMETRY_SDK_LANGUAGE]:GS.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[GS.ATTR_TELEMETRY_SDK_VERSION]:VIe.VERSION}});var A5=S(wn=>{"use strict";l();Object.defineProperty(wn,"__esModule",{value:!0});wn.otperformance=wn.SDK_INFO=wn._globalThis=wn.getStringListFromEnv=wn.getNumberFromEnv=wn.getBooleanFromEnv=wn.getStringFromEnv=void 0;var VS=Z4();Object.defineProperty(wn,"getStringFromEnv",{enumerable:!0,get:function(){return VS.getStringFromEnv}});Object.defineProperty(wn,"getBooleanFromEnv",{enumerable:!0,get:function(){return VS.getBooleanFromEnv}});Object.defineProperty(wn,"getNumberFromEnv",{enumerable:!0,get:function(){return VS.getNumberFromEnv}});Object.defineProperty(wn,"getStringListFromEnv",{enumerable:!0,get:function(){return VS.getStringListFromEnv}});var HIe=J4();Object.defineProperty(wn,"_globalThis",{enumerable:!0,get:function(){return HIe._globalThis}});var zIe=S5();Object.defineProperty(wn,"SDK_INFO",{enumerable:!0,get:function(){return zIe.SDK_INFO}});wn.otperformance=performance});var nM=S(Dn=>{"use strict";l();Object.defineProperty(Dn,"__esModule",{value:!0});Dn.getStringListFromEnv=Dn.getNumberFromEnv=Dn.getStringFromEnv=Dn.getBooleanFromEnv=Dn.otperformance=Dn._globalThis=Dn.SDK_INFO=void 0;var hu=A5();Object.defineProperty(Dn,"SDK_INFO",{enumerable:!0,get:function(){return hu.SDK_INFO}});Object.defineProperty(Dn,"_globalThis",{enumerable:!0,get:function(){return hu._globalThis}});Object.defineProperty(Dn,"otperformance",{enumerable:!0,get:function(){return hu.otperformance}});Object.defineProperty(Dn,"getBooleanFromEnv",{enumerable:!0,get:function(){return hu.getBooleanFromEnv}});Object.defineProperty(Dn,"getStringFromEnv",{enumerable:!0,get:function(){return hu.getStringFromEnv}});Object.defineProperty(Dn,"getNumberFromEnv",{enumerable:!0,get:function(){return hu.getNumberFromEnv}});Object.defineProperty(Dn,"getStringListFromEnv",{enumerable:!0,get:function(){return hu.getStringListFromEnv}})});var b5=S(ct=>{"use strict";l();Object.defineProperty(ct,"__esModule",{value:!0});ct.addHrTimes=ct.isTimeInput=ct.isTimeInputHrTime=ct.hrTimeToMicroseconds=ct.hrTimeToMilliseconds=ct.hrTimeToNanoseconds=ct.hrTimeToTimeStamp=ct.hrTimeDuration=ct.timeInputToHrTime=ct.hrTime=ct.getTimeOrigin=ct.millisToHrTime=void 0;var FS=nM(),y5=9,qIe=6,YIe=Math.pow(10,qIe),HS=Math.pow(10,y5);function x_(e){let t=e/1e3,n=Math.trunc(t),o=Math.round(e%1e3*YIe);return[n,o]}ct.millisToHrTime=x_;function WIe(){return FS.otperformance.timeOrigin}ct.getTimeOrigin=WIe;function R5(e){let t=x_(FS.otperformance.timeOrigin),n=x_(typeof e=="number"?e:FS.otperformance.now());return I5(t,n)}ct.hrTime=R5;function KIe(e){if(rM(e))return e;if(typeof e=="number")return e<FS.otperformance.timeOrigin?R5(e):x_(e);if(e instanceof Date)return x_(e.getTime());throw TypeError("Invalid input type")}ct.timeInputToHrTime=KIe;function ZIe(e,t){let n=t[0]-e[0],o=t[1]-e[1];return o<0&&(n-=1,o+=HS),[n,o]}ct.hrTimeDuration=ZIe;function JIe(e){let t=y5,n=`${"0".repeat(t)}${e[1]}Z`,o=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",o)}ct.hrTimeToTimeStamp=JIe;function XIe(e){return e[0]*HS+e[1]}ct.hrTimeToNanoseconds=XIe;function QIe(e){return e[0]*1e3+e[1]/1e6}ct.hrTimeToMilliseconds=QIe;function ebe(e){return e[0]*1e6+e[1]/1e3}ct.hrTimeToMicroseconds=ebe;function rM(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}ct.isTimeInputHrTime=rM;function tbe(e){return rM(e)||typeof e=="number"||e instanceof Date}ct.isTimeInput=tbe;function I5(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=HS&&(n[1]-=HS,n[0]+=1),n}ct.addHrTimes=I5});var N5=S(zS=>{"use strict";l();Object.defineProperty(zS,"__esModule",{value:!0});zS.unrefTimer=void 0;function nbe(e){typeof e!="number"&&e.unref()}zS.unrefTimer=nbe});var O5=S(M_=>{"use strict";l();Object.defineProperty(M_,"__esModule",{value:!0});M_.ExportResultCode=void 0;var rbe;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(rbe=M_.ExportResultCode||(M_.ExportResultCode={}))});var v5=S(qS=>{"use strict";l();Object.defineProperty(qS,"__esModule",{value:!0});qS.CompositePropagator=void 0;var C5=K(),oM=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[];let n=new Set;for(let o of this._propagators){let r=typeof o.fields=="function"?o.fields():[];for(let i of r)n.add(i)}this._fields=Array.from(n)}inject(t,n,o){for(let r of this._propagators)try{r.inject(t,n,o)}catch(i){C5.diag.warn(`Failed to inject with ${r.constructor.name}. Err: ${i.message}`)}}extract(t,n,o){return this._propagators.reduce((r,i)=>{try{return i.extract(r,n,o)}catch(s){C5.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${s.message}`)}return r},t)}fields(){return this._fields.slice()}};qS.CompositePropagator=oM});var P5=S($d=>{"use strict";l();Object.defineProperty($d,"__esModule",{value:!0});$d.validateValue=$d.validateKey=void 0;var iM="[_0-9a-z-*/]",obe=`[a-z]${iM}{0,255}`,ibe=`[a-z0-9]${iM}{0,240}@[a-z]${iM}{0,13}`,sbe=new RegExp(`^(?:${obe}|${ibe})$`),abe=/^[ -~]{0,255}[!-~]$/,cbe=/,|=/;function ube(e){return sbe.test(e)}$d.validateKey=ube;function lbe(e){return abe.test(e)&&!cbe.test(e)}$d.validateValue=lbe});var aM=S(WS=>{"use strict";l();Object.defineProperty(WS,"__esModule",{value:!0});WS.TraceState=void 0;var YS=P5(),dbe=32,x5=512,M5=",",L5="=",sM=class e{_length;_rawTraceState;_internalState;constructor(t){this._rawTraceState=typeof t=="string"?t:"",this._length=this._rawTraceState.length}set(t,n){if(!(0,YS.validateKey)(t)||!(0,YS.validateValue)(n))return this;let o=this._getState(),r=o.get(t),i=this._length;if(typeof r=="string"?i+=n.length-r.length:i+=t.length+n.length+(o.size>0?2:1),i>x5)return this;let s=new Map(o);return s.delete(t),s.set(t,n),this._fromState(s,i)}unset(t){let n=this._getState(),o=n.get(t);if(typeof o!="string")return this;let r=this._length-(t.length+o.length+1);n.size>1&&(r=r-1);let i=new Map(n);return i.delete(t),this._fromState(i,r)}get(t){return this._getState().get(t)}serialize(){let t="",n=0;for(let o of this._getState())n>0&&(t=M5+t),t=`${o[0]}${L5}${o[1]}`+t,n++;return t}_getState(){if(this._internalState)return this._internalState;let t=this._rawTraceState.split(M5),n=new Map,o=0;for(let r of t){let i=r.trim(),s=i.indexOf(L5);if(s===-1)continue;let a=i.slice(0,s),c=i.slice(s+1);if(!(0,YS.validateKey)(a)||!(0,YS.validateValue)(c))continue;let u=o+i.length+(n.size>0?1:0);if(!(u>x5)&&(n.set(a,c),o=u,n.size>=dbe))break}return this._length=o,this._internalState=new Map(Array.from(n.entries()).reverse()),this._internalState}_fromState(t,n){let o=Object.create(e.prototype);return o._internalState=t,o._length=n,o}};WS.TraceState=sM});var D5=S(kn=>{"use strict";l();Object.defineProperty(kn,"__esModule",{value:!0});kn.W3CTraceContextPropagator=kn.parseTraceParent=kn.TRACE_STATE_HEADER=kn.TRACE_PARENT_HEADER=void 0;var KS=K(),pbe=v_(),fbe=aM();kn.TRACE_PARENT_HEADER="traceparent";kn.TRACE_STATE_HEADER="tracestate";var mbe="00",_be="(?!ff)[\\da-f]{2}",gbe="(?![0]{32})[\\da-f]{32}",hbe="(?![0]{16})[\\da-f]{16}",Ebe="[\\da-f]{2}",Tbe=new RegExp(`^\\s?(${_be})-(${gbe})-(${hbe})-(${Ebe})(-.*)?\\s?$`);function w5(e){let t=Tbe.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}kn.parseTraceParent=w5;var cM=class{inject(t,n,o){let r=KS.trace.getSpanContext(t);if(!r||(0,pbe.isTracingSuppressed)(t)||!(0,KS.isSpanContextValid)(r))return;let i=`${mbe}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags||KS.TraceFlags.NONE).toString(16)}`;o.set(n,kn.TRACE_PARENT_HEADER,i),r.traceState&&o.set(n,kn.TRACE_STATE_HEADER,r.traceState.serialize())}extract(t,n,o){let r=o.get(n,kn.TRACE_PARENT_HEADER);if(!r)return t;let i=Array.isArray(r)?r[0]:r;if(typeof i!="string")return t;let s=w5(i);if(!s)return t;s.isRemote=!0;let a=o.get(n,kn.TRACE_STATE_HEADER);if(a){let c=Array.isArray(a)?a.join(","):a;s.traceState=new fbe.TraceState(typeof c=="string"?c:void 0)}return KS.trace.setSpanContext(t,s)}fields(){return[kn.TRACE_PARENT_HEADER,kn.TRACE_STATE_HEADER]}};kn.W3CTraceContextPropagator=cM});var k5=S(Fo=>{"use strict";l();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.getRPCMetadata=Fo.deleteRPCMetadata=Fo.setRPCMetadata=Fo.RPCType=void 0;var Sbe=K(),uM=(0,Sbe.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Abe;(function(e){e.HTTP="http"})(Abe=Fo.RPCType||(Fo.RPCType={}));function ybe(e,t){return e.setValue(uM,t)}Fo.setRPCMetadata=ybe;function Rbe(e){return e.deleteValue(uM)}Fo.deleteRPCMetadata=Rbe;function Ibe(e){return e.getValue(uM)}Fo.getRPCMetadata=Ibe});var j5=S(ZS=>{"use strict";l();Object.defineProperty(ZS,"__esModule",{value:!0});ZS.isPlainObject=void 0;var bbe="[object Object]",Nbe="[object Null]",Obe="[object Undefined]",Cbe=Function.prototype,U5=Cbe.toString,vbe=U5.call(Object),Pbe=Object.getPrototypeOf,$5=Object.prototype,B5=$5.hasOwnProperty,Eu=Symbol?Symbol.toStringTag:void 0,G5=$5.toString;function xbe(e){if(!Mbe(e)||Lbe(e)!==bbe)return!1;let t=Pbe(e);if(t===null)return!0;let n=B5.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&U5.call(n)===vbe}ZS.isPlainObject=xbe;function Mbe(e){return e!=null&&typeof e=="object"}function Lbe(e){return e==null?e===void 0?Obe:Nbe:Eu&&Eu in Object(e)?wbe(e):Dbe(e)}function wbe(e){let t=B5.call(e,Eu),n=e[Eu],o=!1;try{e[Eu]=void 0,o=!0}catch{}let r=G5.call(e);return o&&(t?e[Eu]=n:delete e[Eu]),r}function Dbe(e){return G5.call(e)}});var q5=S(QS=>{"use strict";l();Object.defineProperty(QS,"__esModule",{value:!0});QS.merge=void 0;var V5=j5(),kbe=20;function Ube(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=H5(t,e.shift(),0,n);return t}QS.merge=Ube;function lM(e){return XS(e)?e.slice():e}function H5(e,t,n=0,o){let r;if(!(n>kbe)){if(n++,JS(e)||JS(t)||z5(t))r=lM(t);else if(XS(e)){if(r=e.slice(),XS(t))for(let i=0,s=t.length;i<s;i++)r.push(lM(t[i]));else if(L_(t)){let i=Object.keys(t);for(let s=0,a=i.length;s<a;s++){let c=i[s];c==="__proto__"||c==="constructor"||c==="prototype"||(r[c]=lM(t[c]))}}}else if(L_(e))if(L_(t)){if(!$be(e,t))return t;r=Object.assign({},e);let i=Object.keys(t);for(let s=0,a=i.length;s<a;s++){let c=i[s];if(c==="__proto__"||c==="constructor"||c==="prototype")continue;let u=t[c];if(JS(u))typeof u>"u"?delete r[c]:r[c]=u;else{let d=r[c],p=u;if(F5(e,c,o)||F5(t,c,o))delete r[c];else{if(L_(d)&&L_(p)){let f=o.get(d)||[],m=o.get(p)||[];f.push({obj:e,key:c}),m.push({obj:t,key:c}),o.set(d,f),o.set(p,m)}r[c]=H5(r[c],u,n,o)}}}}else r=t;return r}}function F5(e,t,n){let o=n.get(e[t])||[];for(let r=0,i=o.length;r<i;r++){let s=o[r];if(s.key===t&&s.obj===e)return!0}return!1}function XS(e){return Array.isArray(e)}function z5(e){return typeof e=="function"}function L_(e){return!JS(e)&&!XS(e)&&!z5(e)&&typeof e=="object"}function JS(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function $be(e,t){return!(!(0,V5.isPlainObject)(e)||!(0,V5.isPlainObject)(t))}});var Y5=S(Bd=>{"use strict";l();Object.defineProperty(Bd,"__esModule",{value:!0});Bd.callWithTimeout=Bd.TimeoutError=void 0;var eA=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};Bd.TimeoutError=eA;function Bbe(e,t){let n,o=new Promise(function(i,s){n=setTimeout(function(){s(new eA("Operation timed out."))},t)});return Promise.race([e,o]).then(r=>(clearTimeout(n),r),r=>{throw clearTimeout(n),r})}Bd.callWithTimeout=Bbe});var K5=S(Gd=>{"use strict";l();Object.defineProperty(Gd,"__esModule",{value:!0});Gd.isUrlIgnored=Gd.urlMatches=void 0;function W5(e,t){return typeof t=="string"?e===t:!!e.match(t)}Gd.urlMatches=W5;function Gbe(e,t){if(!t)return!1;for(let n of t)if(W5(e,n))return!0;return!1}Gd.isUrlIgnored=Gbe});var Z5=S(tA=>{"use strict";l();Object.defineProperty(tA,"__esModule",{value:!0});tA.Deferred=void 0;var dM=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};tA.Deferred=dM});var J5=S(nA=>{"use strict";l();Object.defineProperty(nA,"__esModule",{value:!0});nA.BindOnceFuture=void 0;var jbe=Z5(),pM=class{_isCalled=!1;_deferred=new jbe.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};nA.BindOnceFuture=pM});var Q5=S(rA=>{"use strict";l();Object.defineProperty(rA,"__esModule",{value:!0});rA.diagLogLevelFromString=void 0;var ys=K(),X5={ALL:ys.DiagLogLevel.ALL,VERBOSE:ys.DiagLogLevel.VERBOSE,DEBUG:ys.DiagLogLevel.DEBUG,INFO:ys.DiagLogLevel.INFO,WARN:ys.DiagLogLevel.WARN,ERROR:ys.DiagLogLevel.ERROR,NONE:ys.DiagLogLevel.NONE};function Vbe(e){if(e==null)return;let t=X5[e.toUpperCase()];return t??(ys.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(X5)}, using default`),ys.DiagLogLevel.INFO)}rA.diagLogLevelFromString=Vbe});var t9=S(oA=>{"use strict";l();Object.defineProperty(oA,"__esModule",{value:!0});oA._export=void 0;var e9=K(),Fbe=v_();function Hbe(e,t){return new Promise(n=>{e9.context.with((0,Fbe.suppressTracing)(e9.context.active()),()=>{e.export(t,n)})})}oA._export=Hbe});var Xe=S(G=>{"use strict";l();Object.defineProperty(G,"__esModule",{value:!0});G.internal=G.diagLogLevelFromString=G.BindOnceFuture=G.urlMatches=G.isUrlIgnored=G.callWithTimeout=G.TimeoutError=G.merge=G.TraceState=G.unsuppressTracing=G.suppressTracing=G.isTracingSuppressed=G.setRPCMetadata=G.getRPCMetadata=G.deleteRPCMetadata=G.RPCType=G.parseTraceParent=G.W3CTraceContextPropagator=G.TRACE_STATE_HEADER=G.TRACE_PARENT_HEADER=G.CompositePropagator=G.otperformance=G.getStringListFromEnv=G.getNumberFromEnv=G.getBooleanFromEnv=G.getStringFromEnv=G._globalThis=G.SDK_INFO=G.parseKeyPairsIntoRecord=G.ExportResultCode=G.unrefTimer=G.timeInputToHrTime=G.millisToHrTime=G.isTimeInputHrTime=G.isTimeInput=G.hrTimeToTimeStamp=G.hrTimeToNanoseconds=G.hrTimeToMilliseconds=G.hrTimeToMicroseconds=G.hrTimeDuration=G.hrTime=G.getTimeOrigin=G.addHrTimes=G.loggingErrorHandler=G.setGlobalErrorHandler=G.globalErrorHandler=G.sanitizeAttributes=G.isAttributeValue=G.AnchoredClock=G.W3CBaggagePropagator=void 0;var zbe=$4();Object.defineProperty(G,"W3CBaggagePropagator",{enumerable:!0,get:function(){return zbe.W3CBaggagePropagator}});var qbe=B4();Object.defineProperty(G,"AnchoredClock",{enumerable:!0,get:function(){return qbe.AnchoredClock}});var n9=H4();Object.defineProperty(G,"isAttributeValue",{enumerable:!0,get:function(){return n9.isAttributeValue}});Object.defineProperty(G,"sanitizeAttributes",{enumerable:!0,get:function(){return n9.sanitizeAttributes}});var r9=q4();Object.defineProperty(G,"globalErrorHandler",{enumerable:!0,get:function(){return r9.globalErrorHandler}});Object.defineProperty(G,"setGlobalErrorHandler",{enumerable:!0,get:function(){return r9.setGlobalErrorHandler}});var Ybe=eM();Object.defineProperty(G,"loggingErrorHandler",{enumerable:!0,get:function(){return Ybe.loggingErrorHandler}});var ao=b5();Object.defineProperty(G,"addHrTimes",{enumerable:!0,get:function(){return ao.addHrTimes}});Object.defineProperty(G,"getTimeOrigin",{enumerable:!0,get:function(){return ao.getTimeOrigin}});Object.defineProperty(G,"hrTime",{enumerable:!0,get:function(){return ao.hrTime}});Object.defineProperty(G,"hrTimeDuration",{enumerable:!0,get:function(){return ao.hrTimeDuration}});Object.defineProperty(G,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return ao.hrTimeToMicroseconds}});Object.defineProperty(G,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return ao.hrTimeToMilliseconds}});Object.defineProperty(G,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return ao.hrTimeToNanoseconds}});Object.defineProperty(G,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return ao.hrTimeToTimeStamp}});Object.defineProperty(G,"isTimeInput",{enumerable:!0,get:function(){return ao.isTimeInput}});Object.defineProperty(G,"isTimeInputHrTime",{enumerable:!0,get:function(){return ao.isTimeInputHrTime}});Object.defineProperty(G,"millisToHrTime",{enumerable:!0,get:function(){return ao.millisToHrTime}});Object.defineProperty(G,"timeInputToHrTime",{enumerable:!0,get:function(){return ao.timeInputToHrTime}});var Wbe=N5();Object.defineProperty(G,"unrefTimer",{enumerable:!0,get:function(){return Wbe.unrefTimer}});var Kbe=O5();Object.defineProperty(G,"ExportResultCode",{enumerable:!0,get:function(){return Kbe.ExportResultCode}});var Zbe=Kx();Object.defineProperty(G,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return Zbe.parseKeyPairsIntoRecord}});var Tu=nM();Object.defineProperty(G,"SDK_INFO",{enumerable:!0,get:function(){return Tu.SDK_INFO}});Object.defineProperty(G,"_globalThis",{enumerable:!0,get:function(){return Tu._globalThis}});Object.defineProperty(G,"getStringFromEnv",{enumerable:!0,get:function(){return Tu.getStringFromEnv}});Object.defineProperty(G,"getBooleanFromEnv",{enumerable:!0,get:function(){return Tu.getBooleanFromEnv}});Object.defineProperty(G,"getNumberFromEnv",{enumerable:!0,get:function(){return Tu.getNumberFromEnv}});Object.defineProperty(G,"getStringListFromEnv",{enumerable:!0,get:function(){return Tu.getStringListFromEnv}});Object.defineProperty(G,"otperformance",{enumerable:!0,get:function(){return Tu.otperformance}});var Jbe=v5();Object.defineProperty(G,"CompositePropagator",{enumerable:!0,get:function(){return Jbe.CompositePropagator}});var iA=D5();Object.defineProperty(G,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return iA.TRACE_PARENT_HEADER}});Object.defineProperty(G,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return iA.TRACE_STATE_HEADER}});Object.defineProperty(G,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return iA.W3CTraceContextPropagator}});Object.defineProperty(G,"parseTraceParent",{enumerable:!0,get:function(){return iA.parseTraceParent}});var sA=k5();Object.defineProperty(G,"RPCType",{enumerable:!0,get:function(){return sA.RPCType}});Object.defineProperty(G,"deleteRPCMetadata",{enumerable:!0,get:function(){return sA.deleteRPCMetadata}});Object.defineProperty(G,"getRPCMetadata",{enumerable:!0,get:function(){return sA.getRPCMetadata}});Object.defineProperty(G,"setRPCMetadata",{enumerable:!0,get:function(){return sA.setRPCMetadata}});var fM=v_();Object.defineProperty(G,"isTracingSuppressed",{enumerable:!0,get:function(){return fM.isTracingSuppressed}});Object.defineProperty(G,"suppressTracing",{enumerable:!0,get:function(){return fM.suppressTracing}});Object.defineProperty(G,"unsuppressTracing",{enumerable:!0,get:function(){return fM.unsuppressTracing}});var Xbe=aM();Object.defineProperty(G,"TraceState",{enumerable:!0,get:function(){return Xbe.TraceState}});var Qbe=q5();Object.defineProperty(G,"merge",{enumerable:!0,get:function(){return Qbe.merge}});var o9=Y5();Object.defineProperty(G,"TimeoutError",{enumerable:!0,get:function(){return o9.TimeoutError}});Object.defineProperty(G,"callWithTimeout",{enumerable:!0,get:function(){return o9.callWithTimeout}});var i9=K5();Object.defineProperty(G,"isUrlIgnored",{enumerable:!0,get:function(){return i9.isUrlIgnored}});Object.defineProperty(G,"urlMatches",{enumerable:!0,get:function(){return i9.urlMatches}});var eNe=J5();Object.defineProperty(G,"BindOnceFuture",{enumerable:!0,get:function(){return eNe.BindOnceFuture}});var tNe=Q5();Object.defineProperty(G,"diagLogLevelFromString",{enumerable:!0,get:function(){return tNe.diagLogLevelFromString}});var nNe=t9();G.internal={_export:nNe._export}});var hM=S(Vd=>{"use strict";l();Object.defineProperty(Vd,"__esModule",{value:!0});Vd._clearDefaultServiceNameCache=Vd.defaultServiceName=void 0;var k_;function INe(){if(k_===void 0)try{let e=globalThis.process.argv0;k_=e?`unknown_service:${e}`:"unknown_service"}catch{k_="unknown_service"}return k_}Vd.defaultServiceName=INe;function bNe(){k_=void 0}Vd._clearDefaultServiceNameCache=bNe});var S9=S(uA=>{"use strict";l();Object.defineProperty(uA,"__esModule",{value:!0});uA.isPromiseLike=void 0;var NNe=e=>e!==null&&typeof e=="object"&&typeof e.then=="function";uA.isPromiseLike=NNe});var SM=S(Oi=>{"use strict";l();Object.defineProperty(Oi,"__esModule",{value:!0});Oi.defaultResource=Oi.emptyResource=Oi.resourceFromDetectedResource=Oi.resourceFromAttributes=void 0;var $_=K(),EM=Xe(),Ru=We(),ONe=hM(),U_=S9(),lA=class e{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(t,n){let o=new e({},n);return o._rawAttributes=A9(t),o._asyncAttributesPending=t.filter(([r,i])=>(0,U_.isPromiseLike)(i)).length>0,o}constructor(t,n){let o=t.attributes??{};this._rawAttributes=Object.entries(o).map(([r,i])=>((0,U_.isPromiseLike)(i)&&(this._asyncAttributesPending=!0),[r,i])),this._rawAttributes=A9(this._rawAttributes),this._schemaUrl=xNe(n?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){let[n,o]=this._rawAttributes[t];this._rawAttributes[t]=[n,(0,U_.isPromiseLike)(o)?await o:o]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&$_.diag.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;let t={};for(let[n,o]of this._rawAttributes){if((0,U_.isPromiseLike)(o)){$_.diag.debug(`Unsettled resource attribute ${n} skipped`);continue}o!=null&&(t[n]??=o)}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;let n=MNe(this,t),o=n?{schemaUrl:n}:void 0;return e.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],o)}};function TM(e,t){return lA.FromAttributeList(Object.entries(e),t)}Oi.resourceFromAttributes=TM;function CNe(e,t){return new lA(e,t)}Oi.resourceFromDetectedResource=CNe;function vNe(){return TM({})}Oi.emptyResource=vNe;function PNe(){return TM({[Ru.ATTR_SERVICE_NAME]:(0,ONe.defaultServiceName)(),[Ru.ATTR_TELEMETRY_SDK_LANGUAGE]:EM.SDK_INFO[Ru.ATTR_TELEMETRY_SDK_LANGUAGE],[Ru.ATTR_TELEMETRY_SDK_NAME]:EM.SDK_INFO[Ru.ATTR_TELEMETRY_SDK_NAME],[Ru.ATTR_TELEMETRY_SDK_VERSION]:EM.SDK_INFO[Ru.ATTR_TELEMETRY_SDK_VERSION]})}Oi.defaultResource=PNe;function A9(e){return e.map(([t,n])=>(0,U_.isPromiseLike)(n)?[t,n.catch(o=>{$_.diag.debug("promise rejection for resource attribute: %s - %s",t,o)})]:[t,n])}function xNe(e){if(typeof e=="string"||e===void 0)return e;$_.diag.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function MNe(e,t){let n=e?.schemaUrl,o=t?.schemaUrl,r=n===void 0||n==="",i=o===void 0||o==="";if(r)return o;if(i||n===o)return n;$_.diag.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',n,o)}});var R9=S(dA=>{"use strict";l();Object.defineProperty(dA,"__esModule",{value:!0});dA.detectResources=void 0;var y9=K(),AM=SM(),LNe=(e={})=>(e.detectors||[]).map(n=>{try{let o=(0,AM.resourceFromDetectedResource)(n.detect(e));return y9.diag.debug(`${n.constructor.name} found resource.`,o),o}catch(o){return y9.diag.debug(`${n.constructor.name} failed: ${o.message}`),(0,AM.emptyResource)()}}).reduce((n,o)=>n.merge(o),(0,AM.emptyResource)());dA.detectResources=LNe});var b9=S(pA=>{"use strict";l();Object.defineProperty(pA,"__esModule",{value:!0});pA.envDetector=void 0;var wNe=K(),DNe=We(),I9=Xe(),yM=class{_MAX_LENGTH=255;_COMMA_SEPARATOR=",";_LABEL_KEY_VALUE_SPLITTER="=";detect(t){let n={},o=(0,I9.getStringFromEnv)("OTEL_RESOURCE_ATTRIBUTES"),r=(0,I9.getStringFromEnv)("OTEL_SERVICE_NAME");if(o)try{let i=this._parseResourceAttributes(o);Object.assign(n,i)}catch(i){wNe.diag.debug(`EnvDetector failed: ${i instanceof Error?i.message:i}`)}return r&&(n[DNe.ATTR_SERVICE_NAME]=r),{attributes:n}}_parseResourceAttributes(t){if(!t)return{};let n={},o=t.split(this._COMMA_SEPARATOR).filter(r=>r.trim()!=="");for(let r of o){let i=r.split(this._LABEL_KEY_VALUE_SPLITTER);if(i.length!==2)throw new Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${r}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[s,a]=i,c=s.trim(),u=a.trim();if(c.length===0)throw new Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${r}".`);let d,p;try{d=decodeURIComponent(c),p=decodeURIComponent(u)}catch(f){throw new Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${r}": ${f instanceof Error?f.message:f}`)}if(d.length>this._MAX_LENGTH)throw new Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${d}".`);if(p.length>this._MAX_LENGTH)throw new Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${d}".`);n[d]=p}return n}};pA.envDetector=new yM});var B_=S(re=>{"use strict";l();Object.defineProperty(re,"__esModule",{value:!0});re.ATTR_WEBENGINE_VERSION=re.ATTR_WEBENGINE_NAME=re.ATTR_WEBENGINE_DESCRIPTION=re.ATTR_SERVICE_NAMESPACE=re.ATTR_SERVICE_INSTANCE_ID=re.ATTR_PROCESS_RUNTIME_VERSION=re.ATTR_PROCESS_RUNTIME_NAME=re.ATTR_PROCESS_RUNTIME_DESCRIPTION=re.ATTR_PROCESS_PID=re.ATTR_PROCESS_OWNER=re.ATTR_PROCESS_EXECUTABLE_PATH=re.ATTR_PROCESS_EXECUTABLE_NAME=re.ATTR_PROCESS_COMMAND_ARGS=re.ATTR_PROCESS_COMMAND=re.ATTR_OS_VERSION=re.ATTR_OS_TYPE=re.ATTR_K8S_POD_NAME=re.ATTR_K8S_NAMESPACE_NAME=re.ATTR_K8S_DEPLOYMENT_NAME=re.ATTR_K8S_CLUSTER_NAME=re.ATTR_HOST_TYPE=re.ATTR_HOST_NAME=re.ATTR_HOST_IMAGE_VERSION=re.ATTR_HOST_IMAGE_NAME=re.ATTR_HOST_IMAGE_ID=re.ATTR_HOST_ID=re.ATTR_HOST_ARCH=re.ATTR_CONTAINER_NAME=re.ATTR_CONTAINER_IMAGE_TAGS=re.ATTR_CONTAINER_IMAGE_NAME=re.ATTR_CONTAINER_ID=re.ATTR_CLOUD_REGION=re.ATTR_CLOUD_PROVIDER=re.ATTR_CLOUD_AVAILABILITY_ZONE=re.ATTR_CLOUD_ACCOUNT_ID=void 0;re.ATTR_CLOUD_ACCOUNT_ID="cloud.account.id";re.ATTR_CLOUD_AVAILABILITY_ZONE="cloud.availability_zone";re.ATTR_CLOUD_PROVIDER="cloud.provider";re.ATTR_CLOUD_REGION="cloud.region";re.ATTR_CONTAINER_ID="container.id";re.ATTR_CONTAINER_IMAGE_NAME="container.image.name";re.ATTR_CONTAINER_IMAGE_TAGS="container.image.tags";re.ATTR_CONTAINER_NAME="container.name";re.ATTR_HOST_ARCH="host.arch";re.ATTR_HOST_ID="host.id";re.ATTR_HOST_IMAGE_ID="host.image.id";re.ATTR_HOST_IMAGE_NAME="host.image.name";re.ATTR_HOST_IMAGE_VERSION="host.image.version";re.ATTR_HOST_NAME="host.name";re.ATTR_HOST_TYPE="host.type";re.ATTR_K8S_CLUSTER_NAME="k8s.cluster.name";re.ATTR_K8S_DEPLOYMENT_NAME="k8s.deployment.name";re.ATTR_K8S_NAMESPACE_NAME="k8s.namespace.name";re.ATTR_K8S_POD_NAME="k8s.pod.name";re.ATTR_OS_TYPE="os.type";re.ATTR_OS_VERSION="os.version";re.ATTR_PROCESS_COMMAND="process.command";re.ATTR_PROCESS_COMMAND_ARGS="process.command_args";re.ATTR_PROCESS_EXECUTABLE_NAME="process.executable.name";re.ATTR_PROCESS_EXECUTABLE_PATH="process.executable.path";re.ATTR_PROCESS_OWNER="process.owner";re.ATTR_PROCESS_PID="process.pid";re.ATTR_PROCESS_RUNTIME_DESCRIPTION="process.runtime.description";re.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name";re.ATTR_PROCESS_RUNTIME_VERSION="process.runtime.version";re.ATTR_SERVICE_INSTANCE_ID="service.instance.id";re.ATTR_SERVICE_NAMESPACE="service.namespace";re.ATTR_WEBENGINE_DESCRIPTION="webengine.description";re.ATTR_WEBENGINE_NAME="webengine.name";re.ATTR_WEBENGINE_VERSION="webengine.version"});var mA=S(fA=>{"use strict";l();Object.defineProperty(fA,"__esModule",{value:!0});fA.execAsync=void 0;var kNe=require("child_process"),UNe=require("util");fA.execAsync=UNe.promisify(kNe.exec)});var N9=S(_A=>{"use strict";l();Object.defineProperty(_A,"__esModule",{value:!0});_A.getMachineId=void 0;var $Ne=mA(),BNe=K();async function GNe(){try{let t=(await(0,$Ne.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
7
+ `).find(o=>o.includes("IOPlatformUUID"));if(!t)return;let n=t.split('" = "');if(n.length===2)return n[1].slice(0,-1)}catch(e){BNe.diag.debug(`error reading machine id: ${e}`)}}_A.getMachineId=GNe});var O9=S(gA=>{"use strict";l();Object.defineProperty(gA,"__esModule",{value:!0});gA.getMachineId=void 0;var jNe=require("fs"),VNe=K();async function FNe(){let e=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let t of e)try{return(await jNe.promises.readFile(t,{encoding:"utf8"})).trim()}catch(n){VNe.diag.debug(`error reading machine id: ${n}`)}}gA.getMachineId=FNe});var v9=S(hA=>{"use strict";l();Object.defineProperty(hA,"__esModule",{value:!0});hA.getMachineId=void 0;var HNe=require("fs"),zNe=mA(),C9=K();async function qNe(){try{return(await HNe.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(e){C9.diag.debug(`error reading machine id: ${e}`)}try{return(await(0,zNe.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(e){C9.diag.debug(`error reading machine id: ${e}`)}}hA.getMachineId=qNe});var x9=S(EA=>{"use strict";l();Object.defineProperty(EA,"__esModule",{value:!0});EA.getMachineId=void 0;var P9=require("process"),YNe=mA(),WNe=K();async function KNe(){let e="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",t="%windir%\\System32\\REG.exe";P9.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in P9.env&&(t="%windir%\\sysnative\\cmd.exe /c "+t);try{let o=(await(0,YNe.execAsync)(`${t} ${e}`)).stdout.split("REG_SZ");if(o.length===2)return o[1].trim()}catch(n){WNe.diag.debug(`error reading machine id: ${n}`)}}EA.getMachineId=KNe});var M9=S(TA=>{"use strict";l();Object.defineProperty(TA,"__esModule",{value:!0});TA.getMachineId=void 0;var ZNe=K();async function JNe(){ZNe.diag.debug("could not read machine-id: unsupported platform")}TA.getMachineId=JNe});var L9=S(SA=>{"use strict";l();Object.defineProperty(SA,"__esModule",{value:!0});SA.getMachineId=void 0;var XNe=require("process"),Iu;async function QNe(){if(!Iu)switch(XNe.platform){case"darwin":Iu=(await Promise.resolve().then(()=>U(N9()))).getMachineId;break;case"linux":Iu=(await Promise.resolve().then(()=>U(O9()))).getMachineId;break;case"freebsd":Iu=(await Promise.resolve().then(()=>U(v9()))).getMachineId;break;case"win32":Iu=(await Promise.resolve().then(()=>U(x9()))).getMachineId;break;default:Iu=(await Promise.resolve().then(()=>U(M9()))).getMachineId;break}return Iu()}SA.getMachineId=QNe});var RM=S(Fd=>{"use strict";l();Object.defineProperty(Fd,"__esModule",{value:!0});Fd.normalizeType=Fd.normalizeArch=void 0;var eOe=e=>{switch(e){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return e}};Fd.normalizeArch=eOe;var tOe=e=>{switch(e){case"sunos":return"solaris";case"win32":return"windows";default:return e}};Fd.normalizeType=tOe});var D9=S(AA=>{"use strict";l();Object.defineProperty(AA,"__esModule",{value:!0});AA.hostDetector=void 0;var IM=B_(),w9=require("os"),nOe=L9(),rOe=RM(),bM=class{detect(t){return{attributes:{[IM.ATTR_HOST_NAME]:(0,w9.hostname)(),[IM.ATTR_HOST_ARCH]:(0,rOe.normalizeArch)((0,w9.arch)()),[IM.ATTR_HOST_ID]:(0,nOe.getMachineId)()}}}};AA.hostDetector=new bM});var $9=S(yA=>{"use strict";l();Object.defineProperty(yA,"__esModule",{value:!0});yA.osDetector=void 0;var k9=B_(),U9=require("os"),oOe=RM(),NM=class{detect(t){return{attributes:{[k9.ATTR_OS_TYPE]:(0,oOe.normalizeType)((0,U9.platform)()),[k9.ATTR_OS_VERSION]:(0,U9.release)()}}}};yA.osDetector=new NM});var B9=S(RA=>{"use strict";l();Object.defineProperty(RA,"__esModule",{value:!0});RA.processDetector=void 0;var iOe=K(),bs=B_(),sOe=require("os"),OM=class{detect(t){let n={[bs.ATTR_PROCESS_PID]:process.pid,[bs.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[bs.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[bs.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[bs.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[bs.ATTR_PROCESS_RUNTIME_NAME]:"nodejs",[bs.ATTR_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(n[bs.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let o=sOe.userInfo();n[bs.ATTR_PROCESS_OWNER]=o.username}catch(o){iOe.diag.debug(`error obtaining process owner: ${o}`)}return{attributes:n}}};RA.processDetector=new OM});var G9=S(IA=>{"use strict";l();Object.defineProperty(IA,"__esModule",{value:!0});IA.serviceInstanceIdDetector=void 0;var aOe=B_(),cOe=require("crypto"),CM=class{detect(t){return{attributes:{[aOe.ATTR_SERVICE_INSTANCE_ID]:(0,cOe.randomUUID)()}}}};IA.serviceInstanceIdDetector=new CM});var j9=S(Ci=>{"use strict";l();Object.defineProperty(Ci,"__esModule",{value:!0});Ci.serviceInstanceIdDetector=Ci.processDetector=Ci.osDetector=Ci.hostDetector=void 0;var uOe=D9();Object.defineProperty(Ci,"hostDetector",{enumerable:!0,get:function(){return uOe.hostDetector}});var lOe=$9();Object.defineProperty(Ci,"osDetector",{enumerable:!0,get:function(){return lOe.osDetector}});var dOe=B9();Object.defineProperty(Ci,"processDetector",{enumerable:!0,get:function(){return dOe.processDetector}});var pOe=G9();Object.defineProperty(Ci,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return pOe.serviceInstanceIdDetector}})});var V9=S(vi=>{"use strict";l();Object.defineProperty(vi,"__esModule",{value:!0});vi.serviceInstanceIdDetector=vi.processDetector=vi.osDetector=vi.hostDetector=void 0;var bA=j9();Object.defineProperty(vi,"hostDetector",{enumerable:!0,get:function(){return bA.hostDetector}});Object.defineProperty(vi,"osDetector",{enumerable:!0,get:function(){return bA.osDetector}});Object.defineProperty(vi,"processDetector",{enumerable:!0,get:function(){return bA.processDetector}});Object.defineProperty(vi,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return bA.serviceInstanceIdDetector}})});var F9=S(Hd=>{"use strict";l();Object.defineProperty(Hd,"__esModule",{value:!0});Hd.noopDetector=Hd.NoopDetector=void 0;var NA=class{detect(){return{attributes:{}}}};Hd.NoopDetector=NA;Hd.noopDetector=new NA});var H9=S(Er=>{"use strict";l();Object.defineProperty(Er,"__esModule",{value:!0});Er.noopDetector=Er.serviceInstanceIdDetector=Er.processDetector=Er.osDetector=Er.hostDetector=Er.envDetector=void 0;var fOe=b9();Object.defineProperty(Er,"envDetector",{enumerable:!0,get:function(){return fOe.envDetector}});var OA=V9();Object.defineProperty(Er,"hostDetector",{enumerable:!0,get:function(){return OA.hostDetector}});Object.defineProperty(Er,"osDetector",{enumerable:!0,get:function(){return OA.osDetector}});Object.defineProperty(Er,"processDetector",{enumerable:!0,get:function(){return OA.processDetector}});Object.defineProperty(Er,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return OA.serviceInstanceIdDetector}});var mOe=F9();Object.defineProperty(Er,"noopDetector",{enumerable:!0,get:function(){return mOe.noopDetector}})});var z9=S(Ot=>{"use strict";l();Object.defineProperty(Ot,"__esModule",{value:!0});Ot.defaultServiceName=Ot.emptyResource=Ot.defaultResource=Ot.resourceFromAttributes=Ot.serviceInstanceIdDetector=Ot.processDetector=Ot.osDetector=Ot.hostDetector=Ot.envDetector=Ot.detectResources=void 0;var _Oe=R9();Object.defineProperty(Ot,"detectResources",{enumerable:!0,get:function(){return _Oe.detectResources}});var G_=H9();Object.defineProperty(Ot,"envDetector",{enumerable:!0,get:function(){return G_.envDetector}});Object.defineProperty(Ot,"hostDetector",{enumerable:!0,get:function(){return G_.hostDetector}});Object.defineProperty(Ot,"osDetector",{enumerable:!0,get:function(){return G_.osDetector}});Object.defineProperty(Ot,"processDetector",{enumerable:!0,get:function(){return G_.processDetector}});Object.defineProperty(Ot,"serviceInstanceIdDetector",{enumerable:!0,get:function(){return G_.serviceInstanceIdDetector}});var vM=SM();Object.defineProperty(Ot,"resourceFromAttributes",{enumerable:!0,get:function(){return vM.resourceFromAttributes}});Object.defineProperty(Ot,"defaultResource",{enumerable:!0,get:function(){return vM.defaultResource}});Object.defineProperty(Ot,"emptyResource",{enumerable:!0,get:function(){return vM.emptyResource}});var gOe=hM();Object.defineProperty(Ot,"defaultServiceName",{enumerable:!0,get:function(){return gOe.defaultServiceName}})});var q9=S(CA=>{"use strict";l();Object.defineProperty(CA,"__esModule",{value:!0});CA.ExceptionEventName=void 0;CA.ExceptionEventName="exception"});var Y9=S(vA=>{"use strict";l();Object.defineProperty(vA,"__esModule",{value:!0});vA.SpanImpl=void 0;var En=K(),Tn=Xe(),bu=We(),hOe=q9(),PM=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:En.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(t){let n=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=Tn.otperformance.now(),this._performanceOffset=n-(this._performanceStartTime+Tn.otperformance.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(let o of t.links)this.addLink(o);this.startTime=this._getTime(t.startTime??n),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,n){if(n==null||this._isSpanEnded())return this;if(t.length===0)return En.diag.warn(`Invalid attribute key: ${t}`),this;if(!(0,Tn.isAttributeValue)(n))return En.diag.warn(`Invalid attribute value set for key: ${t}`),this;let{attributeCountLimit:o}=this._spanLimits,r=!Object.prototype.hasOwnProperty.call(this.attributes,t);return o!==void 0&&this._attributesCount>=o&&r?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(n),r&&this._attributesCount++,this)}setAttributes(t){for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.setAttribute(n,t[n]);return this}addEvent(t,n,o){if(this._isSpanEnded())return this;let{eventCountLimit:r}=this._spanLimits;if(r===0)return En.diag.warn("No events allowed."),this._droppedEventsCount++,this;r!==void 0&&this.events.length>=r&&(this._droppedEventsCount===0&&En.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,Tn.isTimeInput)(n)&&((0,Tn.isTimeInput)(o)||(o=n),n=void 0);let i=(0,Tn.sanitizeAttributes)(n),{attributePerEventCountLimit:s}=this._spanLimits,a={},c=0,u=0;for(let d in i){if(!Object.prototype.hasOwnProperty.call(i,d))continue;let p=i[d];if(s!==void 0&&u>=s){c++;continue}a[d]=this._truncateToSize(p),u++}return this.events.push({name:t,attributes:a,time:this._getTime(o),droppedAttributesCount:c}),this}addLink(t){if(this._isSpanEnded())return this;let{linkCountLimit:n}=this._spanLimits;if(n===0)return this._droppedLinksCount++,this;n!==void 0&&this.links.length>=n&&(this._droppedLinksCount===0&&En.diag.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:o}=this._spanLimits,r=(0,Tn.sanitizeAttributes)(t.attributes),i={},s=0,a=0;for(let u in r){if(!Object.prototype.hasOwnProperty.call(r,u))continue;let d=r[u];if(o!==void 0&&a>=o){s++;continue}i[u]=this._truncateToSize(d),a++}let c={context:t.context};return a>0&&(c.attributes=i),s>0&&(c.droppedAttributesCount=s),this.links.push(c),this}addLinks(t){for(let n of t)this.addLink(n);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===En.SpanStatusCode.UNSET)return this;if(this.status.code===En.SpanStatusCode.OK)return this;let n={code:t.code};return t.code===En.SpanStatusCode.ERROR&&(typeof t.message=="string"?n.message=t.message:t.message!=null&&En.diag.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=n,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){if(this._isSpanEnded()){En.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=(0,Tn.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(En.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&En.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&En.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=Tn.otperformance.now())return(0,Tn.hrTime)(t+this._performanceOffset);if(typeof t=="number")return(0,Tn.millisToHrTime)(t);if(t instanceof Date)return(0,Tn.millisToHrTime)(t.getTime());if((0,Tn.isTimeInputHrTime)(t))return t;if(this._startTimeProvided)return(0,Tn.millisToHrTime)(Date.now());let n=Tn.otperformance.now()-this._performanceStartTime;return(0,Tn.addHrTimes)(this.startTime,(0,Tn.millisToHrTime)(n))}isRecording(){return this._ended===!1}recordException(t,n){let o={};typeof t=="string"?o[bu.ATTR_EXCEPTION_MESSAGE]=t:t&&(t.code?o[bu.ATTR_EXCEPTION_TYPE]=t.code.toString():t.name&&(o[bu.ATTR_EXCEPTION_TYPE]=t.name),t.message&&(o[bu.ATTR_EXCEPTION_MESSAGE]=t.message),t.stack&&(o[bu.ATTR_EXCEPTION_STACKTRACE]=t.stack)),o[bu.ATTR_EXCEPTION_TYPE]||o[bu.ATTR_EXCEPTION_MESSAGE]?this.addEvent(hOe.ExceptionEventName,o,n):En.diag.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){let t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);En.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,n){return t.length<=n?t:t.substring(0,n)}_truncateToSize(t){let n=this._attributeValueLengthLimit;return n<=0?(En.diag.warn(`Attribute value limit must be positive, got ${n}`),t):typeof t=="string"?this._truncateToLimitUtil(t,n):Array.isArray(t)?t.map(o=>typeof o=="string"?this._truncateToLimitUtil(o,n):o):t}};vA.SpanImpl=PM});var zd=S(j_=>{"use strict";l();Object.defineProperty(j_,"__esModule",{value:!0});j_.SamplingDecision=void 0;var EOe;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(EOe=j_.SamplingDecision||(j_.SamplingDecision={}))});var xA=S(PA=>{"use strict";l();Object.defineProperty(PA,"__esModule",{value:!0});PA.AlwaysOffSampler=void 0;var TOe=zd(),xM=class{shouldSample(){return{decision:TOe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};PA.AlwaysOffSampler=xM});var LA=S(MA=>{"use strict";l();Object.defineProperty(MA,"__esModule",{value:!0});MA.AlwaysOnSampler=void 0;var SOe=zd(),MM=class{shouldSample(){return{decision:SOe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};MA.AlwaysOnSampler=MM});var DM=S(DA=>{"use strict";l();Object.defineProperty(DA,"__esModule",{value:!0});DA.ParentBasedSampler=void 0;var wA=K(),AOe=Xe(),W9=xA(),LM=LA(),wM=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(t){this._root=t.root,this._root||((0,AOe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new LM.AlwaysOnSampler),this._remoteParentSampled=t.remoteParentSampled??new LM.AlwaysOnSampler,this._remoteParentNotSampled=t.remoteParentNotSampled??new W9.AlwaysOffSampler,this._localParentSampled=t.localParentSampled??new LM.AlwaysOnSampler,this._localParentNotSampled=t.localParentNotSampled??new W9.AlwaysOffSampler}shouldSample(t,n,o,r,i,s){let a=wA.trace.getSpanContext(t);return!a||!(0,wA.isSpanContextValid)(a)?this._root.shouldSample(t,n,o,r,i,s):a.isRemote?a.traceFlags&wA.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(t,n,o,r,i,s):this._remoteParentNotSampled.shouldSample(t,n,o,r,i,s):a.traceFlags&wA.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(t,n,o,r,i,s):this._localParentNotSampled.shouldSample(t,n,o,r,i,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};DA.ParentBasedSampler=wM});var UM=S(kA=>{"use strict";l();Object.defineProperty(kA,"__esModule",{value:!0});kA.TraceIdRatioBasedSampler=void 0;var yOe=K(),K9=zd(),kM=class{_ratio;_upperBound;constructor(t=0){this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,n){return{decision:(0,yOe.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?K9.SamplingDecision.RECORD_AND_SAMPLED:K9.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let n=0;for(let o=0;o<32;o+=8){let r=0;for(let i=0;i<8;i++){let s=t.charCodeAt(o+i),a=s<58?s-48:s<71?s-55:s-87;r=r<<4|a}n=(n^r)>>>0}return n}};kA.TraceIdRatioBasedSampler=kM});var GM=S(qd=>{"use strict";l();Object.defineProperty(qd,"__esModule",{value:!0});qd.buildSamplerFromEnv=qd.loadDefaultConfig=void 0;var BM=K(),Pi=Xe(),Z9=xA(),$M=LA(),UA=DM(),J9=UM(),xi;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(xi||(xi={}));var $A=1;function ROe(){return{sampler:Q9(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,Pi.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,Pi.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??128},spanLimits:{attributeValueLengthLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??1/0,attributeCountLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??128,linkCountLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_LINK_COUNT_LIMIT")??128,eventCountLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_EVENT_COUNT_LIMIT")??128,attributePerEventCountLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT")??128,attributePerLinkCountLimit:(0,Pi.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT")??128}}}qd.loadDefaultConfig=ROe;function Q9(){let e=(0,Pi.getStringFromEnv)("OTEL_TRACES_SAMPLER")??xi.ParentBasedAlwaysOn;switch(e){case xi.AlwaysOn:return new $M.AlwaysOnSampler;case xi.AlwaysOff:return new Z9.AlwaysOffSampler;case xi.ParentBasedAlwaysOn:return new UA.ParentBasedSampler({root:new $M.AlwaysOnSampler});case xi.ParentBasedAlwaysOff:return new UA.ParentBasedSampler({root:new Z9.AlwaysOffSampler});case xi.TraceIdRatio:return new J9.TraceIdRatioBasedSampler(X9());case xi.ParentBasedTraceIdRatio:return new UA.ParentBasedSampler({root:new J9.TraceIdRatioBasedSampler(X9())});default:return BM.diag.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${xi.ParentBasedAlwaysOn}".`),new UA.ParentBasedSampler({root:new $M.AlwaysOnSampler})}}qd.buildSamplerFromEnv=Q9;function X9(){let e=(0,Pi.getNumberFromEnv)("OTEL_TRACES_SAMPLER_ARG");return e==null?(BM.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${$A}.`),$A):e<0||e>1?(BM.diag.error(`OTEL_TRACES_SAMPLER_ARG=${e} was given, but it is out of range ([0..1]), defaulting to ${$A}.`),$A):e}});var jM=S(co=>{"use strict";l();Object.defineProperty(co,"__esModule",{value:!0});co.reconfigureLimits=co.mergeConfig=co.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=co.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;var eQ=GM(),BA=Xe();co.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;co.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function IOe(e){let t={sampler:(0,eQ.buildSamplerFromEnv)()},n=(0,eQ.loadDefaultConfig)(),o=Object.assign({},n,t,e);return o.generalLimits=Object.assign({},n.generalLimits,e.generalLimits||{}),o.spanLimits=Object.assign({},n.spanLimits,e.spanLimits||{}),o}co.mergeConfig=IOe;function bOe(e){let t=Object.assign({},e.spanLimits);return t.attributeCountLimit=e.spanLimits?.attributeCountLimit??e.generalLimits?.attributeCountLimit??(0,BA.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT")??(0,BA.getNumberFromEnv)("OTEL_ATTRIBUTE_COUNT_LIMIT")??co.DEFAULT_ATTRIBUTE_COUNT_LIMIT,t.attributeValueLengthLimit=e.spanLimits?.attributeValueLengthLimit??e.generalLimits?.attributeValueLengthLimit??(0,BA.getNumberFromEnv)("OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT")??(0,BA.getNumberFromEnv)("OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT")??co.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},e,{spanLimits:t})}co.reconfigureLimits=bOe});var tQ=S(GA=>{"use strict";l();Object.defineProperty(GA,"__esModule",{value:!0});GA.BatchSpanProcessorBase=void 0;var Yd=K(),Ns=Xe(),VM=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(t,n){this._exporter=t,this._maxExportBatchSize=typeof n?.maxExportBatchSize=="number"?n.maxExportBatchSize:(0,Ns.getNumberFromEnv)("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")??512,this._maxQueueSize=typeof n?.maxQueueSize=="number"?n.maxQueueSize:(0,Ns.getNumberFromEnv)("OTEL_BSP_MAX_QUEUE_SIZE")??2048,this._scheduledDelayMillis=typeof n?.scheduledDelayMillis=="number"?n.scheduledDelayMillis:(0,Ns.getNumberFromEnv)("OTEL_BSP_SCHEDULE_DELAY")??5e3,this._exportTimeoutMillis=typeof n?.exportTimeoutMillis=="number"?n.exportTimeoutMillis:(0,Ns.getNumberFromEnv)("OTEL_BSP_EXPORT_TIMEOUT")??3e4,this._shutdownOnce=new Ns.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Yd.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(t,n){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&Yd.TraceFlags.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Yd.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Yd.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,n)=>{let o=[],r=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,s=r;i<s;i++)o.push(this._flushOneBatch());Promise.all(o).then(()=>{t()}).catch(n)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,n)=>{let o=setTimeout(()=>{n(new Error("Timeout"))},this._exportTimeoutMillis);Yd.context.with((0,Ns.suppressTracing)(Yd.context.active()),()=>{let r;this._finishedSpans.length<=this._maxExportBatchSize?(r=this._finishedSpans,this._finishedSpans=[]):r=this._finishedSpans.splice(0,this._maxExportBatchSize);let i=()=>this._exporter.export(r,a=>{clearTimeout(o),a.code===Ns.ExportResultCode.SUCCESS?t():n(a.error??new Error("BatchSpanProcessor: span export failed"))}),s=null;for(let a=0,c=r.length;a<c;a++){let u=r[a];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(s??=[],s.push(u.resource.waitForAsyncAttributes()))}s===null?i():Promise.all(s).then(i,a=>{(0,Ns.globalErrorHandler)(a),n(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,Ns.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};GA.BatchSpanProcessorBase=VM});var nQ=S(jA=>{"use strict";l();Object.defineProperty(jA,"__esModule",{value:!0});jA.BatchSpanProcessor=void 0;var NOe=tQ(),FM=class extends NOe.BatchSpanProcessorBase{onShutdown(){}};jA.BatchSpanProcessor=FM});var iQ=S(FA=>{"use strict";l();Object.defineProperty(FA,"__esModule",{value:!0});FA.RandomIdGenerator=void 0;var OOe=8,oQ=16,HM=class{generateTraceId=rQ(oQ);generateSpanId=rQ(OOe)};FA.RandomIdGenerator=HM;var VA=Buffer.allocUnsafe(oQ);function rQ(e){return function(){for(let n=0;n<e/4;n++)VA.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<e&&!(VA[n]>0);n++)n===e-1&&(VA[e-1]=1);return VA.toString("hex",0,e)}}});var sQ=S(Wd=>{"use strict";l();Object.defineProperty(Wd,"__esModule",{value:!0});Wd.RandomIdGenerator=Wd.BatchSpanProcessor=void 0;var COe=nQ();Object.defineProperty(Wd,"BatchSpanProcessor",{enumerable:!0,get:function(){return COe.BatchSpanProcessor}});var vOe=iQ();Object.defineProperty(Wd,"RandomIdGenerator",{enumerable:!0,get:function(){return vOe.RandomIdGenerator}})});var zM=S(Kd=>{"use strict";l();Object.defineProperty(Kd,"__esModule",{value:!0});Kd.RandomIdGenerator=Kd.BatchSpanProcessor=void 0;var aQ=sQ();Object.defineProperty(Kd,"BatchSpanProcessor",{enumerable:!0,get:function(){return aQ.BatchSpanProcessor}});Object.defineProperty(Kd,"RandomIdGenerator",{enumerable:!0,get:function(){return aQ.RandomIdGenerator}})});var cQ=S(Mi=>{"use strict";l();Object.defineProperty(Mi,"__esModule",{value:!0});Mi.METRIC_OTEL_SDK_SPAN_STARTED=Mi.METRIC_OTEL_SDK_SPAN_LIVE=Mi.ATTR_OTEL_SPAN_SAMPLING_RESULT=Mi.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0;Mi.ATTR_OTEL_SPAN_PARENT_ORIGIN="otel.span.parent.origin";Mi.ATTR_OTEL_SPAN_SAMPLING_RESULT="otel.span.sampling_result";Mi.METRIC_OTEL_SDK_SPAN_LIVE="otel.sdk.span.live";Mi.METRIC_OTEL_SDK_SPAN_STARTED="otel.sdk.span.started"});var uQ=S(zA=>{"use strict";l();Object.defineProperty(zA,"__esModule",{value:!0});zA.TracerMetrics=void 0;var HA=zd(),V_=cQ(),qM=class{startedSpans;liveSpans;constructor(t){this.startedSpans=t.createCounter(V_.METRIC_OTEL_SDK_SPAN_STARTED,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(V_.METRIC_OTEL_SDK_SPAN_LIVE,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,n){let o=xOe(n);if(this.startedSpans.add(1,{[V_.ATTR_OTEL_SPAN_PARENT_ORIGIN]:POe(t),[V_.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o}),n===HA.SamplingDecision.NOT_RECORD)return()=>{};let r={[V_.ATTR_OTEL_SPAN_SAMPLING_RESULT]:o};return this.liveSpans.add(1,r),()=>{this.liveSpans.add(-1,r)}}};zA.TracerMetrics=qM;function POe(e){return e?e.isRemote?"remote":"local":"none"}function xOe(e){switch(e){case HA.SamplingDecision.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case HA.SamplingDecision.RECORD:return"RECORD_ONLY";case HA.SamplingDecision.NOT_RECORD:return"DROP"}}});var lQ=S(qA=>{"use strict";l();Object.defineProperty(qA,"__esModule",{value:!0});qA.VERSION=void 0;qA.VERSION="2.7.1"});var dQ=S(WA=>{"use strict";l();Object.defineProperty(WA,"__esModule",{value:!0});WA.Tracer=void 0;var on=K(),YA=Xe(),MOe=Y9(),LOe=jM(),wOe=zM(),DOe=uQ(),kOe=lQ(),YM=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(t,n,o,r){let i=(0,LOe.mergeConfig)(n);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=n.idGenerator||new wOe.RandomIdGenerator,this._resource=o,this._spanProcessor=r,this.instrumentationScope=t;let s=i.meterProvider?i.meterProvider.getMeter("@opentelemetry/sdk-trace",kOe.VERSION):on.createNoopMeter();this._tracerMetrics=new DOe.TracerMetrics(s)}startSpan(t,n={},o=on.context.active()){n.root&&(o=on.trace.deleteSpan(o));let r=on.trace.getSpan(o);if((0,YA.isTracingSuppressed)(o))return on.diag.debug("Instrumentation suppressed, returning Noop Span"),on.trace.wrapSpanContext(on.INVALID_SPAN_CONTEXT);let i=r?.spanContext(),s=this._idGenerator.generateSpanId(),a,c,u;!i||!on.trace.isSpanContextValid(i)?c=this._idGenerator.generateTraceId():(c=i.traceId,u=i.traceState,a=i);let d=n.kind??on.SpanKind.INTERNAL,p=(n.links??[]).map(C=>({context:C.context,attributes:(0,YA.sanitizeAttributes)(C.attributes)})),f=(0,YA.sanitizeAttributes)(n.attributes),m=this._sampler.shouldSample(o,c,t,d,f,p),_=this._tracerMetrics.startSpan(i,m.decision);u=m.traceState??u;let h=m.decision===on.SamplingDecision.RECORD_AND_SAMPLED?on.TraceFlags.SAMPLED:on.TraceFlags.NONE,E={traceId:c,spanId:s,traceFlags:h,traceState:u};if(m.decision===on.SamplingDecision.NOT_RECORD)return on.diag.debug("Recording is off, propagating context in a non-recording span"),on.trace.wrapSpanContext(E);let T=(0,YA.sanitizeAttributes)(Object.assign(f,m.attributes));return new MOe.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:o,spanContext:E,name:t,kind:d,links:p,parentSpanContext:a,attributes:T,startTime:n.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:_})}startActiveSpan(t,n,o,r){let i,s,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(i=n,a=o):(i=n,s=o,a=r);let c=s??on.context.active(),u=this.startSpan(t,i,c),d=on.trace.setSpan(c,u);return on.context.with(d,a,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}};WA.Tracer=YM});var pQ=S(KA=>{"use strict";l();Object.defineProperty(KA,"__esModule",{value:!0});KA.MultiSpanProcessor=void 0;var UOe=Xe(),WM=class{_spanProcessors;constructor(t){this._spanProcessors=t}forceFlush(){let t=[];for(let n of this._spanProcessors)t.push(n.forceFlush());return new Promise(n=>{Promise.all(t).then(()=>{n()}).catch(o=>{(0,UOe.globalErrorHandler)(o||new Error("MultiSpanProcessor: forceFlush failed")),n()})})}onStart(t,n){for(let o of this._spanProcessors)o.onStart(t,n)}onEnding(t){for(let n of this._spanProcessors)n.onEnding&&n.onEnding(t)}onEnd(t){for(let n of this._spanProcessors)n.onEnd(t)}shutdown(){let t=[];for(let n of this._spanProcessors)t.push(n.shutdown());return new Promise((n,o)=>{Promise.all(t).then(()=>{n()},o)})}};KA.MultiSpanProcessor=WM});var fQ=S(Nu=>{"use strict";l();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.BasicTracerProvider=Nu.ForceFlushState=void 0;var $Oe=Xe(),BOe=z9(),GOe=dQ(),jOe=GM(),VOe=pQ(),FOe=jM(),Zd;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(Zd=Nu.ForceFlushState||(Nu.ForceFlushState={}));var KM=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(t={}){let n=(0,$Oe.merge)({},(0,jOe.loadDefaultConfig)(),(0,FOe.reconfigureLimits)(t));this._resource=n.resource??(0,BOe.defaultResource)(),this._config=Object.assign({},n,{resource:this._resource});let o=[];t.spanProcessors?.length&&o.push(...t.spanProcessors),this._activeSpanProcessor=new VOe.MultiSpanProcessor(o)}getTracer(t,n,o){let r=`${t}@${n||""}:${o?.schemaUrl||""}`;return this._tracers.has(r)||this._tracers.set(r,new GOe.Tracer({name:t,version:n,schemaUrl:o?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(r)}forceFlush(){let t=this._config.forceFlushTimeoutMillis,n=this._activeSpanProcessor._spanProcessors.map(o=>new Promise(r=>{let i,s=setTimeout(()=>{r(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=Zd.timeout},t);o.forceFlush().then(()=>{clearTimeout(s),i!==Zd.timeout&&(i=Zd.resolved,r(i))}).catch(a=>{clearTimeout(s),i=Zd.error,r(a)})}));return new Promise((o,r)=>{Promise.all(n).then(i=>{let s=i.filter(a=>a!==Zd.resolved);s.length>0?r(s):o()}).catch(i=>r([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}};Nu.BasicTracerProvider=KM});var mQ=S(ZA=>{"use strict";l();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.ConsoleSpanExporter=void 0;var ZM=Xe(),JM=class{export(t,n){return this._sendSpans(t,n)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(t){return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,traceId:t.spanContext().traceId,parentSpanContext:t.parentSpanContext,traceState:t.spanContext().traceState?.serialize(),name:t.name,id:t.spanContext().spanId,kind:t.kind,timestamp:(0,ZM.hrTimeToMicroseconds)(t.startTime),duration:(0,ZM.hrTimeToMicroseconds)(t.duration),attributes:t.attributes,status:t.status,events:t.events,links:t.links}}_sendSpans(t,n){for(let o of t)console.dir(this._exportInfo(o),{depth:3});if(n)return n({code:ZM.ExportResultCode.SUCCESS})}};ZA.ConsoleSpanExporter=JM});var gQ=S(JA=>{"use strict";l();Object.defineProperty(JA,"__esModule",{value:!0});JA.InMemorySpanExporter=void 0;var _Q=Xe(),XM=class{_finishedSpans=[];_stopped=!1;export(t,n){if(this._stopped)return n({code:_Q.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...t),setTimeout(()=>n({code:_Q.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};JA.InMemorySpanExporter=XM});var hQ=S(QA=>{"use strict";l();Object.defineProperty(QA,"__esModule",{value:!0});QA.SimpleSpanProcessor=void 0;var HOe=K(),XA=Xe(),QM=class{_exporter;_shutdownOnce;_pendingExports;constructor(t){this._exporter=t,this._shutdownOnce=new XA.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(t,n){}onEnd(t){if(this._shutdownOnce.isCalled||(t.spanContext().traceFlags&HOe.TraceFlags.SAMPLED)===0)return;let n=this._doExport(t).catch(o=>(0,XA.globalErrorHandler)(o));this._pendingExports.add(n),n.finally(()=>this._pendingExports.delete(n))}async _doExport(t){t.resource.asyncAttributesPending&&await t.resource.waitForAsyncAttributes?.();let n=await XA.internal._export(this._exporter,[t]);if(n.code!==XA.ExportResultCode.SUCCESS)throw n.error??new Error(`SimpleSpanProcessor: span export failed (status ${n})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};QA.SimpleSpanProcessor=QM});var EQ=S(ey=>{"use strict";l();Object.defineProperty(ey,"__esModule",{value:!0});ey.NoopSpanProcessor=void 0;var eL=class{onStart(t,n){}onEnd(t){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};ey.NoopSpanProcessor=eL});var tL=S(ut=>{"use strict";l();Object.defineProperty(ut,"__esModule",{value:!0});ut.SamplingDecision=ut.TraceIdRatioBasedSampler=ut.ParentBasedSampler=ut.AlwaysOnSampler=ut.AlwaysOffSampler=ut.NoopSpanProcessor=ut.SimpleSpanProcessor=ut.InMemorySpanExporter=ut.ConsoleSpanExporter=ut.RandomIdGenerator=ut.BatchSpanProcessor=ut.BasicTracerProvider=void 0;var zOe=fQ();Object.defineProperty(ut,"BasicTracerProvider",{enumerable:!0,get:function(){return zOe.BasicTracerProvider}});var TQ=zM();Object.defineProperty(ut,"BatchSpanProcessor",{enumerable:!0,get:function(){return TQ.BatchSpanProcessor}});Object.defineProperty(ut,"RandomIdGenerator",{enumerable:!0,get:function(){return TQ.RandomIdGenerator}});var qOe=mQ();Object.defineProperty(ut,"ConsoleSpanExporter",{enumerable:!0,get:function(){return qOe.ConsoleSpanExporter}});var YOe=gQ();Object.defineProperty(ut,"InMemorySpanExporter",{enumerable:!0,get:function(){return YOe.InMemorySpanExporter}});var WOe=hQ();Object.defineProperty(ut,"SimpleSpanProcessor",{enumerable:!0,get:function(){return WOe.SimpleSpanProcessor}});var KOe=EQ();Object.defineProperty(ut,"NoopSpanProcessor",{enumerable:!0,get:function(){return KOe.NoopSpanProcessor}});var ZOe=xA();Object.defineProperty(ut,"AlwaysOffSampler",{enumerable:!0,get:function(){return ZOe.AlwaysOffSampler}});var JOe=LA();Object.defineProperty(ut,"AlwaysOnSampler",{enumerable:!0,get:function(){return JOe.AlwaysOnSampler}});var XOe=DM();Object.defineProperty(ut,"ParentBasedSampler",{enumerable:!0,get:function(){return XOe.ParentBasedSampler}});var QOe=UM();Object.defineProperty(ut,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return QOe.TraceIdRatioBasedSampler}});var eCe=zd();Object.defineProperty(ut,"SamplingDecision",{enumerable:!0,get:function(){return eCe.SamplingDecision}})});var W8=S(rg=>{"use strict";l();Object.defineProperty(rg,"__esModule",{value:!0});rg.SeverityNumber=void 0;var fPe;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(fPe=rg.SeverityNumber||(rg.SeverityNumber={}))});var Oy=S(np=>{"use strict";l();Object.defineProperty(np,"__esModule",{value:!0});np.NOOP_LOGGER=np.NoopLogger=void 0;var Ny=class{emit(t){}};np.NoopLogger=Ny;np.NOOP_LOGGER=new Ny});var K8=S(ki=>{"use strict";l();Object.defineProperty(ki,"__esModule",{value:!0});ki.API_BACKWARDS_COMPATIBILITY_VERSION=ki.makeGetter=ki._global=ki.GLOBAL_LOGS_API_KEY=void 0;ki.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ki._global=globalThis;function mPe(e,t,n){return o=>o===e?t:n}ki.makeGetter=mPe;ki.API_BACKWARDS_COMPATIBILITY_VERSION=1});var GL=S(rp=>{"use strict";l();Object.defineProperty(rp,"__esModule",{value:!0});rp.NOOP_LOGGER_PROVIDER=rp.NoopLoggerProvider=void 0;var _Pe=Oy(),Cy=class{getLogger(t,n,o){return new _Pe.NoopLogger}};rp.NoopLoggerProvider=Cy;rp.NOOP_LOGGER_PROVIDER=new Cy});var Z8=S(vy=>{"use strict";l();Object.defineProperty(vy,"__esModule",{value:!0});vy.ProxyLogger=void 0;var gPe=Oy(),jL=class{constructor(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):gPe.NOOP_LOGGER}};vy.ProxyLogger=jL});var J8=S(Py=>{"use strict";l();Object.defineProperty(Py,"__esModule",{value:!0});Py.ProxyLoggerProvider=void 0;var hPe=GL(),EPe=Z8(),VL=class{getLogger(t,n,o){var r;return(r=this._getDelegateLogger(t,n,o))!==null&&r!==void 0?r:new EPe.ProxyLogger(this,t,n,o)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:hPe.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(t,n,o)}};Py.ProxyLoggerProvider=VL});var Q8=S(xy=>{"use strict";l();Object.defineProperty(xy,"__esModule",{value:!0});xy.LogsAPI=void 0;var uo=K8(),TPe=GL(),X8=J8(),FL=class e{constructor(){this._proxyLoggerProvider=new X8.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return uo._global[uo.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(uo._global[uo.GLOBAL_LOGS_API_KEY]=(0,uo.makeGetter)(uo.API_BACKWARDS_COMPATIBILITY_VERSION,t,TPe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=uo._global[uo.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(uo._global,uo.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,o){return this.getLoggerProvider().getLogger(t,n,o)}disable(){delete uo._global[uo.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new X8.ProxyLoggerProvider}};xy.LogsAPI=FL});var HL=S(Ui=>{"use strict";l();Object.defineProperty(Ui,"__esModule",{value:!0});Ui.logs=Ui.NoopLogger=Ui.NOOP_LOGGER=Ui.SeverityNumber=void 0;var SPe=W8();Object.defineProperty(Ui,"SeverityNumber",{enumerable:!0,get:function(){return SPe.SeverityNumber}});var e7=Oy();Object.defineProperty(Ui,"NOOP_LOGGER",{enumerable:!0,get:function(){return e7.NOOP_LOGGER}});Object.defineProperty(Ui,"NoopLogger",{enumerable:!0,get:function(){return e7.NoopLogger}});var APe=Q8();Ui.logs=APe.LogsAPI.getInstance()});var t7=S(op=>{"use strict";l();Object.defineProperty(op,"__esModule",{value:!0});op.disableInstrumentations=op.enableInstrumentations=void 0;function yPe(e,t,n,o){for(let r=0,i=e.length;r<i;r++){let s=e[r];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),o&&s.setLoggerProvider&&s.setLoggerProvider(o),s.getConfig().enabled||s.enable()}}op.enableInstrumentations=yPe;function RPe(e){e.forEach(t=>t.disable())}op.disableInstrumentations=RPe});var o7=S(My=>{"use strict";l();Object.defineProperty(My,"__esModule",{value:!0});My.registerInstrumentations=void 0;var n7=K(),IPe=HL(),r7=t7();function bPe(e){let t=e.tracerProvider||n7.trace.getTracerProvider(),n=e.meterProvider||n7.metrics.getMeterProvider(),o=e.loggerProvider||IPe.logs.getLoggerProvider(),r=e.instrumentations?.flat()??[];return(0,r7.enableInstrumentations)(r,t,n,o),()=>{(0,r7.disableInstrumentations)(r)}}My.registerInstrumentations=bPe});var f7=S(Ly=>{"use strict";l();Object.defineProperty(Ly,"__esModule",{value:!0});Ly.satisfies=void 0;var WL=K(),u7=/^(?: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-]+)*))?$/,NPe=/^(?<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-]+)*))?$/,OPe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function CPe(e,t,n){if(!vPe(e))return WL.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let o=LPe(e);if(!o)return!1;let r=[],i=l7(o,t,r,n);return i&&!n?.includePrerelease?xPe(o,r):i}Ly.satisfies=CPe;function vPe(e){return typeof e=="string"&&u7.test(e)}function l7(e,t,n,o){if(t.includes("||")){let r=t.trim().split("||");for(let i of r)if(zL(e,i,n,o))return!0;return!1}else if(t.includes(" - "))t=exe(t,o);else if(t.includes(" ")){let r=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of r)if(!zL(e,i,n,o))return!1;return!0}return zL(e,t,n,o)}function zL(e,t,n,o){if(t=MPe(t,o),t.includes(" "))return l7(e,t,n,o);{let r=wPe(t);return n.push(r),PPe(e,r)}}function PPe(e,t){if(t.invalid)return!1;if(!t.version||YL(t.version))return!0;let n=s7(e.versionSegments||[],t.versionSegments||[]);if(n===0){let o=e.prereleaseSegments||[],r=t.prereleaseSegments||[];!o.length&&!r.length?n=0:!o.length&&r.length?n=1:o.length&&!r.length?n=-1:n=s7(o,r)}return OPe[t.op]?.includes(n)}function xPe(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function MPe(e,t){return e=e.trim(),e=XPe(e,t),e=JPe(e),e=QPe(e,t),e=e.trim(),e}function Qn(e){return!e||e.toLowerCase()==="x"||e==="*"}function LPe(e){let t=e.match(u7);if(!t){WL.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,o=t.groups.prerelease,r=t.groups.build,i=n.split("."),s=o?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:r}}function wPe(e){if(!e)return{};let t=e.match(NPe);if(!t)return WL.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,o=t.groups.version,r=t.groups.prerelease,i=t.groups.build,s=o.split("."),a=r?.split(".");return n==="=="&&(n="="),{op:n||"=",version:o,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:i}}function YL(e){return e==="*"||e==="x"||e==="X"}function i7(e){let t=parseInt(e,10);return isNaN(t)?e:t}function DPe(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function kPe(e,t){if(YL(e)||YL(t))return 0;let[n,o]=DPe(i7(e),i7(t));return n>o?1:n<o?-1:0}function s7(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let o=kPe(e[n]||"0",t[n]||"0");if(o!==0)return o}return 0}var d7="[a-zA-Z0-9-]",p7="0|[1-9]\\d*",UPe=`\\d*[a-zA-Z-]${d7}*`,$Pe="((?:<|>)?=?)",a7=`(?:${p7}|${UPe})`,BPe=`(?:-(${a7}(?:\\.${a7})*))`,c7=`${d7}+`,GPe=`(?:\\+(${c7}(?:\\.${c7})*))`,qL=`${p7}|x|X|\\*`,og=`[v=\\s]*(${qL})(?:\\.(${qL})(?:\\.(${qL})(?:${BPe})?${GPe}?)?)?`,jPe=`^${$Pe}\\s*${og}$`,VPe=new RegExp(jPe),FPe=`^\\s*(${og})\\s+-\\s+(${og})\\s*$`,HPe=new RegExp(FPe),zPe="(?:~>?)",qPe=`^${zPe}${og}$`,YPe=new RegExp(qPe),WPe="(?:\\^)",KPe=`^${WPe}${og}$`,ZPe=new RegExp(KPe);function JPe(e){let t=YPe;return e.replace(t,(n,o,r,i,s)=>{let a;return Qn(o)?a="":Qn(r)?a=`>=${o}.0.0 <${+o+1}.0.0-0`:Qn(i)?a=`>=${o}.${r}.0 <${o}.${+r+1}.0-0`:s?a=`>=${o}.${r}.${i}-${s} <${o}.${+r+1}.0-0`:a=`>=${o}.${r}.${i} <${o}.${+r+1}.0-0`,a})}function XPe(e,t){let n=ZPe,o=t?.includePrerelease?"-0":"";return e.replace(n,(r,i,s,a,c)=>{let u;return Qn(i)?u="":Qn(s)?u=`>=${i}.0.0${o} <${+i+1}.0.0-0`:Qn(a)?i==="0"?u=`>=${i}.${s}.0${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.0${o} <${+i+1}.0.0-0`:c?i==="0"?s==="0"?u=`>=${i}.${s}.${a}-${c} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a}-${c} <${+i+1}.0.0-0`:i==="0"?s==="0"?u=`>=${i}.${s}.${a}${o} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a} <${+i+1}.0.0-0`,u})}function QPe(e,t){let n=VPe;return e.replace(n,(o,r,i,s,a,c)=>{let u=Qn(i),d=u||Qn(s),p=d||Qn(a),f=p;return r==="="&&f&&(r=""),c=t?.includePrerelease?"-0":"",u?r===">"||r==="<"?o="<0.0.0-0":o="*":r&&f?(d&&(s=0),a=0,r===">"?(r=">=",d?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",d?i=+i+1:s=+s+1),r==="<"&&(c="-0"),o=`${r+i}.${s}.${a}${c}`):d?o=`>=${i}.0.0${c} <${+i+1}.0.0-0`:p&&(o=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o})}function exe(e,t){let n=HPe;return e.replace(n,(o,r,i,s,a,c,u,d,p,f,m,_)=>(Qn(i)?r="":Qn(s)?r=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Qn(a)?r=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?.includePrerelease?"-0":""}`,Qn(p)?d="":Qn(f)?d=`<${+p+1}.0.0-0`:Qn(m)?d=`<${p}.${+f+1}.0-0`:_?d=`<=${p}.${f}.${m}-${_}`:t?.includePrerelease?d=`<${p}.${f}.${+m+1}-0`:d=`<=${d}`,`${r} ${d}`.trim()))}});var KL=S(Sn=>{"use strict";l();Object.defineProperty(Sn,"__esModule",{value:!0});Sn.massUnwrap=Sn.unwrap=Sn.massWrap=Sn.wrap=void 0;var er=console.error.bind(console);function ig(e,t,n){let o=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:o,writable:!0,value:n})}var txe=(e,t,n)=>{if(!e||!e[t]){er("no original function "+String(t)+" to wrap");return}if(!n){er("no wrapper function"),er(new Error().stack);return}let o=e[t];if(typeof o!="function"||typeof n!="function"){er("original object and wrapper must be functions");return}let r=n(o,t);return ig(r,"__original",o),ig(r,"__unwrap",()=>{e[t]===r&&ig(e,t,o)}),ig(r,"__wrapped",!0),ig(e,t,r),r};Sn.wrap=txe;var nxe=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{er("must provide one or more modules to patch"),er(new Error().stack);return}if(!(t&&Array.isArray(t))){er("must provide one or more functions to wrap on modules");return}e.forEach(o=>{t.forEach(r=>{(0,Sn.wrap)(o,r,n)})})};Sn.massWrap=nxe;var rxe=(e,t)=>{if(!e||!e[t]){er("no function to unwrap."),er(new Error().stack);return}let n=e[t];if(!n.__unwrap)er("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Sn.unwrap=rxe;var oxe=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{er("must provide one or more modules to patch"),er(new Error().stack);return}if(!(t&&Array.isArray(t))){er("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(o=>{(0,Sn.unwrap)(n,o)})})};Sn.massUnwrap=oxe;function sg(e){e&&e.logger&&(typeof e.logger!="function"?er("new logger isn't a function, not replacing"):er=e.logger)}Sn.default=sg;sg.wrap=Sn.wrap;sg.massWrap=Sn.massWrap;sg.unwrap=Sn.unwrap;sg.massUnwrap=Sn.massUnwrap});var m7=S(Dy=>{"use strict";l();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.InstrumentationAbstract=void 0;var ZL=K(),ixe=HL(),wy=KL(),JL=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,o){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(o),this._diag=ZL.diag.createComponentLogger({namespace:t}),this._tracer=ZL.trace.getTracer(t,n),this._meter=ZL.metrics.getMeter(t,n),this._logger=ixe.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=wy.wrap;_unwrap=wy.unwrap;_massWrap=wy.massWrap;_massUnwrap=wy.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,o,r){if(t)try{t(o,r)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};Dy.InstrumentationAbstract=JL});var _7=S(La=>{"use strict";l();Object.defineProperty(La,"__esModule",{value:!0});La.ModuleNameTrie=La.ModuleNameSeparator=void 0;La.ModuleNameSeparator="/";var ky=class{hooks=[];children=new Map},XL=class{_trie=new ky;_counter=0;insert(t){let n=this._trie;for(let o of t.moduleName.split(La.ModuleNameSeparator)){let r=n.children.get(o);r||(r=new ky,n.children.set(o,r)),n=r}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:o}={}){let r=this._trie,i=[],s=!0;for(let a of t.split(La.ModuleNameSeparator)){let c=r.children.get(a);if(!c){s=!1;break}o||i.push(...c.hooks),r=c}return o&&s&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((a,c)=>a.insertedId-c.insertedId),i.map(({hook:a})=>a))}};La.ModuleNameTrie=XL});var h7=S(Uy=>{"use strict";l();Object.defineProperty(Uy,"__esModule",{value:!0});Uy.RequireInTheMiddleSingleton=void 0;var sxe=lu(),g7=require("path"),QL=_7(),axe=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),ew=class e{_moduleNameTrie=new QL.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new sxe.Hook(null,{internals:!0},(t,n,o)=>{let r=cxe(n),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:s}of i)t=s(t,n,o);return t})}register(t,n){let o={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(o),o}static getInstance(){return axe?new e:this._instance=this._instance??new e}};Uy.RequireInTheMiddleSingleton=ew;function cxe(e){return g7.sep!==QL.ModuleNameSeparator?e.split(g7.sep).join(QL.ModuleNameSeparator):e}});var y7=S(ag=>{l();var E7=[],tw=new WeakMap,T7=new WeakMap,S7=new Map,A7=[],uxe={set(e,t,n){let o=tw.get(e),r=o&&o[t];return typeof r=="function"?r(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=T7.get(e)[t];if(typeof n=="function")return n()},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let o=tw.get(e),r=o&&o[t];return typeof r=="function"?r(n.value):!0}};function lxe(e,t,n,o,r){S7.set(e,r),tw.set(t,n),T7.set(t,o);let i=new Proxy(t,uxe);E7.forEach(s=>s(e,i,r)),A7.push([e,i,r])}ag.register=lxe;ag.importHooks=E7;ag.specifiers=S7;ag.toHook=A7});var iw=S((Upt,sp)=>{l();var R7=require("path"),dxe=RS(),{fileURLToPath:pxe}=require("url"),{MessageChannel:fxe}=require("worker_threads"),{isBuiltin:nw}=require("module");nw||(nw=()=>!0);var{importHooks:rw,specifiers:mxe,toHook:_xe}=y7();function I7(e){rw.push(e),_xe.forEach(([t,n,o])=>e(t,n,o))}function b7(e){let t=rw.indexOf(e);t>-1&&rw.splice(t,1)}function ip(e,t,n,o){let r=e(t,n,o);r&&r!==t&&"default"in t&&(t.default=r)}var ow;function gxe(){let{port1:e,port2:t}=new fxe,n=0,o;ow=a=>{n++,e.postMessage(a)},e.on("message",()=>{n--,o&&n<=0&&o()}).unref();function r(){let a=setInterval(()=>{},1e3),c=new Promise(u=>{o=u}).then(()=>{clearInterval(a)});return n===0&&o(),c}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:r}}function cg(e,t,n){if(!(this instanceof cg))return new cg(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let o=t?t.internals===!0:!1;ow&&Array.isArray(e)&&ow(e),this._iitmHook=(r,i,s)=>{let a=r,c=a.startsWith("node:"),u,d;if(c){let p=r.slice(5);nw(p)&&(r=p)}else if(a.startsWith("file://")){let p=Error.stackTraceLimit;Error.stackTraceLimit=0;try{u=pxe(r),r=u}catch{}if(Error.stackTraceLimit=p,u){let f=dxe(u);f&&(r=f.name,d=f.basedir)}}if(e)for(let p of e)if(u&&p===u)ip(n,i,u,void 0);else if(p===r){if(!d)ip(n,i,r,d);else if(d.endsWith(mxe.get(a)))ip(n,i,r,d);else if(o){let f=r+R7.sep+R7.relative(d,u);ip(n,i,f,d)}}else p===s&&ip(n,i,s,d);else ip(n,i,r,d)},I7(this._iitmHook)}cg.prototype.unhook=function(){b7(this._iitmHook)};sp.exports=cg;sp.exports.Hook=cg;sp.exports.addHook=I7;sp.exports.removeHook=b7;sp.exports.createAddHookMessageChannel=gxe});var sw=S(wa=>{"use strict";l();Object.defineProperty(wa,"__esModule",{value:!0});wa.isWrapped=wa.safeExecuteInTheMiddleAsync=wa.safeExecuteInTheMiddle=void 0;function hxe(e,t,n){let o,r;try{r=e()}catch(i){o=i}finally{if(t(o,r),o&&!n)throw o;return r}}wa.safeExecuteInTheMiddle=hxe;async function Exe(e,t,n){let o,r;try{r=await e()}catch(i){o=i}finally{if(await t(o,r),o&&!n)throw o;return r}}wa.safeExecuteInTheMiddleAsync=Exe;function Txe(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}wa.isWrapped=Txe});var C7=S($y=>{"use strict";l();Object.defineProperty($y,"__esModule",{value:!0});$y.InstrumentationBase=void 0;var ug=require("path"),N7=require("util"),Sxe=f7(),aw=KL(),Axe=m7(),yxe=h7(),Rxe=iw(),lg=K(),Ixe=lu(),bxe=require("fs"),Nxe=sw(),cw=class extends Axe.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=yxe.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,o){super(t,n,o);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(t,n,o)=>{if((0,Nxe.isWrapped)(t[n])&&this._unwrap(t,n),N7.types.isProxy(t)){let r=(0,aw.wrap)(Object.assign({},t),n,o);return Object.defineProperty(t,n,{value:r}),r}else return(0,aw.wrap)(t,n,o)};_unwrap=(t,n)=>N7.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,aw.unwrap)(t,n);_massWrap=(t,n,o)=>{if(t)Array.isArray(t)||(t=[t]);else{lg.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){lg.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(i=>{this._wrap(r,i,o)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{lg.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){lg.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(r=>{this._unwrap(o,r)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let o=require.resolve(n);require.cache[o]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,bxe.readFileSync)(ug.join(t,"package.json"),{encoding:"utf8"}),o=JSON.parse(n).version;return typeof o=="string"?o:void 0}catch{lg.diag.warn("Failed extracting version",t)}}_onRequire(t,n,o,r){if(!r)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(r);if(t.moduleVersion=i,t.name===o)return O7(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:r}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],a=ug.normalize(o);return s.filter(u=>u.name===a&&O7(u.supportedVersions,i,t.includePrerelease)).reduce((u,d)=>(d.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:d.name,baseDir:r}),d.patch(u,t.moduleVersion)):u),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,a,c)=>{if(!c&&ug.isAbsolute(a)){let u=ug.parse(a);a=u.name,c=u.dir}return this._onRequire(t,s,a,c)},o=(s,a,c)=>this._onRequire(t,s,a,c),r=ug.isAbsolute(t.name)?new Ixe.Hook([t.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(t.name,o);this._hooks.push(r);let i=new Rxe.Hook([t.name],{internals:!0},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};$y.InstrumentationBase=cw;function O7(e,t,n){return typeof t>"u"?e.includes("*"):e.some(o=>(0,Sxe.satisfies)(t,o,{includePrerelease:n}))}});var v7=S(By=>{"use strict";l();Object.defineProperty(By,"__esModule",{value:!0});By.normalize=void 0;var Oxe=require("path");Object.defineProperty(By,"normalize",{enumerable:!0,get:function(){return Oxe.normalize}})});var P7=S(ap=>{"use strict";l();Object.defineProperty(ap,"__esModule",{value:!0});ap.normalize=ap.InstrumentationBase=void 0;var Cxe=C7();Object.defineProperty(ap,"InstrumentationBase",{enumerable:!0,get:function(){return Cxe.InstrumentationBase}});var vxe=v7();Object.defineProperty(ap,"normalize",{enumerable:!0,get:function(){return vxe.normalize}})});var uw=S(cp=>{"use strict";l();Object.defineProperty(cp,"__esModule",{value:!0});cp.normalize=cp.InstrumentationBase=void 0;var x7=P7();Object.defineProperty(cp,"InstrumentationBase",{enumerable:!0,get:function(){return x7.InstrumentationBase}});Object.defineProperty(cp,"normalize",{enumerable:!0,get:function(){return x7.normalize}})});var M7=S(Gy=>{"use strict";l();Object.defineProperty(Gy,"__esModule",{value:!0});Gy.InstrumentationNodeModuleDefinition=void 0;var lw=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,o,r,i){this.files=i||[],this.name=t,this.supportedVersions=n,this.patch=o,this.unpatch=r}};Gy.InstrumentationNodeModuleDefinition=lw});var L7=S(jy=>{"use strict";l();Object.defineProperty(jy,"__esModule",{value:!0});jy.InstrumentationNodeModuleFile=void 0;var Pxe=uw(),dw=class{name;supportedVersions;patch;unpatch;constructor(t,n,o,r){this.name=(0,Pxe.normalize)(t),this.supportedVersions=n,this.patch=o,this.unpatch=r}};jy.InstrumentationNodeModuleFile=dw});var w7=S(Bu=>{"use strict";l();Object.defineProperty(Bu,"__esModule",{value:!0});Bu.semconvStabilityFromStr=Bu.SemconvStability=void 0;var Vy;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(Vy=Bu.SemconvStability||(Bu.SemconvStability={}));function xxe(e,t){let n=Vy.OLD,o=t?.split(",").map(r=>r.trim()).filter(r=>r!=="");for(let r of o??[])if(r.toLowerCase()===e+"/dup"){n=Vy.DUPLICATE;break}else r.toLowerCase()===e&&(n=Vy.STABLE);return n}Bu.semconvStabilityFromStr=xxe});var k7=S(Vt=>{"use strict";l();Object.defineProperty(Vt,"__esModule",{value:!0});Vt.semconvStabilityFromStr=Vt.SemconvStability=Vt.safeExecuteInTheMiddleAsync=Vt.safeExecuteInTheMiddle=Vt.isWrapped=Vt.InstrumentationNodeModuleFile=Vt.InstrumentationNodeModuleDefinition=Vt.InstrumentationBase=Vt.registerInstrumentations=void 0;var Mxe=o7();Object.defineProperty(Vt,"registerInstrumentations",{enumerable:!0,get:function(){return Mxe.registerInstrumentations}});var Lxe=uw();Object.defineProperty(Vt,"InstrumentationBase",{enumerable:!0,get:function(){return Lxe.InstrumentationBase}});var wxe=M7();Object.defineProperty(Vt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return wxe.InstrumentationNodeModuleDefinition}});var Dxe=L7();Object.defineProperty(Vt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return Dxe.InstrumentationNodeModuleFile}});var pw=sw();Object.defineProperty(Vt,"isWrapped",{enumerable:!0,get:function(){return pw.isWrapped}});Object.defineProperty(Vt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return pw.safeExecuteInTheMiddle}});Object.defineProperty(Vt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return pw.safeExecuteInTheMiddleAsync}});var D7=w7();Object.defineProperty(Vt,"SemconvStability",{enumerable:!0,get:function(){return D7.SemconvStability}});Object.defineProperty(Vt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return D7.semconvStabilityFromStr}})});var U7=S((rft,kxe)=>{kxe.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 B7=S(Gu=>{"use strict";l();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.range=Gu.balanced=void 0;var Uxe=(e,t,n)=>{let o=e instanceof RegExp?$7(e,n):e,r=t instanceof RegExp?$7(t,n):t,i=o!==null&&r!=null&&(0,Gu.range)(o,r,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+o.length,i[1]),post:n.slice(i[1]+r.length)}};Gu.balanced=Uxe;var $7=(e,t)=>{let n=t.match(e);return n?n[0]:null},$xe=(e,t,n)=>{let o,r,i,s,a,c=n.indexOf(e),u=n.indexOf(t,c+1),d=c;if(c>=0&&u>0){if(e===t)return[c,u];for(o=[],i=n.length;d>=0&&!a;){if(d===c)o.push(d),c=n.indexOf(e,d+1);else if(o.length===1){let p=o.pop();p!==void 0&&(a=[p,u])}else r=o.pop(),r!==void 0&&r<i&&(i=r,s=u),u=n.indexOf(t,d+1);d=c<u&&c>=0?c:u}o.length&&s!==void 0&&(a=[i,s])}return a};Gu.range=$xe});var q7=S(up=>{"use strict";l();Object.defineProperty(up,"__esModule",{value:!0});up.EXPANSION_MAX=void 0;up.expand=Jxe;var G7=B7(),j7="\0SLASH"+Math.random()+"\0",V7="\0OPEN"+Math.random()+"\0",mw="\0CLOSE"+Math.random()+"\0",F7="\0COMMA"+Math.random()+"\0",H7="\0PERIOD"+Math.random()+"\0",Bxe=new RegExp(j7,"g"),Gxe=new RegExp(V7,"g"),jxe=new RegExp(mw,"g"),Vxe=new RegExp(F7,"g"),Fxe=new RegExp(H7,"g"),Hxe=/\\\\/g,zxe=/\\{/g,qxe=/\\}/g,Yxe=/\\,/g,Wxe=/\\\./g;up.EXPANSION_MAX=1e5;function fw(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Kxe(e){return e.replace(Hxe,j7).replace(zxe,V7).replace(qxe,mw).replace(Yxe,F7).replace(Wxe,H7)}function Zxe(e){return e.replace(Bxe,"\\").replace(Gxe,"{").replace(jxe,"}").replace(Vxe,",").replace(Fxe,".")}function z7(e){if(!e)return[""];let t=[],n=(0,G7.balanced)("{","}",e);if(!n)return e.split(",");let{pre:o,body:r,post:i}=n,s=o.split(",");s[s.length-1]+="{"+r+"}";let a=z7(i);return i.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),t.push.apply(t,s),t}function Jxe(e,t={}){if(!e)return[];let{max:n=up.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),dg(Kxe(e),n,!0).map(Zxe)}function Xxe(e){return"{"+e+"}"}function Qxe(e){return/^-?0\d/.test(e)}function eMe(e,t){return e<=t}function tMe(e,t){return e>=t}function dg(e,t,n){let o=[],r=(0,G7.balanced)("{","}",e);if(!r)return[e];let i=r.pre,s=r.post.length?dg(r.post,t,!1):[""];if(/\$$/.test(r.pre))for(let a=0;a<s.length&&a<t;a++){let c=i+"{"+r.body+"}"+s[a];o.push(c)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),c=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),u=a||c,d=r.body.indexOf(",")>=0;if(!u&&!d)return r.post.match(/,(?!,).*\}/)?(e=r.pre+"{"+r.body+mw+r.post,dg(e,t,!0)):[e];let p;if(u)p=r.body.split(/\.\./);else if(p=z7(r.body),p.length===1&&p[0]!==void 0&&(p=dg(p[0],t,!1).map(Xxe),p.length===1))return s.map(m=>r.pre+p[0]+m);let f;if(u&&p[0]!==void 0&&p[1]!==void 0){let m=fw(p[0]),_=fw(p[1]),h=Math.max(p[0].length,p[1].length),E=p.length===3&&p[2]!==void 0?Math.max(Math.abs(fw(p[2])),1):1,T=eMe;_<m&&(E*=-1,T=tMe);let C=p.some(Qxe);f=[];for(let P=m;T(P,_);P+=E){let M;if(c)M=String.fromCharCode(P),M==="\\"&&(M="");else if(M=String(P),C){let O=h-M.length;if(O>0){let z=new Array(O+1).join("0");P<0?M="-"+z+M.slice(1):M=z+M}}f.push(M)}}else{f=[];for(let m=0;m<p.length;m++)f.push.apply(f,dg(p[m],t,!1))}for(let m=0;m<f.length;m++)for(let _=0;_<s.length&&o.length<t;_++){let h=i+f[m]+s[_];(!n||u||h)&&o.push(h)}}return o}});var Y7=S(Fy=>{"use strict";l();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.assertValidPattern=void 0;var nMe=1024*64,rMe=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>nMe)throw new TypeError("pattern is too long")};Fy.assertValidPattern=rMe});var K7=S(Hy=>{"use strict";l();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.parseClass=void 0;var oMe={"[: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]},pg=e=>e.replace(/[[\]\\-]/g,"\\$&"),iMe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),W7=e=>e.join(""),sMe=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let o=[],r=[],i=n+1,s=!1,a=!1,c=!1,u=!1,d=n,p="";e:for(;i<e.length;){let h=e.charAt(i);if((h==="!"||h==="^")&&i===n+1){u=!0,i++;continue}if(h==="]"&&s&&!c){d=i+1;break}if(s=!0,h==="\\"&&!c){c=!0,i++;continue}if(h==="["&&!c){for(let[E,[T,R,C]]of Object.entries(oMe))if(e.startsWith(E,i)){if(p)return["$.",!1,e.length-n,!0];i+=E.length,C?r.push(T):o.push(T),a=a||R;continue e}}if(c=!1,p){h>p?o.push(pg(p)+"-"+pg(h)):h===p&&o.push(pg(h)),p="",i++;continue}if(e.startsWith("-]",i+1)){o.push(pg(h+"-")),i+=2;continue}if(e.startsWith("-",i+1)){p=h,i+=2;continue}o.push(pg(h)),i++}if(d<i)return["",!1,0,!1];if(!o.length&&!r.length)return["$.",!1,e.length-n,!0];if(r.length===0&&o.length===1&&/^\\?.$/.test(o[0])&&!u){let h=o[0].length===2?o[0].slice(-1):o[0];return[iMe(h),!1,d-n,!1]}let f="["+(u?"^":"")+W7(o)+"]",m="["+(u?"":"^")+W7(r)+"]";return[o.length&&r.length?"("+f+"|"+m+")":o.length?f:m,a,d-n,!0]};Hy.parseClass=sMe});var qy=S(zy=>{"use strict";l();Object.defineProperty(zy,"__esModule",{value:!0});zy.unescape=void 0;var aMe=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):t?e.replace(/\[([^/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1");zy.unescape=aMe});var hw=S(Zy=>{"use strict";l();var Sr;Object.defineProperty(Zy,"__esModule",{value:!0});Zy.AST=void 0;var cMe=K7(),Yy=qy(),uMe=new Set(["!","?","+","*","@"]),_w=e=>uMe.has(e),Z7=e=>_w(e.type),lMe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),dMe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),pMe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),J7=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),fMe="(?!(?:^|/)\\.\\.?(?:$|/))",Wy="(?!\\.)",mMe=new Set(["[","."]),_Me=new Set(["..","."]),gMe=new Set("().*{}+?[]^$\\!"),hMe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),gw="[^/]",X7=gw+"*?",Q7=gw+"+?",EMe=0,Ky=class{type;#n;#r;#o=!1;#e=[];#t;#a;#u;#c=!1;#i;#s;#l=!1;id=++EMe;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(t,n,o={}){this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?o:this.#n.#i,this.#u=this.#n===this?[]:this.#n.#u,t==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#s!==void 0?this.#s:this.type?this.#s=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#s=this.#e.map(t=>String(t)).join("")}#h(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#u.pop();){if(t.type!=="!")continue;let n=t,o=n.#t;for(;o;){for(let r=n.#a+1;!o.type&&r<o.#e.length;r++)for(let i of t.#e){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(o.#e[r])}n=o,o=n.#t}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof Sr&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let t=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let t=this.#t;for(let n=0;n<this.#a;n++){let o=t.#e[n];if(!(o instanceof Sr&&o.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let t=this.#t?this.#t.#e.length:0;return this.#a===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Sr(this.type,t);for(let o of this.#e)n.copyIn(o);return n}static#d(t,n,o,r,i){let s=r.maxExtglobRecursion??2,a=!1,c=!1,u=-1,d=!1;if(n.type===null){let h=o,E="";for(;h<t.length;){let T=t.charAt(h++);if(a||T==="\\"){a=!a,E+=T;continue}if(c){h===u+1?(T==="^"||T==="!")&&(d=!0):T==="]"&&!(h===u+2&&d)&&(c=!1),E+=T;continue}else if(T==="["){c=!0,u=h,d=!1,E+=T;continue}if(!r.noext&&_w(T)&&t.charAt(h)==="("&&i<=s){n.push(E),E="";let C=new Sr(T,n);h=Sr.#d(t,C,h,r,i+1),n.push(C);continue}E+=T}return n.push(E),h}let p=o+1,f=new Sr(null,n),m=[],_="";for(;p<t.length;){let h=t.charAt(p++);if(a||h==="\\"){a=!a,_+=h;continue}if(c){p===u+1?(h==="^"||h==="!")&&(d=!0):h==="]"&&!(p===u+2&&d)&&(c=!1),_+=h;continue}else if(h==="["){c=!0,u=p,d=!1,_+=h;continue}if(!r.noext&&_w(h)&&t.charAt(p)==="("&&(i<=s||n&&n.#p(h))){let T=n&&n.#p(h)?0:1;f.push(_),_="";let R=new Sr(h,f);f.push(R),p=Sr.#d(t,R,p,r,i+T);continue}if(h==="|"){f.push(_),_="",m.push(f),f=new Sr(null,n);continue}if(h===")")return _===""&&n.#e.length===0&&(n.#l=!0),f.push(_),_="",n.push(...m,f),p;_+=h}return n.type=null,n.#r=void 0,n.#e=[t.substring(o-1)],p}#E(t){return this.#m(t,dMe)}#m(t,n=lMe){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;let o=t.#e[0];return!o||typeof o!="object"||o.type===null?!1:this.#p(o.type,n)}#p(t,n=pMe){return!!n.get(this.type)?.includes(t)}#T(t,n){let o=t.#e[0],r=new Sr(null,o,this.options);r.#e.push(""),o.push(r),this.#_(t,n)}#_(t,n){let o=t.#e[0];this.#e.splice(n,1,...o.#e);for(let r of o.#e)typeof r=="object"&&(r.#t=this);this.#s=void 0}#S(t){return!!J7.get(this.type)?.has(t)}#A(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=t.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#y(t){let n=J7.get(this.type),o=t.#e[0],r=n?.get(o.type);if(!r)return!1;this.#e=o.#e;for(let i of this.#e)typeof i=="object"&&(i.#t=this);this.type=r,this.#s=void 0,this.#l=!1}static fromGlob(t,n={}){let o=new Sr(null,void 0,n);return Sr.#d(t,o,0,n,0),o}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let t=this.toString(),[n,o,r,i]=this.toRegExpSource();if(!(r||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return o;let a=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){let n=t??!!this.#i.dot;if(this.#n===this&&(this.#f(),this.#h()),!Z7(this)){let c=this.isStart()&&this.isEnd()&&!this.#e.some(m=>typeof m!="string"),u=this.#e.map(m=>{let[_,h,E,T]=typeof m=="string"?Sr.#R(m,this.#r,c):m.toRegExpSource(t);return this.#r=this.#r||E,this.#o=this.#o||T,_}).join(""),d="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&_Me.has(this.#e[0]))){let _=mMe,h=n&&_.has(u.charAt(0))||u.startsWith("\\.")&&_.has(u.charAt(2))||u.startsWith("\\.\\.")&&_.has(u.charAt(4)),E=!n&&!t&&_.has(u.charAt(0));d=h?fMe:E?Wy:""}let p="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(p="(?:$|\\/)"),[d+u+p,(0,Yy.unescape)(u),this.#r=!!this.#r,this.#o]}let o=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#g(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let c=this.toString(),u=this;return u.#e=[c],u.type=null,u.#r=void 0,[c,(0,Yy.unescape)(this.toString()),!1,!1]}let s=!o||t||n||!Wy?"":this.#g(!0);s===i&&(s=""),s&&(i=`(?:${i})(?:${s})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?Wy:"")+Q7;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!t?Wy:"")+X7+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&s?")":this.type==="*"&&s?")?":`)${this.type}`;a=r+i+c}return[a,(0,Yy.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(Z7(this)){let t=0,n=!1;do{n=!0;for(let o=0;o<this.#e.length;o++){let r=this.#e[o];typeof r=="object"&&(r.#f(),this.#m(r)?(n=!1,this.#_(r,o)):this.#E(r)?(n=!1,this.#T(r,o)):this.#A(r)&&(n=!1,this.#y(r)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#s=void 0}#g(t){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[o,r,i,s]=n.toRegExpSource(t);return this.#o=this.#o||s,o}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#R(t,n,o=!1){let r=!1,i="",s=!1,a=!1;for(let c=0;c<t.length;c++){let u=t.charAt(c);if(r){r=!1,i+=(gMe.has(u)?"\\":"")+u;continue}if(u==="*"){if(a)continue;a=!0,i+=o&&/^[*]+$/.test(t)?Q7:X7,n=!0;continue}else a=!1;if(u==="\\"){c===t.length-1?i+="\\\\":r=!0;continue}if(u==="["){let[d,p,f,m]=(0,cMe.parseClass)(t,c);if(f){i+=d,s=s||p,c+=f-1,n=n||m;continue}}if(u==="?"){i+=gw,n=!0;continue}i+=hMe(u)}return[i,(0,Yy.unescape)(t),!!n,s]}};Zy.AST=Ky;Sr=Ky});var Ew=S(Jy=>{"use strict";l();Object.defineProperty(Jy,"__esModule",{value:!0});Jy.escape=void 0;var TMe=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");Jy.escape=TMe});var see=S(ce=>{"use strict";l();Object.defineProperty(ce,"__esModule",{value:!0});ce.unescape=ce.escape=ce.AST=ce.Minimatch=ce.match=ce.makeRe=ce.braceExpand=ce.defaults=ce.filter=ce.GLOBSTAR=ce.sep=ce.minimatch=void 0;var SMe=q7(),Xy=Y7(),nee=hw(),AMe=Ew(),yMe=qy(),RMe=(e,t,n={})=>((0,Xy.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new ju(t,n).match(e));ce.minimatch=RMe;var IMe=/^\*+([^+@!?*[(]*)$/,bMe=e=>t=>!t.startsWith(".")&&t.endsWith(e),NMe=e=>t=>t.endsWith(e),OMe=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),CMe=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),vMe=/^\*+\.\*+$/,PMe=e=>!e.startsWith(".")&&e.includes("."),xMe=e=>e!=="."&&e!==".."&&e.includes("."),MMe=/^\.\*+$/,LMe=e=>e!=="."&&e!==".."&&e.startsWith("."),wMe=/^\*+$/,DMe=e=>e.length!==0&&!e.startsWith("."),kMe=e=>e.length!==0&&e!=="."&&e!=="..",UMe=/^\?+([^+@!?*[(]*)?$/,$Me=([e,t=""])=>{let n=ree([e]);return t?(t=t.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(t)):n},BMe=([e,t=""])=>{let n=oee([e]);return t?(t=t.toLowerCase(),o=>n(o)&&o.toLowerCase().endsWith(t)):n},GMe=([e,t=""])=>{let n=oee([e]);return t?o=>n(o)&&o.endsWith(t):n},jMe=([e,t=""])=>{let n=ree([e]);return t?o=>n(o)&&o.endsWith(t):n},ree=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},oee=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},iee=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",eee={win32:{sep:"\\"},posix:{sep:"/"}};ce.sep=iee==="win32"?eee.win32.sep:eee.posix.sep;ce.minimatch.sep=ce.sep;ce.GLOBSTAR=Symbol("globstar **");ce.minimatch.GLOBSTAR=ce.GLOBSTAR;var VMe="[^/]",FMe=VMe+"*?",HMe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",zMe="(?:(?!(?:\\/|^)\\.).)*?",qMe=(e,t={})=>n=>(0,ce.minimatch)(n,e,t);ce.filter=qMe;ce.minimatch.filter=ce.filter;var lo=(e,t={})=>Object.assign({},e,t),YMe=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ce.minimatch;let t=ce.minimatch;return Object.assign((o,r,i={})=>t(o,r,lo(e,i)),{Minimatch:class extends t.Minimatch{constructor(r,i={}){super(r,lo(e,i))}static defaults(r){return t.defaults(lo(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,i,s={}){super(r,i,lo(e,s))}static fromGlob(r,i={}){return t.AST.fromGlob(r,lo(e,i))}},unescape:(o,r={})=>t.unescape(o,lo(e,r)),escape:(o,r={})=>t.escape(o,lo(e,r)),filter:(o,r={})=>t.filter(o,lo(e,r)),defaults:o=>t.defaults(lo(e,o)),makeRe:(o,r={})=>t.makeRe(o,lo(e,r)),braceExpand:(o,r={})=>t.braceExpand(o,lo(e,r)),match:(o,r,i={})=>t.match(o,r,lo(e,i)),sep:t.sep,GLOBSTAR:ce.GLOBSTAR})};ce.defaults=YMe;ce.minimatch.defaults=ce.defaults;var WMe=(e,t={})=>((0,Xy.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,SMe.expand)(e,{max:t.braceExpandMax}));ce.braceExpand=WMe;ce.minimatch.braceExpand=ce.braceExpand;var KMe=(e,t={})=>new ju(e,t).makeRe();ce.makeRe=KMe;ce.minimatch.makeRe=ce.makeRe;var ZMe=(e,t,n={})=>{let o=new ju(t,n);return e=e.filter(r=>o.match(r)),o.options.nonull&&!e.length&&e.push(t),e};ce.match=ZMe;ce.minimatch.match=ce.match;var tee=/[?*]|[+@!]\(.*?\)|\[|\]/,JMe=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ju=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,Xy.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||iee,this.isWindows=this.platform==="win32";let o="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[o]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let o=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(o),this.debug(this.pattern,this.globParts);let r=this.globParts.map((i,s,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=i[0]===""&&i[1]===""&&(i[2]==="?"||!tee.test(i[2]))&&!tee.test(i[3]),u=/^[a-z]:/i.test(i[0]);if(c)return[...i.slice(0,4),...i.slice(4).map(d=>this.parse(d))];if(u)return[i[0],...i.slice(1).map(d=>this.parse(d))]}return i.map(c=>this.parse(c))});if(this.debug(this.pattern,r),this.set=r.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let s=this.set[i];s[0]===""&&s[1]===""&&this.globParts[i][2]==="?"&&typeof s[3]=="string"&&/^[a-z]:$/i.test(s[3])&&(s[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let o of t)for(let r=0;r<o.length;r++)o[r]==="**"&&(o[r]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let o=-1;for(;(o=n.indexOf("**",o+1))!==-1;){let r=o;for(;n[r+1]==="**";)r++;r!==o&&n.splice(o,r-o)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((o,r)=>{let i=o[o.length-1];return r==="**"&&i==="**"?o:r===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(o.pop(),o):(o.push(r),o)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let i=t[r];r===1&&i===""&&t[0]===""||(i==="."||i==="")&&(n=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let o=0;for(;(o=t.indexOf("..",o+1))!==-1;){let r=t[o-1];r&&r!=="."&&r!==".."&&r!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(r))&&(n=!0,t.splice(o-1,2),o-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let o of t){let r=-1;for(;(r=o.indexOf("**",r+1))!==-1;){let s=r;for(;o[s+1]==="**";)s++;s>r&&o.splice(r+1,s-r);let a=o[r+1],c=o[r+2],u=o[r+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,o.splice(r,1);let d=o.slice(0);d[r]="**",t.push(d),r--}if(!this.preserveMultipleSlashes){for(let s=1;s<o.length-1;s++){let a=o[s];s===1&&a===""&&o[0]===""||(a==="."||a==="")&&(n=!0,o.splice(s,1),s--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(n=!0,o.pop())}let i=0;for(;(i=o.indexOf("..",i+1))!==-1;){let s=o[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){n=!0;let c=i===1&&o[i+1]==="**"?["."]:[];o.splice(i-1,2,...c),o.length===0&&o.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let o=n+1;o<t.length;o++){let r=this.partsMatch(t[n],t[o],!this.preserveMultipleSlashes);if(r){t[n]=[],t[o]=r;break}}return t.filter(n=>n.length)}partsMatch(t,n,o=!1){let r=0,i=0,s=[],a="";for(;r<t.length&&i<n.length;)if(t[r]===n[i])s.push(a==="b"?n[i]:t[r]),r++,i++;else if(o&&t[r]==="**"&&n[i]===t[r+1])s.push(t[r]),r++;else if(o&&n[i]==="**"&&t[r]===n[i+1])s.push(n[i]),i++;else if(t[r]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(a==="b")return!1;a="a",s.push(t[r]),r++,i++}else if(n[i]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(a==="a")return!1;a="b",s.push(n[i]),r++,i++}else return!1;return t.length===n.length&&s}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,o=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)n=!n,o++;o&&(this.pattern=t.slice(o)),this.negate=n}matchOne(t,n,o=!1){let r=0,i=0;if(this.isWindows){let a=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),c=!a&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),d=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),p=c?3:a?0:void 0,f=d?3:u?0:void 0;if(typeof p=="number"&&typeof f=="number"){let[m,_]=[t[p],n[f]];m.toLowerCase()===_.toLowerCase()&&(n[f]=m,i=f,r=p)}}let{optimizationLevel:s=1}=this.options;return s>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(ce.GLOBSTAR)?this.#n(t,n,o,r,i):this.#o(t,n,o,r,i)}#n(t,n,o,r,i){let s=n.indexOf(ce.GLOBSTAR,i),a=n.lastIndexOf(ce.GLOBSTAR),[c,u,d]=o?[n.slice(i,s),n.slice(s+1),[]]:[n.slice(i,s),n.slice(s+1,a),n.slice(a+1)];if(c.length){let R=t.slice(r,r+c.length);if(!this.#o(R,c,o,0,0))return!1;r+=c.length,i+=c.length}let p=0;if(d.length){if(d.length+r>t.length)return!1;let R=t.length-d.length;if(this.#o(t,d,o,R,0))p=d.length;else{if(t[t.length-1]!==""||r+d.length===t.length||(R--,!this.#o(t,d,o,R,0)))return!1;p=d.length+1}}if(!u.length){let R=!!p;for(let C=r;C<t.length-p;C++){let P=String(t[C]);if(R=!0,P==="."||P===".."||!this.options.dot&&P.startsWith("."))return!1}return o||R}let f=[[[],0]],m=f[0],_=0,h=[0];for(let R of u)R===ce.GLOBSTAR?(h.push(_),m=[[],0],f.push(m)):(m[0].push(R),_++);let E=f.length-1,T=t.length-p;for(let R of f)R[1]=T-(h[E--]+R[0].length);return!!this.#r(t,f,r,0,o,0,!!p)}#r(t,n,o,r,i,s,a){let c=n[r];if(!c){for(let p=o;p<t.length;p++){a=!0;let f=t[p];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1}return a}let[u,d]=c;for(;o<=d;){if(this.#o(t.slice(0,o+u.length),u,i,o,0)&&s<this.maxGlobstarRecursion){let m=this.#r(t,n,o+u.length,r+1,i,s+1,a);if(m!==!1)return m}let f=t[o];if(f==="."||f===".."||!this.options.dot&&f.startsWith("."))return!1;o++}return i||null}#o(t,n,o,r,i){let s,a,c,u;for(s=r,a=i,u=t.length,c=n.length;s<u&&a<c;s++,a++){this.debug("matchOne loop");let d=n[a],p=t[s];if(this.debug(n,d,p),d===!1||d===ce.GLOBSTAR)return!1;let f;if(typeof d=="string"?(f=p===d,this.debug("string match",d,p,f)):(f=d.test(p),this.debug("pattern match",d,p,f)),!f)return!1}if(s===u&&a===c)return!0;if(s===u)return o;if(a===c)return s===u-1&&t[s]==="";throw new Error("wtf?")}braceExpand(){return(0,ce.braceExpand)(this.pattern,this.options)}parse(t){(0,Xy.assertValidPattern)(t);let n=this.options;if(t==="**")return ce.GLOBSTAR;if(t==="")return"";let o,r=null;(o=t.match(wMe))?r=n.dot?kMe:DMe:(o=t.match(IMe))?r=(n.nocase?n.dot?CMe:OMe:n.dot?NMe:bMe)(o[1]):(o=t.match(UMe))?r=(n.nocase?n.dot?BMe:$Me:n.dot?GMe:jMe)(o):(o=t.match(vMe))?r=n.dot?xMe:PMe:(o=t.match(MMe))&&(r=LMe);let i=nee.AST.fromGlob(t,this.options).toMMPattern();return r&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:r}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,o=n.noglobstar?FMe:n.dot?HMe:zMe,r=new Set(n.nocase?["i"]:[]),i=t.map(c=>{let u=c.map(p=>{if(p instanceof RegExp)for(let f of p.flags.split(""))r.add(f);return typeof p=="string"?JMe(p):p===ce.GLOBSTAR?ce.GLOBSTAR:p._src});u.forEach((p,f)=>{let m=u[f+1],_=u[f-1];p!==ce.GLOBSTAR||_===ce.GLOBSTAR||(_===void 0?m!==void 0&&m!==ce.GLOBSTAR?u[f+1]="(?:\\/|"+o+"\\/)?"+m:u[f]=o:m===void 0?u[f-1]=_+"(?:\\/|\\/"+o+")?":m!==ce.GLOBSTAR&&(u[f-1]=_+"(?:\\/|\\/"+o+"\\/)"+m,u[f+1]=ce.GLOBSTAR))});let d=u.filter(p=>p!==ce.GLOBSTAR);if(this.partial&&d.length>=1){let p=[];for(let f=1;f<=d.length;f++)p.push(d.slice(0,f).join("/"));return"(?:"+p.join("|")+")"}return d.join("/")}).join("|"),[s,a]=t.length>1?["(?:",")"]:["",""];i="^"+s+i+a+"$",this.partial&&(i="^(?:\\/|"+s+i.slice(1,-1)+a+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let o=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let i=this.set;this.debug(this.pattern,"set",i);let s=r[r.length-1];if(!s)for(let a=r.length-2;!s&&a>=0;a--)s=r[a];for(let a of i){let c=r;if(o.matchBase&&a.length===1&&(c=[s]),this.matchOne(c,a,n))return o.flipNegate?!0:!this.negate}return o.flipNegate?!1:this.negate}static defaults(t){return ce.minimatch.defaults(t).Minimatch}};ce.Minimatch=ju;var XMe=hw();Object.defineProperty(ce,"AST",{enumerable:!0,get:function(){return XMe.AST}});var QMe=Ew();Object.defineProperty(ce,"escape",{enumerable:!0,get:function(){return QMe.escape}});var eLe=qy();Object.defineProperty(ce,"unescape",{enumerable:!0,get:function(){return eLe.unescape}});ce.minimatch.AST=nee.AST;ce.minimatch.Minimatch=ju;ce.minimatch.escape=AMe.escape;ce.minimatch.unescape=yMe.unescape});var fee=S((yft,Aw)=>{"use strict";l();var aee=require("node:diagnostics_channel"),{context:Qy,trace:Tw,SpanStatusCode:eR,propagation:Sw,diag:tLe}=K(),{getRPCMetadata:nLe,RPCType:rLe}=Xe(),{ATTR_HTTP_ROUTE:tR,ATTR_HTTP_RESPONSE_STATUS_CODE:cee,ATTR_HTTP_REQUEST_METHOD:oLe,ATTR_URL_PATH:iLe}=We(),{InstrumentationBase:sLe}=k7(),{version:aLe,name:uee}=U7(),cLe=">=4.0.0 <6",lee=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],pt={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Da={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},vs="anonymous",ka=Symbol("fastify otel instance"),Ua=Symbol("fastify otel request spans"),fg=Symbol("fastify otel request context"),dee=Symbol("fastify otel addhook original"),pee=Symbol("fastify otel setnotfound original"),mg=Symbol("fastify otel ignore path"),_g=Symbol("fastify otel record exceptions"),nR=class extends sLe{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(uee,aLe,t),this.logger=tLe.createComponentLogger({namespace:uee}),this[mg]=null,this[_g]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[_g]=t.recordExceptions}if(typeof t?.requestHook=="function"&&(this._requestHook=t.requestHook),typeof t?.lifecycleHook=="function"&&(this._lifecycleHook=t.lifecycleHook),t?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=t?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let o=null;this[mg]=r=>typeof n=="function"?n(r):(o==null&&(o=see().minimatch),o(r.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=t=>{this.plugin()(t.fastify,void 0,()=>{});let n=(o,r,i)=>{i()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",t.fastify.register(n)},aee.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(aee.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let t=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:cLe,name:"@fastify/otel"},n;function n(o,r,i){o.decorate(ka,t),o.decorate(dee,o.addHook),o.decorate(pee,o.setNotFoundHandler),o.decorateRequest("opentelemetry",function(){let m=this[fg],_=this[Ua];return{enabled:this.routeOptions.config?.otel!==!1,span:_,tracer:t.tracer,context:m,inject:(h,E)=>Sw.inject(m,h,E),extract:(h,E)=>Sw.extract(m,h,E)}}),o.decorateRequest(Ua,null),o.decorateRequest(fg,null),o.addHook("onRoute",function(m){if(t[mg]?.(m)===!0){t.logger.debug(`Ignoring route instrumentation ${m.method} ${m.url} because it matches the ignore path`);return}if(m.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${m.method} ${m.url} because it is disabled`);return}for(let _ of lee)if(m[_]!=null){let h=m[_];if(typeof h=="function")m[_]=p(h,_,{[pt.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[pt.FASTIFY_TYPE]:Da.ROUTE,[tR]:m.url,[pt.HOOK_CALLBACK_NAME]:h.name?.length>0?h.name:vs});else if(Array.isArray(h)){let E=[];for(let T of h)E.push(p(T,_,{[pt.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[pt.FASTIFY_TYPE]:Da.ROUTE,[tR]:m.url,[pt.HOOK_CALLBACK_NAME]:T.name?.length>0?T.name:vs}));m[_]=E}}m.onSend!=null?m.onSend=Array.isArray(m.onSend)?[...m.onSend,s]:[m.onSend,s]:m.onSend=s,m.onError!=null?m.onError=Array.isArray(m.onError)?[...m.onError,a]:[m.onError,a]:m.onError=a,m.handler=p(m.handler,"handler",{[pt.HOOK_NAME]:`${this.pluginName} - route-handler`,[pt.FASTIFY_TYPE]:Da.HANDLER,[tR]:m.url,[pt.HOOK_CALLBACK_NAME]:m.handler.name.length>0?m.handler.name:vs})}),o.addHook("onRequest",function(m,_,h){if(this[ka].isEnabled()===!1||m.routeOptions.config?.otel===!1)return h();if(this[ka][mg]?.({url:m.url,method:m.method})===!0)return this[ka].logger.debug(`Ignoring request ${m.method} ${m.url} because it matches the ignore path`),h();let E=Qy.active();Tw.getSpan(E)==null&&(E=Sw.extract(E,m.headers));let T=nLe(E);m.routeOptions.url!=null&&T?.type===rLe.HTTP&&(T.route=m.routeOptions.url);let R={[pt.ROOT]:"@fastify/otel",[oLe]:m.method,[iLe]:m.url};m.routeOptions.url!=null&&(R[tR]=m.routeOptions.url);let C=this[ka].tracer.startSpan("request",{attributes:R},E);try{this[ka]._requestHook?.(C,m)}catch(P){this[ka].logger.error({err:P},"requestHook threw")}m[fg]=Tw.setSpan(E,C),m[Ua]=C,Qy.with(m[fg],()=>{h()})}),o.addHook("onResponse",function(m,_,h){let E=m[Ua];E!=null&&(E.setAttributes({[cee]:_.statusCode}),E.end()),m[Ua]=null,h()}),o.addHook=c,o.setNotFoundHandler=u,i();function s(f,m,_,h){let E=f[Ua];E!=null&&(m.statusCode>=500&&E.setStatus({code:eR.ERROR}),E.setAttributes({[cee]:m.statusCode}),E.end()),f[Ua]=null,h(null,_)}function a(f,m,_,h){let E=f[Ua];E!=null&&(E.setStatus({code:eR.ERROR,message:_.message}),t[_g]!==!1&&E.recordException(_)),h()}function c(f,m){let _=this[dee];return lee.includes(f)?_.call(this,f,p(m,f,{[pt.HOOK_NAME]:`${this.pluginName} - ${f}`,[pt.FASTIFY_TYPE]:Da.INSTANCE,[pt.HOOK_CALLBACK_NAME]:m.name?.length>0?m.name:vs})):_.call(this,f,m)}function u(f,m){let _=this[pee];typeof f=="function"?(m=p(f,"notFoundHandler",{[pt.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[pt.FASTIFY_TYPE]:Da.INSTANCE,[pt.HOOK_CALLBACK_NAME]:f.name?.length>0?f.name:vs}),_.call(this,m)):(f.preValidation!=null&&(f.preValidation=p(f.preValidation,"notFoundHandler - preValidation",{[pt.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[pt.FASTIFY_TYPE]:Da.INSTANCE,[pt.HOOK_CALLBACK_NAME]:f.preValidation.name?.length>0?f.preValidation.name:vs})),f.preHandler!=null&&(f.preHandler=p(f.preHandler,"notFoundHandler - preHandler",{[pt.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[pt.FASTIFY_TYPE]:Da.INSTANCE,[pt.HOOK_CALLBACK_NAME]:f.preHandler.name?.length>0?f.preHandler.name:vs})),m=p(m,"notFoundHandler",{[pt.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[pt.FASTIFY_TYPE]:Da.INSTANCE,[pt.HOOK_CALLBACK_NAME]:m.name?.length>0?m.name:vs}),_.call(this,f,m))}function d(f){for(let m of f)if(m?.routeOptions&&m.url&&m.method)return m;return null}function p(f,m,_={}){return function(...E){let T=this[ka],R=d(E);if(R===null)return T.logger.debug(`Ignoring route instrumentation because ${m} was called without a Fastify request argument`),f.call(this,...E);if(T.isEnabled()===!1||R.routeOptions.config?.otel===!1)return T.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it is disabled`),f.call(this,...E);if(T[mg]?.({url:R.url,method:R.method})===!0)return T.logger.debug(`Ignoring route instrumentation ${R.routeOptions.method} ${R.routeOptions.url} because it matches the ignore path`),f.call(this,...E);let C=R[fg]??Qy.active(),P=f.name?.length>0?f.name:this.pluginName??vs,M=T.tracer.startSpan(`${m} - ${P}`,{attributes:_},C);if(T._lifecycleHook!=null)try{T._lifecycleHook(M,{hookName:m,request:R,handler:P})}catch(O){T.logger.error({err:O},"Execution of lifecycleHook failed")}return Qy.with(Tw.setSpan(C,M),function(){try{let O=f.call(this,...E);return typeof O?.then=="function"?O.then(z=>(M.end(),z),z=>(M.setStatus({code:eR.ERROR,message:z.message}),T[_g]!==!1&&M.recordException(z),M.end(),Promise.reject(z))):(M.end(),O)}catch(O){throw M.setStatus({code:eR.ERROR,message:O.message}),T[_g]!==!1&&M.recordException(O),M.end(),O}},this)}}}}};Aw.exports=nR;Aw.exports.FastifyOtelInstrumentation=nR});var bw=S(Yo=>{"use strict";l();Object.defineProperty(Yo,"__esModule",{value:!0});Yo.SpanNames=Yo.TokenKind=Yo.AllowedOperationTypes=void 0;var hLe;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(hLe=Yo.AllowedOperationTypes||(Yo.AllowedOperationTypes={}));var ELe;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(ELe=Yo.TokenKind||(Yo.TokenKind={}));var TLe;(function(e){e.EXECUTE="graphql.execute",e.PARSE="graphql.parse",e.RESOLVE="graphql.resolve",e.VALIDATE="graphql.validate",e.SCHEMA_VALIDATE="graphql.validateSchema",e.SCHEMA_PARSE="graphql.parseSchema"})(TLe=Yo.SpanNames||(Yo.SpanNames={}))});var Nw=S(Tg=>{"use strict";l();Object.defineProperty(Tg,"__esModule",{value:!0});Tg.AttributeNames=void 0;var SLe;(function(e){e.SOURCE="graphql.source",e.FIELD_NAME="graphql.field.name",e.FIELD_PATH="graphql.field.path",e.FIELD_TYPE="graphql.field.type",e.PARENT_NAME="graphql.parent.name",e.OPERATION_TYPE="graphql.operation.type",e.OPERATION_NAME="graphql.operation.name",e.VARIABLES="graphql.variables.",e.ERROR_VALIDATION_NAME="graphql.validation.error"})(SLe=Tg.AttributeNames||(Tg.AttributeNames={}))});var aR=S(lp=>{"use strict";l();Object.defineProperty(lp,"__esModule",{value:!0});lp.OTEL_GRAPHQL_DATA_SYMBOL=lp.OTEL_PATCHED_SYMBOL=void 0;lp.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");lp.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var Nee=S(cR=>{"use strict";l();Object.defineProperty(cR,"__esModule",{value:!0});cR.OPERATION_NOT_SUPPORTED=void 0;var Wft=aR();cR.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var Gee=S(Xt=>{"use strict";l();Object.defineProperty(Xt,"__esModule",{value:!0});Xt.wrapFieldResolver=Xt.wrapFields=Xt.getSourceFromLocation=Xt.getOperation=Xt.endSpan=Xt.addSpanSource=Xt.addInputVariableAttributes=Xt.isPromise=void 0;var dp=K(),$a=bw(),Fu=Nw(),xs=aR(),Oee=Object.values($a.AllowedOperationTypes),ALe=e=>typeof e?.then=="function";Xt.isPromise=ALe;var yLe=e=>typeof e=="object"&&e!==null;function Ow(e,t,n){Array.isArray(n)?n.forEach((o,r)=>{Ow(e,`${t}.${r}`,o)}):n instanceof Object?Object.entries(n).forEach(([o,r])=>{Ow(e,`${t}.${o}`,r)}):e.setAttribute(`${Fu.AttributeNames.VARIABLES}${String(t)}`,n)}function RLe(e,t){Object.entries(t).forEach(([n,o])=>{Ow(e,n,o)})}Xt.addInputVariableAttributes=RLe;function xee(e,t,n,o,r){let i=kee(t,n,o,r);e.setAttribute(Fu.AttributeNames.SOURCE,i)}Xt.addSpanSource=xee;function ILe(e,t,n,o,r){let i=Mee(n,r);if(i)return{field:i,spanAdded:!1};let a=t().flatResolveSpans?wee(n):Lee(n,r);return i={span:bLe(e,t,n,o,r,a)},CLe(n,r,i),{field:i,spanAdded:!0}}function bLe(e,t,n,o,r,i){let s={[Fu.AttributeNames.FIELD_NAME]:o.fieldName,[Fu.AttributeNames.FIELD_PATH]:r.join("."),[Fu.AttributeNames.FIELD_TYPE]:o.returnType.toString(),[Fu.AttributeNames.PARENT_NAME]:o.parentType.name},a=e.startSpan(`${$a.SpanNames.RESOLVE} ${s[Fu.AttributeNames.FIELD_PATH]}`,{attributes:s},i?dp.trace.setSpan(dp.context.active(),i):void 0),c=n[xs.OTEL_GRAPHQL_DATA_SYMBOL].source,u=o.fieldNodes.find(d=>d.kind==="Field");return u&&xee(a,c.loc,t().allowValues,u.loc?.start,u.loc?.end),a}function NLe(e,t){t&&e.recordException(t),e.end()}Xt.endSpan=NLe;function OLe(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>Oee.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>Oee.indexOf(n?.operation)!==-1)}Xt.getOperation=OLe;function CLe(e,t,n){return e[xs.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function Mee(e,t){return e[xs.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function Lee(e,t){for(let n=t.length-1;n>0;n--){let o=Mee(e,t.slice(0,n));if(o)return o.span}return wee(e)}function wee(e){return e[xs.OTEL_GRAPHQL_DATA_SYMBOL].span}function vLe(e,t){let n=[],o=t;for(;o;){let r=o.key;e&&typeof r=="number"&&(r="*"),n.push(String(r)),o=o.prev}return n.reverse()}function PLe(e){return Dee(`
8
+ `,e)}function Cee(e){return Dee(" ",e)}function Dee(e,t){let n="";for(let o=0;o<t;o++)n+=e;return n}var xLe=[$a.TokenKind.FLOAT,$a.TokenKind.STRING,$a.TokenKind.INT,$a.TokenKind.BLOCK_STRING];function kee(e,t=!1,n,o){let r="";if(e?.startToken){let i=typeof n=="number"?n:e.start,s=typeof o=="number"?o:e.end,a=e.startToken.next,c=1;for(;a;){if(a.start<i){a=a.next,c=a?.line;continue}if(a.end>s){a=a.next,c=a?.line;continue}let u=a.value||a.kind,d="";!t&&xLe.indexOf(a.kind)>=0&&(u="*"),a.kind===$a.TokenKind.STRING&&(u=`"${u}"`),a.kind===$a.TokenKind.EOF&&(u=""),a.line>c?(r+=PLe(a.line-c),c=a.line,d=Cee(a.column-1)):a.line===a.prev?.line&&(d=Cee(a.start-(a.prev?.end||0))),r+=d+u,a&&(a=a.next)}}return r}Xt.getSourceFromLocation=kee;function Uee(e,t,n){if(!e||e[xs.OTEL_PATCHED_SYMBOL])return;let o=e.getFields();e[xs.OTEL_PATCHED_SYMBOL]=!0,Object.keys(o).forEach(r=>{let i=o[r];if(i&&(i.resolve&&(i.resolve=Bee(t,n,i.resolve)),i.type)){let s=$ee(i.type);for(let a of s)Uee(a,t,n)}})}Xt.wrapFields=Uee;function $ee(e){return"ofType"in e?$ee(e.ofType):MLe(e)?e.getTypes():LLe(e)?[e]:[]}function MLe(e){return"getTypes"in e&&typeof e.getTypes=="function"}function LLe(e){return"getFields"in e&&typeof e.getFields=="function"}var vee=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:dp.SpanStatusCode.ERROR,message:t.message}),e.end())},Pee=(e,t)=>{t&&e.end()};function Bee(e,t,n,o=!1){if(r[xs.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function r(i,s,a,c){if(!n)return;let u=t();if(u.ignoreTrivialResolveSpans&&o&&(yLe(i)||typeof i=="function")&&typeof i[c.fieldName]!="function")return n.call(this,i,s,a,c);if(!a[xs.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,s,a,c);let d=vLe(u.mergeItems,c&&c.path),p=d.filter(_=>typeof _=="string").length,f,m=!1;if(u.depth>=0&&u.depth<p)f=Lee(a,d);else{let{field:_,spanAdded:h}=ILe(e,t,a,c,d);f=_.span,m=h}return dp.context.with(dp.trace.setSpan(dp.context.active(),f),()=>{try{let _=n.call(this,i,s,a,c);return(0,Xt.isPromise)(_)?_.then(h=>(Pee(f,m),h),h=>{throw vee(f,h,m),h}):(Pee(f,m),_)}catch(_){throw vee(f,_,m),_}})}return r[xs.OTEL_PATCHED_SYMBOL]=!0,r}Xt.wrapFieldResolver=Bee});var jee=S(pp=>{"use strict";l();Object.defineProperty(pp,"__esModule",{value:!0});pp.PACKAGE_NAME=pp.PACKAGE_VERSION=void 0;pp.PACKAGE_VERSION="0.62.0";pp.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var Hee=S(dR=>{"use strict";l();Object.defineProperty(dR,"__esModule",{value:!0});dR.GraphQLInstrumentation=void 0;var Ms=K(),po=Pe(),Sg=bw(),uR=Nw(),Cw=aR(),wLe=Nee(),Un=Gee(),Vee=jee(),Fee={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},lR=[">=14.0.0 <17"],vw=class extends po.InstrumentationBase{constructor(t={}){super(Vee.PACKAGE_NAME,Vee.PACKAGE_VERSION,{...Fee,...t})}setConfig(t={}){super.setConfig({...Fee,...t})}init(){let t=new po.InstrumentationNodeModuleDefinition("graphql",lR);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new po.InstrumentationNodeModuleFile("graphql/execution/execute.js",lR,t=>((0,po.isWrapped)(t.execute)&&this._unwrap(t,"execute"),this._wrap(t,"execute",this._patchExecute(t.defaultFieldResolver)),t),t=>{t&&this._unwrap(t,"execute")})}_addPatchingParser(){return new po.InstrumentationNodeModuleFile("graphql/language/parser.js",lR,t=>((0,po.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new po.InstrumentationNodeModuleFile("graphql/validation/validate.js",lR,t=>((0,po.isWrapped)(t.validate)&&this._unwrap(t,"validate"),this._wrap(t,"validate",this._patchValidate()),t),t=>{t&&this._unwrap(t,"validate")})}_patchExecute(t){let n=this;return function(r){return function(){let s;if(arguments.length>=2){let u=arguments;s=n._wrapExecuteArgs(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],t)}else{let u=arguments[0];s=n._wrapExecuteArgs(u.schema,u.document,u.rootValue,u.contextValue,u.variableValues,u.operationName,u.fieldResolver,u.typeResolver,t)}let a=(0,Un.getOperation)(s.document,s.operationName),c=n._createExecuteSpan(a,s);return s.contextValue[Cw.OTEL_GRAPHQL_DATA_SYMBOL]={source:s.document?s.document||s.document[Cw.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},Ms.context.with(Ms.trace.setSpan(Ms.context.active(),c),()=>(0,po.safeExecuteInTheMiddle)(()=>r.apply(this,[s]),(u,d)=>{n._handleExecutionResult(c,u,d)}))}}}_handleExecutionResult(t,n,o){let r=this.getConfig();if(o===void 0||n){(0,Un.endSpan)(t,n);return}if((0,Un.isPromise)(o))o.then(i=>{if(typeof r.responseHook!="function"){(0,Un.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,Un.endSpan)(t,i)});else{if(typeof r.responseHook!="function"){(0,Un.endSpan)(t);return}this._executeResponseHook(t,o)}}_executeResponseHook(t,n){let{responseHook:o}=this.getConfig();o&&(0,po.safeExecuteInTheMiddle)(()=>{o(t,n)},r=>{r&&this._diag.error("Error running response hook",r),(0,Un.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(o){return function(i,s){return t._parse(this,o,i,s)}}}_patchValidate(){let t=this;return function(o){return function(i,s,a,c,u){return t._validate(this,o,i,s,a,u,c)}}}_parse(t,n,o,r){let i=this.getConfig(),s=this.tracer.startSpan(Sg.SpanNames.PARSE);return Ms.context.with(Ms.trace.setSpan(Ms.context.active(),s),()=>(0,po.safeExecuteInTheMiddle)(()=>n.call(t,o,r),(a,c)=>{c&&((0,Un.getOperation)(c)?c.loc&&(0,Un.addSpanSource)(s,c.loc,i.allowValues):s.updateName(Sg.SpanNames.SCHEMA_PARSE)),(0,Un.endSpan)(s,a)}))}_validate(t,n,o,r,i,s,a){let c=this.tracer.startSpan(Sg.SpanNames.VALIDATE,{});return Ms.context.with(Ms.trace.setSpan(Ms.context.active(),c),()=>(0,po.safeExecuteInTheMiddle)(()=>n.call(t,o,r,i,a,s),(u,d)=>{r.loc||c.updateName(Sg.SpanNames.SCHEMA_VALIDATE),d&&d.length&&c.recordException({name:uR.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(d)}),(0,Un.endSpan)(c,u)}))}_createExecuteSpan(t,n){let o=this.getConfig(),r=this.tracer.startSpan(Sg.SpanNames.EXECUTE,{});if(t){let{operation:i,name:s}=t;r.setAttribute(uR.AttributeNames.OPERATION_TYPE,i);let a=s?.value;a?(r.setAttribute(uR.AttributeNames.OPERATION_NAME,a),r.updateName(`${i} ${a}`)):r.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=wLe.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),r.setAttribute(uR.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,Un.addSpanSource)(r,n.document.loc,o.allowValues),n.variableValues&&o.allowValues&&(0,Un.addInputVariableAttributes)(r,n.variableValues),r}_wrapExecuteArgs(t,n,o,r,i,s,a,c,u){if(r||(r={}),r[Cw.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:o,contextValue:r,variableValues:i,operationName:s,fieldResolver:a,typeResolver:c};let d=a==null,p=a??u;return a=(0,Un.wrapFieldResolver)(this.tracer,()=>this.getConfig(),p,d),t&&((0,Un.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,Un.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:o,contextValue:r,variableValues:i,operationName:s,fieldResolver:a,typeResolver:c}}};dR.GraphQLInstrumentation=vw});var zee=S(pR=>{"use strict";l();Object.defineProperty(pR,"__esModule",{value:!0});pR.GraphQLInstrumentation=void 0;var DLe=Hee();Object.defineProperty(pR,"GraphQLInstrumentation",{enumerable:!0,get:function(){return DLe.GraphQLInstrumentation}})});var Jee=S(fR=>{"use strict";l();Object.defineProperty(fR,"__esModule",{value:!0});fR.EVENT_LISTENERS_SET=void 0;fR.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var Xee=S(mR=>{"use strict";l();Object.defineProperty(mR,"__esModule",{value:!0});mR.bufferTextMapGetter=void 0;mR.bufferTextMapGetter={get(e,t){if(!e)return;let n=Object.keys(e);for(let o of n)if(o===t||o.toLowerCase()===t)return e[o]?.toString()},keys(e){return e?Object.keys(e):[]}}});var Qee=S(ke=>{"use strict";l();Object.defineProperty(ke,"__esModule",{value:!0});ke.METRIC_MESSAGING_PROCESS_DURATION=ke.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=ke.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=ke.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=ke.MESSAGING_SYSTEM_VALUE_KAFKA=ke.MESSAGING_OPERATION_TYPE_VALUE_SEND=ke.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=ke.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=ke.ATTR_MESSAGING_SYSTEM=ke.ATTR_MESSAGING_OPERATION_TYPE=ke.ATTR_MESSAGING_OPERATION_NAME=ke.ATTR_MESSAGING_KAFKA_OFFSET=ke.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=ke.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=ke.ATTR_MESSAGING_DESTINATION_PARTITION_ID=ke.ATTR_MESSAGING_DESTINATION_NAME=ke.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;ke.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";ke.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";ke.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";ke.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";ke.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";ke.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";ke.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";ke.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";ke.ATTR_MESSAGING_SYSTEM="messaging.system";ke.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";ke.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";ke.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";ke.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";ke.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";ke.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";ke.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";ke.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var ete=S(fp=>{"use strict";l();Object.defineProperty(fp,"__esModule",{value:!0});fp.PACKAGE_NAME=fp.PACKAGE_VERSION=void 0;fp.PACKAGE_VERSION="0.23.0";fp.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var ste=S(gR=>{"use strict";l();Object.defineProperty(gR,"__esModule",{value:!0});gR.KafkaJsInstrumentation=void 0;var Qe=K(),fo=Pe(),mp=We(),tte=Jee(),nte=Xee(),de=Qee(),rte=ete();function _R(e,t,n){return o=>{e.add(t,{...n,...o?{[mp.ATTR_ERROR_TYPE]:o}:{}})}}function ote(e,t,n){return o=>{e.record((Date.now()-t)/1e3,{...n,...o?{[mp.ATTR_ERROR_TYPE]:o}:{}})}}var ite=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],xw=class extends fo.InstrumentationBase{constructor(t={}){super(rte.PACKAGE_NAME,rte.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(de.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:ite}}),this._sentMessages=this.meter.createCounter(de.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(de.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(de.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:ite}})}init(){let t=o=>{(0,fo.isWrapped)(o?.Kafka?.prototype.producer)&&this._unwrap(o.Kafka.prototype,"producer"),(0,fo.isWrapped)(o?.Kafka?.prototype.consumer)&&this._unwrap(o.Kafka.prototype,"consumer")};return new fo.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],o=>(t(o),this._wrap(o?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(o?.Kafka?.prototype,"consumer",this._getConsumerPatch()),o),t)}_getConsumerPatch(){let t=this;return n=>function(...r){let i=n.apply(this,r);return(0,fo.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[tte.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[tte.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,o]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[mp.ATTR_SERVER_ADDRESS]:n,[mp.ATTR_SERVER_PORT]:Number.parseInt(o,10)})}_getProducerPatch(){let t=this;return n=>function(...r){let i=n.apply(this,r);return(0,fo.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,fo.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,fo.isWrapped)(i.transaction)&&t._unwrap(i,"transaction"),t._wrap(i,"transaction",t._getProducerTransactionPatch()),t._setKafkaEventListeners(i),i}}_getConsumerRunPatch(){let t=this;return n=>function(...r){let i=r[0];return i?.eachMessage&&((0,fo.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,fo.isWrapped)(i.eachBatch)&&t._unwrap(i,"eachBatch"),t._wrap(i,"eachBatch",t._getConsumerEachBatchPatch())),n.call(this,i)}}_getConsumerEachMessagePatch(){let t=this;return n=>function(...r){let i=r[0],s=Qe.propagation.extract(Qe.ROOT_CONTEXT,i.message.headers,nte.bufferTextMapGetter),a=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:de.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:s,attributes:{[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),c=[ote(t._processDuration,Date.now(),{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"process",[de.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),_R(t._consumedMessages,1,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"process",[de.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],u=Qe.context.with(Qe.trace.setSpan(s,a),()=>n.apply(this,r));return t._endSpansOnPromise([a],c,u)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...r){let i=r[0],s=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:de.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Qe.ROOT_CONTEXT,attributes:{[de.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Qe.context.with(Qe.trace.setSpan(Qe.context.active(),s),()=>{let a=Date.now(),c=[],u=[_R(n._consumedMessages,i.batch.messages.length,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"process",[de.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(p=>{let f=Qe.propagation.extract(Qe.ROOT_CONTEXT,p.headers,nte.bufferTextMapGetter),m=Qe.trace.getSpan(f)?.spanContext(),_;m&&(_={context:m}),c.push(n._startConsumerSpan({topic:i.batch.topic,message:p,operationType:de.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:_,attributes:{[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),u.push(ote(n._processDuration,a,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"process",[de.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let d=t.apply(this,r);return c.unshift(s),n._endSpansOnPromise(c,u,d)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...r){let i=t.tracer.startSpan("transaction"),s=n.apply(this,r);return s.then(a=>{let c=a.send;a.send=function(...m){return Qe.context.with(Qe.trace.setSpan(Qe.context.active(),i),()=>t._getSendPatch()(c).apply(this,m).catch(h=>{throw i.setStatus({code:Qe.SpanStatusCode.ERROR,message:h?.message}),i.recordException(h),h}))};let u=a.sendBatch;a.sendBatch=function(...m){return Qe.context.with(Qe.trace.setSpan(Qe.context.active(),i),()=>t._getSendBatchPatch()(u).apply(this,m).catch(h=>{throw i.setStatus({code:Qe.SpanStatusCode.ERROR,message:h?.message}),i.recordException(h),h}))};let d=a.commit;a.commit=function(...m){let _=d.apply(this,m).then(()=>{i.setStatus({code:Qe.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],_)};let p=a.abort;a.abort=function(...m){let _=p.apply(this,m);return t._endSpansOnPromise([i],[],_)}}).catch(a=>{i.setStatus({code:Qe.SpanStatusCode.ERROR,message:a?.message}),i.recordException(a),i.end()}),s}}_getSendBatchPatch(){let t=this;return n=>function(...r){let s=r[0].topicMessages||[],a=[],c=[];s.forEach(d=>{d.messages.forEach(p=>{a.push(t._startProducerSpan(d.topic,p)),c.push(_R(t._sentMessages,1,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"send",[de.ATTR_MESSAGING_DESTINATION_NAME]:d.topic,...p.partition!==void 0?{[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(p.partition)}:{}}))})});let u=n.apply(this,r);return t._endSpansOnPromise(a,c,u)}}_getSendPatch(){let t=this;return n=>function(...r){let i=r[0],s=i.messages.map(u=>t._startProducerSpan(i.topic,u)),a=i.messages.map(u=>_R(t._sentMessages,1,{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_OPERATION_NAME]:"send",[de.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...u.partition!==void 0?{[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(u.partition)}:{}})),c=n.apply(this,r);return t._endSpansOnPromise(s,a,c)}}_endSpansOnPromise(t,n,o){return Promise.resolve(o).then(r=>(n.forEach(i=>i()),r)).catch(r=>{let i,s=mp.ERROR_TYPE_VALUE_OTHER;throw typeof r=="string"||r===void 0?i=r:typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"message")&&(i=r.message,s=r.constructor.name),n.forEach(a=>a(s)),t.forEach(a=>{a.setAttribute(mp.ATTR_ERROR_TYPE,s),a.setStatus({code:Qe.SpanStatusCode.ERROR,message:i})}),r}).finally(()=>{t.forEach(r=>r.end())})}_startConsumerSpan({topic:t,message:n,operationType:o,ctx:r,link:i,attributes:s}){let a=o===de.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":o,c=this.tracer.startSpan(`${a} ${t}`,{kind:o===de.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Qe.SpanKind.CLIENT:Qe.SpanKind.CONSUMER,attributes:{...s,[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_DESTINATION_NAME]:t,[de.ATTR_MESSAGING_OPERATION_TYPE]:o,[de.ATTR_MESSAGING_OPERATION_NAME]:a,[de.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[de.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[de.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},r),{consumerHook:u}=this.getConfig();return u&&n&&(0,fo.safeExecuteInTheMiddle)(()=>u(c,{topic:t,message:n}),d=>{d&&this._diag.error("consumerHook error",d)},!0),c}_startProducerSpan(t,n){let o=this.tracer.startSpan(`send ${t}`,{kind:Qe.SpanKind.PRODUCER,attributes:{[de.ATTR_MESSAGING_SYSTEM]:de.MESSAGING_SYSTEM_VALUE_KAFKA,[de.ATTR_MESSAGING_DESTINATION_NAME]:t,[de.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[de.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[de.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[de.ATTR_MESSAGING_OPERATION_NAME]:"send",[de.ATTR_MESSAGING_OPERATION_TYPE]:de.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Qe.propagation.inject(Qe.trace.setSpan(Qe.context.active(),o),n.headers);let{producerHook:r}=this.getConfig();return r&&(0,fo.safeExecuteInTheMiddle)(()=>r(o,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),o}};gR.KafkaJsInstrumentation=xw});var ate=S(hR=>{"use strict";l();Object.defineProperty(hR,"__esModule",{value:!0});hR.KafkaJsInstrumentation=void 0;var $Le=ste();Object.defineProperty(hR,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return $Le.KafkaJsInstrumentation}})});var dte=S(_p=>{"use strict";l();Object.defineProperty(_p,"__esModule",{value:!0});_p.PACKAGE_NAME=_p.PACKAGE_VERSION=void 0;_p.PACKAGE_VERSION="0.58.0";_p.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var _te=S(ER=>{"use strict";l();Object.defineProperty(ER,"__esModule",{value:!0});ER.LruMemoizerInstrumentation=void 0;var pte=K(),fte=Pe(),mte=dte(),Lw=class extends fte.InstrumentationBase{constructor(t={}){super(mte.PACKAGE_NAME,mte.PACKAGE_VERSION,t)}init(){return[new fte.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let o=t.apply(this,arguments);return function(){let r=[...arguments],i=r.pop(),s=typeof i=="function"?pte.context.bind(pte.context.active(),i):i;return r.push(s),o.apply(this,r)}};return n.sync=t.sync,n},void 0)]}};ER.LruMemoizerInstrumentation=Lw});var gte=S(TR=>{"use strict";l();Object.defineProperty(TR,"__esModule",{value:!0});TR.LruMemoizerInstrumentation=void 0;var GLe=_te();Object.defineProperty(TR,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return GLe.LruMemoizerInstrumentation}})});var Ste=S(Et=>{"use strict";l();Object.defineProperty(Et,"__esModule",{value:!0});Et.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Et.DB_SYSTEM_VALUE_MONGODB=Et.DB_SYSTEM_NAME_VALUE_MONGODB=Et.ATTR_NET_PEER_PORT=Et.ATTR_NET_PEER_NAME=Et.ATTR_DB_SYSTEM=Et.ATTR_DB_STATEMENT=Et.ATTR_DB_OPERATION=Et.ATTR_DB_NAME=Et.ATTR_DB_MONGODB_COLLECTION=Et.ATTR_DB_CONNECTION_STRING=void 0;Et.ATTR_DB_CONNECTION_STRING="db.connection_string";Et.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Et.ATTR_DB_NAME="db.name";Et.ATTR_DB_OPERATION="db.operation";Et.ATTR_DB_STATEMENT="db.statement";Et.ATTR_DB_SYSTEM="db.system";Et.ATTR_NET_PEER_NAME="net.peer.name";Et.ATTR_NET_PEER_PORT="net.peer.port";Et.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Et.DB_SYSTEM_VALUE_MONGODB="mongodb";Et.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var Ate=S(Ag=>{"use strict";l();Object.defineProperty(Ag,"__esModule",{value:!0});Ag.MongodbCommandType=void 0;var VLe;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(VLe=Ag.MongodbCommandType||(Ag.MongodbCommandType={}))});var yte=S(gp=>{"use strict";l();Object.defineProperty(gp,"__esModule",{value:!0});gp.PACKAGE_NAME=gp.PACKAGE_VERSION=void 0;gp.PACKAGE_VERSION="0.67.0";gp.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var bte=S(SR=>{"use strict";l();Object.defineProperty(SR,"__esModule",{value:!0});SR.MongoDBInstrumentation=void 0;var At=K(),Ue=Pe(),Ls=We(),jr=Ste(),Hu=Ate(),Rte=yte(),Ite={requireParentSpan:!0},Dw=class e extends Ue.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(Rte.PACKAGE_NAME,Rte.PACKAGE_VERSION,{...Ite,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ue.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ue.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...Ite,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(jr.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,o){this._connectionsUsage?.add(t,{"pool.name":n,state:o})}init(){let{v3PatchConnection:t,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:o,v4UnpatchConnect:r}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:i,v4PatchConnectionPromise:s,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:u}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:d,v4UnpatchSessions:p}=this._getV4SessionsPatches();return[new Ue.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new Ue.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new Ue.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new Ue.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,a),new Ue.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],s,a),new Ue.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,u),new Ue.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],o,r),new Ue.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],d,p)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,Ue.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,Ue.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,Ue.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,Ue.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,Ue.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,Ue.isWrapped)(t.getMore)&&this._unwrap(t,"getMore"),this._wrap(t,"getMore",this._getV3PatchCursor()),t),v3UnpatchConnection:t=>{t!==void 0&&(this._unwrap(t,"insert"),this._unwrap(t,"remove"),this._unwrap(t,"update"),this._unwrap(t,"command"),this._unwrap(t,"query"),this._unwrap(t,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:t=>((0,Ue.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,Ue.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,Ue.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,Ue.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let r=this.sessions.length,i=n.call(this),s=this.sessions.length;return r===s?t._connCountAdd(1,t._poolName,"used"):r-1===s&&(t._connCountAdd(-1,t._poolName,"idle"),t._connCountAdd(1,t._poolName,"used")),i}}_getV4ReleaseCommand(){let t=this;return n=>function(r){let i=n.call(this,r);return t._connCountAdd(-1,t._poolName,"used"),t._connCountAdd(1,t._poolName,"idle"),i}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:t=>{let n=t.ConnectionPool.prototype;return(0,Ue.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),t},v4UnpatchConnectionPool:t=>{t!==void 0&&this._unwrap(t.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:t=>((0,Ue.isWrapped)(t.connect)&&this._unwrap(t,"connect"),this._wrap(t,"connect",this._getV4ConnectCommand()),t),v4UnpatchConnect:t=>{t!==void 0&&this._unwrap(t,"connect")}}}_getV4ConnectionPoolCheckOut(){return t=>function(o){let r=At.context.bind(At.context.active(),o);return t.call(this,r)}}_getV4ConnectCommand(){let t=this;return n=>function(r,i){if(n.length===1){let a=n.call(this,r);return a&&typeof a.then=="function"&&a.then(()=>t.setPoolName(r),()=>{}),a}let s=function(a,c){if(a||!c){i(a,c);return}t.setPoolName(r),i(a,c)};return n.call(this,r,s)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,Ue.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,Ue.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandPromise()),t),v4UnpatchConnection:t=>{t!==void 0&&this._unwrap(t.Connection.prototype,"command")}}}_getV3PatchOperation(t){let n=this;return o=>function(i,s,a,c,u){let d=At.trace.getSpan(At.context.active()),p=n._checkSkipInstrumentation(d),f=typeof c=="function"?c:u;if(p||typeof f!="function"||typeof a!="object")return typeof c=="function"?o.call(this,i,s,a,c):o.call(this,i,s,a,c,u);let m=n._getV3SpanAttributes(s,i,a[0],t),_=n._spanNameFromAttrs(m),h=n.tracer.startSpan(_,{kind:At.SpanKind.CLIENT,attributes:m}),E=n._patchEnd(h,f);return typeof c=="function"?o.call(this,i,s,a,E):o.call(this,i,s,a,c,E)}}_getV3PatchCommand(){let t=this;return n=>function(r,i,s,a,c){let u=At.trace.getSpan(At.context.active()),d=t._checkSkipInstrumentation(u),p=typeof a=="function"?a:c;if(d||typeof p!="function"||typeof s!="object")return typeof a=="function"?n.call(this,r,i,s,a):n.call(this,r,i,s,a,c);let f=e._getCommandType(s),m=f===Hu.MongodbCommandType.UNKNOWN?void 0:f,_=t._getV3SpanAttributes(i,r,s,m),h=t._spanNameFromAttrs(_),E=t.tracer.startSpan(h,{kind:At.SpanKind.CLIENT,attributes:_}),T=t._patchEnd(E,p);return typeof a=="function"?n.call(this,r,i,s,T):n.call(this,r,i,s,a,T)}}_getV4PatchCommandCallback(){let t=this;return n=>function(r,i,s,a){let c=At.trace.getSpan(At.context.active()),u=t._checkSkipInstrumentation(c),d=a,p=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,r,i,s,a);let f;if(!u){let _=t._getV4SpanAttributes(this,r,i,p),h=t._spanNameFromAttrs(_);f=t.tracer.startSpan(h,{kind:At.SpanKind.CLIENT,attributes:_})}let m=t._patchEnd(f,d,this.id,p);return n.call(this,r,i,s,m)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...r){let[i,s]=r,a=At.trace.getSpan(At.context.active()),c=t._checkSkipInstrumentation(a),u=Object.keys(s)[0],d=()=>{};if(typeof s!="object"||s.ismaster||s.hello)return n.apply(this,r);let p;if(!c){let _=t._getV4SpanAttributes(this,i,s,u),h=t._spanNameFromAttrs(_);p=t.tracer.startSpan(h,{kind:At.SpanKind.CLIENT,attributes:_})}let f=t._patchEnd(p,d,this.id,u),m=n.apply(this,r);return m.then(_=>f(null,_),_=>f(_)),m}}_getV3PatchFind(){let t=this;return n=>function(r,i,s,a,c,u){let d=At.trace.getSpan(At.context.active()),p=t._checkSkipInstrumentation(d),f=typeof c=="function"?c:u;if(p||typeof f!="function"||typeof s!="object")return typeof c=="function"?n.call(this,r,i,s,a,c):n.call(this,r,i,s,a,c,u);let m=t._getV3SpanAttributes(i,r,s,"find"),_=t._spanNameFromAttrs(m),h=t.tracer.startSpan(_,{kind:At.SpanKind.CLIENT,attributes:m}),E=t._patchEnd(h,f);return typeof c=="function"?n.call(this,r,i,s,a,E):n.call(this,r,i,s,a,c,E)}}_getV3PatchCursor(){let t=this;return n=>function(r,i,s,a,c,u){let d=At.trace.getSpan(At.context.active()),p=t._checkSkipInstrumentation(d),f=typeof c=="function"?c:u;if(p||typeof f!="function")return typeof c=="function"?n.call(this,r,i,s,a,c):n.call(this,r,i,s,a,c,u);let m=t._getV3SpanAttributes(i,r,s.cmd,"getMore"),_=t._spanNameFromAttrs(m),h=t.tracer.startSpan(_,{kind:At.SpanKind.CLIENT,attributes:m}),E=t._patchEnd(h,f);return typeof c=="function"?n.call(this,r,i,s,a,E):n.call(this,r,i,s,a,c,E)}}static _getCommandType(t){return t.createIndexes!==void 0?Hu.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?Hu.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?Hu.MongodbCommandType.IS_MASTER:t.count!==void 0?Hu.MongodbCommandType.COUNT:t.aggregate!==void 0?Hu.MongodbCommandType.AGGREGATE:Hu.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,o,r){let i,s;if(t){let c=typeof t.address=="string"?t.address.split(":"):"";c.length===2&&(i=c[0],s=c[1])}let a;return o?.documents&&o.documents[0]?a=o.documents[0]:o?.cursors?a=o.cursors:a=o,this._getSpanAttributes(n.db,n.collection,i,s,a,r)}_getV3SpanAttributes(t,n,o,r){let i,s;if(n&&n.s&&(i=n.s.options?.host??n.s.host,s=(n.s.options?.port??n.s.port)?.toString(),i==null||s==null)){let d=n.description?.address;if(d){let p=d.split(":");i=p[0],s=p[1]}}let[a,c]=t.toString().split("."),u=o?.query??o?.q??o;return this._getSpanAttributes(a,c,i,s,u,r)}_getSpanAttributes(t,n,o,r,i,s){let a={};if(this._dbSemconvStability&Ue.SemconvStability.OLD&&(a[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_MONGODB,a[jr.ATTR_DB_NAME]=t,a[jr.ATTR_DB_MONGODB_COLLECTION]=n,a[jr.ATTR_DB_OPERATION]=s,a[jr.ATTR_DB_CONNECTION_STRING]=`mongodb://${o}:${r}/${t}`),this._dbSemconvStability&Ue.SemconvStability.STABLE&&(a[Ls.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_MONGODB,a[Ls.ATTR_DB_NAMESPACE]=t,a[Ls.ATTR_DB_OPERATION_NAME]=s,a[Ls.ATTR_DB_COLLECTION_NAME]=n),o&&r){this._netSemconvStability&Ue.SemconvStability.OLD&&(a[jr.ATTR_NET_PEER_NAME]=o),this._netSemconvStability&Ue.SemconvStability.STABLE&&(a[Ls.ATTR_SERVER_ADDRESS]=o);let c=parseInt(r,10);isNaN(c)||(this._netSemconvStability&Ue.SemconvStability.OLD&&(a[jr.ATTR_NET_PEER_PORT]=c),this._netSemconvStability&Ue.SemconvStability.STABLE&&(a[Ls.ATTR_SERVER_PORT]=c))}if(i){let{dbStatementSerializer:c}=this.getConfig(),u=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,Ue.safeExecuteInTheMiddle)(()=>{let d=u(i);this._dbSemconvStability&Ue.SemconvStability.OLD&&(a[jr.ATTR_DB_STATEMENT]=d),this._dbSemconvStability&Ue.SemconvStability.STABLE&&(a[Ls.ATTR_DB_QUERY_TEXT]=d)},d=>{d&&this._diag.error("Error running dbStatementSerializer hook",d)},!0)}return a}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&Ue.SemconvStability.STABLE?n=[t[Ls.ATTR_DB_OPERATION_NAME],t[Ls.ATTR_DB_COLLECTION_NAME]].filter(o=>o).join(" ")||jr.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[jr.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let t=new WeakSet;return(n,o)=>typeof o!="object"||!o?"?":t.has(o)?"[Circular]":(t.add(o),o)}_defaultDbStatementSerializer(t){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(t):JSON.stringify(t,this._getDefaultDbStatementReplacer())}_handleExecutionResult(t,n){let{responseHook:o}=this.getConfig();typeof o=="function"&&(0,Ue.safeExecuteInTheMiddle)(()=>{o(t,{data:n})},r=>{r&&this._diag.error("Error running response hook",r)},!0)}_patchEnd(t,n,o,r){let i=At.context.active(),s=this,a=!1;return function(...u){if(!a){a=!0;let d=u[0];if(t){if(d instanceof Error)t.setStatus({code:At.SpanStatusCode.ERROR,message:d.message});else{let p=u[1];s._handleExecutionResult(t,p)}t.end()}r==="endSessions"&&s._connCountAdd(-1,s._poolName,"idle")}return At.context.with(i,()=>n.apply(this,u))}}setPoolName(t){let n=t.hostAddress?.host,o=t.hostAddress?.port,r=t.dbName,i=`mongodb://${n}:${o}/${r}`;this._poolName=i}_checkSkipInstrumentation(t){return this.getConfig().requireParentSpan===!0&&t===void 0}};SR.MongoDBInstrumentation=Dw});var Nte=S(yg=>{"use strict";l();Object.defineProperty(yg,"__esModule",{value:!0});yg.MongodbCommandType=void 0;var FLe;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(FLe=yg.MongodbCommandType||(yg.MongodbCommandType={}))});var Ote=S(hp=>{"use strict";l();Object.defineProperty(hp,"__esModule",{value:!0});hp.MongodbCommandType=hp.MongoDBInstrumentation=void 0;var HLe=bte();Object.defineProperty(hp,"MongoDBInstrumentation",{enumerable:!0,get:function(){return HLe.MongoDBInstrumentation}});var zLe=Nte();Object.defineProperty(hp,"MongodbCommandType",{enumerable:!0,get:function(){return zLe.MongodbCommandType}})});var $w=S(Ft=>{"use strict";l();Object.defineProperty(Ft,"__esModule",{value:!0});Ft.DB_SYSTEM_NAME_VALUE_MONGODB=Ft.ATTR_NET_PEER_PORT=Ft.ATTR_NET_PEER_NAME=Ft.ATTR_DB_USER=Ft.ATTR_DB_SYSTEM=Ft.ATTR_DB_STATEMENT=Ft.ATTR_DB_OPERATION=Ft.ATTR_DB_NAME=Ft.ATTR_DB_MONGODB_COLLECTION=void 0;Ft.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Ft.ATTR_DB_NAME="db.name";Ft.ATTR_DB_OPERATION="db.operation";Ft.ATTR_DB_STATEMENT="db.statement";Ft.ATTR_DB_SYSTEM="db.system";Ft.ATTR_DB_USER="db.user";Ft.ATTR_NET_PEER_NAME="net.peer.name";Ft.ATTR_NET_PEER_PORT="net.peer.port";Ft.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var Lte=S(Ba=>{"use strict";l();Object.defineProperty(Ba,"__esModule",{value:!0});Ba.handleCallbackResponse=Ba.handlePromiseResponse=Ba.getAttributesFromCollection=void 0;var xte=K(),Ig=Pe(),Rg=$w(),AR=We();function JLe(e,t,n){let o={};return t&Ig.SemconvStability.OLD&&(o[Rg.ATTR_DB_MONGODB_COLLECTION]=e.name,o[Rg.ATTR_DB_NAME]=e.conn.name,o[Rg.ATTR_DB_USER]=e.conn.user),t&Ig.SemconvStability.STABLE&&(o[AR.ATTR_DB_COLLECTION_NAME]=e.name,o[AR.ATTR_DB_NAMESPACE]=e.conn.name),n&Ig.SemconvStability.OLD&&(o[Rg.ATTR_NET_PEER_NAME]=e.conn.host,o[Rg.ATTR_NET_PEER_PORT]=e.conn.port),n&Ig.SemconvStability.STABLE&&(o[AR.ATTR_SERVER_ADDRESS]=e.conn.host,o[AR.ATTR_SERVER_PORT]=e.conn.port),o}Ba.getAttributesFromCollection=JLe;function Mte(e,t={}){e.recordException(t),e.setStatus({code:xte.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
9
+ Mongoose Error Code: ${t.code}`:""}`})}function Bw(e,t,n,o=void 0){n&&(0,Ig.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:o,response:t}),r=>{r&&xte.diag.error("mongoose instrumentation: responseHook error",r)},!0)}function XLe(e,t,n,o=void 0){return e instanceof Promise?e.then(r=>(Bw(t,r,n,o),r)).catch(r=>{throw Mte(t,r),r}).finally(()=>t.end()):(Bw(t,e,n,o),t.end(),e)}Ba.handlePromiseResponse=XLe;function QLe(e,t,n,o,r,i,s=void 0){let a=0;return r.length===2?a=1:r.length===3&&(a=2),r[a]=(c,u)=>(c?Mte(o,c):Bw(o,u,i,s),o.end(),e(c,u)),t.apply(n,r)}Ba.handleCallbackResponse=QLe});var wte=S(Ep=>{"use strict";l();Object.defineProperty(Ep,"__esModule",{value:!0});Ep.PACKAGE_NAME=Ep.PACKAGE_VERSION=void 0;Ep.PACKAGE_VERSION="0.60.0";Ep.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var Bte=S(Ar=>{"use strict";l();Object.defineProperty(Ar,"__esModule",{value:!0});Ar.MongooseInstrumentation=Ar._ALREADY_INSTRUMENTED=Ar._STORED_PARENT_SPAN=void 0;var Qt=K(),ewe=Xe(),Gw=Lte(),An=Pe(),Dte=wte(),Ga=$w(),zu=We(),yR=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],twe=["remove","count","findOneAndRemove",...yR],nwe=["count","findOneAndRemove",...yR],rwe=[...yR];function kte(e){return e?e.startsWith("6.")||e.startsWith("5.")?twe:e.startsWith("7.")?nwe:rwe:yR}function Ute(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function $te(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Ar._STORED_PARENT_SPAN=Symbol("stored-parent-span");Ar._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var jw=class extends An.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(Dte.PACKAGE_NAME,Dte.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,An.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,An.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new An.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let o=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(o.Model.prototype,"save",this.patchOnModelMethods("save",n)),o.Model.prototype.$save=o.Model.prototype.save,Ute(n)&&this._wrap(o.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),$te(n)&&(this._wrap(o.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(o.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(o.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(o.Aggregate.prototype,"exec",this.patchAggregateExec(n)),kte(n).forEach(i=>{this._wrap(o.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(o.Model,"aggregate",this.patchModelAggregate()),this._wrap(o.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(o.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),o}unpatch(t,n){let o=t[Symbol.toStringTag]==="Module"?t.default:t,r=kte(n);this._unwrap(o.Model.prototype,"save"),o.Model.prototype.$save=o.Model.prototype.save,Ute(n)&&this._unwrap(o.Model.prototype,"remove"),$te(n)&&(this._unwrap(o.Model.prototype,"updateOne"),this._unwrap(o.Model.prototype,"deleteOne")),this._unwrap(o.Query.prototype,"exec"),this._unwrap(o.Aggregate.prototype,"exec"),r.forEach(i=>{this._unwrap(o.Query.prototype,i)}),this._unwrap(o.Model,"aggregate"),this._unwrap(o.Model,"insertMany"),this._unwrap(o.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return o=>function(i){if(n.getConfig().requireParentSpan&&Qt.trace.getSpan(Qt.context.active())===void 0)return o.apply(this,arguments);let s=this[Ar._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let d=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&An.SemconvStability.OLD&&(a[Ga.ATTR_DB_STATEMENT]=d),n._dbSemconvStability&An.SemconvStability.STABLE&&(a[zu.ATTR_DB_QUERY_TEXT]=d)}let u=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,s);return n._handleResponse(u,o,this,arguments,i,t)}}patchQueryExec(t){let n=this;return o=>function(i){if(this[Ar._ALREADY_INSTRUMENTED])return o.apply(this,arguments);if(n.getConfig().requireParentSpan&&Qt.trace.getSpan(Qt.context.active())===void 0)return o.apply(this,arguments);let s=this[Ar._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let d=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&An.SemconvStability.OLD&&(a[Ga.ATTR_DB_STATEMENT]=d),n._dbSemconvStability&An.SemconvStability.STABLE&&(a[zu.ATTR_DB_QUERY_TEXT]=d)}let u=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,s);return n._handleResponse(u,o,this,arguments,i,t)}}patchOnModelMethods(t,n){let o=this;return r=>function(s,a){if(o.getConfig().requireParentSpan&&Qt.trace.getSpan(Qt.context.active())===void 0)return r.apply(this,arguments);let c={document:this};s&&!(s instanceof Function)&&(c.options=s);let u={},{dbStatementSerializer:d}=o.getConfig();if(d){let f=d(t,c);o._dbSemconvStability&An.SemconvStability.OLD&&(u[Ga.ATTR_DB_STATEMENT]=f),o._dbSemconvStability&An.SemconvStability.STABLE&&(u[zu.ATTR_DB_QUERY_TEXT]=f)}let p=o._startSpan(this.constructor.collection,this.constructor.modelName,t,u);return s instanceof Function&&(a=s,s=void 0),o._handleResponse(p,r,this,arguments,a,n)}}_patchDocumentUpdateMethods(t,n){let o=this;return r=>function(s,a,c){if(o.getConfig().requireParentSpan&&Qt.trace.getSpan(Qt.context.active())===void 0)return r.apply(this,arguments);let u=c,d=s,p=a;typeof s=="function"?(u=s,d=void 0,p=void 0):typeof a=="function"&&(u=a,p=void 0);let f={},m=o.getConfig().dbStatementSerializer;if(m){let E=m(t,{condition:{_id:this._id},updates:d,options:p});o._dbSemconvStability&An.SemconvStability.OLD&&(f[Ga.ATTR_DB_STATEMENT]=E),o._dbSemconvStability&An.SemconvStability.STABLE&&(f[zu.ATTR_DB_QUERY_TEXT]=E)}let _=o._startSpan(this.constructor.collection,this.constructor.modelName,t,f),h=o._handleResponse(_,r,this,arguments,u,n);return h&&typeof h=="object"&&(h[Ar._ALREADY_INSTRUMENTED]=!0),h}}patchModelStatic(t,n){let o=this;return r=>function(s,a,c){if(o.getConfig().requireParentSpan&&Qt.trace.getSpan(Qt.context.active())===void 0)return r.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let u={};switch(t){case"insertMany":u.documents=s;break;case"bulkWrite":u.operations=s;break;default:u.document=s;break}a!==void 0&&(u.options=a);let d={},{dbStatementSerializer:p}=o.getConfig();if(p){let m=p(t,u);o._dbSemconvStability&An.SemconvStability.OLD&&(d[Ga.ATTR_DB_STATEMENT]=m),o._dbSemconvStability&An.SemconvStability.STABLE&&(d[zu.ATTR_DB_QUERY_TEXT]=m)}let f=o._startSpan(this.collection,this.modelName,t,d);return o._handleResponse(f,r,this,arguments,c,n)}}patchModelAggregate(){let t=this;return n=>function(){let r=Qt.trace.getSpan(Qt.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Ar._STORED_PARENT_SPAN]=r),i}}patchAndCaptureSpanContext(t){let n=this;return o=>function(){return this[Ar._STORED_PARENT_SPAN]=Qt.trace.getSpan(Qt.context.active()),n._callOriginalFunction(()=>o.apply(this,arguments))}}_startSpan(t,n,o,r,i){let s={...r,...(0,Gw.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&An.SemconvStability.OLD&&(s[Ga.ATTR_DB_OPERATION]=o,s[Ga.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&An.SemconvStability.STABLE&&(s[zu.ATTR_DB_OPERATION_NAME]=o,s[zu.ATTR_DB_SYSTEM_NAME]=Ga.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&An.SemconvStability.STABLE?`${o} ${t.name}`:`mongoose.${n}.${o}`;return this.tracer.startSpan(a,{kind:Qt.SpanKind.CLIENT,attributes:s},i?Qt.trace.setSpan(Qt.context.active(),i):void 0)}_handleResponse(t,n,o,r,i,s=void 0){let a=this;if(i instanceof Function)return a._callOriginalFunction(()=>(0,Gw.handleCallbackResponse)(i,n,o,t,r,a.getConfig().responseHook,s));{let c=a._callOriginalFunction(()=>n.apply(o,r));return(0,Gw.handlePromiseResponse)(c,t,a.getConfig().responseHook,s)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Qt.context.with((0,ewe.suppressTracing)(Qt.context.active()),t):t()}};Ar.MongooseInstrumentation=jw});var Gte=S(RR=>{"use strict";l();Object.defineProperty(RR,"__esModule",{value:!0});RR.MongooseInstrumentation=void 0;var owe=Bte();Object.defineProperty(RR,"MongooseInstrumentation",{enumerable:!0,get:function(){return owe.MongooseInstrumentation}})});var Hte=S(Ht=>{"use strict";l();Object.defineProperty(Ht,"__esModule",{value:!0});Ht.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Ht.DB_SYSTEM_VALUE_MYSQL=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_NAME=Ht.ATTR_DB_CONNECTION_STRING=void 0;Ht.ATTR_DB_CONNECTION_STRING="db.connection_string";Ht.ATTR_DB_NAME="db.name";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_VALUE_MYSQL="mysql";Ht.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var zte=S(bg=>{"use strict";l();Object.defineProperty(bg,"__esModule",{value:!0});bg.AttributeNames=void 0;var swe;(function(e){e.MYSQL_VALUES="db.mysql.values"})(swe=bg.AttributeNames||(bg.AttributeNames={}))});var qte=S($n=>{"use strict";l();Object.defineProperty($n,"__esModule",{value:!0});$n.getPoolNameOld=$n.arrayStringifyHelper=$n.getSpanName=$n.getDbValues=$n.getDbQueryText=$n.getJDBCString=$n.getConfig=void 0;function awe(e){let{host:t,port:n,database:o,user:r}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:o,user:r}}$n.getConfig=awe;function cwe(e,t,n){let o=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(o+=`:${t}`),typeof n=="string"&&(o+=`/${n}`),o}$n.getJDBCString=cwe;function uwe(e){return typeof e=="string"?e:e.sql}$n.getDbQueryText=uwe;function lwe(e,t){return Fw(typeof e=="string"?t:t||e.values)}$n.getDbValues=lwe;function dwe(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}$n.getSpanName=dwe;function Fw(e){return e?`[${e.toString()}]`:""}$n.arrayStringifyHelper=Fw;function pwe(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}$n.getPoolNameOld=pwe});var Yte=S(Tp=>{"use strict";l();Object.defineProperty(Tp,"__esModule",{value:!0});Tp.PACKAGE_NAME=Tp.PACKAGE_VERSION=void 0;Tp.PACKAGE_VERSION="0.60.0";Tp.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var Kte=S(IR=>{"use strict";l();Object.defineProperty(IR,"__esModule",{value:!0});IR.MySQLInstrumentation=void 0;var yr=K(),mo=Pe(),Sp=We(),ws=Hte(),fwe=zte(),qu=qte(),Wte=Yte(),Hw=class extends mo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(Wte.PACKAGE_NAME,Wte.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,mo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,mo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(ws.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,o){this._connectionsUsageOld?.add(t,{state:o,name:n})}init(){return[new mo.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,mo.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,mo.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,mo.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(r){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(r){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let o=this;return function(i){let s=t._allConnections.length,a=t._freeConnections.length,c=s-a,u=(0,qu.getPoolNameOld)(t);o._connCountAdd(-c,u,"used"),o._connCountAdd(-a,u,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(r){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let o=this;return function(i,s){if(!o._enabled)return o._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let a=t._nodes;if(a){let c=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),u=a[c].pool;o._setPoolCallbacks(u,i)}}}}_patchGetConnection(t){return n=>{let o=this;return function(i,s,a){if(!o._enabled)return o._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let c=o._getConnectionCallbackPatchFn(i);return n.call(t,c)}if(arguments.length===2&&typeof s=="function"){let c=o._getConnectionCallbackPatchFn(s);return n.call(t,i,c)}if(arguments.length===3&&typeof a=="function"){let c=o._getConnectionCallbackPatchFn(a);return n.call(t,i,s,c)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,o=yr.context.active();return function(r,i){i&&((0,mo.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&yr.context.with(o,t,this,r,i)}}_patchQuery(t){return n=>{let o=this;return function(r,i,s){if(!o._enabled)return o._unwrap(t,"query"),n.apply(t,arguments);let a={},{host:c,port:u,database:d,user:p}=(0,qu.getConfig)(t.config),f=parseInt(u,10),m=(0,qu.getDbQueryText)(r);o._dbSemconvStability&mo.SemconvStability.OLD&&(a[ws.ATTR_DB_SYSTEM]=ws.DB_SYSTEM_VALUE_MYSQL,a[ws.ATTR_DB_CONNECTION_STRING]=(0,qu.getJDBCString)(c,u,d),a[ws.ATTR_DB_NAME]=d,a[ws.ATTR_DB_USER]=p,a[ws.ATTR_DB_STATEMENT]=m),o._dbSemconvStability&mo.SemconvStability.STABLE&&(a[Sp.ATTR_DB_SYSTEM_NAME]=Sp.DB_SYSTEM_NAME_VALUE_MYSQL,a[Sp.ATTR_DB_NAMESPACE]=d,a[Sp.ATTR_DB_QUERY_TEXT]=m),o._netSemconvStability&mo.SemconvStability.OLD&&(a[ws.ATTR_NET_PEER_NAME]=c,isNaN(f)||(a[ws.ATTR_NET_PEER_PORT]=f)),o._netSemconvStability&mo.SemconvStability.STABLE&&(a[Sp.ATTR_SERVER_ADDRESS]=c,isNaN(f)||(a[Sp.ATTR_SERVER_PORT]=f));let _=o.tracer.startSpan((0,qu.getSpanName)(r),{kind:yr.SpanKind.CLIENT,attributes:a});if(o.getConfig().enhancedDatabaseReporting){let T;Array.isArray(i)?T=i:arguments[2]&&(T=[i]),_.setAttribute(fwe.AttributeNames.MYSQL_VALUES,(0,qu.getDbValues)(r,T))}let h=Array.from(arguments).findIndex(T=>typeof T=="function"),E=yr.context.active();if(h===-1){let T=yr.context.with(yr.trace.setSpan(yr.context.active(),_),()=>n.apply(t,arguments));return yr.context.bind(E,T),T.on("error",R=>_.setStatus({code:yr.SpanStatusCode.ERROR,message:R.message})).on("end",()=>{_.end()})}else return o._wrap(arguments,h,o._patchCallbackQuery(_,E)),yr.context.with(yr.trace.setSpan(yr.context.active(),_),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return o=>function(r,i,s){return r&&t.setStatus({code:yr.SpanStatusCode.ERROR,message:r.message}),t.end(),yr.context.with(n,()=>o(...arguments))}}_setPoolCallbacks(t,n){let o=n||(0,qu.getPoolNameOld)(t);t.on("connection",r=>{this._connCountAdd(1,o,"idle")}),t.on("acquire",r=>{this._connCountAdd(-1,o,"idle"),this._connCountAdd(1,o,"used")}),t.on("release",r=>{this._connCountAdd(1,o,"idle"),this._connCountAdd(-1,o,"used")})}};IR.MySQLInstrumentation=Hw});var Zte=S(bR=>{"use strict";l();Object.defineProperty(bR,"__esModule",{value:!0});bR.MySQLInstrumentation=void 0;var mwe=Kte();Object.defineProperty(bR,"MySQLInstrumentation",{enumerable:!0,get:function(){return mwe.MySQLInstrumentation}})});var qw=S(sn=>{"use strict";l();Object.defineProperty(sn,"__esModule",{value:!0});sn.DB_SYSTEM_VALUE_MYSQL=sn.ATTR_NET_PEER_PORT=sn.ATTR_NET_PEER_NAME=sn.ATTR_DB_USER=sn.ATTR_DB_SYSTEM=sn.ATTR_DB_STATEMENT=sn.ATTR_DB_NAME=sn.ATTR_DB_CONNECTION_STRING=void 0;sn.ATTR_DB_CONNECTION_STRING="db.connection_string";sn.ATTR_DB_NAME="db.name";sn.ATTR_DB_STATEMENT="db.statement";sn.ATTR_DB_SYSTEM="db.system";sn.ATTR_DB_USER="db.user";sn.ATTR_NET_PEER_NAME="net.peer.name";sn.ATTR_NET_PEER_PORT="net.peer.port";sn.DB_SYSTEM_VALUE_MYSQL="mysql"});var Ww=S(NR=>{"use strict";l();Object.defineProperty(NR,"__esModule",{value:!0});NR.addSqlCommenterComment=void 0;var Yw=K(),gwe=Xe();function hwe(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let o=e.indexOf("*/");return t<o}function Ewe(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function Twe(e,t){if(typeof t!="string"||t.length===0||hwe(t))return t;let n=new gwe.W3CTraceContextPropagator,o={};n.inject(Yw.trace.setSpan(Yw.ROOT_CONTEXT,e),o,Yw.defaultTextMapSetter);let r=Object.keys(o).sort();if(r.length===0)return t;let i=r.map(s=>{let a=Ewe(o[s]);return`${s}='${a}'`}).join(",");return`${t} /*${i}*/`}NR.addSqlCommenterComment=Twe});var ene=S(_o=>{"use strict";l();Object.defineProperty(_o,"__esModule",{value:!0});_o.getConnectionPrototypeToInstrument=_o.once=_o.getSpanName=_o.getQueryText=_o.getConnectionAttributes=void 0;var Ng=qw(),OR=Pe(),Kw=We();function Swe(e,t,n){let{host:o,port:r,database:i,user:s}=Awe(e),a={};t&OR.SemconvStability.OLD&&(a[Ng.ATTR_DB_CONNECTION_STRING]=ywe(o,r,i),a[Ng.ATTR_DB_NAME]=i,a[Ng.ATTR_DB_USER]=s),t&OR.SemconvStability.STABLE&&(a[Kw.ATTR_DB_NAMESPACE]=i);let c=parseInt(r,10);return n&OR.SemconvStability.OLD&&(a[Ng.ATTR_NET_PEER_NAME]=o,isNaN(c)||(a[Ng.ATTR_NET_PEER_PORT]=c)),n&OR.SemconvStability.STABLE&&(a[Kw.ATTR_SERVER_ADDRESS]=o,isNaN(c)||(a[Kw.ATTR_SERVER_PORT]=c)),a}_o.getConnectionAttributes=Swe;function Awe(e){let{host:t,port:n,database:o,user:r}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:o,user:r}}function ywe(e,t,n){let o=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(o+=`:${t}`),typeof n=="string"&&(o+=`/${n}`),o}function Rwe(e,t,n,o=!1,r=Iwe){let[i,s]=typeof e=="string"?[e,n]:[e.sql,bwe(e)?n||e.values:n];try{return o?r(i):t&&s?t(i,s):i}catch{return"Could not determine the query due to an error in masking or formatting"}}_o.getQueryText=Rwe;function Iwe(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function bwe(e){return"values"in e}function Nwe(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}_o.getSpanName=Nwe;var Owe=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};_o.once=Owe;function Cwe(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}_o.getConnectionPrototypeToInstrument=Cwe});var tne=S(Ap=>{"use strict";l();Object.defineProperty(Ap,"__esModule",{value:!0});Ap.PACKAGE_NAME=Ap.PACKAGE_VERSION=void 0;Ap.PACKAGE_VERSION="0.60.0";Ap.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var ine=S(CR=>{"use strict";l();Object.defineProperty(CR,"__esModule",{value:!0});CR.MySQL2Instrumentation=void 0;var nne=K(),Wo=Pe(),Zw=qw(),rne=Ww(),yp=ene(),one=tne(),Jw=We(),Xw=[">=1.4.2 <4"],Qw=class extends Wo.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(one.PACKAGE_NAME,one.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Wo.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Wo.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let o=i=>{(0,Wo.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,Wo.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},r=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new Wo.InstrumentationNodeModuleDefinition("mysql2",Xw,i=>(n(i),i),()=>{},[new Wo.InstrumentationNodeModuleFile("mysql2/promise.js",Xw,i=>(n(i),i),()=>{}),new Wo.InstrumentationNodeModuleFile("mysql2/lib/connection.js",Xw,i=>{let s=(0,yp.getConnectionPrototypeToInstrument)(i);return o(s),i},i=>{if(i===void 0)return;let s=(0,yp.getConnectionPrototypeToInstrument)(i);r(s)})])]}_patchQuery(t,n){return o=>{let r=this;return function(i,s,a){let c;Array.isArray(s)?c=s:arguments[2]&&(c=[s]);let{maskStatement:u,maskStatementHook:d,responseHook:p}=r.getConfig(),f=(0,yp.getConnectionAttributes)(this.config,r._dbSemconvStability,r._netSemconvStability),m=(0,yp.getQueryText)(i,t,c,u,d);r._dbSemconvStability&Wo.SemconvStability.OLD&&(f[Zw.ATTR_DB_SYSTEM]=Zw.DB_SYSTEM_VALUE_MYSQL,f[Zw.ATTR_DB_STATEMENT]=m),r._dbSemconvStability&Wo.SemconvStability.STABLE&&(f[Jw.ATTR_DB_SYSTEM_NAME]=Jw.DB_SYSTEM_NAME_VALUE_MYSQL,f[Jw.ATTR_DB_QUERY_TEXT]=m);let _=r.tracer.startSpan((0,yp.getSpanName)(i),{kind:nne.SpanKind.CLIENT,attributes:f});!n&&r.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,rne.addSqlCommenterComment)(_,i):Object.assign(i,{sql:(0,rne.addSqlCommenterComment)(_,i.sql)}));let h=(0,yp.once)((E,T)=>{E?_.setStatus({code:nne.SpanStatusCode.ERROR,message:E.message}):typeof p=="function"&&(0,Wo.safeExecuteInTheMiddle)(()=>{p(_,{queryResults:T})},R=>{R&&r._diag.warn("Failed executing responseHook",R)},!0),_.end()});if(arguments.length===1){typeof i.onResult=="function"&&r._wrap(i,"onResult",r._patchCallbackQuery(h));let E=o.apply(this,arguments);return E.once("error",T=>{h(T)}).once("result",T=>{h(void 0,T)}),E}return typeof arguments[1]=="function"?r._wrap(arguments,1,r._patchCallbackQuery(h)):typeof arguments[2]=="function"&&r._wrap(arguments,2,r._patchCallbackQuery(h)),o.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(o,r,i){return t(o,r),n(...arguments)}}};CR.MySQL2Instrumentation=Qw});var sne=S(vR=>{"use strict";l();Object.defineProperty(vR,"__esModule",{value:!0});vR.MySQL2Instrumentation=void 0;var vwe=ine();Object.defineProperty(vR,"MySQL2Instrumentation",{enumerable:!0,get:function(){return vwe.MySQL2Instrumentation}})});var Ine=S(kR=>{"use strict";l();Object.defineProperty(kR,"__esModule",{value:!0});kR.EVENT_LISTENERS_SET=void 0;kR.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var cD=S(xg=>{"use strict";l();Object.defineProperty(xg,"__esModule",{value:!0});xg.AttributeNames=void 0;var Jwe;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(Jwe=xg.AttributeNames||(xg.AttributeNames={}))});var uD=S(Ke=>{"use strict";l();Object.defineProperty(Ke,"__esModule",{value:!0});Ke.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=Ke.METRIC_DB_CLIENT_CONNECTION_COUNT=Ke.DB_SYSTEM_VALUE_POSTGRESQL=Ke.DB_CLIENT_CONNECTION_STATE_VALUE_USED=Ke.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=Ke.ATTR_NET_PEER_PORT=Ke.ATTR_NET_PEER_NAME=Ke.ATTR_DB_USER=Ke.ATTR_DB_SYSTEM=Ke.ATTR_DB_STATEMENT=Ke.ATTR_DB_NAME=Ke.ATTR_DB_CONNECTION_STRING=Ke.ATTR_DB_CLIENT_CONNECTION_STATE=Ke.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;Ke.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";Ke.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";Ke.ATTR_DB_CONNECTION_STRING="db.connection_string";Ke.ATTR_DB_NAME="db.name";Ke.ATTR_DB_STATEMENT="db.statement";Ke.ATTR_DB_SYSTEM="db.system";Ke.ATTR_DB_USER="db.user";Ke.ATTR_NET_PEER_NAME="net.peer.name";Ke.ATTR_NET_PEER_PORT="net.peer.port";Ke.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";Ke.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";Ke.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";Ke.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";Ke.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var lD=S(Mg=>{"use strict";l();Object.defineProperty(Mg,"__esModule",{value:!0});Mg.SpanNames=void 0;var Xwe;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(Xwe=Mg.SpanNames||(Mg.SpanNames={}))});var xne=S($e=>{"use strict";l();Object.defineProperty($e,"__esModule",{value:!0});$e.sanitizedErrorMessage=$e.isObjectWithTextString=$e.getErrorMessage=$e.patchClientConnectCallback=$e.patchCallbackPGPool=$e.updateCounter=$e.getPoolName=$e.patchCallback=$e.handleExecutionResult=$e.handleConfigQuery=$e.shouldSkipInstrumentation=$e.getSemanticAttributesFromPoolConnection=$e.getSemanticAttributesFromConnection=$e.getConnectionString=$e.parseAndMaskConnectionString=$e.parseNormalizedOperationName=$e.getQuerySpanName=void 0;var Va=K(),UR=cD(),ho=We(),vt=uD(),Ku=Pe(),bne=lD();function Nne(e,t){if(!t)return bne.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:One(t.text);return`${bne.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}$e.getQuerySpanName=Nne;function One(e){let t=e.trim(),n=t.indexOf(" "),o=n===-1?t:t.slice(0,n);return o=o.toUpperCase(),o.endsWith(";")?o.slice(0,-1):o}$e.parseNormalizedOperationName=One;function Cne(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}$e.parseAndMaskConnectionString=Cne;function dD(e){if("connectionString"in e&&e.connectionString)return Cne(e.connectionString);let t=e.host||"localhost",n=e.port||5432,o=e.database||"";return`postgresql://${t}:${n}/${o}`}$e.getConnectionString=dD;function $R(e){if(Number.isInteger(e))return e}function vne(e,t){let n={};return t&Ku.SemconvStability.OLD&&(n={...n,[vt.ATTR_DB_SYSTEM]:vt.DB_SYSTEM_VALUE_POSTGRESQL,[vt.ATTR_DB_NAME]:e.database,[vt.ATTR_DB_CONNECTION_STRING]:dD(e),[vt.ATTR_DB_USER]:e.user,[vt.ATTR_NET_PEER_NAME]:e.host,[vt.ATTR_NET_PEER_PORT]:$R(e.port)}),t&Ku.SemconvStability.STABLE&&(n={...n,[ho.ATTR_DB_SYSTEM_NAME]:ho.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ho.ATTR_DB_NAMESPACE]:e.namespace,[ho.ATTR_SERVER_ADDRESS]:e.host,[ho.ATTR_SERVER_PORT]:$R(e.port)}),n}$e.getSemanticAttributesFromConnection=vne;function Qwe(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let o={[UR.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[UR.AttributeNames.MAX_CLIENT]:e.maxClient};return t&Ku.SemconvStability.OLD&&(o={...o,[vt.ATTR_DB_SYSTEM]:vt.DB_SYSTEM_VALUE_POSTGRESQL,[vt.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[vt.ATTR_DB_CONNECTION_STRING]:dD(e),[vt.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[vt.ATTR_NET_PEER_PORT]:Number(n?.port)||$R(e.port),[vt.ATTR_DB_USER]:n?.username??e.user}),t&Ku.SemconvStability.STABLE&&(o={...o,[ho.ATTR_DB_SYSTEM_NAME]:ho.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[ho.ATTR_DB_NAMESPACE]:e.namespace,[ho.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[ho.ATTR_SERVER_PORT]:Number(n?.port)||$R(e.port)}),o}$e.getSemanticAttributesFromPoolConnection=Qwe;function eDe(e){return e.requireParentSpan===!0&&Va.trace.getSpan(Va.context.active())===void 0}$e.shouldSkipInstrumentation=eDe;function tDe(e,t,n,o){let{connectionParameters:r}=this,i=r.database,s=Nne(i,o),a=e.startSpan(s,{kind:Va.SpanKind.CLIENT,attributes:vne(r,n)});if(!o)return a;if(o.text&&(n&Ku.SemconvStability.OLD&&a.setAttribute(vt.ATTR_DB_STATEMENT,o.text),n&Ku.SemconvStability.STABLE&&a.setAttribute(ho.ATTR_DB_QUERY_TEXT,o.text)),t.enhancedDatabaseReporting&&Array.isArray(o.values))try{let c=o.values.map(u=>u==null?"null":u instanceof Buffer?u.toString():typeof u=="object"?typeof u.toPostgres=="function"?u.toPostgres():JSON.stringify(u):u.toString());a.setAttribute(UR.AttributeNames.PG_VALUES,c)}catch(c){Va.diag.error("failed to stringify ",o.values,c)}return typeof o.name=="string"&&a.setAttribute(UR.AttributeNames.PG_PLAN,o.name),a}$e.handleConfigQuery=tDe;function Pne(e,t,n){typeof e.responseHook=="function"&&(0,Ku.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},o=>{o&&Va.diag.error("Error running response hook",o)},!0)}$e.handleExecutionResult=Pne;function nDe(e,t,n,o,r){return function(s,a){s?(Object.prototype.hasOwnProperty.call(s,"code")&&(o[ho.ATTR_ERROR_TYPE]=s.code),s instanceof Error&&t.recordException(BR(s)),t.setStatus({code:Va.SpanStatusCode.ERROR,message:s.message})):Pne(e,t,a),r(),t.end(),n.call(this,s,a)}}$e.patchCallback=nDe;function rDe(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}$e.getPoolName=rDe;function oDe(e,t,n,o,r){let i=t.totalCount,s=t.waitingCount,a=t.idleCount,c=i-a;return n.add(c-r.used,{[vt.ATTR_DB_CLIENT_CONNECTION_STATE]:vt.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[vt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(a-r.idle,{[vt.ATTR_DB_CLIENT_CONNECTION_STATE]:vt.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[vt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),o.add(s-r.pending,{[vt.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:c,idle:a,pending:s}}$e.updateCounter=oDe;function iDe(e,t){return function(o,r,i){o&&(o instanceof Error&&e.recordException(BR(o)),e.setStatus({code:Va.SpanStatusCode.ERROR,message:o.message})),e.end(),t.call(this,o,r,i)}}$e.patchCallbackPGPool=iDe;function sDe(e,t){return function(o){o&&(o instanceof Error&&e.recordException(BR(o)),e.setStatus({code:Va.SpanStatusCode.ERROR,message:o.message})),e.end(),t.apply(this,arguments)}}$e.patchClientConnectCallback=sDe;function aDe(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}$e.getErrorMessage=aDe;function cDe(e){return typeof e=="object"&&typeof e?.text=="string"}$e.isObjectWithTextString=cDe;function BR(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}$e.sanitizedErrorMessage=BR});var Mne=S(bp=>{"use strict";l();Object.defineProperty(bp,"__esModule",{value:!0});bp.PACKAGE_NAME=bp.PACKAGE_VERSION=void 0;bp.PACKAGE_VERSION="0.66.0";bp.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var $ne=S(jR=>{"use strict";l();Object.defineProperty(jR,"__esModule",{value:!0});jR.PgInstrumentation=void 0;var tr=Pe(),et=K(),Lne=Ine(),yt=xne(),wne=Ww(),Dne=Mne(),kne=lD(),GR=Xe(),Ko=We(),Lg=uD();function Np(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var pD=class extends tr.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(Dne.PACKAGE_NAME,Dne.PACKAGE_VERSION,t),this._semconvStability=(0,tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(Ko.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:et.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(Lg.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(Lg.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],o=new tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),r=new tr.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new tr.InstrumentationNodeModuleDefinition("pg",t,a=>{let c=Np(a);return this._patchPgClient(c.Client),a},a=>{let c=Np(a);return this._unpatchPgClient(c.Client),a},[r,o]),s=new tr.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=Np(a);return(0,tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=Np(a);(0,tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[i,s]}_patchPgClient(t){if(!t)return;let n=Np(t);return(0,tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=Np(t);return(0,tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(r){let i=t.getConfig();if(yt.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,r);let s=t.tracer.startSpan(kne.SpanNames.CONNECT,{kind:et.SpanKind.CLIENT,attributes:yt.getSemanticAttributesFromConnection(this,t._semconvStability)});if(r){let c=et.trace.getSpan(et.context.active());r=yt.patchClientConnectCallback(s,r),c&&(r=et.context.bind(et.context.active(),r))}let a=et.context.with(et.trace.setSpan(et.context.active(),s),()=>n.call(this,r));return Une(s,a)}}recordOperationDuration(t,n){let o={},r=[Ko.ATTR_DB_NAMESPACE,Ko.ATTR_ERROR_TYPE,Ko.ATTR_SERVER_PORT,Ko.ATTR_SERVER_ADDRESS,Ko.ATTR_DB_OPERATION_NAME];this._semconvStability&tr.SemconvStability.OLD&&r.push(Lg.ATTR_DB_SYSTEM),this._semconvStability&tr.SemconvStability.STABLE&&r.push(Ko.ATTR_DB_SYSTEM_NAME),r.forEach(s=>{s in t&&(o[s]=t[s])});let i=(0,GR.hrTimeToMilliseconds)((0,GR.hrTimeDuration)(n,(0,GR.hrTime)()))/1e3;this._operationDuration.record(i,o)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...r){if(yt.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,r);let i=(0,GR.hrTime)(),s=r[0],a=typeof s=="string",c=yt.isObjectWithTextString(s),u=a?{text:s,values:Array.isArray(r[1])?r[1]:void 0}:c?{...s,name:s.name,text:s.text,values:s.values??(Array.isArray(r[1])?r[1]:void 0)}:void 0,d={[Lg.ATTR_DB_SYSTEM]:Lg.DB_SYSTEM_VALUE_POSTGRESQL,[Ko.ATTR_DB_NAMESPACE]:this.database,[Ko.ATTR_SERVER_PORT]:this.connectionParameters.port,[Ko.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};u?.text&&(d[Ko.ATTR_DB_OPERATION_NAME]=yt.parseNormalizedOperationName(u?.text));let p=()=>{t.recordOperationDuration(d,i)},f=t.getConfig(),m=yt.handleConfigQuery.call(this,t.tracer,f,t._semconvStability,u);if(f.addSqlCommenterCommentToQueries&&(a?r[0]=(0,wne.addSqlCommenterComment)(m,s):c&&!("name"in s)&&(r[0]={...s,text:(0,wne.addSqlCommenterComment)(m,s.text)})),r.length>0){let E=et.trace.getSpan(et.context.active());if(typeof r[r.length-1]=="function")r[r.length-1]=yt.patchCallback(f,m,r[r.length-1],d,p),E&&(r[r.length-1]=et.context.bind(et.context.active(),r[r.length-1]));else if(typeof u?.callback=="function"){let T=yt.patchCallback(t.getConfig(),m,u.callback,d,p);E&&(T=et.context.bind(et.context.active(),T)),r[0].callback=T}}let{requestHook:_}=f;typeof _=="function"&&u&&(0,tr.safeExecuteInTheMiddle)(()=>{let{database:E,host:T,port:R,user:C}=this.connectionParameters;_(m,{connection:{database:E,host:T,port:R,user:C},query:{text:u.text,values:u.values,name:u.name}})},E=>{E&&t._diag.error("Error running query hook",E)},!0);let h;try{h=n.apply(this,r)}catch(E){throw E instanceof Error&&m.recordException(yt.sanitizedErrorMessage(E)),m.setStatus({code:et.SpanStatusCode.ERROR,message:yt.getErrorMessage(E)}),m.end(),E}return h instanceof Promise?h.then(E=>new Promise(T=>{yt.handleExecutionResult(t.getConfig(),m,E),p(),m.end(),T(E)})).catch(E=>new Promise((T,R)=>{E instanceof Error&&m.recordException(yt.sanitizedErrorMessage(E)),m.setStatus({code:et.SpanStatusCode.ERROR,message:E.message}),p(),m.end(),R(E)})):h})}_setPoolConnectEventListeners(t){if(t[Lne.EVENT_LISTENERS_SET])return;let n=yt.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=yt.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=yt.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=yt.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=yt.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[Lne.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(r){let i=t.getConfig();if(yt.shouldSkipInstrumentation(i))return n.call(this,r);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,r);let s=t.tracer.startSpan(kne.SpanNames.POOL_CONNECT,{kind:et.SpanKind.CLIENT,attributes:yt.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(r){let c=et.trace.getSpan(et.context.active());r=yt.patchCallbackPGPool(s,r),c&&(r=et.context.bind(et.context.active(),r))}let a=et.context.with(et.trace.setSpan(et.context.active(),s),()=>n.call(this,r));return Une(s,a)}}};jR.PgInstrumentation=pD;function Une(e,t){if(!(t instanceof Promise))return t;let n=t;return et.context.bind(et.context.active(),n.then(o=>(e.end(),o)).catch(o=>(o instanceof Error&&e.recordException(yt.sanitizedErrorMessage(o)),e.setStatus({code:et.SpanStatusCode.ERROR,message:yt.getErrorMessage(o)}),e.end(),Promise.reject(o))))}});var Bne=S(Op=>{"use strict";l();Object.defineProperty(Op,"__esModule",{value:!0});Op.AttributeNames=Op.PgInstrumentation=void 0;var uDe=$ne();Object.defineProperty(Op,"PgInstrumentation",{enumerable:!0,get:function(){return uDe.PgInstrumentation}});var lDe=cD();Object.defineProperty(Op,"AttributeNames",{enumerable:!0,get:function(){return lDe.AttributeNames}})});var zne=S(wg=>{"use strict";l();Object.defineProperty(wg,"__esModule",{value:!0});wg.SeverityNumber=void 0;var _De;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(_De=wg.SeverityNumber||(wg.SeverityNumber={}))});var HR=S(Cp=>{"use strict";l();Object.defineProperty(Cp,"__esModule",{value:!0});Cp.NOOP_LOGGER=Cp.NoopLogger=void 0;var FR=class{emit(t){}};Cp.NoopLogger=FR;Cp.NOOP_LOGGER=new FR});var qR=S(vp=>{"use strict";l();Object.defineProperty(vp,"__esModule",{value:!0});vp.NOOP_LOGGER_PROVIDER=vp.NoopLoggerProvider=void 0;var gDe=HR(),zR=class{getLogger(t,n,o){return new gDe.NoopLogger}};vp.NoopLoggerProvider=zR;vp.NOOP_LOGGER_PROVIDER=new zR});var ED=S(YR=>{"use strict";l();Object.defineProperty(YR,"__esModule",{value:!0});YR.ProxyLogger=void 0;var hDe=HR(),hD=class{constructor(t,n,o,r){this._provider=t,this.name=n,this.version=o,this.options=r}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):hDe.NOOP_LOGGER}};YR.ProxyLogger=hD});var SD=S(WR=>{"use strict";l();Object.defineProperty(WR,"__esModule",{value:!0});WR.ProxyLoggerProvider=void 0;var EDe=qR(),TDe=ED(),TD=class{getLogger(t,n,o){var r;return(r=this._getDelegateLogger(t,n,o))!==null&&r!==void 0?r:new TDe.ProxyLogger(this,t,n,o)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:EDe.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,o){var r;return(r=this._delegate)===null||r===void 0?void 0:r.getLogger(t,n,o)}};WR.ProxyLoggerProvider=TD});var qne=S(KR=>{"use strict";l();Object.defineProperty(KR,"__esModule",{value:!0});KR._globalThis=void 0;KR._globalThis=typeof globalThis=="object"?globalThis:global});var Yne=S(ZR=>{"use strict";l();Object.defineProperty(ZR,"__esModule",{value:!0});ZR._globalThis=void 0;var SDe=qne();Object.defineProperty(ZR,"_globalThis",{enumerable:!0,get:function(){return SDe._globalThis}})});var Wne=S(JR=>{"use strict";l();Object.defineProperty(JR,"__esModule",{value:!0});JR._globalThis=void 0;var ADe=Yne();Object.defineProperty(JR,"_globalThis",{enumerable:!0,get:function(){return ADe._globalThis}})});var Kne=S(Vi=>{"use strict";l();Object.defineProperty(Vi,"__esModule",{value:!0});Vi.API_BACKWARDS_COMPATIBILITY_VERSION=Vi.makeGetter=Vi._global=Vi.GLOBAL_LOGS_API_KEY=void 0;var yDe=Wne();Vi.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Vi._global=yDe._globalThis;function RDe(e,t,n){return o=>o===e?t:n}Vi.makeGetter=RDe;Vi.API_BACKWARDS_COMPATIBILITY_VERSION=1});var Jne=S(XR=>{"use strict";l();Object.defineProperty(XR,"__esModule",{value:!0});XR.LogsAPI=void 0;var Eo=Kne(),IDe=qR(),Zne=SD(),AD=class e{constructor(){this._proxyLoggerProvider=new Zne.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Eo._global[Eo.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Eo._global[Eo.GLOBAL_LOGS_API_KEY]=(0,Eo.makeGetter)(Eo.API_BACKWARDS_COMPATIBILITY_VERSION,t,IDe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Eo._global[Eo.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Eo._global,Eo.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,o){return this.getLoggerProvider().getLogger(t,n,o)}disable(){delete Eo._global[Eo.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Zne.ProxyLoggerProvider}};XR.LogsAPI=AD});var yD=S(an=>{"use strict";l();Object.defineProperty(an,"__esModule",{value:!0});an.logs=an.ProxyLoggerProvider=an.ProxyLogger=an.NoopLoggerProvider=an.NOOP_LOGGER_PROVIDER=an.NoopLogger=an.NOOP_LOGGER=an.SeverityNumber=void 0;var bDe=zne();Object.defineProperty(an,"SeverityNumber",{enumerable:!0,get:function(){return bDe.SeverityNumber}});var Xne=HR();Object.defineProperty(an,"NOOP_LOGGER",{enumerable:!0,get:function(){return Xne.NOOP_LOGGER}});Object.defineProperty(an,"NoopLogger",{enumerable:!0,get:function(){return Xne.NoopLogger}});var Qne=qR();Object.defineProperty(an,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return Qne.NOOP_LOGGER_PROVIDER}});Object.defineProperty(an,"NoopLoggerProvider",{enumerable:!0,get:function(){return Qne.NoopLoggerProvider}});var NDe=ED();Object.defineProperty(an,"ProxyLogger",{enumerable:!0,get:function(){return NDe.ProxyLogger}});var ODe=SD();Object.defineProperty(an,"ProxyLoggerProvider",{enumerable:!0,get:function(){return ODe.ProxyLoggerProvider}});var CDe=Jne();an.logs=CDe.LogsAPI.getInstance()});var ere=S(Pp=>{"use strict";l();Object.defineProperty(Pp,"__esModule",{value:!0});Pp.disableInstrumentations=Pp.enableInstrumentations=void 0;function vDe(e,t,n,o){for(let r=0,i=e.length;r<i;r++){let s=e[r];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),o&&s.setLoggerProvider&&s.setLoggerProvider(o),s.getConfig().enabled||s.enable()}}Pp.enableInstrumentations=vDe;function PDe(e){e.forEach(t=>t.disable())}Pp.disableInstrumentations=PDe});var rre=S(QR=>{"use strict";l();Object.defineProperty(QR,"__esModule",{value:!0});QR.registerInstrumentations=void 0;var tre=K(),xDe=yD(),nre=ere();function MDe(e){let t=e.tracerProvider||tre.trace.getTracerProvider(),n=e.meterProvider||tre.metrics.getMeterProvider(),o=e.loggerProvider||xDe.logs.getLoggerProvider(),r=e.instrumentations?.flat()??[];return(0,nre.enableInstrumentations)(r,t,n,o),()=>{(0,nre.disableInstrumentations)(r)}}QR.registerInstrumentations=MDe});var pre=S(eI=>{"use strict";l();Object.defineProperty(eI,"__esModule",{value:!0});eI.satisfies=void 0;var ND=K(),cre=/^(?: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-]+)*))?$/,LDe=/^(?<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-]+)*))?$/,wDe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function DDe(e,t,n){if(!kDe(e))return ND.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let o=GDe(e);if(!o)return!1;let r=[],i=ure(o,t,r,n);return i&&!n?.includePrerelease?$De(o,r):i}eI.satisfies=DDe;function kDe(e){return typeof e=="string"&&cre.test(e)}function ure(e,t,n,o){if(t.includes("||")){let r=t.trim().split("||");for(let i of r)if(RD(e,i,n,o))return!0;return!1}else if(t.includes(" - "))t=ake(t,o);else if(t.includes(" ")){let r=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of r)if(!RD(e,i,n,o))return!1;return!0}return RD(e,t,n,o)}function RD(e,t,n,o){if(t=BDe(t,o),t.includes(" "))return ure(e,t,n,o);{let r=jDe(t);return n.push(r),UDe(e,r)}}function UDe(e,t){if(t.invalid)return!1;if(!t.version||bD(t.version))return!0;let n=ire(e.versionSegments||[],t.versionSegments||[]);if(n===0){let o=e.prereleaseSegments||[],r=t.prereleaseSegments||[];!o.length&&!r.length?n=0:!o.length&&r.length?n=1:o.length&&!r.length?n=-1:n=ire(o,r)}return wDe[t.op]?.includes(n)}function $De(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function BDe(e,t){return e=e.trim(),e=ike(e,t),e=oke(e),e=ske(e,t),e=e.trim(),e}function nr(e){return!e||e.toLowerCase()==="x"||e==="*"}function GDe(e){let t=e.match(cre);if(!t){ND.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,o=t.groups.prerelease,r=t.groups.build,i=n.split("."),s=o?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:r}}function jDe(e){if(!e)return{};let t=e.match(LDe);if(!t)return ND.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,o=t.groups.version,r=t.groups.prerelease,i=t.groups.build,s=o.split("."),a=r?.split(".");return n==="=="&&(n="="),{op:n||"=",version:o,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:i}}function bD(e){return e==="*"||e==="x"||e==="X"}function ore(e){let t=parseInt(e,10);return isNaN(t)?e:t}function VDe(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function FDe(e,t){if(bD(e)||bD(t))return 0;let[n,o]=VDe(ore(e),ore(t));return n>o?1:n<o?-1:0}function ire(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let o=FDe(e[n]||"0",t[n]||"0");if(o!==0)return o}return 0}var lre="[a-zA-Z0-9-]",dre="0|[1-9]\\d*",HDe=`\\d*[a-zA-Z-]${lre}*`,zDe="((?:<|>)?=?)",sre=`(?:${dre}|${HDe})`,qDe=`(?:-(${sre}(?:\\.${sre})*))`,are=`${lre}+`,YDe=`(?:\\+(${are}(?:\\.${are})*))`,ID=`${dre}|x|X|\\*`,Dg=`[v=\\s]*(${ID})(?:\\.(${ID})(?:\\.(${ID})(?:${qDe})?${YDe}?)?)?`,WDe=`^${zDe}\\s*${Dg}$`,KDe=new RegExp(WDe),ZDe=`^\\s*(${Dg})\\s+-\\s+(${Dg})\\s*$`,JDe=new RegExp(ZDe),XDe="(?:~>?)",QDe=`^${XDe}${Dg}$`,eke=new RegExp(QDe),tke="(?:\\^)",nke=`^${tke}${Dg}$`,rke=new RegExp(nke);function oke(e){let t=eke;return e.replace(t,(n,o,r,i,s)=>{let a;return nr(o)?a="":nr(r)?a=`>=${o}.0.0 <${+o+1}.0.0-0`:nr(i)?a=`>=${o}.${r}.0 <${o}.${+r+1}.0-0`:s?a=`>=${o}.${r}.${i}-${s} <${o}.${+r+1}.0-0`:a=`>=${o}.${r}.${i} <${o}.${+r+1}.0-0`,a})}function ike(e,t){let n=rke,o=t?.includePrerelease?"-0":"";return e.replace(n,(r,i,s,a,c)=>{let u;return nr(i)?u="":nr(s)?u=`>=${i}.0.0${o} <${+i+1}.0.0-0`:nr(a)?i==="0"?u=`>=${i}.${s}.0${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.0${o} <${+i+1}.0.0-0`:c?i==="0"?s==="0"?u=`>=${i}.${s}.${a}-${c} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a}-${c} <${+i+1}.0.0-0`:i==="0"?s==="0"?u=`>=${i}.${s}.${a}${o} <${i}.${s}.${+a+1}-0`:u=`>=${i}.${s}.${a}${o} <${i}.${+s+1}.0-0`:u=`>=${i}.${s}.${a} <${+i+1}.0.0-0`,u})}function ske(e,t){let n=KDe;return e.replace(n,(o,r,i,s,a,c)=>{let u=nr(i),d=u||nr(s),p=d||nr(a),f=p;return r==="="&&f&&(r=""),c=t?.includePrerelease?"-0":"",u?r===">"||r==="<"?o="<0.0.0-0":o="*":r&&f?(d&&(s=0),a=0,r===">"?(r=">=",d?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):r==="<="&&(r="<",d?i=+i+1:s=+s+1),r==="<"&&(c="-0"),o=`${r+i}.${s}.${a}${c}`):d?o=`>=${i}.0.0${c} <${+i+1}.0.0-0`:p&&(o=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o})}function ake(e,t){let n=JDe;return e.replace(n,(o,r,i,s,a,c,u,d,p,f,m,_)=>(nr(i)?r="":nr(s)?r=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:nr(a)?r=`>=${i}.${s}.0${t?.includePrerelease?"-0":""}`:c?r=`>=${r}`:r=`>=${r}${t?.includePrerelease?"-0":""}`,nr(p)?d="":nr(f)?d=`<${+p+1}.0.0-0`:nr(m)?d=`<${p}.${+f+1}.0-0`:_?d=`<=${p}.${f}.${m}-${_}`:t?.includePrerelease?d=`<${p}.${f}.${+m+1}-0`:d=`<=${d}`,`${r} ${d}`.trim()))}});var OD=S(yn=>{"use strict";l();Object.defineProperty(yn,"__esModule",{value:!0});yn.massUnwrap=yn.unwrap=yn.massWrap=yn.wrap=void 0;var rr=console.error.bind(console);function kg(e,t,n){let o=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:o,writable:!0,value:n})}var cke=(e,t,n)=>{if(!e||!e[t]){rr("no original function "+String(t)+" to wrap");return}if(!n){rr("no wrapper function"),rr(new Error().stack);return}let o=e[t];if(typeof o!="function"||typeof n!="function"){rr("original object and wrapper must be functions");return}let r=n(o,t);return kg(r,"__original",o),kg(r,"__unwrap",()=>{e[t]===r&&kg(e,t,o)}),kg(r,"__wrapped",!0),kg(e,t,r),r};yn.wrap=cke;var uke=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{rr("must provide one or more modules to patch"),rr(new Error().stack);return}if(!(t&&Array.isArray(t))){rr("must provide one or more functions to wrap on modules");return}e.forEach(o=>{t.forEach(r=>{(0,yn.wrap)(o,r,n)})})};yn.massWrap=uke;var lke=(e,t)=>{if(!e||!e[t]){rr("no function to unwrap."),rr(new Error().stack);return}let n=e[t];if(!n.__unwrap)rr("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};yn.unwrap=lke;var dke=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{rr("must provide one or more modules to patch"),rr(new Error().stack);return}if(!(t&&Array.isArray(t))){rr("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(o=>{(0,yn.unwrap)(n,o)})})};yn.massUnwrap=dke;function Ug(e){e&&e.logger&&(typeof e.logger!="function"?rr("new logger isn't a function, not replacing"):rr=e.logger)}yn.default=Ug;Ug.wrap=yn.wrap;Ug.massWrap=yn.massWrap;Ug.unwrap=yn.unwrap;Ug.massUnwrap=yn.massUnwrap});var fre=S(nI=>{"use strict";l();Object.defineProperty(nI,"__esModule",{value:!0});nI.InstrumentationAbstract=void 0;var CD=K(),pke=yD(),tI=OD(),vD=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,o){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(o),this._diag=CD.diag.createComponentLogger({namespace:t}),this._tracer=CD.trace.getTracer(t,n),this._meter=CD.metrics.getMeter(t,n),this._logger=pke.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=tI.wrap;_unwrap=tI.unwrap;_massWrap=tI.massWrap;_massUnwrap=tI.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,o,r){if(t)try{t(o,r)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};nI.InstrumentationAbstract=vD});var mre=S(Ha=>{"use strict";l();Object.defineProperty(Ha,"__esModule",{value:!0});Ha.ModuleNameTrie=Ha.ModuleNameSeparator=void 0;Ha.ModuleNameSeparator="/";var rI=class{hooks=[];children=new Map},PD=class{_trie=new rI;_counter=0;insert(t){let n=this._trie;for(let o of t.moduleName.split(Ha.ModuleNameSeparator)){let r=n.children.get(o);r||(r=new rI,n.children.set(o,r)),n=r}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:o}={}){let r=this._trie,i=[],s=!0;for(let a of t.split(Ha.ModuleNameSeparator)){let c=r.children.get(a);if(!c){s=!1;break}o||i.push(...c.hooks),r=c}return o&&s&&i.push(...r.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((a,c)=>a.insertedId-c.insertedId),i.map(({hook:a})=>a))}};Ha.ModuleNameTrie=PD});var gre=S(oI=>{"use strict";l();Object.defineProperty(oI,"__esModule",{value:!0});oI.RequireInTheMiddleSingleton=void 0;var fke=lu(),_re=require("path"),xD=mre(),mke=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),MD=class e{_moduleNameTrie=new xD.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new fke.Hook(null,{internals:!0},(t,n,o)=>{let r=_ke(n),i=this._moduleNameTrie.search(r,{maintainInsertionOrder:!0,fullOnly:o===void 0});for(let{onRequire:s}of i)t=s(t,n,o);return t})}register(t,n){let o={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(o),o}static getInstance(){return mke?new e:this._instance=this._instance??new e}};oI.RequireInTheMiddleSingleton=MD;function _ke(e){return _re.sep!==xD.ModuleNameSeparator?e.split(_re.sep).join(xD.ModuleNameSeparator):e}});var LD=S(za=>{"use strict";l();Object.defineProperty(za,"__esModule",{value:!0});za.isWrapped=za.safeExecuteInTheMiddleAsync=za.safeExecuteInTheMiddle=void 0;function gke(e,t,n){let o,r;try{r=e()}catch(i){o=i}finally{if(t(o,r),o&&!n)throw o;return r}}za.safeExecuteInTheMiddle=gke;async function hke(e,t,n){let o,r;try{r=await e()}catch(i){o=i}finally{if(t(o,r),o&&!n)throw o;return r}}za.safeExecuteInTheMiddleAsync=hke;function Eke(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}za.isWrapped=Eke});var Tre=S(iI=>{"use strict";l();Object.defineProperty(iI,"__esModule",{value:!0});iI.InstrumentationBase=void 0;var $g=require("path"),hre=require("util"),Tke=pre(),wD=OD(),Ske=fre(),Ake=gre(),yke=iw(),Bg=K(),Rke=lu(),Ike=require("fs"),bke=LD(),DD=class extends Ske.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=Ake.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,o){super(t,n,o);let r=this.init();r&&!Array.isArray(r)&&(r=[r]),this._modules=r||[],this._config.enabled&&this.enable()}_wrap=(t,n,o)=>{if((0,bke.isWrapped)(t[n])&&this._unwrap(t,n),hre.types.isProxy(t)){let r=(0,wD.wrap)(Object.assign({},t),n,o);return Object.defineProperty(t,n,{value:r}),r}else return(0,wD.wrap)(t,n,o)};_unwrap=(t,n)=>hre.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,wD.unwrap)(t,n);_massWrap=(t,n,o)=>{if(t)Array.isArray(t)||(t=[t]);else{Bg.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Bg.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(i=>{this._wrap(r,i,o)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Bg.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){Bg.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(r=>{this._unwrap(o,r)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let o=require.resolve(n);require.cache[o]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,Ike.readFileSync)($g.join(t,"package.json"),{encoding:"utf8"}),o=JSON.parse(n).version;return typeof o=="string"?o:void 0}catch{Bg.diag.warn("Failed extracting version",t)}}_onRequire(t,n,o,r){if(!r)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(r);if(t.moduleVersion=i,t.name===o)return Ere(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:r}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],a=$g.normalize(o);return s.filter(u=>u.name===a).filter(u=>Ere(u.supportedVersions,i,t.includePrerelease)).reduce((u,d)=>(d.moduleExports=u,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:d.name,baseDir:r}),d.patch(u,t.moduleVersion)):u),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,a,c)=>{if(!c&&$g.isAbsolute(a)){let u=$g.parse(a);a=u.name,c=u.dir}return this._onRequire(t,s,a,c)},o=(s,a,c)=>this._onRequire(t,s,a,c),r=$g.isAbsolute(t.name)?new Rke.Hook([t.name],{internals:!0},o):this._requireInTheMiddleSingleton.register(t.name,o);this._hooks.push(r);let i=new yke.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};iI.InstrumentationBase=DD;function Ere(e,t,n){return typeof t>"u"?e.includes("*"):e.some(o=>(0,Tke.satisfies)(t,o,{includePrerelease:n}))}});var Sre=S(sI=>{"use strict";l();Object.defineProperty(sI,"__esModule",{value:!0});sI.normalize=void 0;var Nke=require("path");Object.defineProperty(sI,"normalize",{enumerable:!0,get:function(){return Nke.normalize}})});var Are=S(xp=>{"use strict";l();Object.defineProperty(xp,"__esModule",{value:!0});xp.normalize=xp.InstrumentationBase=void 0;var Oke=Tre();Object.defineProperty(xp,"InstrumentationBase",{enumerable:!0,get:function(){return Oke.InstrumentationBase}});var Cke=Sre();Object.defineProperty(xp,"normalize",{enumerable:!0,get:function(){return Cke.normalize}})});var kD=S(Mp=>{"use strict";l();Object.defineProperty(Mp,"__esModule",{value:!0});Mp.normalize=Mp.InstrumentationBase=void 0;var yre=Are();Object.defineProperty(Mp,"InstrumentationBase",{enumerable:!0,get:function(){return yre.InstrumentationBase}});Object.defineProperty(Mp,"normalize",{enumerable:!0,get:function(){return yre.normalize}})});var Rre=S(aI=>{"use strict";l();Object.defineProperty(aI,"__esModule",{value:!0});aI.InstrumentationNodeModuleDefinition=void 0;var UD=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,o,r,i){this.name=t,this.supportedVersions=n,this.patch=o,this.unpatch=r,this.files=i||[]}};aI.InstrumentationNodeModuleDefinition=UD});var Ire=S(cI=>{"use strict";l();Object.defineProperty(cI,"__esModule",{value:!0});cI.InstrumentationNodeModuleFile=void 0;var vke=kD(),$D=class{supportedVersions;patch;unpatch;name;constructor(t,n,o,r){this.supportedVersions=n,this.patch=o,this.unpatch=r,this.name=(0,vke.normalize)(t)}};cI.InstrumentationNodeModuleFile=$D});var bre=S(Zu=>{"use strict";l();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.semconvStabilityFromStr=Zu.SemconvStability=void 0;var uI;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(uI=Zu.SemconvStability||(Zu.SemconvStability={}));function Pke(e,t){let n=uI.OLD,o=t?.split(",").map(r=>r.trim()).filter(r=>r!=="");for(let r of o??[])if(r.toLowerCase()===e+"/dup"){n=uI.DUPLICATE;break}else r.toLowerCase()===e&&(n=uI.STABLE);return n}Zu.semconvStabilityFromStr=Pke});var Ore=S(zt=>{"use strict";l();Object.defineProperty(zt,"__esModule",{value:!0});zt.semconvStabilityFromStr=zt.SemconvStability=zt.safeExecuteInTheMiddleAsync=zt.safeExecuteInTheMiddle=zt.isWrapped=zt.InstrumentationNodeModuleFile=zt.InstrumentationNodeModuleDefinition=zt.InstrumentationBase=zt.registerInstrumentations=void 0;var xke=rre();Object.defineProperty(zt,"registerInstrumentations",{enumerable:!0,get:function(){return xke.registerInstrumentations}});var Mke=kD();Object.defineProperty(zt,"InstrumentationBase",{enumerable:!0,get:function(){return Mke.InstrumentationBase}});var Lke=Rre();Object.defineProperty(zt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return Lke.InstrumentationNodeModuleDefinition}});var wke=Ire();Object.defineProperty(zt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return wke.InstrumentationNodeModuleFile}});var BD=LD();Object.defineProperty(zt,"isWrapped",{enumerable:!0,get:function(){return BD.isWrapped}});Object.defineProperty(zt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return BD.safeExecuteInTheMiddle}});Object.defineProperty(zt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return BD.safeExecuteInTheMiddleAsync}});var Nre=bre();Object.defineProperty(zt,"SemconvStability",{enumerable:!0,get:function(){return Nre.SemconvStability}});Object.defineProperty(zt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return Nre.semconvStabilityFromStr}})});var Ure=S(wp=>{"use strict";l();Object.defineProperty(wp,"__esModule",{value:!0});wp.PACKAGE_NAME=wp.PACKAGE_VERSION=void 0;wp.PACKAGE_VERSION="0.60.0";wp.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var HD=S(Fi=>{"use strict";l();Object.defineProperty(Fi,"__esModule",{value:!0});Fi.HapiLifecycleMethodNames=Fi.HapiLayerType=Fi.handlerPatched=Fi.HapiComponentName=void 0;Fi.HapiComponentName="@hapi/hapi";Fi.handlerPatched=Symbol("hapi-handler-patched");Fi.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};Fi.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var $re=S(dI=>{"use strict";l();Object.defineProperty(dI,"__esModule",{value:!0});dI.ATTR_HTTP_METHOD=void 0;dI.ATTR_HTTP_METHOD="http.method"});var zD=S(Gg=>{"use strict";l();Object.defineProperty(Gg,"__esModule",{value:!0});Gg.AttributeNames=void 0;var Zke;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(Zke=Gg.AttributeNames||(Gg.AttributeNames={}))});var jre=S(qt=>{"use strict";l();Object.defineProperty(qt,"__esModule",{value:!0});qt.getPluginFromInput=qt.getExtMetadata=qt.getRouteMetadata=qt.isPatchableExtMethod=qt.isDirectExtInput=qt.isLifecycleExtEventObj=qt.isLifecycleExtType=qt.getPluginName=void 0;var Bre=We(),Jke=$re(),jg=HD(),Ya=zD(),Gre=Pe();function Xke(e){return e.name?e.name:e.pkg.name}qt.getPluginName=Xke;var Qke=e=>typeof e=="string"&&jg.HapiLifecycleMethodNames.has(e);qt.isLifecycleExtType=Qke;var e0e=e=>{let t=e?.type;return t!==void 0&&(0,qt.isLifecycleExtType)(t)};qt.isLifecycleExtEventObj=e0e;var t0e=e=>Array.isArray(e)&&e.length<=3&&(0,qt.isLifecycleExtType)(e[0])&&typeof e[1]=="function";qt.isDirectExtInput=t0e;var n0e=e=>!Array.isArray(e);qt.isPatchableExtMethod=n0e;var r0e=(e,t,n)=>{let o={[Bre.ATTR_HTTP_ROUTE]:e.path};t&Gre.SemconvStability.OLD&&(o[Jke.ATTR_HTTP_METHOD]=e.method),t&Gre.SemconvStability.STABLE&&(o[Bre.ATTR_HTTP_REQUEST_METHOD]=e.method);let r;return n?(o[Ya.AttributeNames.HAPI_TYPE]=jg.HapiLayerType.PLUGIN,o[Ya.AttributeNames.PLUGIN_NAME]=n,r=`${n}: route - ${e.path}`):(o[Ya.AttributeNames.HAPI_TYPE]=jg.HapiLayerType.ROUTER,r=`route - ${e.path}`),{attributes:o,name:r}};qt.getRouteMetadata=r0e;var o0e=(e,t,n)=>{let o=`ext - ${e}`;return n&&n!=="method"&&(o=`ext - ${e} - ${n}`),t?{attributes:{[Ya.AttributeNames.EXT_TYPE]:e,[Ya.AttributeNames.HAPI_TYPE]:jg.HapiLayerType.EXT,[Ya.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${o}`}:{attributes:{[Ya.AttributeNames.EXT_TYPE]:e,[Ya.AttributeNames.HAPI_TYPE]:jg.HapiLayerType.EXT},name:o}};qt.getExtMetadata=o0e;var i0e=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;qt.getPluginFromInput=i0e});var Hre=S(pI=>{"use strict";l();Object.defineProperty(pI,"__esModule",{value:!0});pI.HapiInstrumentation=void 0;var Vr=K(),Vre=Xe(),Vg=Pe(),Fre=Ure(),Fg=HD(),ks=jre(),qD=class extends Vg.InstrumentationBase{_semconvStability;constructor(t={}){super(Fre.PACKAGE_NAME,Fre.PACKAGE_VERSION,t),this._semconvStability=(0,Vg.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Vg.InstrumentationNodeModuleDefinition(Fg.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Vg.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Vg.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,o=this;return function(i){let s=t.apply(this,[i]);return o._wrap(s,"route",a=>n._getServerRoutePatch.bind(n)(a)),o._wrap(s,"ext",a=>n._getServerExtPatch.bind(n)(a)),o._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(r,i){if(Array.isArray(r))for(let s of r){let a=(0,ks.getPluginFromInput)(s);n._wrapRegisterHandler(a)}else{let s=(0,ks.getPluginFromInput)(r);n._wrapRegisterHandler(s)}return t.apply(this,[r,i])}}_getServerExtPatch(t,n){let o=this;return function(...i){if(Array.isArray(i[0])){let s=i[0];for(let a=0;a<s.length;a++){let c=s[a];if((0,ks.isLifecycleExtType)(c.type)){let u=c,d=o._wrapExtMethods(u.method,c.type,n);u.method=d,s[a]=u}}return t.apply(this,i)}else if((0,ks.isDirectExtInput)(i)){let s=i,a=s[1],c=o._wrapExtMethods(a,s[0],n);return t.apply(this,[s[0],c,s[2]])}else if((0,ks.isLifecycleExtEventObj)(i[0])){let s=i[0],a=o._wrapExtMethods(s.method,s.type,n);return s.method=a,t.call(this,s)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let o=this;return function(r){if(Array.isArray(r))for(let i=0;i<r.length;i++){let s=o._wrapRouteHandler.call(o,r[i],n);r[i]=s}else r=o._wrapRouteHandler.call(o,r,n);return t.apply(this,[r])}}_wrapRegisterHandler(t){let n=this,o=(0,ks.getPluginName)(t),r=t.register,i=this,s=function(a,c){return i._wrap(a,"route",u=>n._getServerRoutePatch.bind(n)(u,o)),i._wrap(a,"ext",u=>n._getServerExtPatch.bind(n)(u,o)),r.call(this,a,c)};t.register=s}_wrapExtMethods(t,n,o){let r=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=r._wrapExtMethods(t[i],n);return t}else if((0,ks.isPatchableExtMethod)(t))return t[Fg.handlerPatched]===!0?t:(t[Fg.handlerPatched]=!0,async function(...s){if(Vr.trace.getSpan(Vr.context.active())===void 0)return await t.apply(this,s);let a=(0,ks.getExtMetadata)(n,o,t.name),c=r.tracer.startSpan(a.name,{attributes:a.attributes});try{return await Vr.context.with(Vr.trace.setSpan(Vr.context.active(),c),t,void 0,...s)}catch(u){throw c.recordException(u),c.setStatus({code:Vr.SpanStatusCode.ERROR,message:u.message}),u}finally{c.end()}});return t}_wrapRouteHandler(t,n){let o=this;if(t[Fg.handlerPatched]===!0)return t;t[Fg.handlerPatched]=!0;let r=i=>async function(...s){if(Vr.trace.getSpan(Vr.context.active())===void 0)return await i.call(this,...s);let a=(0,Vre.getRPCMetadata)(Vr.context.active());a?.type===Vre.RPCType.HTTP&&(a.route=t.path);let c=(0,ks.getRouteMetadata)(t,o._semconvStability,n),u=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Vr.context.with(Vr.trace.setSpan(Vr.context.active(),u),()=>i.call(this,...s))}catch(d){throw u.recordException(d),u.setStatus({code:Vr.SpanStatusCode.ERROR,message:d.message}),d}finally{u.end()}};if(typeof t.handler=="function")t.handler=r(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(s){let a=i(s);return typeof a.handler=="function"&&(a.handler=r(a.handler)),a}}else typeof t.options?.handler=="function"&&(t.options.handler=r(t.options.handler));return t}};pI.HapiInstrumentation=qD});var zre=S(Dp=>{"use strict";l();Object.defineProperty(Dp,"__esModule",{value:!0});Dp.AttributeNames=Dp.HapiInstrumentation=void 0;var s0e=Hre();Object.defineProperty(Dp,"HapiInstrumentation",{enumerable:!0,get:function(){return s0e.HapiInstrumentation}});var a0e=zD();Object.defineProperty(Dp,"AttributeNames",{enumerable:!0,get:function(){return a0e.AttributeNames}})});var gI=S(zg=>{"use strict";l();Object.defineProperty(zg,"__esModule",{value:!0});zg.KoaLayerType=void 0;var f0e;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(f0e=zg.KoaLayerType||(zg.KoaLayerType={}))});var Jre=S(kp=>{"use strict";l();Object.defineProperty(kp,"__esModule",{value:!0});kp.PACKAGE_NAME=kp.PACKAGE_VERSION=void 0;kp.PACKAGE_VERSION="0.62.0";kp.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var KD=S(qg=>{"use strict";l();Object.defineProperty(qg,"__esModule",{value:!0});qg.AttributeNames=void 0;var m0e;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})(m0e=qg.AttributeNames||(qg.AttributeNames={}))});var Qre=S(Up=>{"use strict";l();Object.defineProperty(Up,"__esModule",{value:!0});Up.isLayerIgnored=Up.getMiddlewareMetadata=void 0;var Xre=gI(),hI=KD(),_0e=We(),g0e=(e,t,n,o)=>n?{attributes:{[hI.AttributeNames.KOA_NAME]:o?.toString(),[hI.AttributeNames.KOA_TYPE]:Xre.KoaLayerType.ROUTER,[_0e.ATTR_HTTP_ROUTE]:o?.toString()},name:e._matchedRouteName||`router - ${o}`}:{attributes:{[hI.AttributeNames.KOA_NAME]:t.name??"middleware",[hI.AttributeNames.KOA_TYPE]:Xre.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};Up.getMiddlewareMetadata=g0e;var h0e=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));Up.isLayerIgnored=h0e});var eoe=S(EI=>{"use strict";l();Object.defineProperty(EI,"__esModule",{value:!0});EI.kLayerPatched=void 0;EI.kLayerPatched=Symbol("koa-layer-patched")});var soe=S(TI=>{"use strict";l();Object.defineProperty(TI,"__esModule",{value:!0});TI.KoaInstrumentation=void 0;var Hi=K(),Yg=Pe(),toe=gI(),noe=Jre(),roe=Qre(),ooe=Xe(),ioe=eoe(),ZD=class extends Yg.InstrumentationBase{constructor(t={}){super(noe.PACKAGE_NAME,noe.PACKAGE_VERSION,t)}init(){return new Yg.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,Yg.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,Yg.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(r){let i;return r.router?i=n._patchRouterDispatch(r):i=n._patchLayer(r,!1),t.apply(this,[i])}}_patchRouterDispatch(t){Hi.diag.debug("Patching @koa/router dispatch");let o=t.router?.stack??[];for(let r of o){let i=r.path,s=r.stack;for(let a=0;a<s.length;a++){let c=s[a];s[a]=this._patchLayer(c,!0,i)}}return t}_patchLayer(t,n,o){let r=n?toe.KoaLayerType.ROUTER:toe.KoaLayerType.MIDDLEWARE;return t[ioe.kLayerPatched]===!0||(0,roe.isLayerIgnored)(r,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(Hi.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[ioe.kLayerPatched]=!0,Hi.diag.debug("patching Koa middleware layer"),async(i,s)=>{if(Hi.trace.getSpan(Hi.context.active())===void 0)return t(i,s);let c=(0,roe.getMiddlewareMetadata)(i,t,n,o),u=this.tracer.startSpan(c.name,{attributes:c.attributes}),d=(0,ooe.getRPCMetadata)(Hi.context.active());d?.type===ooe.RPCType.HTTP&&i._matchedRoute&&(d.route=i._matchedRoute.toString());let{requestHook:p}=this.getConfig();p&&(0,Yg.safeExecuteInTheMiddle)(()=>p(u,{context:i,middlewareLayer:t,layerType:r}),m=>{m&&Hi.diag.error("koa instrumentation: request hook failed",m)},!0);let f=Hi.trace.setSpan(Hi.context.active(),u);return Hi.context.with(f,async()=>{try{return await t(i,s)}catch(m){throw u.recordException(m),m}finally{u.end()}})})}};TI.KoaInstrumentation=ZD});var aoe=S(Ka=>{"use strict";l();Object.defineProperty(Ka,"__esModule",{value:!0});Ka.KoaLayerType=Ka.AttributeNames=Ka.KoaInstrumentation=void 0;var E0e=soe();Object.defineProperty(Ka,"KoaInstrumentation",{enumerable:!0,get:function(){return E0e.KoaInstrumentation}});var T0e=KD();Object.defineProperty(Ka,"AttributeNames",{enumerable:!0,get:function(){return T0e.AttributeNames}});var S0e=gI();Object.defineProperty(Ka,"KoaLayerType",{enumerable:!0,get:function(){return S0e.KoaLayerType}})});var XD=S(Jo=>{"use strict";l();Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ConnectNames=Jo.ConnectTypes=Jo.AttributeNames=void 0;var y0e;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(y0e=Jo.AttributeNames||(Jo.AttributeNames={}));var R0e;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(R0e=Jo.ConnectTypes||(Jo.ConnectTypes={}));var I0e;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(I0e=Jo.ConnectNames||(Jo.ConnectNames={}))});var poe=S($p=>{"use strict";l();Object.defineProperty($p,"__esModule",{value:!0});$p.PACKAGE_NAME=$p.PACKAGE_VERSION=void 0;$p.PACKAGE_VERSION="0.57.0";$p.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var foe=S(SI=>{"use strict";l();Object.defineProperty(SI,"__esModule",{value:!0});SI._LAYERS_STORE_PROPERTY=void 0;SI._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var moe=S(Ja=>{"use strict";l();Object.defineProperty(Ja,"__esModule",{value:!0});Ja.generateRoute=Ja.replaceCurrentStackRoute=Ja.addNewStackLayer=void 0;var b0e=K(),Za=foe(),N0e=e=>{Array.isArray(e[Za._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,Za._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[Za._LAYERS_STORE_PROPERTY].push("/");let t=e[Za._LAYERS_STORE_PROPERTY].length;return()=>{t===e[Za._LAYERS_STORE_PROPERTY].length?e[Za._LAYERS_STORE_PROPERTY].pop():b0e.diag.warn("Connect: Trying to pop the stack multiple time")}};Ja.addNewStackLayer=N0e;var O0e=(e,t)=>{t&&e[Za._LAYERS_STORE_PROPERTY].splice(-1,1,t)};Ja.replaceCurrentStackRoute=O0e;var C0e=e=>e[Za._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);Ja.generateRoute=C0e});var hoe=S(Xa=>{"use strict";l();Object.defineProperty(Xa,"__esModule",{value:!0});Xa.ConnectInstrumentation=Xa.ANONYMOUS_NAME=void 0;var v0e=K(),_oe=Xe(),Bp=XD(),goe=poe(),AI=Pe(),P0e=We(),QD=moe();Xa.ANONYMOUS_NAME="anonymous";var ek=class extends AI.InstrumentationBase{constructor(t={}){super(goe.PACKAGE_NAME,goe.PACKAGE_VERSION,t)}init(){return[new AI.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,AI.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,AI.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...o){let r=t.apply(this,o);return n._patchApp(r),r}}_patchNext(t,n){return function(r){let i=t.apply(this,[r]);return n(),i}}_startSpan(t,n){let o,r,i;t?(o=Bp.ConnectTypes.REQUEST_HANDLER,i=Bp.ConnectNames.REQUEST_HANDLER,r=t):(o=Bp.ConnectTypes.MIDDLEWARE,i=Bp.ConnectNames.MIDDLEWARE,r=n.name||Xa.ANONYMOUS_NAME);let s=`${i} - ${r}`,a={attributes:{[P0e.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[Bp.AttributeNames.CONNECT_TYPE]:o,[Bp.AttributeNames.CONNECT_NAME]:r}};return this.tracer.startSpan(s,a)}_patchMiddleware(t,n){let o=this,r=n.length===4;function i(){if(!o.isEnabled())return n.apply(this,arguments);let[s,a,c]=r?[1,2,3]:[0,1,2],u=arguments[s],d=arguments[a],p=arguments[c];(0,QD.replaceCurrentStackRoute)(u,t);let f=(0,_oe.getRPCMetadata)(v0e.context.active());t&&f?.type===_oe.RPCType.HTTP&&(f.route=(0,QD.generateRoute)(u));let m="";t?m=`request handler - ${t}`:m=`middleware - ${n.name||Xa.ANONYMOUS_NAME}`;let _=o._startSpan(t,n);o._diag.debug("start span",m);let h=!1;function E(){h?o._diag.debug(`span ${_.name} - already finished`):(h=!0,o._diag.debug(`finishing span ${_.name}`),_.end()),d.removeListener("close",E)}return d.addListener("close",E),arguments[c]=o._patchNext(p,E),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...o){let r=o[o.length-1],i=o[o.length-2]||"";return o[o.length-1]=n._patchMiddleware(i,r),t.apply(this,o)}}_patchHandle(t){let n=this;return function(){let[o,r]=[0,2],i=arguments[o],s=arguments[r],a=(0,QD.addNewStackLayer)(i);return typeof s=="function"&&(arguments[r]=n._patchOut(s,a)),t.apply(this,arguments)}}_patchOut(t,n){return function(...r){return n(),Reflect.apply(t,this,r)}}};Xa.ConnectInstrumentation=ek});var Toe=S(So=>{"use strict";l();Object.defineProperty(So,"__esModule",{value:!0});So.ConnectTypes=So.ConnectNames=So.AttributeNames=So.ANONYMOUS_NAME=So.ConnectInstrumentation=void 0;var Eoe=hoe();Object.defineProperty(So,"ConnectInstrumentation",{enumerable:!0,get:function(){return Eoe.ConnectInstrumentation}});Object.defineProperty(So,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return Eoe.ANONYMOUS_NAME}});var tk=XD();Object.defineProperty(So,"AttributeNames",{enumerable:!0,get:function(){return tk.AttributeNames}});Object.defineProperty(So,"ConnectNames",{enumerable:!0,get:function(){return tk.ConnectNames}});Object.defineProperty(So,"ConnectTypes",{enumerable:!0,get:function(){return tk.ConnectTypes}})});var Roe=S(cn=>{"use strict";l();Object.defineProperty(cn,"__esModule",{value:!0});cn.DB_SYSTEM_VALUE_MSSQL=cn.ATTR_NET_PEER_PORT=cn.ATTR_NET_PEER_NAME=cn.ATTR_DB_USER=cn.ATTR_DB_SYSTEM=cn.ATTR_DB_STATEMENT=cn.ATTR_DB_SQL_TABLE=cn.ATTR_DB_NAME=void 0;cn.ATTR_DB_NAME="db.name";cn.ATTR_DB_SQL_TABLE="db.sql.table";cn.ATTR_DB_STATEMENT="db.statement";cn.ATTR_DB_SYSTEM="db.system";cn.ATTR_DB_USER="db.user";cn.ATTR_NET_PEER_NAME="net.peer.name";cn.ATTR_NET_PEER_PORT="net.peer.port";cn.DB_SYSTEM_VALUE_MSSQL="mssql"});var Ioe=S(Gp=>{"use strict";l();Object.defineProperty(Gp,"__esModule",{value:!0});Gp.once=Gp.getSpanName=void 0;function M0e(e,t,n,o){return e==="execBulkLoad"&&o&&t?`${e} ${o} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}Gp.getSpanName=M0e;var L0e=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Gp.once=L0e});var boe=S(jp=>{"use strict";l();Object.defineProperty(jp,"__esModule",{value:!0});jp.PACKAGE_NAME=jp.PACKAGE_VERSION=void 0;jp.PACKAGE_VERSION="0.33.0";jp.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var Poe=S(ec=>{"use strict";l();Object.defineProperty(ec,"__esModule",{value:!0});ec.TediousInstrumentation=ec.INJECTED_CTX=void 0;var Vp=K(),w0e=require("events"),zi=Pe(),Xu=We(),Qa=Roe(),Noe=Ioe(),Ooe=boe(),voe=Symbol("opentelemetry.instrumentation-tedious.current-database");ec.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var Coe=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function yI(e){Object.defineProperty(this,voe,{value:e,writable:!0})}var rk=class e extends zi.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(Ooe.PACKAGE_NAME,Ooe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,zi.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,zi.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new zi.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let o of Coe)(0,zi.isWrapped)(n[o])&&this._unwrap(n,o),this._wrap(n,o,this._patchQuery(o,t));return(0,zi.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let o of Coe)this._unwrap(n,o);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return yI.call(this,this.config?.options?.database),this.removeListener("databaseChange",yI),this.on("databaseChange",yI),this.once("end",()=>{this.removeListener("databaseChange",yI)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Vp.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,o){return new Promise(r=>{try{let i="set context_info @opentelemetry_traceparent",s=new n.Request(i,c=>{r()});Object.defineProperty(s,ec.INJECTED_CTX,{value:!0});let a=Buffer.from(o,"utf8");s.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),t.execSql(s)}catch{r()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return o=>{let r=this;function i(s){if(s?.[ec.INJECTED_CTX])return o.apply(this,arguments);if(!(s instanceof w0e.EventEmitter))return r._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),o.apply(this,arguments);let a=0,c=0,u=()=>c++,d=()=>a++,p=this[voe],f=(P=>P.sqlTextOrProcedure==="sp_prepare"&&P.parametersByName?.stmt?.value?P.parametersByName.stmt.value:P.sqlTextOrProcedure)(s),m={};r._dbSemconvStability&zi.SemconvStability.OLD&&(m[Qa.ATTR_DB_SYSTEM]=Qa.DB_SYSTEM_VALUE_MSSQL,m[Qa.ATTR_DB_NAME]=p,m[Qa.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,m[Qa.ATTR_DB_STATEMENT]=f,m[Qa.ATTR_DB_SQL_TABLE]=s.table),r._dbSemconvStability&zi.SemconvStability.STABLE&&(m[Xu.ATTR_DB_NAMESPACE]=p,m[Xu.ATTR_DB_SYSTEM_NAME]=Xu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,m[Xu.ATTR_DB_QUERY_TEXT]=f,m[Xu.ATTR_DB_COLLECTION_NAME]=s.table),r._netSemconvStability&zi.SemconvStability.OLD&&(m[Qa.ATTR_NET_PEER_NAME]=this.config?.server,m[Qa.ATTR_NET_PEER_PORT]=this.config?.options?.port),r._netSemconvStability&zi.SemconvStability.STABLE&&(m[Xu.ATTR_SERVER_ADDRESS]=this.config?.server,m[Xu.ATTR_SERVER_PORT]=this.config?.options?.port);let _=r.tracer.startSpan((0,Noe.getSpanName)(t,p,f,s.table),{kind:Vp.SpanKind.CLIENT,attributes:m}),h=(0,Noe.once)(P=>{s.removeListener("done",u),s.removeListener("doneInProc",u),s.removeListener("doneProc",d),s.removeListener("error",h),this.removeListener("end",h),_.setAttribute("tedious.procedure_count",a),_.setAttribute("tedious.statement_count",c),P&&_.setStatus({code:Vp.SpanStatusCode.ERROR,message:P.message}),_.end()});s.on("done",u),s.on("doneInProc",u),s.on("doneProc",d),s.once("error",h),this.on("end",h),typeof s.callback=="function"?r._wrap(s,"callback",r._patchCallbackQuery(h)):r._diag.error("Expected request.callback to be a function");let E=()=>Vp.context.with(Vp.trace.setSpan(Vp.context.active(),_),o,this,...arguments);if(!(r.getConfig().enableTraceContextPropagation&&r._shouldInjectFor(t)))return E();let C=r._buildTraceparent(_);r._injectContextInfo(this,n,C).finally(E)}return Object.defineProperty(i,"length",{value:o.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(o,r,i){return t(o),n.apply(this,arguments)}}};ec.TediousInstrumentation=rk});var xoe=S(RI=>{"use strict";l();Object.defineProperty(RI,"__esModule",{value:!0});RI.TediousInstrumentation=void 0;var D0e=Poe();Object.defineProperty(RI,"TediousInstrumentation",{enumerable:!0,get:function(){return D0e.TediousInstrumentation}})});var Doe=S(Fp=>{"use strict";l();Object.defineProperty(Fp,"__esModule",{value:!0});Fp.PACKAGE_NAME=Fp.PACKAGE_VERSION=void 0;Fp.PACKAGE_VERSION="0.57.0";Fp.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var Uoe=S(II=>{"use strict";l();Object.defineProperty(II,"__esModule",{value:!0});II.GenericPoolInstrumentation=void 0;var Hp=K(),Qu=Pe(),koe=Doe(),ik="generic-pool",sk=class extends Qu.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(koe.PACKAGE_NAME,koe.PACKAGE_VERSION,t)}init(){return[new Qu.InstrumentationNodeModuleDefinition(ik,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,Qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Qu.InstrumentationNodeModuleDefinition(ik,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,Qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Qu.InstrumentationNodeModuleDefinition(ik,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,Qu.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...r){let i=Hp.context.active(),s=n.tracer.startSpan("generic-pool.acquire",{},i);return Hp.context.with(Hp.trace.setSpan(i,s),()=>t.call(this,...r).then(a=>(s.end(),a),a=>{throw s.recordException(a),s.end(),a}))}}_poolWrapper(t){let n=this;return function(){let r=t.apply(this,arguments);return n._wrap(r,"acquire",n._acquireWithCallbacksPatcher.bind(n)),r}}_acquireWithCallbacksPatcher(t){let n=this;return function(r,i){if(n._isDisabled)return t.call(this,r,i);let s=Hp.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},s);return Hp.context.with(Hp.trace.setSpan(s,a),()=>{t.call(this,(c,u)=>{if(a.end(),r)return r(c,u)},i)})}}};II.GenericPoolInstrumentation=sk});var $oe=S(bI=>{"use strict";l();Object.defineProperty(bI,"__esModule",{value:!0});bI.GenericPoolInstrumentation=void 0;var $0e=Uoe();Object.defineProperty(bI,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return $0e.GenericPoolInstrumentation}})});var ck=S(qi=>{"use strict";l();Object.defineProperty(qi,"__esModule",{value:!0});qi.ATTR_NET_PEER_PORT=qi.ATTR_NET_PEER_NAME=qi.ATTR_MESSAGING_SYSTEM=qi.ATTR_MESSAGING_OPERATION=void 0;qi.ATTR_MESSAGING_OPERATION="messaging.operation";qi.ATTR_MESSAGING_SYSTEM="messaging.system";qi.ATTR_NET_PEER_NAME="net.peer.name";qi.ATTR_NET_PEER_PORT="net.peer.port"});var uk=S(Pt=>{"use strict";l();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.ATTR_MESSAGING_CONVERSATION_ID=Pt.OLD_ATTR_MESSAGING_MESSAGE_ID=Pt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Pt.ATTR_MESSAGING_URL=Pt.ATTR_MESSAGING_PROTOCOL_VERSION=Pt.ATTR_MESSAGING_PROTOCOL=Pt.MESSAGING_OPERATION_VALUE_PROCESS=Pt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Pt.ATTR_MESSAGING_DESTINATION_KIND=Pt.ATTR_MESSAGING_DESTINATION=void 0;Pt.ATTR_MESSAGING_DESTINATION="messaging.destination";Pt.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Pt.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Pt.MESSAGING_OPERATION_VALUE_PROCESS="process";Pt.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Pt.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Pt.ATTR_MESSAGING_URL="messaging.url";Pt.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Pt.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Pt.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var lk=S(el=>{"use strict";l();Object.defineProperty(el,"__esModule",{value:!0});el.DEFAULT_CONFIG=el.EndOperation=void 0;var G0e;(function(e){e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout"})(G0e=el.EndOperation||(el.EndOperation={}));el.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var zoe=S(xt=>{"use strict";l();Object.defineProperty(xt,"__esModule",{value:!0});xt.isConfirmChannelTracing=xt.unmarkConfirmChannelTracing=xt.markConfirmChannelTracing=xt.getConnectionAttributesFromUrl=xt.getConnectionAttributesFromServer=xt.normalizeExchange=xt.CONNECTION_ATTRIBUTES=xt.CHANNEL_CONSUME_TIMEOUT_TIMER=xt.CHANNEL_SPANS_NOT_ENDED=xt.MESSAGE_STORED_SPAN=void 0;var dk=K(),tc=Pe(),NI=We(),Wg=ck(),OI=uk();xt.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");xt.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");xt.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");xt.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var pk=(0,dk.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),j0e=e=>e!==""?e:"<default>";xt.normalizeExchange=j0e;var V0e=e=>e.replace(/:[^:@/]*@/,":***@"),Voe=(e,t)=>e||(t==="AMQP"?5672:5671),Foe=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},Hoe=e=>e||"localhost",Yi=(e,t,n,o)=>n?{[t]:n}:(dk.diag.error(`amqplib instrumentation: could not extract connection attribute ${o} from user supplied url`,{url:e}),{}),F0e=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[Wg.ATTR_MESSAGING_SYSTEM]:t}:{}};xt.getConnectionAttributesFromServer=F0e;var H0e=(e,t)=>{let n={[OI.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let o=e,r=Foe(o?.protocol);Object.assign(n,{...Yi(e,OI.ATTR_MESSAGING_PROTOCOL,r,"protocol")});let i=Hoe(o?.hostname);t&tc.SemconvStability.OLD&&Object.assign(n,{...Yi(e,Wg.ATTR_NET_PEER_NAME,i,"hostname")}),t&tc.SemconvStability.STABLE&&Object.assign(n,{...Yi(e,NI.ATTR_SERVER_ADDRESS,i,"hostname")});let s=Voe(o.port,r);t&tc.SemconvStability.OLD&&Object.assign(n,Yi(e,Wg.ATTR_NET_PEER_PORT,s,"port")),t&tc.SemconvStability.STABLE&&Object.assign(n,Yi(e,NI.ATTR_SERVER_PORT,s,"port"))}else{let o=V0e(e);n[OI.ATTR_MESSAGING_URL]=o;try{let r=new URL(o),i=Foe(r.protocol);Object.assign(n,{...Yi(o,OI.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let s=Hoe(r.hostname);t&tc.SemconvStability.OLD&&Object.assign(n,{...Yi(o,Wg.ATTR_NET_PEER_NAME,s,"hostname")}),t&tc.SemconvStability.STABLE&&Object.assign(n,{...Yi(o,NI.ATTR_SERVER_ADDRESS,s,"hostname")});let a=Voe(r.port?parseInt(r.port):void 0,i);t&tc.SemconvStability.OLD&&Object.assign(n,Yi(o,Wg.ATTR_NET_PEER_PORT,a,"port")),t&tc.SemconvStability.STABLE&&Object.assign(n,Yi(o,NI.ATTR_SERVER_PORT,a,"port"))}catch(r){dk.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:o,err:r})}}return n};xt.getConnectionAttributesFromUrl=H0e;var z0e=e=>e.setValue(pk,!0);xt.markConfirmChannelTracing=z0e;var q0e=e=>e.deleteValue(pk);xt.unmarkConfirmChannelTracing=q0e;var Y0e=e=>e.getValue(pk)===!0;xt.isConfirmChannelTracing=Y0e});var qoe=S(zp=>{"use strict";l();Object.defineProperty(zp,"__esModule",{value:!0});zp.PACKAGE_NAME=zp.PACKAGE_VERSION=void 0;zp.PACKAGE_VERSION="0.61.0";zp.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Woe=S(PI=>{"use strict";l();Object.defineProperty(PI,"__esModule",{value:!0});PI.AmqplibInstrumentation=void 0;var Rt=K(),CI=Xe(),He=Pe(),W0e=ck(),Fr=uk(),or=lk(),Mt=zoe(),Yoe=qoe(),vI=[">=0.5.5 <1"],fk=class extends He.InstrumentationBase{_netSemconvStability;constructor(t={}){super(Yoe.PACKAGE_NAME,Yoe.PACKAGE_VERSION,{...or.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,He.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...or.DEFAULT_CONFIG,...t})}init(){let t=new He.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",vI,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new He.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",vI,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),o=new He.InstrumentationNodeModuleFile("amqplib/lib/connect.js",vI,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new He.InstrumentationNodeModuleDefinition("amqplib",vI,void 0,void 0,[t,o,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,He.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,He.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,He.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,He.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,He.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,or.EndOperation.Ack)),(0,He.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,or.EndOperation.Nack)),(0,He.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,or.EndOperation.Reject)),(0,He.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,or.EndOperation.AckAll)),(0,He.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,or.EndOperation.NackAll)),(0,He.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,He.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,He.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,He.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,He.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,He.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,He.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,He.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,He.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,He.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,He.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(r,i,s){return t.call(this,r,i,function(a,c){if(a==null){let u=(0,Mt.getConnectionAttributesFromUrl)(r,n._netSemconvStability),d=(0,Mt.getConnectionAttributesFromServer)(c);c[Mt.CONNECTION_ATTRIBUTES]={...u,...d}}s.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(r){if(r==="close"){n.endAllSpansOnChannel(this,!0,or.EndOperation.ChannelClosed,void 0);let i=this[Mt.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[Mt.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else r==="error"&&n.endAllSpansOnChannel(this,!0,or.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,o){let r=this;return function(s){return r.endAllSpansOnChannel(this,t,n,s),o.apply(this,arguments)}}getAckPatch(t,n,o){let r=this;return function(s,a,c){let u=this,d=n===or.EndOperation.Reject?a:c,p=u[Mt.CHANNEL_SPANS_NOT_ENDED]??[],f=p.findIndex(m=>m.msg===s);if(f<0)r.endConsumerSpan(s,t,n,d);else if(n!==or.EndOperation.Reject&&a){for(let m=0;m<=f;m++)r.endConsumerSpan(p[m].msg,t,n,d);p.splice(0,f+1)}else r.endConsumerSpan(s,t,n,d),p.splice(f,1);return o.apply(this,arguments)}}getConsumePatch(t,n){let o=this;return function(i,s,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,Mt.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:d}=o.getConfig();if(d){let p=setInterval(()=>{o.checkConsumeTimeoutOnChannel(c)},d);p.unref(),c[Mt.CHANNEL_CONSUME_TIMEOUT_TIMER]=p}c[Mt.CHANNEL_SPANS_NOT_ENDED]=[]}let u=function(d){if(!d)return s.call(this,d);let p=d.properties.headers??{},f=Rt.propagation.extract(Rt.ROOT_CONTEXT,p),m=d.fields?.exchange,_;if(o._config.useLinksForConsume){let R=f?Rt.trace.getSpan(f)?.spanContext():void 0;f=void 0,R&&(_=[{context:R}])}let h=o.tracer.startSpan(`${i} process`,{kind:Rt.SpanKind.CONSUMER,attributes:{...c?.connection?.[Mt.CONNECTION_ATTRIBUTES],[Fr.ATTR_MESSAGING_DESTINATION]:m,[Fr.ATTR_MESSAGING_DESTINATION_KIND]:Fr.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fr.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:d.fields?.routingKey,[W0e.ATTR_MESSAGING_OPERATION]:Fr.MESSAGING_OPERATION_VALUE_PROCESS,[Fr.OLD_ATTR_MESSAGING_MESSAGE_ID]:d?.properties.messageId,[Fr.ATTR_MESSAGING_CONVERSATION_ID]:d?.properties.correlationId},links:_},f),{consumeHook:E}=o.getConfig();E&&(0,He.safeExecuteInTheMiddle)(()=>E(h,{moduleVersion:t,msg:d}),R=>{R&&Rt.diag.error("amqplib instrumentation: consumerHook error",R)},!0),a?.noAck||(c[Mt.CHANNEL_SPANS_NOT_ENDED].push({msg:d,timeOfConsume:(0,CI.hrTime)()}),d[Mt.MESSAGE_STORED_SPAN]=h);let T=f||Rt.ROOT_CONTEXT;Rt.context.with(Rt.trace.setSpan(T,h),()=>{s.call(this,d)}),a?.noAck&&(o.callConsumeEndHook(h,d,!1,or.EndOperation.AutoAck),h.end())};return arguments[1]=u,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let o=this;return function(i,s,a,c,u){let d=this,{span:p,modifiedOptions:f}=o.createPublishSpan(o,i,s,d,c),{publishHook:m}=o.getConfig();m&&(0,He.safeExecuteInTheMiddle)(()=>m(p,{moduleVersion:t,exchange:i,routingKey:s,content:a,options:f,isConfirmChannel:!0}),T=>{T&&Rt.diag.error("amqplib instrumentation: publishHook error",T)},!0);let _=function(T,R){try{u?.call(this,T,R)}finally{let{publishConfirmHook:C}=o.getConfig();C&&(0,He.safeExecuteInTheMiddle)(()=>C(p,{moduleVersion:t,exchange:i,routingKey:s,content:a,options:c,isConfirmChannel:!0,confirmError:T}),P=>{P&&Rt.diag.error("amqplib instrumentation: publishConfirmHook error",P)},!0),T&&p.setStatus({code:Rt.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),p.end()}},h=(0,Mt.markConfirmChannelTracing)(Rt.context.active()),E=[...arguments];return E[3]=f,E[4]=Rt.context.bind((0,Mt.unmarkConfirmChannelTracing)(Rt.trace.setSpan(h,p)),_),Rt.context.with(h,n.bind(this,...E))}}getPublishPatch(t,n){let o=this;return function(i,s,a,c){if((0,Mt.isConfirmChannelTracing)(Rt.context.active()))return n.apply(this,arguments);{let u=this,{span:d,modifiedOptions:p}=o.createPublishSpan(o,i,s,u,c),{publishHook:f}=o.getConfig();f&&(0,He.safeExecuteInTheMiddle)(()=>f(d,{moduleVersion:t,exchange:i,routingKey:s,content:a,options:p,isConfirmChannel:!1}),h=>{h&&Rt.diag.error("amqplib instrumentation: publishHook error",h)},!0);let m=[...arguments];m[3]=p;let _=n.apply(this,m);return d.end(),_}}}createPublishSpan(t,n,o,r,i){let s=(0,Mt.normalizeExchange)(n),a=t.tracer.startSpan(`publish ${s}`,{kind:Rt.SpanKind.PRODUCER,attributes:{...r.connection[Mt.CONNECTION_ATTRIBUTES],[Fr.ATTR_MESSAGING_DESTINATION]:n,[Fr.ATTR_MESSAGING_DESTINATION_KIND]:Fr.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fr.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:o,[Fr.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[Fr.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),c=i??{};return c.headers=c.headers??{},Rt.propagation.inject(Rt.trace.setSpan(Rt.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(t,n,o,r){let i=t[Mt.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Rt.SpanStatusCode.ERROR,message:o!==or.EndOperation.ChannelClosed&&o!==or.EndOperation.ChannelError?`${o} called on message${r===!0?" with requeue":r===!1?" without requeue":""}`:o}),this.callConsumeEndHook(i,t,n,o),i.end(),t[Mt.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,o,r){(t[Mt.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(s=>{this.endConsumerSpan(s.msg,n,o,r)}),t[Mt.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,o,r){let{consumeEndHook:i}=this.getConfig();i&&(0,He.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:o,endOperation:r}),s=>{s&&Rt.diag.error("amqplib instrumentation: consumerEndHook error",s)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,CI.hrTime)(),o=t[Mt.CHANNEL_SPANS_NOT_ENDED]??[],r,{consumeTimeoutMs:i}=this.getConfig();for(r=0;r<o.length;r++){let s=o[r],a=(0,CI.hrTimeDuration)(s.timeOfConsume,n);if((0,CI.hrTimeToMilliseconds)(a)<i)break;this.endConsumerSpan(s.msg,null,or.EndOperation.InstrumentationTimeout,!0)}o.splice(0,r)}};PI.AmqplibInstrumentation=fk});var Zoe=S(nc=>{"use strict";l();Object.defineProperty(nc,"__esModule",{value:!0});nc.EndOperation=nc.DEFAULT_CONFIG=nc.AmqplibInstrumentation=void 0;var K0e=Woe();Object.defineProperty(nc,"AmqplibInstrumentation",{enumerable:!0,get:function(){return K0e.AmqplibInstrumentation}});var Koe=lk();Object.defineProperty(nc,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Koe.DEFAULT_CONFIG}});Object.defineProperty(nc,"EndOperation",{enumerable:!0,get:function(){return Koe.EndOperation}})});function zI(e){return(0,vie.createHash)("sha256").update(e).digest("hex")}var Cie,vie,Oie,HI,qI=I(()=>{"use strict";l();Cie=require("node:sqlite"),vie=require("node:crypto"),Oie=new WeakMap,HI=class extends Cie.DatabaseSync{query(t){let n=Oie.get(this);n||(n=new Map,Oie.set(this,n));let o=n.get(t);return o||(o=this.prepare(t),n.set(t,o)),o}}});function t$e(){let t=process.env.XDG_DATA_HOME||(0,Kp.join)((0,xie.homedir)(),".local","share");return(0,Kp.join)(t,"opencode-lore")}function j(){if(YI)return YI;let e=process.env.LORE_DB_PATH,t;if(e)(0,Ok.mkdirSync)((0,Kp.dirname)(e),{recursive:!0}),t=e;else{let o=t$e();(0,Ok.mkdirSync)(o,{recursive:!0}),t=(0,Kp.join)(o,"lore.db")}let n=new HI(t);return n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA foreign_keys = ON"),n.exec("PRAGMA busy_timeout = 5000"),n.exec("PRAGMA auto_vacuum = INCREMENTAL"),r$e(n),YI=n,YI}function r$e(e){let n=e.query("SELECT name FROM sqlite_master WHERE type='table' AND name='schema_version'").get()?e.query("SELECT version FROM schema_version").get()?.version??0:0;if(n>=Jg.length){Pie(e);return}for(let o=n;o<Jg.length;o++)if(o===n$e)e.exec("PRAGMA auto_vacuum = INCREMENTAL"),e.exec("VACUUM");else try{e.exec(Jg[o])}catch(r){if(r instanceof Error&&/duplicate column name/i.test(r.message)){let i=o$e(Jg[o],e);i.trim()&&e.exec(i)}else throw r}e.exec(`UPDATE schema_version SET version = ${Jg.length}`),Pie(e)}function o$e(e,t){return e.replace(/ALTER\s+TABLE\s+(\w+)\s+ADD\s+COLUMN\s+(\w+)\b[^;]*;/gi,(n,o,r)=>t.query(`PRAGMA table_info(${o})`).all().some(s=>s.name===r)?"":n)}function Pie(e){e.exec(`
10
+ CREATE TABLE IF NOT EXISTS kv_meta (
11
+ key TEXT PRIMARY KEY,
12
+ value TEXT NOT NULL
13
+ );
14
+ `)}function De(e,t){let n=j().query("SELECT id FROM projects WHERE path = ?").get(e);if(n)return n.id;let o=crypto.randomUUID();return j().query("INSERT INTO projects (id, path, name, created_at) VALUES (?, ?, ?, ?)").run(o,e,t??e.split("/").pop()??"unknown",Date.now()),o}function Ck(e){return j().query("SELECT name FROM projects WHERE id = ?").get(e)?.name??null}function vk(e){return j().query("SELECT force_min_layer FROM session_state WHERE session_id = ?").get(e)?.force_min_layer??0}function Pk(e,t){t===0?j().query("DELETE FROM session_state WHERE session_id = ?").run(e):j().query("INSERT OR REPLACE INTO session_state (session_id, force_min_layer, updated_at) VALUES (?, ?, ?)").run(e,t,Date.now())}var Kp,Ok,xie,Jg,YI,n$e,Ki=I(()=>{"use strict";l();qI();Kp=require("path"),Ok=require("fs"),xie=require("os"),Jg=[`
15
+ -- Version 1: Initial schema
16
+
17
+ CREATE TABLE IF NOT EXISTS projects (
18
+ id TEXT PRIMARY KEY,
19
+ path TEXT NOT NULL UNIQUE,
20
+ name TEXT,
21
+ created_at INTEGER NOT NULL
22
+ );
23
+
24
+ CREATE TABLE IF NOT EXISTS temporal_messages (
25
+ id TEXT PRIMARY KEY,
26
+ project_id TEXT NOT NULL REFERENCES projects(id),
27
+ session_id TEXT NOT NULL,
28
+ role TEXT NOT NULL,
29
+ content TEXT NOT NULL,
30
+ tokens INTEGER DEFAULT 0,
31
+ distilled INTEGER DEFAULT 0,
32
+ created_at INTEGER NOT NULL,
33
+ metadata TEXT
34
+ );
35
+
36
+ CREATE VIRTUAL TABLE IF NOT EXISTS temporal_fts USING fts5(
37
+ content,
38
+ content=temporal_messages,
39
+ content_rowid=rowid,
40
+ tokenize='porter unicode61'
41
+ );
42
+
43
+ -- Triggers to keep FTS in sync
44
+ CREATE TRIGGER IF NOT EXISTS temporal_fts_insert AFTER INSERT ON temporal_messages BEGIN
45
+ INSERT INTO temporal_fts(rowid, content) VALUES (new.rowid, new.content);
46
+ END;
47
+
48
+ CREATE TRIGGER IF NOT EXISTS temporal_fts_delete AFTER DELETE ON temporal_messages BEGIN
49
+ INSERT INTO temporal_fts(temporal_fts, rowid, content) VALUES('delete', old.rowid, old.content);
50
+ END;
51
+
52
+ CREATE TRIGGER IF NOT EXISTS temporal_fts_update AFTER UPDATE ON temporal_messages BEGIN
53
+ INSERT INTO temporal_fts(temporal_fts, rowid, content) VALUES('delete', old.rowid, old.content);
54
+ INSERT INTO temporal_fts(rowid, content) VALUES (new.rowid, new.content);
55
+ END;
56
+
57
+ CREATE INDEX IF NOT EXISTS idx_temporal_session ON temporal_messages(session_id);
58
+ CREATE INDEX IF NOT EXISTS idx_temporal_project ON temporal_messages(project_id);
59
+ CREATE INDEX IF NOT EXISTS idx_temporal_distilled ON temporal_messages(distilled);
60
+ CREATE INDEX IF NOT EXISTS idx_temporal_created ON temporal_messages(created_at);
61
+
62
+ CREATE TABLE IF NOT EXISTS distillations (
63
+ id TEXT PRIMARY KEY,
64
+ project_id TEXT NOT NULL REFERENCES projects(id),
65
+ session_id TEXT NOT NULL,
66
+ narrative TEXT NOT NULL,
67
+ facts TEXT NOT NULL,
68
+ source_ids TEXT NOT NULL,
69
+ generation INTEGER DEFAULT 0,
70
+ token_count INTEGER DEFAULT 0,
71
+ created_at INTEGER NOT NULL
72
+ );
73
+
74
+ CREATE INDEX IF NOT EXISTS idx_distillation_session ON distillations(session_id);
75
+ CREATE INDEX IF NOT EXISTS idx_distillation_project ON distillations(project_id);
76
+ CREATE INDEX IF NOT EXISTS idx_distillation_generation ON distillations(generation);
77
+ CREATE INDEX IF NOT EXISTS idx_distillation_created ON distillations(created_at);
78
+
79
+ CREATE TABLE IF NOT EXISTS knowledge (
80
+ id TEXT PRIMARY KEY,
81
+ project_id TEXT,
82
+ category TEXT NOT NULL,
83
+ title TEXT NOT NULL,
84
+ content TEXT NOT NULL,
85
+ source_session TEXT,
86
+ cross_project INTEGER DEFAULT 0,
87
+ confidence REAL DEFAULT 1.0,
88
+ created_at INTEGER NOT NULL,
89
+ updated_at INTEGER NOT NULL,
90
+ metadata TEXT
91
+ );
92
+
93
+ CREATE VIRTUAL TABLE IF NOT EXISTS knowledge_fts USING fts5(
94
+ title,
95
+ content,
96
+ category,
97
+ content=knowledge,
98
+ content_rowid=rowid,
99
+ tokenize='porter unicode61'
100
+ );
101
+
102
+ CREATE TRIGGER IF NOT EXISTS knowledge_fts_insert AFTER INSERT ON knowledge BEGIN
103
+ INSERT INTO knowledge_fts(rowid, title, content, category)
104
+ VALUES (new.rowid, new.title, new.content, new.category);
105
+ END;
106
+
107
+ CREATE TRIGGER IF NOT EXISTS knowledge_fts_delete AFTER DELETE ON knowledge BEGIN
108
+ INSERT INTO knowledge_fts(knowledge_fts, rowid, title, content, category)
109
+ VALUES('delete', old.rowid, old.title, old.content, old.category);
110
+ END;
111
+
112
+ CREATE TRIGGER IF NOT EXISTS knowledge_fts_update AFTER UPDATE ON knowledge BEGIN
113
+ INSERT INTO knowledge_fts(knowledge_fts, rowid, title, content, category)
114
+ VALUES('delete', old.rowid, old.title, old.content, old.category);
115
+ INSERT INTO knowledge_fts(rowid, title, content, category)
116
+ VALUES (new.rowid, new.title, new.content, new.category);
117
+ END;
118
+
119
+ CREATE INDEX IF NOT EXISTS idx_knowledge_project ON knowledge(project_id);
120
+ CREATE INDEX IF NOT EXISTS idx_knowledge_category ON knowledge(category);
121
+ CREATE INDEX IF NOT EXISTS idx_knowledge_cross ON knowledge(cross_project);
122
+
123
+ CREATE TABLE IF NOT EXISTS schema_version (
124
+ version INTEGER NOT NULL
125
+ );
126
+
127
+ INSERT INTO schema_version (version) VALUES (1);
128
+ `,`
129
+ -- Version 2: Replace narrative+facts with observations text
130
+ ALTER TABLE distillations ADD COLUMN observations TEXT NOT NULL DEFAULT '';
131
+ `,`
132
+ -- Version 3: One-time vacuum to reclaim accumulated free pages, and enable
133
+ -- incremental auto-vacuum so future deletes return pages to the OS.
134
+ -- VACUUM must run outside a transaction and cannot be in a multi-statement
135
+ -- exec, so it is handled specially in the migrate() function.
136
+ `,`
137
+ -- Version 4: Persistent session state for error recovery.
138
+ -- Stores forceMinLayer so it survives OpenCode restarts. Without this,
139
+ -- a "prompt too long" error recovery (escalate to layer 2) is lost if
140
+ -- the process restarts before the next turn.
141
+ CREATE TABLE IF NOT EXISTS session_state (
142
+ session_id TEXT PRIMARY KEY,
143
+ force_min_layer INTEGER NOT NULL DEFAULT 0,
144
+ updated_at INTEGER NOT NULL
145
+ );
146
+ `,`
147
+ -- Version 5: Multi-resolution composable distillations.
148
+ -- Instead of deleting gen-0 distillations during meta-distillation,
149
+ -- mark them as archived. Archived entries are excluded from the in-context
150
+ -- prefix but remain searchable via the recall tool, providing a detailed
151
+ -- "zoom-in" layer beneath the compressed gen-1 summary.
152
+ -- Inspired by Cartridges (Eyuboglu et al., 2025) composability: independently
153
+ -- compressed representations can be concatenated and queried without retraining.
154
+ -- Reference: https://arxiv.org/abs/2501.17390
155
+ ALTER TABLE distillations ADD COLUMN archived INTEGER NOT NULL DEFAULT 0;
156
+ CREATE INDEX IF NOT EXISTS idx_distillation_archived ON distillations(archived);
157
+ `,`
158
+ -- Version 6: Compound indexes for common multi-column query patterns.
159
+ -- Almost every query filters on (project_id, session_id) but only single-column
160
+ -- indexes existed, forcing SQLite to pick one and scan for the rest.
161
+
162
+ -- temporal_messages: covers bySession, search-LIKE fallback, count, undistilledCount
163
+ CREATE INDEX IF NOT EXISTS idx_temporal_project_session ON temporal_messages(project_id, session_id);
164
+ -- temporal_messages: covers undistilled() and undistilledCount() with distilled filter
165
+ CREATE INDEX IF NOT EXISTS idx_temporal_project_session_distilled ON temporal_messages(project_id, session_id, distilled);
166
+ -- temporal_messages: covers pruning TTL pass and size-cap pass (distilled=1 ordered by created_at)
167
+ CREATE INDEX IF NOT EXISTS idx_temporal_project_distilled_created ON temporal_messages(project_id, distilled, created_at);
168
+
169
+ -- distillations: covers loadForSession, latestObservations, searchDistillations, resetOrphans
170
+ CREATE INDEX IF NOT EXISTS idx_distillation_project_session ON distillations(project_id, session_id);
171
+ -- distillations: covers gen0Count, loadGen0, gradient prefix loading (archived filter)
172
+ CREATE INDEX IF NOT EXISTS idx_distillation_project_session_gen_archived ON distillations(project_id, session_id, generation, archived);
173
+
174
+ -- Drop redundant single-column indexes that are now left-prefixes of compound indexes.
175
+ -- idx_temporal_project is a prefix of idx_temporal_project_session.
176
+ -- idx_distillation_project is a prefix of idx_distillation_project_session.
177
+ -- idx_temporal_distilled is a prefix of no compound index but is low-selectivity (0/1)
178
+ -- and all queries that use it also filter on project_id \u2014 covered by the new compounds.
179
+ DROP INDEX IF EXISTS idx_temporal_project;
180
+ DROP INDEX IF EXISTS idx_temporal_distilled;
181
+ DROP INDEX IF EXISTS idx_distillation_project;
182
+ `,`
183
+ -- Version 7: FTS5 for distillations \u2014 enables ranked search instead of LIKE.
184
+ CREATE VIRTUAL TABLE IF NOT EXISTS distillation_fts USING fts5(
185
+ observations,
186
+ content=distillations,
187
+ content_rowid=rowid,
188
+ tokenize='porter unicode61'
189
+ );
190
+
191
+ -- Backfill existing data (skip empty observations from schema v1\u2192v2 migration)
192
+ INSERT INTO distillation_fts(rowid, observations)
193
+ SELECT rowid, observations FROM distillations WHERE observations != '';
194
+
195
+ -- Sync triggers
196
+ CREATE TRIGGER IF NOT EXISTS distillation_fts_insert AFTER INSERT ON distillations BEGIN
197
+ INSERT INTO distillation_fts(rowid, observations) VALUES (new.rowid, new.observations);
198
+ END;
199
+
200
+ CREATE TRIGGER IF NOT EXISTS distillation_fts_delete AFTER DELETE ON distillations BEGIN
201
+ INSERT INTO distillation_fts(distillation_fts, rowid, observations)
202
+ VALUES('delete', old.rowid, old.observations);
203
+ END;
204
+
205
+ CREATE TRIGGER IF NOT EXISTS distillation_fts_update AFTER UPDATE ON distillations BEGIN
206
+ INSERT INTO distillation_fts(distillation_fts, rowid, observations)
207
+ VALUES('delete', old.rowid, old.observations);
208
+ INSERT INTO distillation_fts(rowid, observations) VALUES (new.rowid, new.observations);
209
+ END;
210
+ `,`
211
+ -- Version 8: Embedding BLOB column for vector search (Voyage AI).
212
+ -- No backfill \u2014 entries get embedded lazily on next create/update
213
+ -- or via explicit backfill when embeddings are first enabled.
214
+ ALTER TABLE knowledge ADD COLUMN embedding BLOB;
215
+
216
+ -- Key-value metadata table for plugin state (e.g. embedding config fingerprint).
217
+ CREATE TABLE IF NOT EXISTS kv_meta (
218
+ key TEXT PRIMARY KEY,
219
+ value TEXT NOT NULL
220
+ );
221
+ `,`
222
+ -- Version 9: Embedding BLOB column for distillation vector search.
223
+ -- Same pattern as knowledge embeddings (version 8). Enables semantic
224
+ -- search over distilled session summaries via cosine similarity.
225
+ -- No backfill \u2014 entries get embedded lazily on next distillation
226
+ -- or via explicit backfill when embeddings are first enabled.
227
+ ALTER TABLE distillations ADD COLUMN embedding BLOB;
228
+ `,`
229
+ -- Version 10: lat.md section cache + knowledge cross-references.
230
+
231
+ -- lat.md section cache for recall integration.
232
+ -- Parsed from lat.md/ directory markdown files, FTS5-indexed for search.
233
+ CREATE TABLE IF NOT EXISTS lat_sections (
234
+ id TEXT PRIMARY KEY,
235
+ project_id TEXT NOT NULL REFERENCES projects(id),
236
+ file TEXT NOT NULL,
237
+ heading TEXT NOT NULL,
238
+ depth INTEGER NOT NULL,
239
+ content TEXT NOT NULL,
240
+ content_hash TEXT NOT NULL,
241
+ first_paragraph TEXT,
242
+ updated_at INTEGER NOT NULL
243
+ );
244
+
245
+ CREATE VIRTUAL TABLE IF NOT EXISTS lat_sections_fts USING fts5(
246
+ heading,
247
+ content,
248
+ content=lat_sections,
249
+ content_rowid=rowid,
250
+ tokenize='porter unicode61'
251
+ );
252
+
253
+ CREATE TRIGGER IF NOT EXISTS lat_fts_insert AFTER INSERT ON lat_sections BEGIN
254
+ INSERT INTO lat_sections_fts(rowid, heading, content)
255
+ VALUES (new.rowid, new.heading, new.content);
256
+ END;
257
+
258
+ CREATE TRIGGER IF NOT EXISTS lat_fts_delete AFTER DELETE ON lat_sections BEGIN
259
+ INSERT INTO lat_sections_fts(lat_sections_fts, rowid, heading, content)
260
+ VALUES('delete', old.rowid, old.heading, old.content);
261
+ END;
262
+
263
+ CREATE TRIGGER IF NOT EXISTS lat_fts_update AFTER UPDATE ON lat_sections BEGIN
264
+ INSERT INTO lat_sections_fts(lat_sections_fts, rowid, heading, content)
265
+ VALUES('delete', old.rowid, old.heading, old.content);
266
+ INSERT INTO lat_sections_fts(rowid, heading, content)
267
+ VALUES (new.rowid, new.heading, new.content);
268
+ END;
269
+
270
+ CREATE INDEX IF NOT EXISTS idx_lat_sections_project ON lat_sections(project_id);
271
+ CREATE INDEX IF NOT EXISTS idx_lat_sections_file ON lat_sections(project_id, file);
272
+
273
+ -- Knowledge cross-references via [[entry-id]] wiki links.
274
+ -- ON DELETE CASCADE: when either entry is deleted, the ref row is auto-removed.
275
+ CREATE TABLE IF NOT EXISTS knowledge_refs (
276
+ from_id TEXT NOT NULL REFERENCES knowledge(id) ON DELETE CASCADE,
277
+ to_id TEXT NOT NULL REFERENCES knowledge(id) ON DELETE CASCADE,
278
+ PRIMARY KEY (from_id, to_id)
279
+ );
280
+ `,`
281
+ -- Version 11: F3b -- unambiguous chunk terminator in temporal_messages.content.
282
+ --
283
+ -- Pre-F3b, partsToText joined chunks with a newline. Tool-output payloads
284
+ -- can contain newlines too, so the boundary between a tool envelope and a
285
+ -- following plain-text or [reasoning] chunk was structurally ambiguous.
286
+ -- This caused two known limitations in the F3 distill-input truncator:
287
+ -- trailing text could be swallowed into a tool payload, and embedded
288
+ -- literal envelope strings inside a payload (e.g. when reading AGENTS.md)
289
+ -- could fabricate fake boundaries.
290
+ --
291
+ -- F3b switches the chunk separator to newline plus ASCII Unit Separator
292
+ -- (char 31). The Unit Separator is non-word so FTS5's unicode61 tokenizer
293
+ -- ignores it (zero BM25 impact). New rows are written via the post-F3b
294
+ -- partsToText. Existing rows are rewritten in place by the UPDATE below,
295
+ -- which uses pure SQL replace() to inject the Unit Separator after every
296
+ -- legacy chunk-prefix sequence -- the same boundary patterns the legacy
297
+ -- F3 reader was already trying to recover.
298
+ --
299
+ -- Trade-off (acceptable): any embedded legacy chunk-prefix sequence
300
+ -- inside a tool payload becomes a structural boundary post-migration.
301
+ -- This matches what the legacy F3 reader did at read-time anyway, baked
302
+ -- into the row permanently. The migration runs once per machine.
303
+ --
304
+ -- Idempotent: a row that already contains the Unit Separator before a
305
+ -- chunk prefix no longer matches the search literal (the separator
306
+ -- interposes), so re-running the UPDATE is a no-op for migrated rows.
307
+ -- (Important: migrate() in db.ts runs each migration via database.exec()
308
+ -- with no explicit BEGIN/COMMIT around the whole loop. SQLite makes this
309
+ -- single UPDATE statement atomic per-statement, so partial progress on
310
+ -- crash is safe to retry thanks to the idempotency above.)
311
+ --
312
+ -- char(10) = newline, char(31) = Unit Separator. SQLite has no native
313
+ -- regex, but two nested replace() calls on the literal prefixes are
314
+ -- sufficient because both legacy chunk prefixes match at line-start.
315
+ --
316
+ -- Each row UPDATE fires the temporal_fts_update trigger once; because
317
+ -- the Unit Separator is a non-word character, the re-indexed content
318
+ -- tokenizes identically -- net no-op for FTS scoring.
319
+ UPDATE temporal_messages
320
+ SET content = replace(
321
+ replace(
322
+ content,
323
+ char(10) || '[tool:',
324
+ char(10) || char(31) || '[tool:'
325
+ ),
326
+ char(10) || '[reasoning] ',
327
+ char(10) || char(31) || '[reasoning] '
328
+ )
329
+ WHERE content LIKE '%' || char(10) || '[tool:%'
330
+ OR content LIKE '%' || char(10) || '[reasoning] %';
331
+ `,`
332
+ -- Version 12: Context health diagnostic columns on distillations.
333
+ --
334
+ -- r_compression: k/\u221AN where k = distilled token count, N = source token
335
+ -- count. Values < 1.0 signal likely lossy compression. NULL for rows
336
+ -- created before this migration or for meta-distillations (gen > 0)
337
+ -- where the metric is not computed.
338
+ --
339
+ -- c_norm: normalized variance of relative-existence weights over source
340
+ -- message timestamps. Range [0, 1]; 0 = uniform distribution, 1 = attention
341
+ -- dominated by distant past. NULL for pre-migration rows or meta-distillations.
342
+ --
343
+ -- Both columns are nullable REALs \u2014 cheap to add, no backfill needed.
344
+ ALTER TABLE distillations ADD COLUMN r_compression REAL;
345
+ ALTER TABLE distillations ADD COLUMN c_norm REAL;
346
+ `];n$e=2});function tl(e,t){let n=t||i$e,o=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,r=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Lie(e,o,r)}function Lie(e,t,n){if(s$e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Mie(e.children,t,n)}return Array.isArray(e)?Mie(e,t,n):""}function Mie(e,t,n){let o=[],r=-1;for(;++r<e.length;)o[r]=Lie(e[r],t,n);return o.join("")}function s$e(e){return!!(e&&typeof e=="object")}var i$e,wie=I(()=>{l();i$e={}});var WI=I(()=>{l();wie()});var xk,Die=I(()=>{l();xk={AElig:"\xC6",AMP:"&",Aacute:"\xC1",Abreve:"\u0102",Acirc:"\xC2",Acy:"\u0410",Afr:"\u{1D504}",Agrave:"\xC0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2A53",Aogon:"\u0104",Aopf:"\u{1D538}",ApplyFunction:"\u2061",Aring:"\xC5",Ascr:"\u{1D49C}",Assign:"\u2254",Atilde:"\xC3",Auml:"\xC4",Backslash:"\u2216",Barv:"\u2AE7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212C",Beta:"\u0392",Bfr:"\u{1D505}",Bopf:"\u{1D539}",Breve:"\u02D8",Bscr:"\u212C",Bumpeq:"\u224E",CHcy:"\u0427",COPY:"\xA9",Cacute:"\u0106",Cap:"\u22D2",CapitalDifferentialD:"\u2145",Cayleys:"\u212D",Ccaron:"\u010C",Ccedil:"\xC7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010A",Cedilla:"\xB8",CenterDot:"\xB7",Cfr:"\u212D",Chi:"\u03A7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2A74",Congruent:"\u2261",Conint:"\u222F",ContourIntegral:"\u222E",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2A2F",Cscr:"\u{1D49E}",Cup:"\u22D3",CupCap:"\u224D",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040F",Dagger:"\u2021",Darr:"\u21A1",Dashv:"\u2AE4",Dcaron:"\u010E",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\u{1D507}",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",Diamond:"\u22C4",DifferentialD:"\u2146",Dopf:"\u{1D53B}",Dot:"\xA8",DotDot:"\u20DC",DotEqual:"\u2250",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",Downarrow:"\u21D3",Dscr:"\u{1D49F}",Dstrok:"\u0110",ENG:"\u014A",ETH:"\xD0",Eacute:"\xC9",Ecaron:"\u011A",Ecirc:"\xCA",Ecy:"\u042D",Edot:"\u0116",Efr:"\u{1D508}",Egrave:"\xC8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25FB",EmptyVerySmallSquare:"\u25AB",Eogon:"\u0118",Eopf:"\u{1D53C}",Epsilon:"\u0395",Equal:"\u2A75",EqualTilde:"\u2242",Equilibrium:"\u21CC",Escr:"\u2130",Esim:"\u2A73",Eta:"\u0397",Euml:"\xCB",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\u{1D509}",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",Fopf:"\u{1D53D}",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03DC",Gbreve:"\u011E",Gcedil:"\u0122",Gcirc:"\u011C",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\u{1D50A}",Gg:"\u22D9",Gopf:"\u{1D53E}",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",Gt:"\u226B",HARDcy:"\u042A",Hacek:"\u02C7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210C",HilbertSpace:"\u210B",Hopf:"\u210D",HorizontalLine:"\u2500",Hscr:"\u210B",Hstrok:"\u0126",HumpDownHump:"\u224E",HumpEqual:"\u224F",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xCD",Icirc:"\xCE",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xCC",Im:"\u2111",Imacr:"\u012A",ImaginaryI:"\u2148",Implies:"\u21D2",Int:"\u222C",Integral:"\u222B",Intersection:"\u22C2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012E",Iopf:"\u{1D540}",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xCF",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\u{1D50D}",Jopf:"\u{1D541}",Jscr:"\u{1D4A5}",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040C",Kappa:"\u039A",Kcedil:"\u0136",Kcy:"\u041A",Kfr:"\u{1D50E}",Kopf:"\u{1D542}",Kscr:"\u{1D4A6}",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039B",Lang:"\u27EA",Laplacetrf:"\u2112",Larr:"\u219E",Lcaron:"\u013D",Lcedil:"\u013B",Lcy:"\u041B",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",LeftRightArrow:"\u2194",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",Leftarrow:"\u21D0",Leftrightarrow:"\u21D4",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2AA1",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",Lfr:"\u{1D50F}",Ll:"\u22D8",Lleftarrow:"\u21DA",Lmidot:"\u013F",LongLeftArrow:"\u27F5",LongLeftRightArrow:"\u27F7",LongRightArrow:"\u27F6",Longleftarrow:"\u27F8",Longleftrightarrow:"\u27FA",Longrightarrow:"\u27F9",Lopf:"\u{1D543}",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21B0",Lstrok:"\u0141",Lt:"\u226A",Map:"\u2905",Mcy:"\u041C",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",MinusPlus:"\u2213",Mopf:"\u{1D544}",Mscr:"\u2133",Mu:"\u039C",NJcy:"\u040A",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041D",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
347
+ `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',Qfr:"\u{1D514}",Qopf:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\u{1D516}",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\u{1D54A}",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\u{1D4AE}",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:" ",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\u{1D517}",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\u{1D54B}",TripleDot:"\u20DB",Tscr:"\u{1D4AF}",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\u{1D518}",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\u{1D54C}",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\u{1D4B0}",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",Vopf:"\u{1D54D}",Vscr:"\u{1D4B1}",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\u{1D51A}",Wopf:"\u{1D54E}",Wscr:"\u{1D4B2}",Xfr:"\u{1D51B}",Xi:"\u039E",Xopf:"\u{1D54F}",Xscr:"\u{1D4B3}",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\u{1D51C}",Yopf:"\u{1D550}",Yscr:"\u{1D4B4}",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\u{1D4B5}",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\u{1D51E}",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\u{1D552}",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\u{1D4B6}",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\u{1D520}",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\u{1D554}",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\u{1D521}",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\u{1D555}",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\u{1D4B9}",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\u{1D522}",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\u{1D523}",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\u{1D557}",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\u{1D4BB}",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\u{1D524}",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\u{1D558}",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\u{1D525}",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\u{1D559}",horbar:"\u2015",hscr:"\u{1D4BD}",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\u{1D526}",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\u{1D55A}",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\u{1D4BE}",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\u{1D527}",jmath:"\u0237",jopf:"\u{1D55B}",jscr:"\u{1D4BF}",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\u{1D528}",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\u{1D55C}",kscr:"\u{1D4C0}",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\u{1D4C1}",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\u{1D55E}",mp:"\u2213",mscr:"\u{1D4C2}",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\u{1D55F}",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\u{1D52C}",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\u{1D560}",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\u{1D52D}",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\u{1D561}",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\u{1D4C5}",psi:"\u03C8",puncsp:"\u2008",qfr:"\u{1D52E}",qint:"\u2A0C",qopf:"\u{1D562}",qprime:"\u2057",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\u{1D52F}",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\u{1D4C7}",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\u{1D531}",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\u{1D4C9}",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\u{1D532}",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\u{1D566}",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\u{1D4CA}",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\u{1D534}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\u{1D536}",yicy:"\u0457",yopf:"\u{1D56A}",yscr:"\u{1D4CE}",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\u{1D537}",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\u{1D56B}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}});function Zp(e){return a$e.call(xk,e)?xk[e]:!1}var a$e,KI=I(()=>{l();Die();a$e={}.hasOwnProperty});function Rn(e,t,n,o){let r=e.length,i=0,s;if(t<0?t=-t>r?0:r+t:t=t>r?r:t,n=n>0?n:0,o.length<1e4)s=Array.from(o),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<o.length;)s=o.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function sr(e,t){return e.length>0?(Rn(e,e.length,0,t),e):t}var oc=I(()=>{l()});function Uie(e){let t={},n=-1;for(;++n<e.length;)c$e(t,e[n]);return t}function c$e(e,t){let n;for(n in t){let r=(kie.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],s;if(i)for(s in i){kie.call(r,s)||(r[s]=[]);let a=i[s];u$e(r[s],Array.isArray(a)?a:a?[a]:[])}}}function u$e(e,t){let n=-1,o=[];for(;++n<t.length;)(t[n].add==="after"?e:o).push(t[n]);Rn(e,0,0,o)}var kie,$ie=I(()=>{l();oc();kie={}.hasOwnProperty});function ZI(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}var Mk=I(()=>{l()});function js(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var JI=I(()=>{l()});function Xg(e){return e!==null&&(e<32||e===127)}function ae(e){return e!==null&&e<-2}function Dt(e){return e!==null&&(e<0||e===32)}function be(e){return e===-2||e===-1||e===32}function ic(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}var Hr,ar,Bie,Qg,Gie,jie,Vie,Fie,tt=I(()=>{l();Hr=ic(/[A-Za-z]/),ar=ic(/[\dA-Za-z]/),Bie=ic(/[#-'*+\--9=?A-Z^-~]/);Qg=ic(/\d/),Gie=ic(/[\dA-Fa-f]/),jie=ic(/[!-/:-@[-`{-~]/);Vie=ic(new RegExp("\\p{P}|\\p{S}","u")),Fie=ic(/\s/)});function Oe(e,t,n,o){let r=o?o-1:Number.POSITIVE_INFINITY,i=0;return s;function s(c){return be(c)?(e.enter(n),a(c)):t(c)}function a(c){return be(c)&&i++<r?(e.consume(c),a):(e.exit(n),t(c))}}var un=I(()=>{l();tt()});function l$e(e){let t=e.attempt(this.parser.constructs.contentInitial,o,r),n;return t;function o(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Oe(e,t,"linePrefix")}function r(a){return e.enter("paragraph"),i(a)}function i(a){let c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ae(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}var Hie,zie=I(()=>{l();un();tt();Hie={tokenize:l$e}});function d$e(e){let t=this,n=[],o=0,r,i,s;return a;function a(C){if(o<n.length){let P=n[o];return t.containerState=P[1],e.attempt(P[0].continuation,c,u)(C)}return u(C)}function c(C){if(o++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,r&&R();let P=t.events.length,M=P,O;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){O=t.events[M][1].end;break}T(o);let z=P;for(;z<t.events.length;)t.events[z][1].end={...O},z++;return Rn(t.events,M+1,0,t.events.slice(P)),t.events.length=z,u(C)}return a(C)}function u(C){if(o===n.length){if(!r)return f(C);if(r.currentConstruct&&r.currentConstruct.concrete)return _(C);t.interrupt=!!(r.currentConstruct&&!r._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qie,d,p)(C)}function d(C){return r&&R(),T(o),f(C)}function p(C){return t.parser.lazy[t.now().line]=o!==n.length,s=t.now().offset,_(C)}function f(C){return t.containerState={},e.attempt(qie,m,_)(C)}function m(C){return o++,n.push([t.currentConstruct,t.containerState]),f(C)}function _(C){if(C===null){r&&R(),T(0),e.consume(C);return}return r=r||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:r,contentType:"flow",previous:i}),h(C)}function h(C){if(C===null){E(e.exit("chunkFlow"),!0),T(0),e.consume(C);return}return ae(C)?(e.consume(C),E(e.exit("chunkFlow")),o=0,t.interrupt=void 0,a):(e.consume(C),h)}function E(C,P){let M=t.sliceStream(C);if(P&&M.push(null),C.previous=i,i&&(i.next=C),i=C,r.defineSkip(C.start),r.write(M),t.parser.lazy[C.start.line]){let O=r.events.length;for(;O--;)if(r.events[O][1].start.offset<s&&(!r.events[O][1].end||r.events[O][1].end.offset>s))return;let z=t.events.length,ie=z,$,q;for(;ie--;)if(t.events[ie][0]==="exit"&&t.events[ie][1].type==="chunkFlow"){if($){q=t.events[ie][1].end;break}$=!0}for(T(o),O=z;O<t.events.length;)t.events[O][1].end={...q},O++;Rn(t.events,ie+1,0,t.events.slice(z)),t.events.length=O}}function T(C){let P=n.length;for(;P-- >C;){let M=n[P];t.containerState=M[1],M[0].exit.call(t,e)}n.length=C}function R(){r.write([null]),i=void 0,r=void 0,t.containerState._closeFlow=void 0}}function p$e(e,t,n){return Oe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}var Yie,qie,Wie=I(()=>{l();un();tt();oc();Yie={tokenize:d$e},qie={tokenize:p$e}});function Jp(e){if(e===null||Dt(e)||Fie(e))return 1;if(Vie(e))return 2}var Lk=I(()=>{l();tt()});function Xp(e,t,n){let o=[],r=-1;for(;++r<e.length;){let i=e[r].resolveAll;i&&!o.includes(i)&&(t=i(t,n),o.push(i))}return t}var XI=I(()=>{l()});function f$e(e,t){let n=-1,o,r,i,s,a,c,u,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(o=n;o--;)if(e[o][0]==="exit"&&e[o][1].type==="attentionSequence"&&e[o][1]._open&&t.sliceSerialize(e[o][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[o][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[o][1].end.offset-e[o][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[o][1].end.offset-e[o][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let p={...e[o][1].end},f={...e[n][1].start};Kie(p,-c),Kie(f,c),s={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[o][1].end}},a={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},i={type:c>1?"strongText":"emphasisText",start:{...e[o][1].end},end:{...e[n][1].start}},r={type:c>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[o][1].end={...s.start},e[n][1].start={...a.end},u=[],e[o][1].end.offset-e[o][1].start.offset&&(u=sr(u,[["enter",e[o][1],t],["exit",e[o][1],t]])),u=sr(u,[["enter",r,t],["enter",s,t],["exit",s,t],["enter",i,t]]),u=sr(u,Xp(t.parser.constructs.insideSpan.null,e.slice(o+1,n),t)),u=sr(u,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",r,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=sr(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Rn(e,o-1,n-o+3,u),n=o+u.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function m$e(e,t){let n=this.parser.constructs.attentionMarkers.null,o=this.previous,r=Jp(o),i;return s;function s(c){return i=c,e.enter("attentionSequence"),a(c)}function a(c){if(c===i)return e.consume(c),a;let u=e.exit("attentionSequence"),d=Jp(c),p=!d||d===2&&r||n.includes(c),f=!r||r===2&&d||n.includes(o);return u._open=!!(i===42?p:p&&(r||!f)),u._close=!!(i===42?f:f&&(d||!p)),t(c)}}function Kie(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var eh,Zie=I(()=>{l();oc();Lk();XI();eh={name:"attention",resolveAll:f$e,tokenize:m$e}});function _$e(e,t,n){let o=0;return r;function r(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return Hr(m)?(e.consume(m),s):m===64?n(m):u(m)}function s(m){return m===43||m===45||m===46||ar(m)?(o=1,a(m)):u(m)}function a(m){return m===58?(e.consume(m),o=0,c):(m===43||m===45||m===46||ar(m))&&o++<32?(e.consume(m),a):(o=0,u(m))}function c(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Xg(m)?n(m):(e.consume(m),c)}function u(m){return m===64?(e.consume(m),d):Bie(m)?(e.consume(m),u):n(m)}function d(m){return ar(m)?p(m):n(m)}function p(m){return m===46?(e.consume(m),o=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):f(m)}function f(m){if((m===45||ar(m))&&o++<63){let _=m===45?f:p;return e.consume(m),_}return n(m)}}var wk,Jie=I(()=>{l();tt();wk={name:"autolink",tokenize:_$e}});function g$e(e,t,n){return o;function o(i){return be(i)?Oe(e,r,"linePrefix")(i):r(i)}function r(i){return i===null||ae(i)?t(i):n(i)}}var sc,QI=I(()=>{l();un();tt();sc={partial:!0,tokenize:g$e}});function h$e(e,t,n){let o=this;return r;function r(s){if(s===62){let a=o.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return be(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function E$e(e,t,n){let o=this;return r;function r(s){return be(s)?Oe(e,i,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(eb,t,n)(s)}}function T$e(e){e.exit("blockQuote")}var eb,Xie=I(()=>{l();un();tt();eb={continuation:{tokenize:E$e},exit:T$e,name:"blockQuote",tokenize:h$e}});function S$e(e,t,n){return o;function o(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),r}function r(i){return jie(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}var tb,Qie=I(()=>{l();tt();tb={name:"characterEscape",tokenize:S$e}});function A$e(e,t,n){let o=this,r=0,i,s;return a;function a(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),i=31,s=ar,d(p))}function u(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=Gie,d):(e.enter("characterReferenceValue"),i=7,s=Qg,d(p))}function d(p){if(p===59&&r){let f=e.exit("characterReferenceValue");return s===ar&&!Zp(o.sliceSerialize(f))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&r++<i?(e.consume(p),d):n(p)}}var nb,ese=I(()=>{l();KI();tt();nb={name:"characterReference",tokenize:A$e}});function y$e(e,t,n){let o=this,r={partial:!0,tokenize:M},i=0,s=0,a;return c;function c(O){return u(O)}function u(O){let z=o.events[o.events.length-1];return i=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(O)}function d(O){return O===a?(s++,e.consume(O),d):s<3?n(O):(e.exit("codeFencedFenceSequence"),be(O)?Oe(e,p,"whitespace")(O):p(O))}function p(O){return O===null||ae(O)?(e.exit("codeFencedFence"),o.interrupt?t(O):e.check(tse,h,P)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(O))}function f(O){return O===null||ae(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(O)):be(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Oe(e,m,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),f)}function m(O){return O===null||ae(O)?p(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(O))}function _(O){return O===null||ae(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(O)):O===96&&O===a?n(O):(e.consume(O),_)}function h(O){return e.attempt(r,P,E)(O)}function E(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),T}function T(O){return i>0&&be(O)?Oe(e,R,"linePrefix",i+1)(O):R(O)}function R(O){return O===null||ae(O)?e.check(tse,h,P)(O):(e.enter("codeFlowValue"),C(O))}function C(O){return O===null||ae(O)?(e.exit("codeFlowValue"),R(O)):(e.consume(O),C)}function P(O){return e.exit("codeFenced"),t(O)}function M(O,z,ie){let $=0;return q;function q(le){return O.enter("lineEnding"),O.consume(le),O.exit("lineEnding"),J}function J(le){return O.enter("codeFencedFence"),be(le)?Oe(O,Z,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(le):Z(le)}function Z(le){return le===a?(O.enter("codeFencedFenceSequence"),k(le)):ie(le)}function k(le){return le===a?($++,O.consume(le),k):$>=s?(O.exit("codeFencedFenceSequence"),be(le)?Oe(O,ue,"whitespace")(le):ue(le)):ie(le)}function ue(le){return le===null||ae(le)?(O.exit("codeFencedFence"),z(le)):ie(le)}}}function R$e(e,t,n){let o=this;return r;function r(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return o.parser.lazy[o.now().line]?n(s):t(s)}}var tse,rb,nse=I(()=>{l();un();tt();tse={partial:!0,tokenize:R$e},rb={concrete:!0,name:"codeFenced",tokenize:y$e}});function b$e(e,t,n){let o=this;return r;function r(u){return e.enter("codeIndented"),Oe(e,i,"linePrefix",5)(u)}function i(u){let d=o.events[o.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?c(u):ae(u)?e.attempt(I$e,s,c)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ae(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function c(u){return e.exit("codeIndented"),t(u)}}function N$e(e,t,n){let o=this;return r;function r(s){return o.parser.lazy[o.now().line]?n(s):ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),r):Oe(e,i,"linePrefix",5)(s)}function i(s){let a=o.events[o.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ae(s)?r(s):n(s)}}var th,I$e,rse=I(()=>{l();un();tt();th={name:"codeIndented",tokenize:b$e},I$e={partial:!0,tokenize:N$e}});function O$e(e){let t=e.length-4,n=3,o,r;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(o=n;++o<t;)if(e[o][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(o=n-1,t++;++o<=t;)r===void 0?o!==t&&e[o][1].type!=="lineEnding"&&(r=o):(o===t||e[o][1].type==="lineEnding")&&(e[r][1].type="codeTextData",o!==r+2&&(e[r][1].end=e[o-1][1].end,e.splice(r+2,o-r-2),t-=o-r-2,o=r+2),r=void 0);return e}function C$e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function v$e(e,t,n){let o=this,r=0,i,s;return a;function a(f){return e.enter("codeText"),e.enter("codeTextSequence"),c(f)}function c(f){return f===96?(e.consume(f),r++,c):(e.exit("codeTextSequence"),u(f))}function u(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),u):f===96?(s=e.enter("codeTextSequence"),i=0,p(f)):ae(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("codeTextData"),d(f))}function d(f){return f===null||f===32||f===96||ae(f)?(e.exit("codeTextData"),u(f)):(e.consume(f),d)}function p(f){return f===96?(e.consume(f),i++,p):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(s.type="codeTextData",d(f))}}var Dk,ose=I(()=>{l();tt();Dk={name:"codeText",previous:C$e,resolve:O$e,tokenize:v$e}});function nh(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}var ob,ise=I(()=>{l();ob=class{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){let o=n??Number.POSITIVE_INFINITY;return o<this.left.length?this.left.slice(t,o):t>this.left.length?this.right.slice(this.right.length-o+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-o+this.left.length).reverse())}splice(t,n,o){let r=n||0;this.setCursor(Math.trunc(t));let i=this.right.splice(this.right.length-r,Number.POSITIVE_INFINITY);return o&&nh(this.left,o),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),nh(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nh(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){let n=this.left.splice(t,Number.POSITIVE_INFINITY);nh(this.right,n.reverse())}else{let n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nh(this.left,n.reverse())}}}});function ib(e){let t={},n=-1,o,r,i,s,a,c,u,d=new ob(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(o=d.get(n),n&&o[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=o[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(o[0]==="enter")o[1].contentType&&(Object.assign(t,P$e(d,n)),n=t[n],u=!0);else if(o[1]._container){for(i=n,r=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(r&&(d.get(r)[1].type="lineEndingBlank"),s[1].type="lineEnding",r=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;r&&(o[1].end={...d.get(r)[1].start},a=d.slice(r,n),a.unshift(o),d.splice(r,n-r+1,a))}}return Rn(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function P$e(e,t){let n=e.get(t)[1],o=e.get(t)[2],r=t-1,i=[],s=n._tokenizer;s||(s=o.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));let a=s.events,c=[],u={},d,p,f=-1,m=n,_=0,h=0,E=[h];for(;m;){for(;e.get(++r)[1]!==m;);i.push(r),m._tokenizer||(d=o.sliceStream(m),m.next||d.push(null),p&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=m,m=m.next}for(m=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(h=f+1,E.push(h),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):E.pop(),f=E.length;f--;){let T=a.slice(E[f],E[f+1]),R=i.pop();c.push([R,R+T.length-1]),e.splice(R,2,T)}for(c.reverse(),f=-1;++f<c.length;)u[_+c[f][0]]=_+c[f][1],_+=c[f][1]-c[f][0]-1;return u}var kk=I(()=>{l();oc();ise()});function M$e(e){return ib(e),e}function L$e(e,t){let n;return o;function o(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),r(a)}function r(a){return a===null?i(a):ae(a)?e.check(x$e,s,i)(a):(e.consume(a),r)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,r}}function w$e(e,t,n){let o=this;return r;function r(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Oe(e,i,"linePrefix")}function i(s){if(s===null||ae(s))return n(s);let a=o.events[o.events.length-1];return!o.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(o.parser.constructs.flow,n,t)(s)}}var Uk,x$e,sse=I(()=>{l();un();tt();kk();Uk={resolve:M$e,tokenize:L$e},x$e={partial:!0,tokenize:w$e}});function sb(e,t,n,o,r,i,s,a,c){let u=c||Number.POSITIVE_INFINITY,d=0;return p;function p(T){return T===60?(e.enter(o),e.enter(r),e.enter(i),e.consume(T),e.exit(i),f):T===null||T===32||T===41||Xg(T)?n(T):(e.enter(o),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),h(T))}function f(T){return T===62?(e.enter(i),e.consume(T),e.exit(i),e.exit(r),e.exit(o),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(T))}function m(T){return T===62?(e.exit("chunkString"),e.exit(a),f(T)):T===null||T===60||ae(T)?n(T):(e.consume(T),T===92?_:m)}function _(T){return T===60||T===62||T===92?(e.consume(T),m):m(T)}function h(T){return!d&&(T===null||T===41||Dt(T))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(o),t(T)):d<u&&T===40?(e.consume(T),d++,h):T===41?(e.consume(T),d--,h):T===null||T===32||T===40||Xg(T)?n(T):(e.consume(T),T===92?E:h)}function E(T){return T===40||T===41||T===92?(e.consume(T),h):h(T)}}var $k=I(()=>{l();tt()});function ab(e,t,n,o,r,i){let s=this,a=0,c;return u;function u(m){return e.enter(o),e.enter(r),e.consume(m),e.exit(r),e.enter(i),d}function d(m){return a>999||m===null||m===91||m===93&&!c||m===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(m):m===93?(e.exit(i),e.enter(r),e.consume(m),e.exit(r),e.exit(o),t):ae(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===null||m===91||m===93||ae(m)||a++>999?(e.exit("chunkString"),d(m)):(e.consume(m),c||(c=!be(m)),m===92?f:p)}function f(m){return m===91||m===92||m===93?(e.consume(m),a++,p):p(m)}}var Bk=I(()=>{l();tt()});function cb(e,t,n,o,r,i){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(o),e.enter(r),e.consume(f),e.exit(r),s=f===40?41:f,c):n(f)}function c(f){return f===s?(e.enter(r),e.consume(f),e.exit(r),e.exit(o),t):(e.enter(i),u(f))}function u(f){return f===s?(e.exit(i),c(s)):f===null?n(f):ae(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Oe(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===s||f===null||ae(f)?(e.exit("chunkString"),u(f)):(e.consume(f),f===92?p:d)}function p(f){return f===s||f===92?(e.consume(f),d):d(f)}}var Gk=I(()=>{l();un();tt()});function nl(e,t){let n;return o;function o(r){return ae(r)?(e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),n=!0,o):be(r)?Oe(e,o,n?"linePrefix":"lineSuffix")(r):t(r)}}var jk=I(()=>{l();un();tt()});function k$e(e,t,n){let o=this,r;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return ab.call(o,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return r=js(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),c):n(m)}function c(m){return Dt(m)?nl(e,u)(m):u(m)}function u(m){return sb(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(D$e,p,p)(m)}function p(m){return be(m)?Oe(e,f,"whitespace")(m):f(m)}function f(m){return m===null||ae(m)?(e.exit("definition"),o.parser.defined.push(r),t(m)):n(m)}}function U$e(e,t,n){return o;function o(a){return Dt(a)?nl(e,r)(a):n(a)}function r(a){return cb(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return be(a)?Oe(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ae(a)?t(a):n(a)}}var Vk,D$e,ase=I(()=>{l();$k();Bk();un();Gk();jk();tt();JI();Vk={name:"definition",tokenize:k$e},D$e={partial:!0,tokenize:U$e}});function $$e(e,t,n){return o;function o(i){return e.enter("hardBreakEscape"),e.consume(i),r}function r(i){return ae(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}var Fk,cse=I(()=>{l();tt();Fk={name:"hardBreakEscape",tokenize:$$e}});function B$e(e,t){let n=e.length-2,o=3,r,i;return e[o][1].type==="whitespace"&&(o+=2),n-2>o&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(o===n-1||n-4>o&&e[n-2][1].type==="whitespace")&&(n-=o+1===n?2:4),n>o&&(r={type:"atxHeadingText",start:e[o][1].start,end:e[n][1].end},i={type:"chunkText",start:e[o][1].start,end:e[n][1].end,contentType:"text"},Rn(e,o,n-o+1,[["enter",r,t],["enter",i,t],["exit",i,t],["exit",r,t]])),e}function G$e(e,t,n){let o=0;return r;function r(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&o++<6?(e.consume(d),s):d===null||Dt(d)?(e.exit("atxHeadingSequence"),a(d)):n(d)}function a(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||ae(d)?(e.exit("atxHeading"),t(d)):be(d)?Oe(e,a,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),a(d))}function u(d){return d===null||d===35||Dt(d)?(e.exit("atxHeadingText"),a(d)):(e.consume(d),u)}}var Hk,use=I(()=>{l();un();tt();oc();Hk={name:"headingAtx",resolve:B$e,tokenize:G$e}});var lse,zk,dse=I(()=>{l();lse=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],zk=["pre","script","style","textarea"]});function F$e(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function H$e(e,t,n){let o=this,r,i,s,a,c;return u;function u(N){return d(N)}function d(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),p}function p(N){return N===33?(e.consume(N),f):N===47?(e.consume(N),i=!0,h):N===63?(e.consume(N),r=3,o.interrupt?t:v):Hr(N)?(e.consume(N),s=String.fromCharCode(N),E):n(N)}function f(N){return N===45?(e.consume(N),r=2,m):N===91?(e.consume(N),r=5,a=0,_):Hr(N)?(e.consume(N),r=4,o.interrupt?t:v):n(N)}function m(N){return N===45?(e.consume(N),o.interrupt?t:v):n(N)}function _(N){let bt="CDATA[";return N===bt.charCodeAt(a++)?(e.consume(N),a===bt.length?o.interrupt?t:Z:_):n(N)}function h(N){return Hr(N)?(e.consume(N),s=String.fromCharCode(N),E):n(N)}function E(N){if(N===null||N===47||N===62||Dt(N)){let bt=N===47,vo=s.toLowerCase();return!bt&&!i&&zk.includes(vo)?(r=1,o.interrupt?t(N):Z(N)):lse.includes(s.toLowerCase())?(r=6,bt?(e.consume(N),T):o.interrupt?t(N):Z(N)):(r=7,o.interrupt&&!o.parser.lazy[o.now().line]?n(N):i?R(N):C(N))}return N===45||ar(N)?(e.consume(N),s+=String.fromCharCode(N),E):n(N)}function T(N){return N===62?(e.consume(N),o.interrupt?t:Z):n(N)}function R(N){return be(N)?(e.consume(N),R):q(N)}function C(N){return N===47?(e.consume(N),q):N===58||N===95||Hr(N)?(e.consume(N),P):be(N)?(e.consume(N),C):q(N)}function P(N){return N===45||N===46||N===58||N===95||ar(N)?(e.consume(N),P):M(N)}function M(N){return N===61?(e.consume(N),O):be(N)?(e.consume(N),M):C(N)}function O(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,z):be(N)?(e.consume(N),O):ie(N)}function z(N){return N===c?(e.consume(N),c=null,$):N===null||ae(N)?n(N):(e.consume(N),z)}function ie(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Dt(N)?M(N):(e.consume(N),ie)}function $(N){return N===47||N===62||be(N)?C(N):n(N)}function q(N){return N===62?(e.consume(N),J):n(N)}function J(N){return N===null||ae(N)?Z(N):be(N)?(e.consume(N),J):n(N)}function Z(N){return N===45&&r===2?(e.consume(N),Ae):N===60&&r===1?(e.consume(N),ye):N===62&&r===4?(e.consume(N),Fn):N===63&&r===3?(e.consume(N),v):N===93&&r===5?(e.consume(N),Yt):ae(N)&&(r===6||r===7)?(e.exit("htmlFlowData"),e.check(j$e,Me,k)(N)):N===null||ae(N)?(e.exit("htmlFlowData"),k(N)):(e.consume(N),Z)}function k(N){return e.check(V$e,ue,Me)(N)}function ue(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),le}function le(N){return N===null||ae(N)?k(N):(e.enter("htmlFlowData"),Z(N))}function Ae(N){return N===45?(e.consume(N),v):Z(N)}function ye(N){return N===47?(e.consume(N),s="",at):Z(N)}function at(N){if(N===62){let bt=s.toLowerCase();return zk.includes(bt)?(e.consume(N),Fn):Z(N)}return Hr(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),at):Z(N)}function Yt(N){return N===93?(e.consume(N),v):Z(N)}function v(N){return N===62?(e.consume(N),Fn):N===45&&r===2?(e.consume(N),v):Z(N)}function Fn(N){return N===null||ae(N)?(e.exit("htmlFlowData"),Me(N)):(e.consume(N),Fn)}function Me(N){return e.exit("htmlFlow"),t(N)}}function z$e(e,t,n){let o=this;return r;function r(s){return ae(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return o.parser.lazy[o.now().line]?n(s):t(s)}}function q$e(e,t,n){return o;function o(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(sc,t,n)}}var qk,j$e,V$e,pse=I(()=>{l();tt();dse();QI();qk={concrete:!0,name:"htmlFlow",resolveTo:F$e,tokenize:H$e},j$e={partial:!0,tokenize:q$e},V$e={partial:!0,tokenize:z$e}});function Y$e(e,t,n){let o=this,r,i,s;return a;function a(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),c}function c(v){return v===33?(e.consume(v),u):v===47?(e.consume(v),M):v===63?(e.consume(v),C):Hr(v)?(e.consume(v),ie):n(v)}function u(v){return v===45?(e.consume(v),d):v===91?(e.consume(v),i=0,_):Hr(v)?(e.consume(v),R):n(v)}function d(v){return v===45?(e.consume(v),m):n(v)}function p(v){return v===null?n(v):v===45?(e.consume(v),f):ae(v)?(s=p,ye(v)):(e.consume(v),p)}function f(v){return v===45?(e.consume(v),m):p(v)}function m(v){return v===62?Ae(v):v===45?f(v):p(v)}function _(v){let Fn="CDATA[";return v===Fn.charCodeAt(i++)?(e.consume(v),i===Fn.length?h:_):n(v)}function h(v){return v===null?n(v):v===93?(e.consume(v),E):ae(v)?(s=h,ye(v)):(e.consume(v),h)}function E(v){return v===93?(e.consume(v),T):h(v)}function T(v){return v===62?Ae(v):v===93?(e.consume(v),T):h(v)}function R(v){return v===null||v===62?Ae(v):ae(v)?(s=R,ye(v)):(e.consume(v),R)}function C(v){return v===null?n(v):v===63?(e.consume(v),P):ae(v)?(s=C,ye(v)):(e.consume(v),C)}function P(v){return v===62?Ae(v):C(v)}function M(v){return Hr(v)?(e.consume(v),O):n(v)}function O(v){return v===45||ar(v)?(e.consume(v),O):z(v)}function z(v){return ae(v)?(s=z,ye(v)):be(v)?(e.consume(v),z):Ae(v)}function ie(v){return v===45||ar(v)?(e.consume(v),ie):v===47||v===62||Dt(v)?$(v):n(v)}function $(v){return v===47?(e.consume(v),Ae):v===58||v===95||Hr(v)?(e.consume(v),q):ae(v)?(s=$,ye(v)):be(v)?(e.consume(v),$):Ae(v)}function q(v){return v===45||v===46||v===58||v===95||ar(v)?(e.consume(v),q):J(v)}function J(v){return v===61?(e.consume(v),Z):ae(v)?(s=J,ye(v)):be(v)?(e.consume(v),J):$(v)}function Z(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),r=v,k):ae(v)?(s=Z,ye(v)):be(v)?(e.consume(v),Z):(e.consume(v),ue)}function k(v){return v===r?(e.consume(v),r=void 0,le):v===null?n(v):ae(v)?(s=k,ye(v)):(e.consume(v),k)}function ue(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Dt(v)?$(v):(e.consume(v),ue)}function le(v){return v===47||v===62||Dt(v)?$(v):n(v)}function Ae(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function ye(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),at}function at(v){return be(v)?Oe(e,Yt,"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):Yt(v)}function Yt(v){return e.enter("htmlTextData"),s(v)}}var Yk,fse=I(()=>{l();un();tt();Yk={name:"htmlText",tokenize:Y$e}});function J$e(e){let t=-1,n=[];for(;++t<e.length;){let o=e[t][1];if(n.push(e[t]),o.type==="labelImage"||o.type==="labelLink"||o.type==="labelEnd"){let r=o.type==="labelImage"?4:2;o.type="data",t+=r}}return e.length!==n.length&&Rn(e,0,e.length,n),e}function X$e(e,t){let n=e.length,o=0,r,i,s,a;for(;n--;)if(r=e[n][1],i){if(r.type==="link"||r.type==="labelLink"&&r._inactive)break;e[n][0]==="enter"&&r.type==="labelLink"&&(r._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(r.type==="labelImage"||r.type==="labelLink")&&!r._balanced&&(i=n,r.type!=="labelLink")){o=2;break}}else r.type==="labelEnd"&&(s=n);let c={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+o+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",c,t],["enter",u,t]],a=sr(a,e.slice(i+1,i+o+3)),a=sr(a,[["enter",d,t]]),a=sr(a,Xp(t.parser.constructs.insideSpan.null,e.slice(i+o+4,s-3),t)),a=sr(a,[["exit",d,t],e[s-2],e[s-1],["exit",u,t]]),a=sr(a,e.slice(s+1)),a=sr(a,[["exit",c,t]]),Rn(e,i,e.length,a),e}function Q$e(e,t,n){let o=this,r=o.events.length,i,s;for(;r--;)if((o.events[r][1].type==="labelImage"||o.events[r][1].type==="labelLink")&&!o.events[r][1]._balanced){i=o.events[r][1];break}return a;function a(f){return i?i._inactive?p(f):(s=o.parser.defined.includes(js(o.sliceSerialize({start:i.end,end:o.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),c):n(f)}function c(f){return f===40?e.attempt(W$e,d,s?d:p)(f):f===91?e.attempt(K$e,d,s?u:p)(f):s?d(f):p(f)}function u(f){return e.attempt(Z$e,d,p)(f)}function d(f){return t(f)}function p(f){return i._balanced=!0,n(f)}}function eBe(e,t,n){return o;function o(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),r}function r(p){return Dt(p)?nl(e,i)(p):i(p)}function i(p){return p===41?d(p):sb(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return Dt(p)?nl(e,c)(p):d(p)}function a(p){return n(p)}function c(p){return p===34||p===39||p===40?cb(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return Dt(p)?nl(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function tBe(e,t,n){let o=this;return r;function r(a){return ab.call(o,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return o.parser.defined.includes(js(o.sliceSerialize(o.events[o.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function nBe(e,t,n){return o;function o(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),r}function r(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}var rl,W$e,K$e,Z$e,ub=I(()=>{l();$k();Bk();Gk();jk();tt();oc();JI();XI();rl={name:"labelEnd",resolveAll:J$e,resolveTo:X$e,tokenize:Q$e},W$e={tokenize:eBe},K$e={tokenize:tBe},Z$e={tokenize:nBe}});function rBe(e,t,n){let o=this;return r;function r(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(a):t(a)}}var Wk,mse=I(()=>{l();ub();Wk={name:"labelStartImage",resolveAll:rl.resolveAll,tokenize:rBe}});function oBe(e,t,n){let o=this;return r;function r(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in o.parser.constructs?n(s):t(s)}}var Kk,_se=I(()=>{l();ub();Kk={name:"labelStartLink",resolveAll:rl.resolveAll,tokenize:oBe}});function iBe(e,t){return n;function n(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Oe(e,t,"linePrefix")}}var rh,gse=I(()=>{l();un();rh={name:"lineEnding",tokenize:iBe}});function sBe(e,t,n){let o=0,r;return i;function i(u){return e.enter("thematicBreak"),s(u)}function s(u){return r=u,a(u)}function a(u){return u===r?(e.enter("thematicBreakSequence"),c(u)):o>=3&&(u===null||ae(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===r?(e.consume(u),o++,c):(e.exit("thematicBreakSequence"),be(u)?Oe(e,a,"whitespace")(u):a(u))}}var ol,Zk=I(()=>{l();un();tt();ol={name:"thematicBreak",tokenize:sBe}});function uBe(e,t,n){let o=this,r=o.events[o.events.length-1],i=r&&r[1].type==="linePrefix"?r[2].sliceSerialize(r[1],!0).length:0,s=0;return a;function a(m){let _=o.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!o.containerState.marker||m===o.containerState.marker:Qg(m)){if(o.containerState.type||(o.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(ol,n,u)(m):u(m);if(!o.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(m)}return n(m)}function c(m){return Qg(m)&&++s<10?(e.consume(m),c):(!o.interrupt||s<2)&&(o.containerState.marker?m===o.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),o.containerState.marker=o.containerState.marker||m,e.check(sc,o.interrupt?n:d,e.attempt(aBe,f,p))}function d(m){return o.containerState.initialBlankLine=!0,i++,f(m)}function p(m){return be(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return o.containerState.size=i+o.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function lBe(e,t,n){let o=this;return o.containerState._closeFlow=void 0,e.check(sc,r,i);function r(a){return o.containerState.furtherBlankLines=o.containerState.furtherBlankLines||o.containerState.initialBlankLine,Oe(e,t,"listItemIndent",o.containerState.size+1)(a)}function i(a){return o.containerState.furtherBlankLines||!be(a)?(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,s(a)):(o.containerState.furtherBlankLines=void 0,o.containerState.initialBlankLine=void 0,e.attempt(cBe,t,s)(a))}function s(a){return o.containerState._closeFlow=!0,o.interrupt=void 0,Oe(e,e.attempt(Gn,t,n),"linePrefix",o.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function dBe(e,t,n){let o=this;return Oe(e,r,"listItemIndent",o.containerState.size+1);function r(i){let s=o.events[o.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===o.containerState.size?t(i):n(i)}}function pBe(e){e.exit(this.containerState.type)}function fBe(e,t,n){let o=this;return Oe(e,r,"listItemPrefixWhitespace",o.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function r(i){let s=o.events[o.events.length-1];return!be(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}var Gn,aBe,cBe,hse=I(()=>{l();un();tt();QI();Zk();Gn={continuation:{tokenize:lBe},exit:pBe,name:"list",tokenize:uBe},aBe={partial:!0,tokenize:fBe},cBe={partial:!0,tokenize:dBe}});function mBe(e,t){let n=e.length,o,r,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){o=n;break}e[n][1].type==="paragraph"&&(r=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);let s={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[r][1].type="setextHeadingText",i?(e.splice(r,0,["enter",s,t]),e.splice(i+1,0,["exit",e[o][1],t]),e[o][1].end={...e[i][1].end}):e[o][1]=s,e.push(["exit",s,t]),e}function _Be(e,t,n){let o=this,r;return i;function i(u){let d=o.events.length,p;for(;d--;)if(o.events[d][1].type!=="lineEnding"&&o.events[d][1].type!=="linePrefix"&&o.events[d][1].type!=="content"){p=o.events[d][1].type==="paragraph";break}return!o.parser.lazy[o.now().line]&&(o.interrupt||p)?(e.enter("setextHeadingLine"),r=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===r?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),be(u)?Oe(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||ae(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}var lb,Ese=I(()=>{l();un();tt();lb={name:"setextUnderline",resolveTo:mBe,tokenize:_Be}});var Jk=I(()=>{l();Zie();Jie();QI();Xie();Qie();ese();nse();rse();ose();sse();ase();cse();use();pse();fse();ub();mse();_se();gse();hse();Ese();Zk()});function gBe(e){let t=this,n=e.attempt(sc,o,e.attempt(this.parser.constructs.flowInitial,r,Oe(e,e.attempt(this.parser.constructs.flow,r,e.attempt(Uk,r)),"linePrefix")));return n;function o(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function r(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var Tse,Sse=I(()=>{l();Jk();un();Tse={tokenize:gBe}});function Ise(e){return{resolveAll:bse(e==="text"?hBe:void 0),tokenize:t};function t(n){let o=this,r=this.parser.constructs[e],i=n.attempt(r,s,a);return s;function s(d){return u(d)?i(d):a(d)}function a(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),i(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;let p=r[d],f=-1;if(p)for(;++f<p.length;){let m=p[f];if(!m.previous||m.previous.call(o,o.previous))return!0}return!1}}}function bse(e){return t;function t(n,o){let r=-1,i;for(;++r<=n.length;)i===void 0?n[r]&&n[r][1].type==="data"&&(i=r,r++):(!n[r]||n[r][1].type!=="data")&&(r!==i+2&&(n[i][1].end=n[r-1][1].end,n.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(n,o):n}}function hBe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){let o=e[n-1][1],r=t.sliceStream(o),i=r.length,s=-1,a=0,c;for(;i--;){let u=r[i];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)c=!0,a++;else if(u!==-1){i++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){let u={type:n===e.length||c||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:o.start._bufferIndex+s,_index:o.start._index+i,line:o.end.line,column:o.end.column-a,offset:o.end.offset-a},end:{...o.end}};o.end={...u.start},o.start.offset===o.end.offset?Object.assign(o,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}var Ase,yse,Rse,Xk=I(()=>{l();Ase={resolveAll:bse()},yse=Ise("string"),Rse=Ise("text")});var Qk={};ft(Qk,{attentionMarkers:()=>bBe,contentInitial:()=>TBe,disable:()=>NBe,document:()=>EBe,flow:()=>ABe,flowInitial:()=>SBe,insideSpan:()=>IBe,string:()=>yBe,text:()=>RBe});var EBe,TBe,SBe,ABe,yBe,RBe,IBe,bBe,NBe,Nse=I(()=>{l();Jk();Xk();EBe={42:Gn,43:Gn,45:Gn,48:Gn,49:Gn,50:Gn,51:Gn,52:Gn,53:Gn,54:Gn,55:Gn,56:Gn,57:Gn,62:eb},TBe={91:Vk},SBe={[-2]:th,[-1]:th,32:th},ABe={35:Hk,42:ol,45:[lb,ol],60:qk,61:lb,95:ol,96:rb,126:rb},yBe={38:nb,92:tb},RBe={[-5]:rh,[-4]:rh,[-3]:rh,33:Wk,38:nb,42:eh,60:[wk,Yk],91:Kk,92:[Fk,tb],93:rl,95:eh,96:Dk},IBe={null:[eh,Ase]},bBe={null:[42,95]},NBe={null:[]}});function Ose(e,t,n){let o={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},r={},i=[],s=[],a=[],c=!0,u={attempt:$(z),check:$(ie),consume:P,enter:M,exit:O,interrupt:$(ie,{interrupt:!0})},d={code:null,containerState:{},defineSkip:T,events:[],now:E,parser:e,previous:null,sliceSerialize:_,sliceStream:h,write:m},p=t.tokenize.call(d,u),f;return t.resolveAll&&i.push(t),d;function m(k){return s=sr(s,k),R(),s[s.length-1]!==null?[]:(q(t,0),d.events=Xp(i,d.events,d),d.events)}function _(k,ue){return CBe(h(k),ue)}function h(k){return OBe(s,k)}function E(){let{_bufferIndex:k,_index:ue,line:le,column:Ae,offset:ye}=o;return{_bufferIndex:k,_index:ue,line:le,column:Ae,offset:ye}}function T(k){r[k.line]=k.column,Z()}function R(){let k;for(;o._index<s.length;){let ue=s[o._index];if(typeof ue=="string")for(k=o._index,o._bufferIndex<0&&(o._bufferIndex=0);o._index===k&&o._bufferIndex<ue.length;)C(ue.charCodeAt(o._bufferIndex));else C(ue)}}function C(k){c=void 0,f=k,p=p(k)}function P(k){ae(k)?(o.line++,o.column=1,o.offset+=k===-3?2:1,Z()):k!==-1&&(o.column++,o.offset++),o._bufferIndex<0?o._index++:(o._bufferIndex++,o._bufferIndex===s[o._index].length&&(o._bufferIndex=-1,o._index++)),d.previous=k,c=!0}function M(k,ue){let le=ue||{};return le.type=k,le.start=E(),d.events.push(["enter",le,d]),a.push(le),le}function O(k){let ue=a.pop();return ue.end=E(),d.events.push(["exit",ue,d]),ue}function z(k,ue){q(k,ue.from)}function ie(k,ue){ue.restore()}function $(k,ue){return le;function le(Ae,ye,at){let Yt,v,Fn,Me;return Array.isArray(Ae)?bt(Ae):"tokenize"in Ae?bt([Ae]):N(Ae);function N(pn){return rm;function rm(os){let Oc=os!==null&&pn[os],Ll=os!==null&&pn.null,gC=[...Array.isArray(Oc)?Oc:Oc?[Oc]:[],...Array.isArray(Ll)?Ll:Ll?[Ll]:[]];return bt(gC)(os)}}function bt(pn){return Yt=pn,v=0,pn.length===0?at:vo(pn[v])}function vo(pn){return rm;function rm(os){return Me=J(),Fn=pn,pn.partial||(d.currentConstruct=pn),pn.name&&d.parser.constructs.disable.null.includes(pn.name)?bE(os):pn.tokenize.call(ue?Object.assign(Object.create(d),ue):d,u,nm,bE)(os)}}function nm(pn){return c=!0,k(Fn,Me),ye}function bE(pn){return c=!0,Me.restore(),++v<Yt.length?vo(Yt[v]):at}}}function q(k,ue){k.resolveAll&&!i.includes(k)&&i.push(k),k.resolve&&Rn(d.events,ue,d.events.length-ue,k.resolve(d.events.slice(ue),d)),k.resolveTo&&(d.events=k.resolveTo(d.events,d))}function J(){let k=E(),ue=d.previous,le=d.currentConstruct,Ae=d.events.length,ye=Array.from(a);return{from:Ae,restore:at};function at(){o=k,d.previous=ue,d.currentConstruct=le,d.events.length=Ae,a=ye,Z()}}function Z(){o.line in r&&o.column<2&&(o.column=r[o.line],o.offset+=r[o.line]-1)}}function OBe(e,t){let n=t.start._index,o=t.start._bufferIndex,r=t.end._index,i=t.end._bufferIndex,s;if(n===r)s=[e[n].slice(o,i)];else{if(s=e.slice(n,r),o>-1){let a=s[0];typeof a=="string"?s[0]=a.slice(o):s.shift()}i>0&&s.push(e[r].slice(0,i))}return s}function CBe(e,t){let n=-1,o=[],r;for(;++n<e.length;){let i=e[n],s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
348
+ `;break}case-3:{s=`\r
349
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&r)continue;s=" ";break}default:s=String.fromCharCode(i)}r=i===-2,o.push(s)}return o.join("")}var Cse=I(()=>{l();tt();oc();XI()});function e0(e){let o={constructs:Uie([Qk,...(e||{}).extensions||[]]),content:r(Hie),defined:[],document:r(Yie),flow:r(Tse),lazy:{},string:r(yse),text:r(Rse)};return o;function r(i){return s;function s(a){return Ose(o,i,a)}}}var vse=I(()=>{l();$ie();zie();Wie();Sse();Xk();Nse();Cse()});function t0(e){for(;!ib(e););return e}var Pse=I(()=>{l();kk()});function n0(){let e=1,t="",n=!0,o;return r;function r(i,s,a){let c=[],u,d,p,f,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),p=0,t="",n&&(i.charCodeAt(0)===65279&&p++,n=void 0);p<i.length;){if(xse.lastIndex=p,u=xse.exec(i),f=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(f),!u){t=i.slice(p);break}if(m===10&&p===f&&o)c.push(-3),o=void 0;else switch(o&&(c.push(-5),o=void 0),p<f&&(c.push(i.slice(p,f)),e+=f-p),m){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:o=!0,e=1}p=f+1}return a&&(o&&c.push(-5),t&&c.push(t),c.push(null)),c}}var xse,Mse=I(()=>{l();xse=/[\0\t\n\r]/g});var Lse=I(()=>{l();vse();Pse();Mse()});function db(e){return e.replace(vBe,PBe)}function PBe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let r=n.charCodeAt(1),i=r===120||r===88;return ZI(n.slice(i?2:1),i?16:10)}return Zp(n)||e}var vBe,r0=I(()=>{l();KI();Mk();vBe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi});function ac(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wse(e.position):"start"in e||"end"in e?wse(e):"line"in e||"column"in e?o0(e):""}function o0(e){return Dse(e&&e.line)+":"+Dse(e&&e.column)}function wse(e){return o0(e&&e.start)+"-"+o0(e&&e.end)}function Dse(e){return e&&typeof e=="number"?e:1}var kse=I(()=>{l()});var i0=I(()=>{l();kse()});function s0(e,t,n){return typeof t!="string"&&(n=t,t=void 0),xBe(n)(t0(e0(n).document().write(n0()(e,t,!0))))}function xBe(e){let t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ZV),autolinkProtocol:$,autolinkEmail:$,atxHeading:i(YV),blockQuote:i(os),characterEscape:$,characterReference:$,codeFenced:i(Oc),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(Oc,s),codeText:i(Ll,s),codeTextData:$,data:$,codeFlowValue:$,definition:i(gC),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(cge),hardBreakEscape:i(WV),hardBreakTrailing:i(WV),htmlFlow:i(KV,s),htmlFlowData:$,htmlText:i(KV,s),htmlTextData:$,image:i(uge),label:s,link:i(ZV),listItem:i(lge),listItemValue:f,listOrdered:i(JV,p),listUnordered:i(JV),paragraph:i(dge),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(YV),strong:i(pge),thematicBreak:i(mge)},exit:{atxHeading:c(),atxHeadingSequence:M,autolink:c(),autolinkEmail:rm,autolinkProtocol:pn,blockQuote:c(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:vo,characterReferenceMarkerNumeric:vo,characterReferenceValue:nm,characterReference:bE,codeFenced:c(E),codeFencedFence:h,codeFencedFenceInfo:m,codeFencedFenceMeta:_,codeFlowValue:q,codeIndented:c(T),codeText:c(le),codeTextData:q,data:q,definition:c(),definitionDestinationString:P,definitionLabelString:R,definitionTitleString:C,emphasis:c(),hardBreakEscape:c(Z),hardBreakTrailing:c(Z),htmlFlow:c(k),htmlFlowData:q,htmlText:c(ue),htmlTextData:q,image:c(ye),label:Yt,labelText:at,lineEnding:J,link:c(Ae),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:bt,resourceDestinationString:v,resourceTitleString:Fn,resource:Me,setextHeading:c(ie),setextHeadingLineSequence:z,setextHeadingText:O,strong:c(),thematicBreak:c()}};Bse(t,(e||{}).mdastExtensions||[]);let n={};return o;function o(D){let X={type:"root",children:[]},Ne={stack:[X],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:d,data:n},Be=[],ot=-1;for(;++ot<D.length;)if(D[ot][1].type==="listOrdered"||D[ot][1].type==="listUnordered")if(D[ot][0]==="enter")Be.push(ot);else{let Po=Be.pop();ot=r(D,Po,ot)}for(ot=-1;++ot<D.length;){let Po=t[D[ot][0]];$se.call(Po,D[ot][1].type)&&Po[D[ot][1].type].call(Object.assign({sliceSerialize:D[ot][2].sliceSerialize},Ne),D[ot][1])}if(Ne.tokenStack.length>0){let Po=Ne.tokenStack[Ne.tokenStack.length-1];(Po[1]||Use).call(Ne,void 0,Po[0])}for(X.position={start:cc(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:cc(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},ot=-1;++ot<t.transforms.length;)X=t.transforms[ot](X)||X;return X}function r(D,X,Ne){let Be=X-1,ot=-1,Po=!1,Cc,is,om,im;for(;++Be<=Ne;){let Pr=D[Be];switch(Pr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pr[0]==="enter"?ot++:ot--,im=void 0;break}case"lineEndingBlank":{Pr[0]==="enter"&&(Cc&&!im&&!ot&&!om&&(om=Be),im=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:im=void 0}if(!ot&&Pr[0]==="enter"&&Pr[1].type==="listItemPrefix"||ot===-1&&Pr[0]==="exit"&&(Pr[1].type==="listUnordered"||Pr[1].type==="listOrdered")){if(Cc){let wl=Be;for(is=void 0;wl--;){let ss=D[wl];if(ss[1].type==="lineEnding"||ss[1].type==="lineEndingBlank"){if(ss[0]==="exit")continue;is&&(D[is][1].type="lineEndingBlank",Po=!0),ss[1].type="lineEnding",is=wl}else if(!(ss[1].type==="linePrefix"||ss[1].type==="blockQuotePrefix"||ss[1].type==="blockQuotePrefixWhitespace"||ss[1].type==="blockQuoteMarker"||ss[1].type==="listItemIndent"))break}om&&(!is||om<is)&&(Cc._spread=!0),Cc.end=Object.assign({},is?D[is][1].start:Pr[1].end),D.splice(is||Be,0,["exit",Cc,Pr[2]]),Be++,Ne++}if(Pr[1].type==="listItemPrefix"){let wl={type:"listItem",_spread:!1,start:Object.assign({},Pr[1].start),end:void 0};Cc=wl,D.splice(Be,0,["enter",wl,Pr[2]]),Be++,Ne++,om=void 0,im=!0}}}return D[X][1]._spread=Po,Ne}function i(D,X){return Ne;function Ne(Be){a.call(this,D(Be),Be),X&&X.call(this,Be)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(D,X,Ne){this.stack[this.stack.length-1].children.push(D),this.stack.push(D),this.tokenStack.push([X,Ne||void 0]),D.position={start:cc(X.start),end:void 0}}function c(D){return X;function X(Ne){D&&D.call(this,Ne),u.call(this,Ne)}}function u(D,X){let Ne=this.stack.pop(),Be=this.tokenStack.pop();if(Be)Be[0].type!==D.type&&(X?X.call(this,D,Be[0]):(Be[1]||Use).call(this,D,Be[0]));else throw new Error("Cannot close `"+D.type+"` ("+ac({start:D.start,end:D.end})+"): it\u2019s not open");Ne.position.end=cc(D.end)}function d(){return tl(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function f(D){if(this.data.expectingFirstListItemValue){let X=this.stack[this.stack.length-2];X.start=Number.parseInt(this.sliceSerialize(D),10),this.data.expectingFirstListItemValue=void 0}}function m(){let D=this.resume(),X=this.stack[this.stack.length-1];X.lang=D}function _(){let D=this.resume(),X=this.stack[this.stack.length-1];X.meta=D}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){let D=this.resume(),X=this.stack[this.stack.length-1];X.value=D.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){let D=this.resume(),X=this.stack[this.stack.length-1];X.value=D.replace(/(\r?\n|\r)$/g,"")}function R(D){let X=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=X,Ne.identifier=js(this.sliceSerialize(D)).toLowerCase()}function C(){let D=this.resume(),X=this.stack[this.stack.length-1];X.title=D}function P(){let D=this.resume(),X=this.stack[this.stack.length-1];X.url=D}function M(D){let X=this.stack[this.stack.length-1];if(!X.depth){let Ne=this.sliceSerialize(D).length;X.depth=Ne}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function z(D){let X=this.stack[this.stack.length-1];X.depth=this.sliceSerialize(D).codePointAt(0)===61?1:2}function ie(){this.data.setextHeadingSlurpLineEnding=void 0}function $(D){let Ne=this.stack[this.stack.length-1].children,Be=Ne[Ne.length-1];(!Be||Be.type!=="text")&&(Be=fge(),Be.position={start:cc(D.start),end:void 0},Ne.push(Be)),this.stack.push(Be)}function q(D){let X=this.stack.pop();X.value+=this.sliceSerialize(D),X.position.end=cc(D.end)}function J(D){let X=this.stack[this.stack.length-1];if(this.data.atHardBreak){let Ne=X.children[X.children.length-1];Ne.position.end=cc(D.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(X.type)&&($.call(this,D),q.call(this,D))}function Z(){this.data.atHardBreak=!0}function k(){let D=this.resume(),X=this.stack[this.stack.length-1];X.value=D}function ue(){let D=this.resume(),X=this.stack[this.stack.length-1];X.value=D}function le(){let D=this.resume(),X=this.stack[this.stack.length-1];X.value=D}function Ae(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let X=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=X,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function ye(){let D=this.stack[this.stack.length-1];if(this.data.inReference){let X=this.data.referenceType||"shortcut";D.type+="Reference",D.referenceType=X,delete D.url,delete D.title}else delete D.identifier,delete D.label;this.data.referenceType=void 0}function at(D){let X=this.sliceSerialize(D),Ne=this.stack[this.stack.length-2];Ne.label=db(X),Ne.identifier=js(X).toLowerCase()}function Yt(){let D=this.stack[this.stack.length-1],X=this.resume(),Ne=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ne.type==="link"){let Be=D.children;Ne.children=Be}else Ne.alt=X}function v(){let D=this.resume(),X=this.stack[this.stack.length-1];X.url=D}function Fn(){let D=this.resume(),X=this.stack[this.stack.length-1];X.title=D}function Me(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function bt(D){let X=this.resume(),Ne=this.stack[this.stack.length-1];Ne.label=X,Ne.identifier=js(this.sliceSerialize(D)).toLowerCase(),this.data.referenceType="full"}function vo(D){this.data.characterReferenceType=D.type}function nm(D){let X=this.sliceSerialize(D),Ne=this.data.characterReferenceType,Be;Ne?(Be=ZI(X,Ne==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Be=Zp(X);let ot=this.stack[this.stack.length-1];ot.value+=Be}function bE(D){let X=this.stack.pop();X.position.end=cc(D.end)}function pn(D){q.call(this,D);let X=this.stack[this.stack.length-1];X.url=this.sliceSerialize(D)}function rm(D){q.call(this,D);let X=this.stack[this.stack.length-1];X.url="mailto:"+this.sliceSerialize(D)}function os(){return{type:"blockquote",children:[]}}function Oc(){return{type:"code",lang:null,meta:null,value:""}}function Ll(){return{type:"inlineCode",value:""}}function gC(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function cge(){return{type:"emphasis",children:[]}}function YV(){return{type:"heading",depth:0,children:[]}}function WV(){return{type:"break"}}function KV(){return{type:"html",value:""}}function uge(){return{type:"image",title:null,url:"",alt:null}}function ZV(){return{type:"link",title:null,url:"",children:[]}}function JV(D){return{type:"list",ordered:D.type==="listOrdered",start:null,spread:D._spread,children:[]}}function lge(D){return{type:"listItem",spread:D._spread,checked:null,children:[]}}function dge(){return{type:"paragraph",children:[]}}function pge(){return{type:"strong",children:[]}}function fge(){return{type:"text",value:""}}function mge(){return{type:"thematicBreak"}}}function cc(e){return{line:e.line,column:e.column,offset:e.offset}}function Bse(e,t){let n=-1;for(;++n<t.length;){let o=t[n];Array.isArray(o)?Bse(e,o):MBe(e,o)}}function MBe(e,t){let n;for(n in t)if($se.call(t,n))switch(n){case"canContainEols":{let o=t[n];o&&e[n].push(...o);break}case"transforms":{let o=t[n];o&&e[n].push(...o);break}case"enter":case"exit":{let o=t[n];o&&Object.assign(e[n],o);break}}}function Use(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ac({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ac({start:t.start,end:t.end})+") is still open")}var $se,Gse=I(()=>{l();WI();Lse();Mk();r0();JI();KI();i0();$se={}.hasOwnProperty});var jse=I(()=>{l();Gse()});function pb(e){let t=this;t.parser=n;function n(o){return s0(o,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}var Vse=I(()=>{l();jse()});var Fse=I(()=>{l();Vse()});function zse(e,t){let n=t||{};function o(r,...i){let s=o.invalid,a=o.handlers;if(r&&Hse.call(r,e)){let c=String(r[e]);s=Hse.call(a,c)?a[c]:o.unknown}if(s)return s.call(this,r,...i)}return o.handlers=n.handlers||{},o.invalid=n.invalid,o.unknown=n.unknown,o}var Hse,qse=I(()=>{l();Hse={}.hasOwnProperty});function a0(e,t){let n=-1,o;if(t.extensions)for(;++n<t.extensions.length;)a0(e,t.extensions[n]);for(o in t)if(LBe.call(t,o))switch(o){case"extensions":break;case"unsafe":{Yse(e[o],t[o]);break}case"join":{Yse(e[o],t[o]);break}case"handlers":{wBe(e[o],t[o]);break}default:e.options[o]=t[o]}return e}function Yse(e,t){t&&e.push(...t)}function wBe(e,t){t&&Object.assign(e,t)}var LBe,Wse=I(()=>{l();LBe={}.hasOwnProperty});function Kse(e,t,n,o){let r=n.enter("blockquote"),i=n.createTracker(o);i.move("> "),i.shift(2);let s=n.indentLines(n.containerFlow(e,i.current()),DBe);return r(),s}function DBe(e,t,n){return">"+(n?"":" ")+e}var Zse=I(()=>{l()});function fb(e,t){return Jse(e,t.inConstruct,!0)&&!Jse(e,t.notInConstruct,!1)}function Jse(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let o=-1;for(;++o<t.length;)if(e.includes(t[o]))return!0;return!1}var c0=I(()=>{l()});function u0(e,t,n,o){let r=-1;for(;++r<n.unsafe.length;)if(n.unsafe[r].character===`
350
+ `&&fb(n.stack,n.unsafe[r]))return/[ \t]/.test(o.before)?"":" ";return`\\
351
+ `}var Xse=I(()=>{l();c0()});function Qse(e,t){let n=String(e),o=n.indexOf(t),r=o,i=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;o!==-1;)o===r?++i>s&&(s=i):i=1,r=o+t.length,o=n.indexOf(t,r);return s}var eae=I(()=>{l()});function oh(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}var l0=I(()=>{l()});function tae(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}var nae=I(()=>{l()});function rae(e,t,n,o){let r=tae(n),i=e.value||"",s=r==="`"?"GraveAccent":"Tilde";if(oh(e,n)){let p=n.enter("codeIndented"),f=n.indentLines(i,kBe);return p(),f}let a=n.createTracker(o),c=r.repeat(Math.max(Qse(i,r)+1,3)),u=n.enter("codeFenced"),d=a.move(c);if(e.lang){let p=n.enter(`codeFencedLang${s}`);d+=a.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...a.current()})),p()}if(e.lang&&e.meta){let p=n.enter(`codeFencedMeta${s}`);d+=a.move(" "),d+=a.move(n.safe(e.meta,{before:d,after:`
352
+ `,encode:["`"],...a.current()})),p()}return d+=a.move(`
353
+ `),i&&(d+=a.move(i+`
354
+ `)),d+=a.move(c),u(),d}function kBe(e,t,n){return(n?"":" ")+e}var oae=I(()=>{l();eae();l0();nae()});function Qp(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}var mb=I(()=>{l()});function iae(e,t,n,o){let r=Qp(n),i=r==='"'?"Quote":"Apostrophe",s=n.enter("definition"),a=n.enter("label"),c=n.createTracker(o),u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(a=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":`
355
+ `,...c.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),a()),s(),u}var sae=I(()=>{l();mb()});function aae(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}var cae=I(()=>{l()});function zr(e){return"&#x"+e.toString(16).toUpperCase()+";"}var ef=I(()=>{l()});function tf(e,t,n){let o=Jp(e),r=Jp(t);return o===void 0?r===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:o===1?r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:r===void 0?{inside:!1,outside:!1}:r===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}var d0=I(()=>{l();Lk()});function p0(e,t,n,o){let r=aae(n),i=n.enter("emphasis"),s=n.createTracker(o),a=s.move(r),c=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()})),u=c.charCodeAt(0),d=tf(o.before.charCodeAt(o.before.length-1),u,r);d.inside&&(c=zr(u)+c.slice(1));let p=c.charCodeAt(c.length-1),f=tf(o.after.charCodeAt(0),p,r);f.inside&&(c=c.slice(0,-1)+zr(p));let m=s.move(r);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},a+c+m}function UBe(e,t,n){return n.options.emphasis||"*"}var uae=I(()=>{l();cae();ef();d0();p0.peek=UBe});function $Be(e){let t=[],n=-1;for(;++n<e.length;)t[n]=nf(e[n]);return _b(o);function o(...r){let i=-1;for(;++i<t.length;)if(t[i].apply(this,r))return!0;return!1}}function BBe(e){let t=e;return _b(n);function n(o){let r=o,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function GBe(e){return _b(t);function t(n){return n&&n.type===e}}function _b(e){return t;function t(n,o,r){return!!(VBe(n)&&e.call(this,n,typeof o=="number"?o:void 0,r||void 0))}}function jBe(){return!0}function VBe(e){return e!==null&&typeof e=="object"&&"type"in e}var nf,lae=I(()=>{l();nf=(function(e){if(e==null)return jBe;if(typeof e=="function")return _b(e);if(typeof e=="object")return Array.isArray(e)?$Be(e):BBe(e);if(typeof e=="string")return GBe(e);throw new Error("Expected function, string, or object as test")})});var f0=I(()=>{l();lae()});function dae(e){return"\x1B[33m"+e+"\x1B[39m"}var pae=I(()=>{l()});function m0(e,t,n,o){let r;typeof t=="function"&&typeof n!="function"?(o=n,n=t):r=t;let i=nf(r),s=o?-1:1;a(e,void 0,[])();function a(c,u,d){let p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){let m=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(f,"name",{value:"node ("+dae(c.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=fae,_,h,E;if((!t||i(c,u,d[d.length-1]||void 0))&&(m=FBe(n(c,d)),m[0]===il))return m;if("children"in c&&c.children){let T=c;if(T.children&&m[0]!==hb)for(h=(o?T.children.length:-1)+s,E=d.concat(T);h>-1&&h<T.children.length;){let R=T.children[h];if(_=a(R,h,E)(),_[0]===il)return _;h=typeof _[1]=="number"?_[1]:h+s}}return m}}}function FBe(e){return Array.isArray(e)?e:typeof e=="number"?[gb,e]:e==null?fae:[e]}var fae,gb,il,hb,mae=I(()=>{l();f0();pae();fae=[],gb=!0,il=!1,hb="skip"});var _0=I(()=>{l();mae()});function g0(e,t,n,o){let r,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,r=n):(i=t,s=n,r=o),m0(e,i,a,r);function a(c,u){let d=u[u.length-1],p=d?d.children.indexOf(c):void 0;return s(c,p,d)}}var _ae=I(()=>{l();_0();_0()});var gae=I(()=>{l();_ae()});function Eb(e,t){let n=!1;return g0(e,function(o){if("value"in o&&/\r?\n|\r/.test(o.value)||o.type==="break")return n=!0,il}),!!((!e.depth||e.depth<3)&&tl(e)&&(t.options.setext||n))}var h0=I(()=>{l();gae();WI()});function hae(e,t,n,o){let r=Math.max(Math.min(6,e.depth||1),1),i=n.createTracker(o);if(Eb(e,n)){let d=n.enter("headingSetext"),p=n.enter("phrasing"),f=n.containerPhrasing(e,{...i.current(),before:`
356
+ `,after:`
357
+ `});return p(),d(),f+`
358
+ `+(r===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
359
+ `))+1))}let s="#".repeat(r),a=n.enter("headingAtx"),c=n.enter("phrasing");i.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
360
+ `,...i.current()});return/^[\t ]/.test(u)&&(u=zr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),c(),a(),u}var Eae=I(()=>{l();ef();h0()});function E0(e){return e.value||""}function HBe(){return"<"}var Tae=I(()=>{l();E0.peek=HBe});function T0(e,t,n,o){let r=Qp(n),i=r==='"'?"Quote":"Apostrophe",s=n.enter("image"),a=n.enter("label"),c=n.createTracker(o),u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(a=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),a(),e.title&&(a=n.enter(`title${i}`),u+=c.move(" "+r),u+=c.move(n.safe(e.title,{before:u,after:r,...c.current()})),u+=c.move(r),a()),u+=c.move(")"),s(),u}function zBe(){return"!"}var Sae=I(()=>{l();mb();T0.peek=zBe});function S0(e,t,n,o){let r=e.referenceType,i=n.enter("imageReference"),s=n.enter("label"),a=n.createTracker(o),c=a.move("!["),u=n.safe(e.alt,{before:c,after:"]",...a.current()});c+=a.move(u+"]["),s();let d=n.stack;n.stack=[],s=n.enter("reference");let p=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=d,i(),r==="full"||!u||u!==p?c+=a.move(p+"]"):r==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function qBe(){return"!"}var Aae=I(()=>{l();S0.peek=qBe});function A0(e,t,n){let o=e.value||"",r="`",i=-1;for(;new RegExp("(^|[^`])"+r+"([^`]|$)").test(o);)r+="`";for(/[^ \r\n]/.test(o)&&(/^[ \r\n]/.test(o)&&/[ \r\n]$/.test(o)||/^`|`$/.test(o))&&(o=" "+o+" ");++i<n.unsafe.length;){let s=n.unsafe[i],a=n.compilePattern(s),c;if(s.atBreak)for(;c=a.exec(o);){let u=c.index;o.charCodeAt(u)===10&&o.charCodeAt(u-1)===13&&u--,o=o.slice(0,u)+" "+o.slice(c.index+1)}}return r+o+r}function YBe(){return"`"}var yae=I(()=>{l();A0.peek=YBe});function y0(e,t){let n=tl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}var Rae=I(()=>{l();WI()});function R0(e,t,n,o){let r=Qp(n),i=r==='"'?"Quote":"Apostrophe",s=n.createTracker(o),a,c;if(y0(e,n)){let d=n.stack;n.stack=[],a=n.enter("autolink");let p=s.move("<");return p+=s.move(n.containerPhrasing(e,{before:p,after:">",...s.current()})),p+=s.move(">"),a(),n.stack=d,p}a=n.enter("link"),c=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(c=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),c(),e.title&&(c=n.enter(`title${i}`),u+=s.move(" "+r),u+=s.move(n.safe(e.title,{before:u,after:r,...s.current()})),u+=s.move(r),c()),u+=s.move(")"),a(),u}function WBe(e,t,n){return y0(e,n)?"<":"["}var Iae=I(()=>{l();mb();Rae();R0.peek=WBe});function I0(e,t,n,o){let r=e.referenceType,i=n.enter("linkReference"),s=n.enter("label"),a=n.createTracker(o),c=a.move("["),u=n.containerPhrasing(e,{before:c,after:"]",...a.current()});c+=a.move(u+"]["),s();let d=n.stack;n.stack=[],s=n.enter("reference");let p=n.safe(n.associationId(e),{before:c,after:"]",...a.current()});return s(),n.stack=d,i(),r==="full"||!u||u!==p?c+=a.move(p+"]"):r==="shortcut"?c=c.slice(0,-1):c+=a.move("]"),c}function KBe(){return"["}var bae=I(()=>{l();I0.peek=KBe});function rf(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}var Tb=I(()=>{l()});function Nae(e){let t=rf(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}var Oae=I(()=>{l();Tb()});function Cae(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}var vae=I(()=>{l()});function Sb(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}var b0=I(()=>{l()});function Pae(e,t,n,o){let r=n.enter("list"),i=n.bulletCurrent,s=e.ordered?Cae(n):rf(n),a=e.ordered?s==="."?")":".":Nae(n),c=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){let d=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),Sb(n)===s&&d){let p=-1;for(;++p<e.children.length;){let f=e.children[p];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(s=a),n.bulletCurrent=s;let u=n.containerFlow(e,o);return n.bulletLastUsed=s,n.bulletCurrent=i,r(),u}var xae=I(()=>{l();Tb();Oae();vae();b0()});function Mae(e){let t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}var Lae=I(()=>{l()});function wae(e,t,n,o){let r=Mae(n),i=n.bulletCurrent||rf(n);t&&t.type==="list"&&t.ordered&&(i=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+i);let s=i.length+1;(r==="tab"||r==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);let a=n.createTracker(o);a.move(i+" ".repeat(s-i.length)),a.shift(s);let c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),d);return c(),u;function d(p,f,m){return f?(m?"":" ".repeat(s))+p:(m?i:i+" ".repeat(s-i.length))+p}}var Dae=I(()=>{l();Tb();Lae()});function kae(e,t,n,o){let r=n.enter("paragraph"),i=n.enter("phrasing"),s=n.containerPhrasing(e,o);return i(),r(),s}var Uae=I(()=>{l()});var N0,$ae=I(()=>{l();f0();N0=nf(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"])});var Bae=I(()=>{l();$ae()});function Gae(e,t,n,o){return(e.children.some(function(s){return N0(s)})?n.containerPhrasing:n.containerFlow).call(n,e,o)}var jae=I(()=>{l();Bae()});function Vae(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}var Fae=I(()=>{l()});function O0(e,t,n,o){let r=Vae(n),i=n.enter("strong"),s=n.createTracker(o),a=s.move(r+r),c=s.move(n.containerPhrasing(e,{after:r,before:a,...s.current()})),u=c.charCodeAt(0),d=tf(o.before.charCodeAt(o.before.length-1),u,r);d.inside&&(c=zr(u)+c.slice(1));let p=c.charCodeAt(c.length-1),f=tf(o.after.charCodeAt(0),p,r);f.inside&&(c=c.slice(0,-1)+zr(p));let m=s.move(r+r);return i(),n.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},a+c+m}function ZBe(e,t,n){return n.options.strong||"*"}var Hae=I(()=>{l();Fae();ef();d0();O0.peek=ZBe});function zae(e,t,n,o){return n.safe(e.value,o)}var qae=I(()=>{l()});function Yae(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}var Wae=I(()=>{l()});function Kae(e,t,n){let o=(Sb(n)+(n.options.ruleSpaces?" ":"")).repeat(Yae(n));return n.options.ruleSpaces?o.slice(0,-1):o}var Zae=I(()=>{l();Wae();b0()});var Jae,Xae=I(()=>{l();Zse();Xse();oae();sae();uae();Eae();Tae();Sae();Aae();yae();Iae();bae();xae();Dae();Uae();jae();Hae();qae();Zae();Jae={blockquote:Kse,break:u0,code:rae,definition:iae,emphasis:p0,hardBreak:u0,heading:hae,html:E0,image:T0,imageReference:S0,inlineCode:A0,link:R0,linkReference:I0,list:Pae,listItem:wae,paragraph:kae,root:Gae,strong:O0,text:zae,thematicBreak:Kae}});function JBe(e,t,n,o){if(t.type==="code"&&oh(t,o)&&(e.type==="list"||e.type===t.type&&oh(e,o)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Eb(t,o))?void 0:n.spread?1:0}var Qae,ece=I(()=>{l();l0();h0();Qae=[JBe]});var sl,tce,nce=I(()=>{l();sl=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],tce=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:`
361
+ `,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:sl},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r
362
+ ]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:sl},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r
363
+ *])`},{character:"*",inConstruct:"phrasing",notInConstruct:sl},{atBreak:!0,character:"+",after:`(?:[ \r
364
+ ])`},{atBreak:!0,character:"-",after:`(?:[ \r
365
+ -])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r
366
+ ]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:sl},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:sl},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:sl},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:sl},{atBreak:!0,character:"~"}]});function rce(e){return e.label||!e.identifier?e.label||"":db(e.identifier)}var oce=I(()=>{l();r0()});function ice(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}var sce=I(()=>{l()});function ace(e,t,n){let o=t.indexStack,r=e.children||[],i=[],s=-1,a=n.before,c;o.push(-1);let u=t.createTracker(n);for(;++s<r.length;){let d=r[s],p;if(o[o.length-1]=s,s+1<r.length){let _=t.handle.handlers[r[s+1].type];_&&_.peek&&(_=_.peek),p=_?_(r[s+1],e,t,{before:"",after:"",...u.current()}).charAt(0):""}else p=n.after;i.length>0&&(a==="\r"||a===`
367
+ `)&&d.type==="html"&&(i[i.length-1]=i[i.length-1].replace(/(\r?\n|\r)$/," "),a=" ",u=t.createTracker(n),u.move(i.join("")));let f=t.handle(d,e,t,{...u.current(),after:p,before:a});c&&c===f.slice(0,1)&&(f=zr(c.charCodeAt(0))+f.slice(1));let m=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,m&&(i.length>0&&m.before&&a===i[i.length-1].slice(-1)&&(i[i.length-1]=i[i.length-1].slice(0,-1)+zr(a.charCodeAt(0))),m.after&&(c=p)),u.move(f),i.push(f),a=f.slice(-1)}return o.pop(),i.join("")}var cce=I(()=>{l();ef()});function uce(e,t,n){let o=t.indexStack,r=e.children||[],i=t.createTracker(n),s=[],a=-1;for(o.push(-1);++a<r.length;){let c=r[a];o[o.length-1]=a,s.push(i.move(t.handle(c,e,t,{before:`
368
+ `,after:`
369
+ `,...i.current()}))),c.type!=="list"&&(t.bulletLastUsed=void 0),a<r.length-1&&s.push(i.move(XBe(c,r[a+1],e,t)))}return o.pop(),s.join("")}function XBe(e,t,n,o){let r=o.join.length;for(;r--;){let i=o.join[r](e,t,n,o);if(i===!0||i===1)break;if(typeof i=="number")return`
370
+ `.repeat(1+i);if(i===!1)return`
371
+
372
+ <!---->
373
+
374
+ `}return`
375
+
376
+ `}var lce=I(()=>{l()});function dce(e,t){let n=[],o=0,r=0,i;for(;i=QBe.exec(e);)s(e.slice(o,i.index)),n.push(i[0]),o=i.index+i[0].length,r++;return s(e.slice(o)),n.join("");function s(a){n.push(t(a,r,!a))}}var QBe,pce=I(()=>{l();QBe=/\r?\n|\r/g});function mce(e,t,n){let o=(n.before||"")+(t||"")+(n.after||""),r=[],i=[],s={},a=-1;for(;++a<e.unsafe.length;){let d=e.unsafe[a];if(!fb(e.stack,d))continue;let p=e.compilePattern(d),f;for(;f=p.exec(o);){let m="before"in d||!!d.atBreak,_="after"in d,h=f.index+(m?f[1].length:0);r.includes(h)?(s[h].before&&!m&&(s[h].before=!1),s[h].after&&!_&&(s[h].after=!1)):(r.push(h),s[h]={before:m,after:_})}}r.sort(eGe);let c=n.before?n.before.length:0,u=o.length-(n.after?n.after.length:0);for(a=-1;++a<r.length;){let d=r[a];d<c||d>=u||d+1<u&&r[a+1]===d+1&&s[d].after&&!s[d+1].before&&!s[d+1].after||r[a-1]===d-1&&s[d].before&&!s[d-1].before&&!s[d-1].after||(c!==d&&i.push(fce(o.slice(c,d),"\\")),c=d,/[!-/:-@[-`{-~]/.test(o.charAt(d))&&(!n.encode||!n.encode.includes(o.charAt(d)))?i.push("\\"):(i.push(zr(o.charCodeAt(d))),c++))}return i.push(fce(o.slice(c,u),n.after)),i.join("")}function eGe(e,t){return e-t}function fce(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,o=[],r=[],i=e+t,s=-1,a=0,c;for(;c=n.exec(i);)o.push(c.index);for(;++s<o.length;)a!==o[s]&&r.push(e.slice(a,o[s])),r.push("\\"),a=o[s];return r.push(e.slice(a)),r.join("")}var _ce=I(()=>{l();ef();c0()});function gce(e){let t=e||{},n=t.now||{},o=t.lineShift||0,r=n.line||1,i=n.column||1;return{move:c,current:s,shift:a};function s(){return{now:{line:r,column:i},lineShift:o}}function a(u){o+=u}function c(u){let d=u||"",p=d.split(/\r?\n|\r/g),f=p[p.length-1];return r+=p.length-1,i=p.length===1?i+f.length:1+f.length+o,d}}var hce=I(()=>{l()});function C0(e,t){let n=t||{},o={associationId:rce,containerPhrasing:oGe,containerFlow:iGe,createTracker:gce,compilePattern:ice,enter:i,handlers:{...Jae},handle:void 0,indentLines:dce,indexStack:[],join:[...Qae],options:{},safe:sGe,stack:[],unsafe:[...tce]};a0(o,n),o.options.tightDefinitions&&o.join.push(rGe),o.handle=zse("type",{invalid:tGe,unknown:nGe,handlers:o.handlers});let r=o.handle(e,void 0,o,{before:`
377
+ `,after:`
378
+ `,now:{line:1,column:1},lineShift:0});return r&&r.charCodeAt(r.length-1)!==10&&r.charCodeAt(r.length-1)!==13&&(r+=`
379
+ `),r;function i(s){return o.stack.push(s),a;function a(){o.stack.pop()}}}function tGe(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function nGe(e){let t=e;throw new Error("Cannot handle unknown node `"+t.type+"`")}function rGe(e,t){if(e.type==="definition"&&e.type===t.type)return 0}function oGe(e,t){return ace(e,this,t)}function iGe(e,t){return uce(e,this,t)}function sGe(e,t){return mce(this,e,t)}var Ece=I(()=>{l();qse();Wse();Xae();ece();nce();oce();sce();cce();lce();pce();_ce();hce()});var Tce=I(()=>{l();Ece()});function Ab(e){let t=this;t.compiler=n;function n(o){return C0(o,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}}var Sce=I(()=>{l();Tce()});var Ace=I(()=>{l();Sce()});function v0(e){if(e)throw e}var yce=I(()=>{l()});var xce=S((sxt,Pce)=>{"use strict";l();var yb=Object.prototype.hasOwnProperty,vce=Object.prototype.toString,Rce=Object.defineProperty,Ice=Object.getOwnPropertyDescriptor,bce=function(t){return typeof Array.isArray=="function"?Array.isArray(t):vce.call(t)==="[object Array]"},Nce=function(t){if(!t||vce.call(t)!=="[object Object]")return!1;var n=yb.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&yb.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;var r;for(r in t);return typeof r>"u"||yb.call(t,r)},Oce=function(t,n){Rce&&n.name==="__proto__"?Rce(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Cce=function(t,n){if(n==="__proto__")if(yb.call(t,n)){if(Ice)return Ice(t,n).value}else return;return t[n]};Pce.exports=function e(){var t,n,o,r,i,s,a=arguments[0],c=1,u=arguments.length,d=!1;for(typeof a=="boolean"&&(d=a,a=arguments[1]||{},c=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});c<u;++c)if(t=arguments[c],t!=null)for(n in t)o=Cce(a,n),r=Cce(t,n),a!==r&&(d&&r&&(Nce(r)||(i=bce(r)))?(i?(i=!1,s=o&&bce(o)?o:[]):s=o&&Nce(o)?o:{},Oce(a,{name:n,newValue:e(d,s,r)})):typeof r<"u"&&Oce(a,{name:n,newValue:r}));return a}});function ih(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}var Mce=I(()=>{l()});function P0(){let e=[],t={run:n,use:o};return t;function n(...r){let i=-1,s=r.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...r);function a(c,...u){let d=e[++i],p=-1;if(c){s(c);return}for(;++p<r.length;)(u[p]===null||u[p]===void 0)&&(u[p]=r[p]);r=u,d?Lce(d,a)(...u):s(null,...u)}}function o(r){if(typeof r!="function")throw new TypeError("Expected `middelware` to be a function, not "+r);return e.push(r),t}}function Lce(e,t){let n;return o;function o(...s){let a=e.length>s.length,c;a&&s.push(r);try{c=e.apply(this,s)}catch(u){let d=u;if(a&&n)throw d;return r(d)}a||(c&&c.then&&typeof c.then=="function"?c.then(i,r):c instanceof Error?r(c):i(c))}function r(s,...a){n||(n=!0,t(s,...a))}function i(s){r(null,s)}}var wce=I(()=>{l()});var Dce=I(()=>{l();wce()});var ln,kce=I(()=>{l();i0();ln=class extends Error{constructor(t,n,o){super(),typeof n=="string"&&(o=n,n=void 0);let r="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?r=t:!i.cause&&t&&(s=!0,r=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof o=="string"){let c=o.indexOf(":");c===-1?i.ruleId=o:(i.source=o.slice(0,c),i.ruleId=o.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){let c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}let a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=r,this.line=a?a.line:void 0,this.name=ac(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0});var Uce=I(()=>{l();kce()});var yo,$ce=I(()=>{l();yo=U(require("node:path"),1)});var x0,Bce=I(()=>{l();x0=U(require("node:process"),1)});function Rb(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var Gce=I(()=>{l()});var M0,jce=I(()=>{l();M0=require("node:url");Gce()});function w0(e,t){if(e&&e.includes(yo.default.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+yo.default.sep+"`")}function D0(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Vce(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function aGe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var L0,sh,Fce=I(()=>{l();Uce();$ce();Bce();jce();L0=["history","path","basename","stem","extname","dirname"],sh=class{constructor(t){let n;t?Rb(t)?n={path:t}:typeof t=="string"||aGe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":x0.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let o=-1;for(;++o<L0.length;){let i=L0[o];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let r;for(r in n)L0.includes(r)||(this[r]=n[r])}get basename(){return typeof this.path=="string"?yo.default.basename(this.path):void 0}set basename(t){D0(t,"basename"),w0(t,"basename"),this.path=yo.default.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?yo.default.dirname(this.path):void 0}set dirname(t){Vce(this.basename,"dirname"),this.path=yo.default.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?yo.default.extname(this.path):void 0}set extname(t){if(w0(t,"extname"),Vce(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=yo.default.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Rb(t)&&(t=(0,M0.fileURLToPath)(t)),D0(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?yo.default.basename(this.path,this.extname):void 0}set stem(t){D0(t,"stem"),w0(t,"stem"),this.path=yo.default.join(this.dirname||"",t+(this.extname||""))}fail(t,n,o){let r=this.message(t,n,o);throw r.fatal=!0,r}info(t,n,o){let r=this.message(t,n,o);return r.fatal=void 0,r}message(t,n,o){let r=new ln(t,n,o);return this.path&&(r.name=this.path+":"+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}});var Hce=I(()=>{l();Fce()});var zce,qce=I(()=>{l();zce=(function(e){let o=this.constructor.prototype,r=o[e],i=function(){return r.apply(i,arguments)};return Object.setPrototypeOf(i,o),i})});function k0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function U0(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function $0(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yce(e){if(!ih(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Wce(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ib(e){return uGe(e)?e:new sh(e)}function uGe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lGe(e){return typeof e=="string"||dGe(e)}function dGe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var bb,cGe,B0,G0,Kce=I(()=>{l();yce();bb=U(xce(),1);Mce();Dce();Hce();qce();cGe={}.hasOwnProperty,B0=class e extends zce{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=P0()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let o=this.attachers[n];t.use(...o)}return t.data((0,bb.default)(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?($0("data",this.frozen),this.namespace[t]=n,this):cGe.call(this.namespace,t)&&this.namespace[t]||void 0:t?($0("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;let t=this;for(;++this.freezeIndex<this.attachers.length;){let[n,...o]=this.attachers[this.freezeIndex];if(o[0]===!1)continue;o[0]===!0&&(o[0]=void 0);let r=n.call(t,...o);typeof r=="function"&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();let n=Ib(t),o=this.parser||this.Parser;return k0("parse",o),o(String(n),n)}process(t,n){let o=this;return this.freeze(),k0("process",this.parser||this.Parser),U0("process",this.compiler||this.Compiler),n?r(void 0,n):new Promise(r);function r(i,s){let a=Ib(t),c=o.parse(a);o.run(c,a,function(d,p,f){if(d||!p||!f)return u(d);let m=p,_=o.stringify(m,f);lGe(_)?f.value=_:f.result=_,u(d,f)});function u(d,p){d||!p?s(d):i?i(p):n(void 0,p)}}}processSync(t){let n=!1,o;return this.freeze(),k0("processSync",this.parser||this.Parser),U0("processSync",this.compiler||this.Compiler),this.process(t,r),Wce("processSync","process",n),o;function r(i,s){n=!0,v0(i),o=s}}run(t,n,o){Yce(t),this.freeze();let r=this.transformers;return!o&&typeof n=="function"&&(o=n,n=void 0),o?i(void 0,o):new Promise(i);function i(s,a){let c=Ib(n);r.run(t,c,u);function u(d,p,f){let m=p||t;d?a(d):s?s(m):o(void 0,m,f)}}}runSync(t,n){let o=!1,r;return this.run(t,n,i),Wce("runSync","run",o),r;function i(s,a){v0(s),r=a,o=!0}}stringify(t,n){this.freeze();let o=Ib(n),r=this.compiler||this.Compiler;return U0("stringify",r),Yce(t),r(t,o)}use(t,...n){let o=this.attachers,r=this.namespace;if($0("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){let[d,...p]=u;c(d,p)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(r.settings=(0,bb.default)(!0,r.settings,u.settings))}function a(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){let p=u[d];i(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,f=-1;for(;++p<o.length;)if(o[p][0]===u){f=p;break}if(f===-1)o.push([u,...d]);else if(d.length>0){let[m,..._]=d,h=o[f][1];ih(h)&&ih(m)&&(m=(0,bb.default)(!0,h,m)),o[f]=[u,m,..._]}}}},G0=new B0().freeze()});var Zce=I(()=>{l();Kce()});var Nb,j0=I(()=>{l();Fse();Ace();Zce();Nb=G0().use(pb).use(Ab).freeze()});function al(e){return pGe.stringify(e)}function Ob(e){return e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"\uFFFD")}function In(e){return Ob(e).replace(/\s*\n\s*/g," ").trim()}function of(e,t){return{type:"heading",depth:e,children:[Ro(t)]}}function Jce(e){return{type:"paragraph",children:[Ro(e)]}}function cl(e){return{type:"list",ordered:!1,spread:!1,children:e}}function Xce(...e){return{type:"listItem",spread:!1,children:e}}function Cb(e){return Xce(Jce(e))}function Vs(...e){return Xce({type:"paragraph",children:e})}function Ro(e){return{type:"text",value:e}}function ah(e){return{type:"strong",children:[Ro(e)]}}function ul(...e){return{type:"root",children:e}}var pGe,ll=I(()=>{"use strict";l();j0();pGe=Nb()});function uh(e){return`${e.priorObservations?`Previous observations (do NOT repeat these \u2014 your new observations will be appended):
380
+ ${e.priorObservations}
381
+
382
+ ---`:"This is the beginning of the session."}
383
+
384
+ Session date: ${e.date}
385
+
386
+ Conversation to observe:
387
+
388
+ ${e.messages}
389
+
390
+ Extract new observations. Output ONLY an <observations> block.`}function F0(e,t){let n=e.map((o,r)=>`Segment ${r+1}:
391
+ ${o.observations}`);return t?`Update the anchored meta-summary below using the NEW observation segments. Preserve still-true details, remove stale details, and merge in new facts. Keep the same section headings.
392
+
393
+ <previous-meta-summary>
394
+ ${t}
395
+ </previous-meta-summary>
396
+
397
+ ---
398
+
399
+ New observation segments to merge (chronological order):
400
+
401
+ ${n.join(`
402
+
403
+ ---
404
+
405
+ `)}`:`Observation segments to consolidate (chronological order):
406
+
407
+ ${n.join(`
408
+
409
+ ---
410
+
411
+ `)}`}function z0(e){let t=e.existing.length;return`${t?`Existing knowledge entries (${t} total \u2014 you may update or delete these):
412
+ ${e.existing.map(o=>`- [${o.id}] (${o.category}) ${o.title}: ${o.content}`).join(`
413
+ `)}`:"No existing knowledge entries."}
414
+
415
+ ---
416
+ Recent conversation to extract knowledge from:
417
+
418
+ ${e.messages}
419
+
420
+ ---
421
+ IMPORTANT:
422
+ 1. Prefer updating existing entries over creating new ones. If a new insight refines or
423
+ extends an existing entry on the same topic, update that entry \u2014 don't create a new one.
424
+ 2. When updating, REPLACE the content with a complete rewrite \u2014 never append.
425
+ 3. If entries cover the same system from different angles, merge them: update one, delete the rest.
426
+ 4. Only create a new entry for genuinely distinct knowledge with no existing home.
427
+ 5. Keep all entries under 150 words. If an existing entry is too long, use an update op to trim it.`}function Y0(e){let t=e.entries.length,n=e.entries.map(o=>`- [${o.id}] (${o.category}) ${o.title}: ${o.content}`).join(`
428
+ `);return`Current knowledge entries (${t} total, target max: ${e.targetMax}):
429
+
430
+ ${n}
431
+
432
+ Produce update/delete ops to reduce entry count to at most ${e.targetMax}. Prioritize merging related entries and trimming verbose ones over outright deletion.`}function lh(e){if(!e.length)return"";let t=e.filter(r=>r.generation>0),n=e.filter(r=>r.generation===0),o=["## Session History"];if(t.length){o.push("### Earlier Work (summarized)");for(let r of t)o.push(r.observations.trim())}if(n.length){o.push("### Recent Work (distilled)");for(let r of n)o.push(r.observations.trim())}return o.join(`
433
+
434
+ `)}function W0(e){let t=e.hasDistillations?`Lore has pre-computed chunked summaries of the session history (injected above as context). Use them as the authoritative source \u2014 do NOT re-read raw conversation messages that conflict with them.
435
+
436
+ `:"",n=e.previousSummary?`A prior compacted summary exists for this session. Update it using the conversation history above: preserve still-true details, remove stale details, and merge in new facts. Keep every section in place.
437
+
438
+ <previous-summary>
439
+ ${e.previousSummary}
440
+ </previous-summary>
441
+
442
+ `:"",o=e.knowledge?`
443
+ ${e.knowledge}
444
+ `:"";return`You are producing a compacted session summary for an AI coding agent. This summary will be the ONLY context available in the next part of the conversation.
445
+
446
+ ${t}${n}${Qce}
447
+ ${o}`}function fGe(e){return Math.ceil(e.length/3)}function vb(e,t){if(!e.length)return"";let n=e;if(t!==void 0){let s=50,a=[];for(let c of e){let u=fGe(c.title+c.content)+10;s+u>t||(a.push(c),s+=u)}if(n=a,!n.length)return""}let o={};for(let i of n)(o[i.category]??(o[i.category]=[])).push(i);let r=[of(2,"Long-term Knowledge")];for(let[i,s]of Object.entries(o))r.push(of(3,i.charAt(0).toUpperCase()+i.slice(1))),r.push(cl(s.map(a=>Vs(ah(In(a.title)),Ro(": "+In(a.content))))));return al(ul(...r))}var ch,V0,H0,q0,Qce,K0,dl=I(()=>{"use strict";l();ll();ch=`You are a memory observer. Your observations will be the ONLY information an AI assistant has about past interactions. Produce a dense, dated event log \u2014 not a summary.
448
+
449
+ CRITICAL: DISTINGUISH USER ASSERTIONS FROM QUESTIONS
450
+
451
+ When the user TELLS you something about themselves, mark it as an assertion (\u{1F534}):
452
+ - "I have two kids" \u2192 \u{1F534} (14:30) User stated has two kids
453
+ - "I work at Acme Corp" \u2192 \u{1F534} (14:31) User stated works at Acme Corp
454
+
455
+ When the user ASKS about something, mark it as a question (\u{1F7E1}):
456
+ - "Can you help me with X?" \u2192 \u{1F7E1} (15:00) User asked for help with X
457
+
458
+ User assertions are AUTHORITATIVE \u2014 the user is the source of truth about their own life.
459
+
460
+ TEMPORAL ANCHORING \u2014 CRITICAL FOR TEMPORAL REASONING:
461
+
462
+ Each observation has up to two timestamps:
463
+ 1. BEGINNING: The time the statement was made \u2014 ALWAYS include this as (HH:MM)
464
+ 2. END: The referenced date, if the content refers to a different time \u2014 add as "(meaning DATE)" or "(estimated DATE)"
465
+
466
+ ONLY add "(meaning DATE)" when you can derive an actual date:
467
+ - "last week", "yesterday", "next month" \u2192 compute and add the date
468
+ - "recently", "a while ago", "soon" \u2192 too vague, omit the end date
469
+
470
+ ALWAYS put the date annotation at the END of the observation line.
471
+
472
+ GOOD: (09:15) User will visit parents this weekend. (meaning Jun 17-18, 2025)
473
+ GOOD: (09:15) User's friend had a birthday party last month. (estimated May 2025)
474
+ GOOD: (09:15) User prefers hiking in the mountains.
475
+ BAD: (09:15) User prefers hiking. (meaning Jun 15, 2025) \u2190 no time reference, don't add date
476
+
477
+ If an observation contains MULTIPLE events, split into SEPARATE lines, each with its own date.
478
+
479
+ STATE CHANGES \u2014 make supersession explicit:
480
+ - "User will use X (replacing Y)" \u2014 not just "User will use X"
481
+ - "User moved to Berlin (no longer in London)"
482
+
483
+ DETAILS TO ALWAYS PRESERVE:
484
+ - Names, handles, usernames (@username, "Dr. Smith")
485
+ - Numbers, counts, quantities (4 items, 3 sessions, $120)
486
+ - Measurements, percentages (5kg, 20% improvement, 85% accuracy)
487
+ - Sequences and orderings (steps 1-5, lucky numbers: 7 14 23)
488
+ - Prices, dates, times, durations
489
+ - Locations and distinguishing attributes
490
+ - User's specific role (presenter, volunteer, organizer \u2014 not just "attended")
491
+ - Exact phrasing when unusual ("movement session" for exercise)
492
+
493
+ EXACT NUMBERS \u2014 NEVER APPROXIMATE:
494
+
495
+ When the conversation states a specific count, record that EXACT number \u2014 do not round, estimate, or substitute a count you see later. If the same quantity appears with different values at different times, record each with its timestamp.
496
+
497
+ BAD: All existing entries bulk-updated to cross_project=1 (50 entries) \u2190 wrong: mixed up with a later count
498
+ GOOD: 43 knowledge entries bulk-updated to cross_project=1 via SQL UPDATE \u2190 exact number from the operation
499
+
500
+ BAD: ~130 test failures
501
+ GOOD: 131 test failures (1902 pass, 131 fail, 1 error across 100 files) \u2190 preserve exact counts
502
+
503
+ BUG FIXES AND CODE CHANGES \u2014 HIGH PRIORITY:
504
+
505
+ Every bug fix, code change, or technical decision is important regardless of where it appears in the conversation. Early-session fixes are just as valuable as later ones.
506
+
507
+ For each fix, record:
508
+ - The specific bug/problem (what went wrong)
509
+ - The root cause (why it went wrong)
510
+ - The fix applied (what changed, with file paths and line numbers)
511
+ - The outcome (tests pass, deployed, etc.)
512
+
513
+ BAD: \u{1F7E1} Fixed an FTS5 search bug
514
+ GOOD: \u{1F7E1} FTS5 was doing exact term matching instead of prefix matching in ltm.ts. Fix: added ftsQuery() function that appends * to each search term for prefix matching. Committed as [hash].
515
+
516
+ ASSISTANT-GENERATED CONTENT \u2014 THIS IS CRITICAL:
517
+
518
+ When the assistant produces lists, recommendations, explanations, recipes, schedules, creative content, or any structured output \u2014 record EVERY ITEM with its distinguishing details. The user WILL ask about specific items later.
519
+
520
+ BAD: \u{1F7E1} Assistant recommended 5 dessert spots in Orlando.
521
+ GOOD: \u{1F7E1} Assistant recommended dessert spots: Sugar Factory (Icon Park, giant milkshakes), Wondermade (Sanford, gourmet marshmallows), Gideon's Bakehouse (Disney Springs, cookies), Farris & Foster's (unique flavors), Kilwins (handmade fudge)
522
+
523
+ BAD: \u{1F7E1} Assistant listed work-from-home jobs for seniors.
524
+ GOOD: \u{1F7E1} Assistant listed 10 WFH jobs for seniors: 1. Virtual assistant, 2. Online tutor, 3. Freelance writer, 4. Social media manager, 5. Customer service rep, 6. Bookkeeper, 7. Transcriptionist, 8. Web designer, 9. Data entry, 10. Consultant
525
+
526
+ BAD: \u{1F7E1} Assistant explained refining processes.
527
+ GOOD: \u{1F7E1} Assistant explained Lake Charles refinery processes: atmospheric distillation, fluid catalytic cracking (FCC), alkylation, hydrotreating
528
+
529
+ Rules for assistant content:
530
+ - Record EACH item in a list with at least one distinguishing attribute
531
+ - For numbered lists, preserve the EXACT ordering (1st, 2nd, 3rd...)
532
+ - For recipes: preserve specific quantities, ratios, temperatures, times
533
+ - For recommendations: preserve names, locations, prices, key features
534
+ - For creative content (songs, stories, poems): preserve titles, key phrases, character names, structural details
535
+ - For technical explanations: preserve specific values, percentages, formulas, tool/library names
536
+ - Ordered lists must keep their numbering \u2014 users ask "what was the 7th item?"
537
+ - Use \u{1F7E1} priority but NEVER skip assistant-generated details to save space
538
+
539
+ ENUMERATABLE ENTITIES \u2014 always flag for cross-session aggregation:
540
+ When the user mentions attending events, buying things, meeting people, completing tasks \u2014 mark with entity type so these can be aggregated across sessions:
541
+ \u{1F534} [event-attended] User attended Rachel+Mike's wedding (vineyard in Napa, Aug 12, 2023)
542
+ \u{1F534} [item-purchased] User bought Sony WH-1000XM5 headphones ($280, replaced old Bose)
543
+ This makes it possible to answer "how many weddings did I attend?" by aggregating across sessions.
544
+
545
+ PRIORITY LEVELS:
546
+ - \u{1F534} High: user assertions, stated facts, preferences, goals, enumeratable entities
547
+ - \u{1F7E1} Medium: questions asked, context, assistant-generated content with full detail
548
+ - \u{1F7E2} Low: minor conversational context, greetings, acknowledgments
549
+
550
+ OUTPUT FORMAT \u2014 output ONLY observations, no preamble:
551
+
552
+ <observations>
553
+ Date: Jan 15, 2026
554
+ * \u{1F534} (09:15) User stated has two kids: Emma (12) and Jake (9)
555
+ * \u{1F534} (09:16) User's anniversary is March 15
556
+ * \u{1F7E1} (09:20) User asked how to optimize database queries
557
+ * \u{1F534} [event-attended] (10:00) User attended company holiday party as a presenter (gave talk on microservices)
558
+ * \u{1F534} (11:30) User will visit parents this weekend. (meaning Jan 17-18, 2026)
559
+ * \u{1F7E1} (14:00) Agent debugging auth issue \u2014 found missing null check in auth.ts:45, applied fix, tests pass
560
+ * \u{1F7E1} (14:30) Assistant recommended 5 hotels: 1. Grand Plaza (near station, $180), 2. Seaside Inn (pet-friendly, $120), 3. Mountain Lodge (pool, free breakfast, $95), 4. Harbor View (historic, walkable, $150), 5. Zen Garden (quietest, spa, $200)
561
+ * \u{1F534} (15:00) User switched from Python to TypeScript for the project (no longer using Python)
562
+ </observations>`;V0=`You are a memory reflector. You are given a set of observations from multiple conversation segments. Your job is to consolidate them into a structured working context that will become the agent's entire memory going forward.
563
+
564
+ IMPORTANT: Your reflections ARE the entirety of the assistant's memory. Any information you omit is permanently forgotten. Do not leave out anything important.
565
+
566
+ STRUCTURE your output into these sections \u2014 each section supports a different type of downstream query:
567
+
568
+ ### Current State
569
+ What is in progress right now? Active branches, open files, current task, blockers.
570
+ This section answers: "What was I working on?"
571
+
572
+ ### Key Decisions
573
+ What was decided and why? Include the alternatives considered and rationale.
574
+ This section answers: "Why did we choose approach X?" and "What alternatives were rejected?"
575
+
576
+ ### Technical Changes
577
+ Bugs found, root causes, fixes applied, files modified, tests added/fixed.
578
+ Preserve exact file paths, line numbers, error messages, and commit references.
579
+ This section answers: "What bugs were fixed?" and "What files were changed?"
580
+
581
+ ### Session Timeline
582
+ Condensed chronological events with timestamps. Older events compressed more aggressively; recent events retain detail. This section answers: "When did X happen?" and "What was the sequence of events?"
583
+
584
+ CONSOLIDATION RULES:
585
+ - Preserve ALL dates and timestamps \u2014 temporal context is critical
586
+ - Combine related items (e.g., "agent called view tool 5 times on file x" \u2192 single line)
587
+ - Merge duplicate facts, keeping the most specific version
588
+ - Drop observations superseded by later info (if value changed, keep only final value)
589
+ - When consolidating, USER ASSERTIONS take precedence over questions about the same topic
590
+ - Preserve all enumeratable entities [entity-type] \u2014 these are needed for aggregation questions
591
+ - For enumeratable entities spanning multiple segments, create an explicit aggregation:
592
+ \u{1F534} [event-attended] User attended 3 weddings total: Rachel+Mike (vineyard, Aug 2023), Emily+Sarah (garden, Sep 2023), Jen+Tom (Oct 8, 2023)
593
+
594
+ EXACT NUMBERS: When two segments report different numbers for what seems like the same thing, keep the number from the earlier/original observation \u2014 it's likely the correct one from the actual event. Later references may be from memory or approximation.
595
+
596
+ EARLY-SESSION CONTENT: Bug fixes, code changes, and decisions from the start of a session are just as important as later work. Never drop them just because the segment is short or old. If the first segment contains a specific bug fix with file paths and root cause, it MUST survive into the reflection.
597
+
598
+ ANCHORED UPDATES: If the prompt includes a <previous-meta-summary> block, treat it as the current consolidated state. Update it using the NEW observation segments \u2014 preserve still-true details, remove stale details, and merge in new facts. Keep the same section headings. Do NOT re-derive unchanged sections verbatim unless the new segments contradict them.
599
+
600
+ Output ONLY an <observations> block with the consolidated observations.`;H0=`You are a long-term memory curator. Your job is to extract durable knowledge from a conversation that should persist across sessions.
601
+
602
+ Focus ONLY on knowledge that helps a coding agent work effectively on THIS codebase:
603
+ - Architectural decisions and their rationale (why something was built a certain way)
604
+ - Non-obvious implementation patterns and conventions specific to the project
605
+ - Recurring gotchas, constraints, or traps in the codebase
606
+ - Environment/tooling setup details that affect development
607
+ - Important relationships between components that aren't obvious from reading the code
608
+ - User preferences and working style specific to how they use this project
609
+
610
+ Do NOT extract:
611
+ - Task-specific details (file currently being edited, current bug being fixed)
612
+ - Temporary state (current branch, in-progress work)
613
+ - Information that will change frequently
614
+ - Ecosystem descriptions, product announcements, or marketing content
615
+ - Business strategy, roadmap, or organizational information
616
+ - Information that's readily available in public documentation or READMEs
617
+ - Knowledge about unrelated projects or repositories unless explicitly cross-project
618
+ - Restatements of what the code obviously does (e.g. "the auth module handles authentication")
619
+
620
+ BREVITY IS CRITICAL \u2014 each entry must be concise:
621
+ - content MUST be under 150 words (~600 characters). Capture ONE specific actionable
622
+ insight in 2-3 sentences. Prefer terse technical language.
623
+ - Each "gotcha": one specific trap + its fix in 1-2 sentences
624
+ - Each "architecture": one design decision and its key constraint
625
+ - Focus on the actionable insight, not the full story behind it
626
+ - If a pattern requires more detail, split into multiple focused entries (each under 150 words)
627
+ - Omit code examples unless a single short snippet is essential
628
+ - Never include full file contents, large diffs, or complete command outputs
629
+
630
+ PREFER UPDATES OVER CREATES:
631
+ - Before creating a new entry, always check if an existing entry covers the same system
632
+ or component. Update the existing entry rather than creating a new one.
633
+ - When updating, REPLACE the full content with a concise rewrite \u2014 do not append to
634
+ the existing content or repeat what was already there.
635
+ - If multiple existing entries cover the same system from different angles (e.g. different
636
+ bugs in the same module), consolidate them: update one with merged insights, delete the
637
+ rest. Fewer, denser entries are better than many scattered ones.
638
+
639
+ CROSS-REFERENCES between entries:
640
+ - When an entry relates to another entry, reference it with [[entry-uuid]] using the entry's ID
641
+ from the existing entries list. This creates navigable links between entries.
642
+ - Only reference entries you can see in the existing entries list \u2014 don't guess IDs.
643
+ - Example: "Uses the gradient system [[019c904b-791e-772a-ab2b-93ac892a960c]] for context management."
644
+
645
+ crossProject flag:
646
+ - Default is true \u2014 most useful knowledge is worth sharing across projects
647
+ - Set crossProject to false for things that are meaningless outside this specific repo (e.g. a config path, a project-local naming convention that conflicts with your usual style)
648
+
649
+ Produce a JSON array of operations:
650
+ [
651
+ {
652
+ "op": "create",
653
+ "category": "decision" | "pattern" | "preference" | "architecture" | "gotcha",
654
+ "title": "Short descriptive title",
655
+ "content": "Concise knowledge entry \u2014 under 150 words",
656
+ "scope": "project" | "global",
657
+ "crossProject": true
658
+ },
659
+ {
660
+ "op": "update",
661
+ "id": "existing-entry-id",
662
+ "content": "Updated content \u2014 under 150 words",
663
+ "confidence": 0.0-1.0
664
+ },
665
+ {
666
+ "op": "delete",
667
+ "id": "existing-entry-id",
668
+ "reason": "Why this is no longer relevant"
669
+ }
670
+ ]
671
+
672
+ If nothing warrants extraction, return an empty array: []
673
+
674
+ Output ONLY valid JSON. No markdown fences, no explanation, no preamble.`;q0=`You are a long-term memory curator performing a consolidation pass. The knowledge base has grown too large and needs to be trimmed.
675
+
676
+ Your goal: reduce the entry count to the target maximum while preserving the most valuable knowledge.
677
+
678
+ CONSOLIDATION RULES:
679
+ 1. MERGE related entries \u2014 if multiple entries describe the same system, module, or concept
680
+ from different angles (e.g. several bug fixes in the same component), merge them into
681
+ ONE concise entry. Use an "update" op for the surviving entry and "delete" ops for the rest.
682
+ 2. TRIM verbose entries \u2014 any entry over 150 words must be trimmed to its essential insight.
683
+ Use an "update" op with the rewritten content.
684
+ 3. DELETE low-value entries:
685
+ - Stale entries about bugs that have been fixed and no longer need gotcha warnings
686
+ - Entries whose knowledge is fully subsumed by another entry
687
+ - Entries about one-off incidents with no recurring applicability
688
+ - General advice available in any documentation
689
+ 4. PRESERVE:
690
+ - Entries describing non-obvious design decisions specific to this codebase
691
+ - Entries about recurring traps that a developer would hit again
692
+ - Entries that capture a hard-won gotcha with a concrete fix
693
+
694
+ OUTPUT: A JSON array of "update" and "delete" ops only. No "create" ops \u2014 you are not
695
+ extracting new knowledge, only consolidating existing knowledge.
696
+
697
+ - "update": Replace content with a concise rewrite (under 150 words). Use to merge survivors or trim verbose entries.
698
+ - "delete": Remove entries that are merged, stale, or low-value.
699
+
700
+ Output ONLY valid JSON. No markdown fences, no explanation, no preamble.`;Qce=`Output exactly this Markdown structure. Keep every section in this order, even when empty (use "(none)").
701
+
702
+ ---
703
+ ## Goal
704
+ - [single-sentence task summary]
705
+
706
+ ## Constraints & Preferences
707
+ - [user constraints, preferences, specs, or "(none)"]
708
+
709
+ ## Progress
710
+ ### Done
711
+ - [completed work or "(none)"]
712
+
713
+ ### In Progress
714
+ - [current work or "(none)"]
715
+
716
+ ### Blocked
717
+ - [blockers or "(none)"]
718
+
719
+ ## Key Decisions
720
+ - [decision and why, or "(none)"]
721
+
722
+ ## Next Steps
723
+ - [ordered next actions or "(none)"]
724
+
725
+ ## Critical Context
726
+ - [important technical facts, errors, open questions, or "(none)"]
727
+
728
+ ## Relevant Files
729
+ - [file or directory path: why it matters, or "(none)"]
730
+ ---
731
+
732
+ Rules:
733
+ - Keep every section, even when empty.
734
+ - Use terse bullets, not prose paragraphs.
735
+ - Preserve exact file paths, commands, error strings, and identifiers when known.
736
+ - Do not mention the summary process or that context was compacted.
737
+ - End with "I'm ready to continue." on its own line after the closing "---".`;K0=`You are a search query expander for a code knowledge base. Given a search query, generate 2\u20133 alternative queries that would help find relevant results. Focus on:
738
+ - Synonyms and related technical terms
739
+ - Different phrasings of the same concept
740
+ - Broader or narrower scopes
741
+
742
+ Return ONLY a JSON array of strings. No explanation, no markdown.
743
+
744
+ Example:
745
+ Input: "SQLite FTS5 ranking"
746
+ Output: ["full text search scoring SQLite", "BM25 relevance ranking database", "FTS5 match order by rank"]`});var F={};ft(F,{error:()=>ph,info:()=>Fe,registerSink:()=>mGe,warn:()=>sf});function mGe(e){dh=e}function Z0(e){return e.map(t=>typeof t=="string"?t:t instanceof Error?t.message:String(t)).join(" ")}function _Ge(e){for(let t of e)if(t instanceof Error)return t}function Fe(...e){eue&&console.error("[lore]",...e),dh?.info(Z0(e))}function sf(...e){eue&&console.error("[lore] WARN:",...e),dh?.warn(Z0(e))}function ph(...e){console.error("[lore]",...e),dh?.error(Z0(e));let t=_Ge(e);t&&dh?.captureException(t)}var dh,eue,Zi=I(()=>{"use strict";l();dh=null;eue=!!process.env.LORE_DEBUG});function fh(e){return e.replace(/[^\w\s]/g," ").split(/\s+/).filter(Boolean).filter(n=>n.length>1&&!tue.has(n.toLowerCase()))}function Ir(e){let t=fh(e);return t.length?t.map(n=>`${n}*`).join(" "):It}function Io(e){let t=fh(e);return t.length?t.map(n=>`${n}*`).join(" OR "):It}function mh(e,t=40){return[...e.replace(/[^\w\s]/g," ").toLowerCase().split(/\s+/).filter(o=>o.length>1&&!tue.has(o)).reduce((o,r)=>(o.set(r,(o.get(r)??0)+1),o),new Map).entries()].sort((o,r)=>r[1]-o[1]).slice(0,t).map(([o])=>o)}function J0(e,t=60){let n=new Map;for(let o of e)for(let r=0;r<o.items.length;r++){let i=o.items[r],s=o.key(i),a=1/(t+r),c=n.get(s);c?c.score+=a:n.set(s,{item:i,score:a})}return[...n.values()].sort((o,r)=>r.score-o.score)}function X0(e,t,n){let o=fh(n).map(i=>i.toLowerCase());return o.length?e.map(i=>{let s=t(i).toLowerCase(),a=o.filter(c=>s.includes(c)).length;return{item:i,matches:a}}).filter(i=>i.matches>0).sort((i,s)=>s.matches-i.matches).map(i=>i.item):[]}async function Q0(e,t,n,o){try{let i=await Promise.race([e.prompt(K0,`Input: "${t}"`,{model:n,workerID:"lore-query-expand",thinking:!1,urgent:!0,sessionID:o}),new Promise(u=>setTimeout(()=>u(null),3e3))]);if(!i)return Fe("query expansion timed out or failed, using original query"),[t];let s=i.trim().replace(/^```json?\s*/i,"").replace(/\s*```$/i,""),a=JSON.parse(s);if(!Array.isArray(a))return[t];let c=a.filter(u=>typeof u=="string"&&u.trim().length>0);return c.length?[t,...c.slice(0,3)]:[t]}catch(i){return Fe("query expansion failed, using original query:",i),[t]}}var tue,It,af=I(()=>{"use strict";l();dl();Zi();tue=new Set(["an","the","this","that","these","those","some","each","every","he","it","me","my","we","us","or","am","they","them","their","there","here","what","which","where","when","whom","is","be","do","no","so","if","as","at","by","in","of","on","to","up","are","was","has","had","not","but","can","did","for","got","let","may","our","its","nor","yet","how","all","any","too","own","out","why","who","few","have","been","were","will","would","could","should","does","being","also","with","from","into","about","than","over","such","after","before","between","just","only","very","more","most","really","already"]),It='""'});function uc(e){return e.type==="text"}function _h(e){return e.type==="reasoning"}function cr(e){return e.type==="tool"}var Pb=I(()=>{"use strict";l()});var br={};ft(br,{CHUNK_TERMINATOR:()=>gh,bySession:()=>tU,count:()=>TGe,markDistilled:()=>nU,partsToText:()=>oue,prune:()=>AGe,search:()=>EGe,searchScored:()=>rU,store:()=>gGe,temporalCnorm:()=>xb,undistilled:()=>eU,undistilledCount:()=>SGe});function nue(e){return Math.ceil(e.length/3)}function oue(e){let t=[];for(let n of e)uc(n)?t.push(n.text):_h(n)&&n.text?t.push(`[reasoning] ${n.text}`):cr(n)&&n.state.status==="completed"&&t.push(`[tool:${n.tool}] ${n.state.output}`);return Ob(t.join(`
747
+ `+gh))}function rue(e,t){let n={};e.role==="user"?(n.agent=e.agent,n.model=e.model):(n.modelID=e.modelID,n.providerID=e.providerID,n.mode=e.mode);let o=t.filter(cr).map(r=>r.tool);return o.length&&(n.tools=o),JSON.stringify(n)}function gGe(e){let t=De(e.projectPath),n=oue(e.parts);if(!n.trim())return;if(j().query("SELECT id FROM temporal_messages WHERE id = ?").get(e.info.id)){j().query("UPDATE temporal_messages SET content = ?, tokens = ?, metadata = ? WHERE id = ?").run(n,nue(n),rue(e.info,e.parts),e.info.id);return}j().query(`INSERT INTO temporal_messages (id, project_id, session_id, role, content, tokens, distilled, created_at, metadata)
748
+ VALUES (?, ?, ?, ?, ?, ?, 0, ?, ?)`).run(e.info.id,t,e.info.sessionID,e.info.role,n,nue(n),e.info.time.created,rue(e.info,e.parts))}function eU(e,t){let n=De(e),o=t?"SELECT * FROM temporal_messages WHERE project_id = ? AND session_id = ? AND distilled = 0 ORDER BY created_at ASC":"SELECT * FROM temporal_messages WHERE project_id = ? AND distilled = 0 ORDER BY created_at ASC",r=t?[n,t]:[n];return j().query(o).all(...r)}function tU(e,t){let n=De(e);return j().query("SELECT * FROM temporal_messages WHERE project_id = ? AND session_id = ? ORDER BY created_at ASC").all(n,t)}function nU(e){if(!e.length)return;let t=e.map(()=>"?").join(",");j().query(`UPDATE temporal_messages SET distilled = 1 WHERE id IN (${t})`).run(...e)}function hGe(e){let t=e.query.toLowerCase().split(/\s+/).filter(s=>s.length>2);if(!t.length)return[];let n=t.map(()=>"LOWER(content) LIKE ?").join(" AND "),o=t.map(s=>`%${s}%`),r=e.sessionID?`SELECT * FROM temporal_messages WHERE project_id = ? AND session_id = ? AND ${n} ORDER BY created_at DESC LIMIT ?`:`SELECT * FROM temporal_messages WHERE project_id = ? AND ${n} ORDER BY created_at DESC LIMIT ?`,i=e.sessionID?[e.pid,e.sessionID,...o,e.limit]:[e.pid,...o,e.limit];return j().query(r).all(...i)}function EGe(e){let t=De(e.projectPath),n=e.limit??20,o=Ir(e.query);if(o===It)return[];let r=e.sessionID?`SELECT m.* FROM temporal_fts f
749
+ CROSS JOIN temporal_messages m ON m.rowid = f.rowid
750
+ WHERE f.content MATCH ? AND m.project_id = ? AND m.session_id = ?
751
+ ORDER BY rank LIMIT ?`:`SELECT m.* FROM temporal_fts f
752
+ CROSS JOIN temporal_messages m ON m.rowid = f.rowid
753
+ WHERE f.content MATCH ? AND m.project_id = ?
754
+ ORDER BY rank LIMIT ?`,i=e.sessionID?[o,t,e.sessionID,n]:[o,t,n];try{let s=j().query(r).all(...i);if(s.length)return s;let a=Io(e.query);if(a===It)return[];let c=e.sessionID?[a,t,e.sessionID,n]:[a,t,n];return j().query(r).all(...c)}catch{return hGe({pid:t,query:e.query,sessionID:e.sessionID,limit:n})}}function rU(e){let t=De(e.projectPath),n=e.limit??20,o=Ir(e.query);if(o===It)return[];let r=e.sessionID?`SELECT m.*, rank FROM temporal_fts f
755
+ CROSS JOIN temporal_messages m ON m.rowid = f.rowid
756
+ WHERE f.content MATCH ? AND m.project_id = ? AND m.session_id = ?
757
+ ORDER BY rank LIMIT ?`:`SELECT m.*, rank FROM temporal_fts f
758
+ CROSS JOIN temporal_messages m ON m.rowid = f.rowid
759
+ WHERE f.content MATCH ? AND m.project_id = ?
760
+ ORDER BY rank LIMIT ?`,i=e.sessionID?[o,t,e.sessionID,n]:[o,t,n];try{let s=j().query(r).all(...i);if(s.length)return s;let a=Io(e.query);if(a===It)return[];let c=e.sessionID?[a,t,e.sessionID,n]:[a,t,n];return j().query(r).all(...c)}catch{return[]}}function xb(e,t=Date.now()){let n=e.length;if(n<2)return 0;let o=e.map(u=>t-u),r=o.reduce((u,d)=>u+d,0);if(r<=0)return 0;let i=o.map(u=>u/r),s=1/n,a=i.reduce((u,d)=>u+(d-s)**2,0)/n,c=(n-1)/(n*n);return c===0?0:a/c}function TGe(e,t){let n=De(e),o=t?"SELECT COUNT(*) as count FROM temporal_messages WHERE project_id = ? AND session_id = ?":"SELECT COUNT(*) as count FROM temporal_messages WHERE project_id = ?",r=t?[n,t]:[n];return j().query(o).get(...r).count}function SGe(e,t){let n=De(e),o=t?"SELECT COUNT(*) as count FROM temporal_messages WHERE project_id = ? AND session_id = ? AND distilled = 0":"SELECT COUNT(*) as count FROM temporal_messages WHERE project_id = ? AND distilled = 0",r=t?[n,t]:[n];return j().query(o).get(...r).count}function AGe(e){let t=j(),n=De(e.projectPath),o=Date.now()-e.retentionDays*24*60*60*1e3,r=t.query("SELECT COUNT(*) as c FROM temporal_messages WHERE project_id = ? AND distilled = 1 AND created_at < ?").get(n,o).c;r>0&&t.query("DELETE FROM temporal_messages WHERE project_id = ? AND distilled = 1 AND created_at < ?").run(n,o);let i=r,s=e.maxStorageMB*1024*1024,a=t.query("SELECT SUM(LENGTH(content)) as b FROM temporal_messages WHERE project_id = ?").get(n).b??0,c=0;if(a>s){let u=t.query("SELECT id, LENGTH(content) as size FROM temporal_messages WHERE project_id = ? AND distilled = 1 ORDER BY created_at ASC").all(n),d=[],p=0,f=a-s;for(let m of u){if(p>=f)break;d.push(m.id),p+=m.size}if(d.length){let m=d.map(()=>"?").join(",");t.query(`DELETE FROM temporal_messages WHERE id IN (${m})`).run(...d),c=d.length}}return t.query("DELETE FROM distillations WHERE project_id = ? AND archived = 1 AND created_at < ?").run(n,o),{ttlDeleted:i,capDeleted:c}}var gh,cf=I(()=>{"use strict";l();Ki();af();ll();Pb();gh=""});var Mb,Lb,oU,yGe,iU,iue,sue,RGe,aue=I(()=>{l();Mb="0123456789abcdef",Lb=class e{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new e(t)}static fromFieldsV7(t,n,o,r){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(o)||!Number.isInteger(r)||t<0||n<0||o<0||r<0||t>0xffffffffffff||n>4095||o>1073741823||r>4294967295)throw new RangeError("invalid field value");let i=new Uint8Array(16);return i[0]=t/2**40,i[1]=t/2**32,i[2]=t/2**24,i[3]=t/2**16,i[4]=t/2**8,i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|o>>>24,i[9]=o>>>16,i[10]=o>>>8,i[11]=o,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new e(i)}static parse(t){var n,o,r,i;let s;switch(t.length){case 32:s=(n=/^[0-9a-f]{32}$/i.exec(t))===null||n===void 0?void 0:n[0];break;case 36:s=(o=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 38:s=(r=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 45:s=(i=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||i===void 0?void 0:i.slice(1,6).join("");break;default:break}if(s){let a=new Uint8Array(16);for(let c=0;c<16;c+=4){let u=parseInt(s.substring(2*c,2*c+8),16);a[c+0]=u>>>24,a[c+1]=u>>>16,a[c+2]=u>>>8,a[c+3]=u}return new e(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let n=0;n<this.bytes.length;n++)t+=Mb.charAt(this.bytes[n]>>>4),t+=Mb.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(t+="-");return t}toHex(){let t="";for(let n=0;n<this.bytes.length;n++)t+=Mb.charAt(this.bytes[n]>>>4),t+=Mb.charAt(this.bytes[n]&15);return t}toJSON(){return this.toString()}getVariant(){let t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.bytes.every(n=>n===255)?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}clone(){return new e(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let n=0;n<16;n++){let o=this.bytes[n]-t.bytes[n];if(o!==0)return Math.sign(o)}return 0}},oU=class{constructor(t){this.timestamp_biased=0,this.counter=0,this.random=t??yGe()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(t,n){let o=this.generateOrAbortCore(t,n);return o===void 0&&(this.timestamp_biased=0,o=this.generateOrAbortCore(t,n)),o}generateOrAbortCore(t,n){if(!Number.isInteger(t)||t<0||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit unsigned integer");if(n<0||n>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");if(t++,t>this.timestamp_biased)this.timestamp_biased=t,this.resetCounter();else if(t+n>=this.timestamp_biased)this.counter++,this.counter>4398046511103&&(this.timestamp_biased++,this.resetCounter());else return;return Lb.fromFieldsV7(this.timestamp_biased-1,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){let t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,Lb.ofInner(t)}},yGe=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new iU;if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}},iU=class{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}},sue=()=>RGe().toString(),RGe=()=>(iue||(iue=new oU)).generate()});function x(e,t,n){function o(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,d=Object.keys(u);for(let p=0;p<d.length;p++){let f=d[p];f in a||(a[f]=u[f].bind(a))}}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=n?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Lt(e){return e&&Object.assign(hh,e),hh}var sU,wb,Xo,lc,hh,uf=I(()=>{l();sU=Object.freeze({status:"aborted"});wb=Symbol("zod_brand"),Xo=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},lc=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},hh={}});var Y={};ft(Y,{BIGINT_FORMAT_RANGES:()=>gU,Class:()=>cU,NUMBER_FORMAT_RANGES:()=>_U,aborted:()=>mc,allowsEval:()=>dU,assert:()=>CGe,assertEqual:()=>IGe,assertIs:()=>NGe,assertNever:()=>OGe,assertNotEqual:()=>bGe,assignProp:()=>pc,base64ToUint8Array:()=>uue,base64urlToUint8Array:()=>zGe,cached:()=>df,captureStackTrace:()=>kb,cleanEnum:()=>HGe,cleanRegex:()=>Sh,clone:()=>ur,cloneDef:()=>PGe,createTransparentProxy:()=>kGe,defineLazy:()=>xe,esc:()=>Db,escapeRegex:()=>bo,extend:()=>BGe,finalizeIssue:()=>Nr,floatSafeRemainder:()=>uU,getElementAtPath:()=>xGe,getEnumValues:()=>Th,getLengthableOrigin:()=>Rh,getParsedType:()=>DGe,getSizableOrigin:()=>yh,hexToUint8Array:()=>YGe,isObject:()=>pl,isPlainObject:()=>fc,issue:()=>pf,joinValues:()=>L,jsonStringifyReplacer:()=>lf,merge:()=>jGe,mergeDefs:()=>Fs,normalizeParams:()=>W,nullish:()=>dc,numKeys:()=>wGe,objectClone:()=>vGe,omit:()=>$Ge,optionalKeys:()=>mU,parsedType:()=>H,partial:()=>VGe,pick:()=>UGe,prefixIssues:()=>qr,primitiveTypes:()=>fU,promiseAllObject:()=>MGe,propertyKeyTypes:()=>Ah,randomString:()=>LGe,required:()=>FGe,safeExtend:()=>GGe,shallowClone:()=>pU,slugify:()=>lU,stringifyPrimitive:()=>V,uint8ArrayToBase64:()=>lue,uint8ArrayToBase64url:()=>qGe,uint8ArrayToHex:()=>WGe,unwrapMessage:()=>Eh});function IGe(e){return e}function bGe(e){return e}function NGe(e){}function OGe(e){throw new Error("Unexpected value in exhaustive check")}function CGe(e){}function Th(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function L(e,t="|"){return e.map(n=>V(n)).join(t)}function lf(e,t){return typeof t=="bigint"?t.toString():t}function df(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function dc(e){return e==null}function Sh(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function uU(e,t){let n=(e.toString().split(".")[1]||"").length,o=t.toString(),r=(o.split(".")[1]||"").length;if(r===0&&/\d?e-\d?/.test(o)){let c=o.match(/\d?e-(\d?)/);c?.[1]&&(r=Number.parseInt(c[1]))}let i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),a=Number.parseInt(t.toFixed(i).replace(".",""));return s%a/10**i}function xe(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==cue)return o===void 0&&(o=cue,o=n()),o},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function vGe(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function pc(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Fs(...e){let t={};for(let n of e){let o=Object.getOwnPropertyDescriptors(n);Object.assign(t,o)}return Object.defineProperties({},t)}function PGe(e){return Fs(e._zod.def)}function xGe(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function MGe(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function LGe(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Db(e){return JSON.stringify(e)}function lU(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function pl(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function fc(e){if(pl(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(pl(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function pU(e){return fc(e)?{...e}:Array.isArray(e)?[...e]:e}function wGe(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function bo(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ur(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function W(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function kGe(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function V(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function mU(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function UGe(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Fs(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=n.shape[a])}return pc(this,"shape",s),s},checks:[]});return ur(e,i)}function $Ge(e,t){let n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Fs(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return pc(this,"shape",s),s},checks:[]});return ur(e,i)}function BGe(e,t){if(!fc(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=Fs(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return pc(this,"shape",i),i}});return ur(e,r)}function GGe(e,t){if(!fc(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Fs(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return pc(this,"shape",o),o}});return ur(e,n)}function jGe(e,t){let n=Fs(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return pc(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:[]});return ur(e,n)}function VGe(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let s=Fs(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(n)for(let u in n){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);n[u]&&(c[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return pc(this,"shape",c),c},checks:[]});return ur(t,s)}function FGe(e,t,n){let o=Fs(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:r[s]}))}else for(let s in r)i[s]=new e({type:"nonoptional",innerType:r[s]});return pc(this,"shape",i),i}});return ur(t,o)}function mc(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function qr(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function Eh(e){return typeof e=="string"?e:e?.message}function Nr(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=Eh(e.inst?._zod.def?.error?.(e))??Eh(t?.error?.(e))??Eh(n.customError?.(e))??Eh(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function yh(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Rh(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function H(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function pf(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function HGe(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function uue(e){let t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function lue(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function zGe(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return uue(t+n)}function qGe(e){return lue(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function YGe(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)n[o/2]=Number.parseInt(t.slice(o,o+2),16);return n}function WGe(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var cue,kb,dU,DGe,Ah,fU,_U,gU,cU,fe=I(()=>{l();cue=Symbol("evaluating");kb="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};dU=df(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});DGe=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Ah=new Set(["string","number","symbol"]),fU=new Set(["string","number","bigint","boolean","symbol","undefined"]);_U={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},gU={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};cU=class{constructor(...t){}}});function bh(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Nh(e,t=n=>n.message){let n={_errors:[]},o=r=>{for(let i of r.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(s=>o({issues:s}));else if(i.code==="invalid_key")o({issues:i.issues});else if(i.code==="invalid_element")o({issues:i.issues});else if(i.path.length===0)n._errors.push(t(i));else{let s=n,a=0;for(;a<i.path.length;){let c=i.path[a];a===i.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(t(i))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return o(e),n}function hU(e,t=n=>n.message){let n={errors:[]},o=(r,i=[])=>{var s,a;for(let c of r.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>o({issues:u},c.path));else if(c.code==="invalid_key")o({issues:c.issues},c.path);else if(c.code==="invalid_element")o({issues:c.issues},c.path);else{let u=[...i,...c.path];if(u.length===0){n.errors.push(t(c));continue}let d=n,p=0;for(;p<u.length;){let f=u[p],m=p===u.length-1;typeof f=="string"?(d.properties??(d.properties={}),(s=d.properties)[f]??(s[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(a=d.items)[f]??(a[f]={errors:[]}),d=d.items[f]),m&&d.errors.push(t(c)),p++}}};return o(e),n}function pue(e){let t=[],n=e.map(o=>typeof o=="object"?o.key:o);for(let o of n)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function EU(e){let t=[],n=[...e.issues].sort((o,r)=>(o.path??[]).length-(r.path??[]).length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${pue(o.path)}`);return t.join(`
761
+ `)}var due,Ih,Or,TU=I(()=>{l();uf();fe();due=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,lf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ih=x("$ZodError",due),Or=x("$ZodError",due,{Parent:Error})});var ff,Ub,mf,$b,_f,SU,gf,AU,Bb,ZGe,Gb,JGe,jb,XGe,Vb,QGe,Fb,e1e,Hb,t1e,zb,n1e,qb,r1e,yU=I(()=>{l();uf();TU();fe();ff=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Xo;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map(c=>Nr(c,i,Lt())));throw kb(a,r?.callee),a}return s.value},Ub=ff(Or),mf=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??e)(s.issues.map(c=>Nr(c,i,Lt())));throw kb(a,r?.callee),a}return s.value},$b=mf(Or),_f=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new Xo;return i.issues.length?{success:!1,error:new(e??Ih)(i.issues.map(s=>Nr(s,r,Lt())))}:{success:!0,data:i.value}},SU=_f(Or),gf=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Nr(s,r,Lt())))}:{success:!0,data:i.value}},AU=gf(Or),Bb=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return ff(e)(t,n,r)},ZGe=Bb(Or),Gb=e=>(t,n,o)=>ff(e)(t,n,o),JGe=Gb(Or),jb=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return mf(e)(t,n,r)},XGe=jb(Or),Vb=e=>async(t,n,o)=>mf(e)(t,n,o),QGe=Vb(Or),Fb=e=>(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return _f(e)(t,n,r)},e1e=Fb(Or),Hb=e=>(t,n,o)=>_f(e)(t,n,o),t1e=Hb(Or),zb=e=>async(t,n,o)=>{let r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return gf(e)(t,n,r)},n1e=zb(Or),qb=e=>async(t,n,o)=>gf(e)(t,n,o),r1e=qb(Or)});var No={};ft(No,{base64:()=>$U,base64url:()=>Yb,bigint:()=>HU,boolean:()=>qU,browserEmail:()=>d1e,cidrv4:()=>kU,cidrv6:()=>UU,cuid:()=>RU,cuid2:()=>IU,date:()=>GU,datetime:()=>VU,domain:()=>m1e,duration:()=>vU,e164:()=>BU,email:()=>xU,emoji:()=>MU,extendedDuration:()=>o1e,guid:()=>PU,hex:()=>_1e,hostname:()=>f1e,html5Email:()=>c1e,idnEmail:()=>l1e,integer:()=>zU,ipv4:()=>LU,ipv6:()=>wU,ksuid:()=>OU,lowercase:()=>KU,mac:()=>DU,md5_base64:()=>h1e,md5_base64url:()=>E1e,md5_hex:()=>g1e,nanoid:()=>CU,null:()=>YU,number:()=>Wb,rfc5322Email:()=>u1e,sha1_base64:()=>S1e,sha1_base64url:()=>A1e,sha1_hex:()=>T1e,sha256_base64:()=>R1e,sha256_base64url:()=>I1e,sha256_hex:()=>y1e,sha384_base64:()=>N1e,sha384_base64url:()=>O1e,sha384_hex:()=>b1e,sha512_base64:()=>v1e,sha512_base64url:()=>P1e,sha512_hex:()=>C1e,string:()=>FU,time:()=>jU,ulid:()=>bU,undefined:()=>WU,unicodeEmail:()=>fue,uppercase:()=>ZU,uuid:()=>fl,uuid4:()=>i1e,uuid6:()=>s1e,uuid7:()=>a1e,xid:()=>NU});function MU(){return new RegExp(p1e,"u")}function _ue(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jU(e){return new RegExp(`^${_ue(e)}$`)}function VU(e){let t=_ue({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${mue}T(?:${o})$`)}function Oh(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Ch(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var RU,IU,bU,NU,OU,CU,vU,o1e,PU,fl,i1e,s1e,a1e,xU,c1e,u1e,fue,l1e,d1e,p1e,LU,wU,DU,kU,UU,$U,Yb,f1e,m1e,BU,mue,GU,FU,HU,zU,Wb,qU,YU,WU,KU,ZU,_1e,g1e,h1e,E1e,T1e,S1e,A1e,y1e,R1e,I1e,b1e,N1e,O1e,C1e,v1e,P1e,Kb=I(()=>{l();fe();RU=/^[cC][^\s-]{8,}$/,IU=/^[0-9a-z]+$/,bU=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,NU=/^[0-9a-vA-V]{20}$/,OU=/^[A-Za-z0-9]{27}$/,CU=/^[a-zA-Z0-9_-]{21}$/,vU=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,o1e=/^[-+]?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)?)??$/,PU=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,fl=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,i1e=fl(4),s1e=fl(6),a1e=fl(7),xU=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,c1e=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,u1e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,fue=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,l1e=fue,d1e=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,p1e="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";LU=/^(?:(?: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])$/,wU=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,DU=e=>{let t=bo(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},kU=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,UU=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$U=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yb=/^[A-Za-z0-9_-]*$/,f1e=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,m1e=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,BU=/^\+[1-9]\d{6,14}$/,mue="(?:(?:\\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])))",GU=new RegExp(`^${mue}$`);FU=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},HU=/^-?\d+n?$/,zU=/^-?\d+$/,Wb=/^-?\d+(?:\.\d+)?$/,qU=/^(?:true|false)$/i,YU=/^null$/i,WU=/^undefined$/i,KU=/^[^A-Z]*$/,ZU=/^[^a-z]*$/,_1e=/^[0-9a-fA-F]*$/;g1e=/^[0-9a-fA-F]{32}$/,h1e=Oh(22,"=="),E1e=Ch(22),T1e=/^[0-9a-fA-F]{40}$/,S1e=Oh(27,"="),A1e=Ch(27),y1e=/^[0-9a-fA-F]{64}$/,R1e=Oh(43,"="),I1e=Ch(43),b1e=/^[0-9a-fA-F]{96}$/,N1e=Oh(64,""),O1e=Ch(64),C1e=/^[0-9a-fA-F]{128}$/,v1e=Oh(86,"=="),P1e=Ch(86)});function gue(e,t,n){e.issues.length&&t.issues.push(...qr(n,e.issues))}var st,hue,Zb,Jb,JU,XU,QU,e$,t$,n$,r$,o$,i$,hf,s$,a$,c$,u$,l$,d$,p$,f$,m$,Xb=I(()=>{l();uf();Kb();fe();st=x("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hue={number:"number",bigint:"bigint",object:"date"},Zb=x("$ZodCheckLessThan",(e,t)=>{st.init(e,t);let n=hue[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jb=x("$ZodCheckGreaterThan",(e,t)=>{st.init(e,t);let n=hue[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),JU=x("$ZodCheckMultipleOf",(e,t)=>{st.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):uU(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),XU=x("$ZodCheckNumberFormat",(e,t)=>{st.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=_U[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=i,n&&(a.pattern=zU)}),e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),QU=x("$ZodCheckBigIntFormat",(e,t)=>{st.init(e,t);let[n,o]=gU[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),e$=x("$ZodCheckMaxSize",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:yh(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t$=x("$ZodCheckMinSize",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:yh(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),n$=x("$ZodCheckSizeEquals",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:yh(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),r$=x("$ZodCheckMaxLength",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let s=Rh(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),o$=x("$ZodCheckMinLength",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let s=Rh(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),i$=x("$ZodCheckLengthEquals",(e,t)=>{var n;st.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!dc(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let s=Rh(r),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),hf=x("$ZodCheckStringFormat",(e,t)=>{var n,o;st.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),s$=x("$ZodCheckRegex",(e,t)=>{hf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),a$=x("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=KU),hf.init(e,t)}),c$=x("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ZU),hf.init(e,t)}),u$=x("$ZodCheckIncludes",(e,t)=>{st.init(e,t);let n=bo(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),l$=x("$ZodCheckStartsWith",(e,t)=>{st.init(e,t);let n=new RegExp(`^${bo(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),d$=x("$ZodCheckEndsWith",(e,t)=>{st.init(e,t);let n=new RegExp(`.*${bo(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});p$=x("$ZodCheckProperty",(e,t)=>{st.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>gue(r,n,t.property));gue(o,n,t.property)}}),f$=x("$ZodCheckMimeType",(e,t)=>{st.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),m$=x("$ZodCheckOverwrite",(e,t)=>{st.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var vh,_$=I(()=>{l();vh=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
762
+ `).filter(s=>s),r=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
763
+ `))}}});var g$,h$=I(()=>{l();g$={major:4,minor:3,patch:6}});function B$(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Pue(e){if(!Yb.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return B$(n)}function xue(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}function Tue(e,t,n){e.issues.length&&t.issues.push(...qr(n,e.issues)),t.value[n]=e.value}function rN(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...qr(n,e.issues))}e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function Mue(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let n=mU(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Lue(e,t,n,o,r,i){let s=[],a=r.keySet,c=r.catchall._zod,u=c.def.type,d=c.optout==="optional";for(let p in t){if(a.has(p))continue;if(u==="never"){s.push(p);continue}let f=c.run({value:t[p],issues:[]},o);f instanceof Promise?e.push(f.then(m=>rN(m,n,p,t,d))):rN(f,n,p,t,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}function Sue(e,t,n,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let r=e.filter(i=>!mc(i));return r.length===1?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Nr(s,o,Lt())))}),t)}function Aue(e,t,n,o){let r=e.filter(i=>i.issues.length===0);return r.length===1?(t.value=r[0].value,t):(r.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Nr(s,o,Lt())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1}),t)}function E$(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fc(e)&&fc(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=E$(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=E$(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function yue(e,t,n){let o=new Map,r;for(let a of t.issues)if(a.code==="unrecognized_keys"){r??(r=a);for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).l=!0}else e.issues.push(a);for(let a of n.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)o.has(c)||o.set(c,{}),o.get(c).r=!0;else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&r&&e.issues.push({...r,keys:i}),mc(e))return e;let s=E$(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}function Qb(e,t,n){e.issues.length&&t.issues.push(...qr(n,e.issues)),t.value[n]=e.value}function Rue(e,t,n,o,r,i,s){e.issues.length&&(Ah.has(typeof o)?n.issues.push(...qr(o,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:r,inst:i,issues:e.issues.map(a=>Nr(a,s,Lt()))})),t.issues.length&&(Ah.has(typeof o)?n.issues.push(...qr(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(a=>Nr(a,s,Lt()))})),n.value.set(e.value,t.value)}function Iue(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function bue(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}function Nue(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Oue(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function eN(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function tN(e,t,n){if(e.issues.length)return e.aborted=!0,e;if((n.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(i=>nN(e,i,t.out,n)):nN(e,r,t.out,n)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(i=>nN(e,i,t.in,n)):nN(e,r,t.in,n)}}function nN(e,t,n,o){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},o)}function Cue(e){return e.value=Object.freeze(e.value),e}function vue(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(pf(r))}}var Re,ml,nt,T$,S$,A$,y$,R$,I$,b$,N$,O$,C$,v$,P$,x$,M$,L$,w$,D$,k$,U$,$$,G$,j$,V$,F$,H$,oN,z$,Ph,iN,q$,Y$,W$,K$,Z$,J$,X$,Q$,eB,tB,wue,nB,xh,rB,oB,iB,sN,sB,aB,cB,uB,lB,dB,pB,aN,fB,mB,_B,gB,hB,EB,TB,SB,AB,Mh,yB,RB,IB,bB,NB,OB,CB=I(()=>{l();Xb();uf();_$();yU();Kb();fe();h$();fe();Re=x("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=g$;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,a,c)=>{let u=mc(s),d;for(let p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;let f=s.issues.length,m=p._zod.check(s);if(m instanceof Promise&&c?.async===!1)throw new Xo;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,s.issues.length!==f&&(u||(u=mc(s,f)))});else{if(s.issues.length===f)continue;u||(u=mc(s,f))}}return d?d.then(()=>s):s},i=(s,a,c)=>{if(mc(s))return s.aborted=!0,s;let u=r(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Xo;return u.then(d=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(d=>i(d,s,a)):i(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Xo;return c.then(u=>r(u,o,a))}return r(c,o,a)}}xe(e,"~standard",()=>({validate:r=>{try{let i=SU(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return AU(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),ml=x("$ZodString",(e,t)=>{Re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??FU(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),nt=x("$ZodStringFormat",(e,t)=>{hf.init(e,t),ml.init(e,t)}),T$=x("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=PU),nt.init(e,t)}),S$=x("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=fl(o))}else t.pattern??(t.pattern=fl());nt.init(e,t)}),A$=x("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xU),nt.init(e,t)}),y$=x("$ZodURL",(e,t)=>{nt.init(e,t),e._zod.check=n=>{try{let o=n.value.trim(),r=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=r.href:n.value=o;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),R$=x("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=MU()),nt.init(e,t)}),I$=x("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=CU),nt.init(e,t)}),b$=x("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=RU),nt.init(e,t)}),N$=x("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=IU),nt.init(e,t)}),O$=x("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bU),nt.init(e,t)}),C$=x("$ZodXID",(e,t)=>{t.pattern??(t.pattern=NU),nt.init(e,t)}),v$=x("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=OU),nt.init(e,t)}),P$=x("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=VU(t)),nt.init(e,t)}),x$=x("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=GU),nt.init(e,t)}),M$=x("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jU(t)),nt.init(e,t)}),L$=x("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=vU),nt.init(e,t)}),w$=x("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=LU),nt.init(e,t),e._zod.bag.format="ipv4"}),D$=x("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=wU),nt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),k$=x("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=DU(t.delimiter)),nt.init(e,t),e._zod.bag.format="mac"}),U$=x("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=kU),nt.init(e,t)}),$$=x("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=UU),nt.init(e,t),e._zod.check=n=>{let o=n.value.split("/");try{if(o.length!==2)throw new Error;let[r,i]=o;if(!i)throw new Error;let s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});G$=x("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=$U),nt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{B$(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});j$=x("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Yb),nt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Pue(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),V$=x("$ZodE164",(e,t)=>{t.pattern??(t.pattern=BU),nt.init(e,t)});F$=x("$ZodJWT",(e,t)=>{nt.init(e,t),e._zod.check=n=>{xue(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),H$=x("$ZodCustomStringFormat",(e,t)=>{nt.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),oN=x("$ZodNumber",(e,t)=>{Re.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wb,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),z$=x("$ZodNumberFormat",(e,t)=>{XU.init(e,t),oN.init(e,t)}),Ph=x("$ZodBoolean",(e,t)=>{Re.init(e,t),e._zod.pattern=qU,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),iN=x("$ZodBigInt",(e,t)=>{Re.init(e,t),e._zod.pattern=HU,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),q$=x("$ZodBigIntFormat",(e,t)=>{QU.init(e,t),iN.init(e,t)}),Y$=x("$ZodSymbol",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),W$=x("$ZodUndefined",(e,t)=>{Re.init(e,t),e._zod.pattern=WU,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),K$=x("$ZodNull",(e,t)=>{Re.init(e,t),e._zod.pattern=YU,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Z$=x("$ZodAny",(e,t)=>{Re.init(e,t),e._zod.parse=n=>n}),J$=x("$ZodUnknown",(e,t)=>{Re.init(e,t),e._zod.parse=n=>n}),X$=x("$ZodNever",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Q$=x("$ZodVoid",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),eB=x("$ZodDate",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});tB=x("$ZodArray",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let a=r[s],c=t.element._zod.run({value:a,issues:[]},o);c instanceof Promise?i.push(c.then(u=>Tue(u,n,s))):Tue(c,n,s)}return i.length?Promise.all(i).then(()=>n):n}});wue=x("$ZodObject",(e,t)=>{if(Re.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=df(()=>Mue(t));xe(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let p of d.values)c[u].add(p)}}return c});let r=pl,i=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!r(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let d=[],p=s.shape;for(let f of s.keys){let m=p[f],_=m._zod.optout==="optional",h=m._zod.run({value:u[f],issues:[]},c);h instanceof Promise?d.push(h.then(E=>rN(E,a,f,u,_))):rN(h,a,f,u,_)}return i?Lue(d,u,a,c,o.value,e):d.length?Promise.all(d).then(()=>a):a}}),nB=x("$ZodObjectJIT",(e,t)=>{wue.init(e,t);let n=e._zod.parse,o=df(()=>Mue(t)),r=f=>{let m=new vh(["shape","payload","ctx"]),_=o.value,h=C=>{let P=Db(C);return`shape[${P}]._zod.run({ value: input[${P}], issues: [] }, ctx)`};m.write("const input = payload.value;");let E=Object.create(null),T=0;for(let C of _.keys)E[C]=`key_${T++}`;m.write("const newResult = {};");for(let C of _.keys){let P=E[C],M=Db(C),z=f[C]?._zod?.optout==="optional";m.write(`const ${P} = ${h(C)};`),z?m.write(`
764
+ if (${P}.issues.length) {
765
+ if (${M} in input) {
766
+ payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
767
+ ...iss,
768
+ path: iss.path ? [${M}, ...iss.path] : [${M}]
769
+ })));
770
+ }
771
+ }
772
+
773
+ if (${P}.value === undefined) {
774
+ if (${M} in input) {
775
+ newResult[${M}] = undefined;
776
+ }
777
+ } else {
778
+ newResult[${M}] = ${P}.value;
779
+ }
780
+
781
+ `):m.write(`
782
+ if (${P}.issues.length) {
783
+ payload.issues = payload.issues.concat(${P}.issues.map(iss => ({
784
+ ...iss,
785
+ path: iss.path ? [${M}, ...iss.path] : [${M}]
786
+ })));
787
+ }
788
+
789
+ if (${P}.value === undefined) {
790
+ if (${M} in input) {
791
+ newResult[${M}] = undefined;
792
+ }
793
+ } else {
794
+ newResult[${M}] = ${P}.value;
795
+ }
796
+
797
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let R=m.compile();return(C,P)=>R(f,C,P)},i,s=pl,a=!hh.jitless,u=a&&dU.value,d=t.catchall,p;e._zod.parse=(f,m)=>{p??(p=o.value);let _=f.value;return s(_)?a&&u&&m?.async===!1&&m.jitless!==!0?(i||(i=r(t.shape)),f=i(f,m),d?Lue([],_,f,m,p,e):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:_,inst:e}),f)}});xh=x("$ZodUnion",(e,t)=>{Re.init(e,t),xe(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xe(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xe(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),xe(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){let r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>Sh(i.source)).join("|")})$`)}});let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,a=[];for(let c of t.options){let u=c._zod.run({value:r.value,issues:[]},i);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(c=>Sue(c,r,e,i)):Sue(a,r,e,i)}});rB=x("$ZodXor",(e,t)=>{xh.init(e,t),t.inclusive=!1;let n=t.options.length===1,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1,a=[];for(let c of t.options){let u=c._zod.run({value:r.value,issues:[]},i);u instanceof Promise?(a.push(u),s=!0):a.push(u)}return s?Promise.all(a).then(c=>Aue(c,r,e,i)):Aue(a,r,e,i)}}),oB=x("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xh.init(e,t);let n=e._zod.parse;xe(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){r[a]||(r[a]=new Set);for(let u of c)r[a].add(u)}}return r});let o=df(()=>{let r=t.options,i=new Map;for(let s of r){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!pl(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r)}}),iB=x("$ZodIntersection",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([c,u])=>yue(n,c,u)):yue(n,i,s)}});sN=x("$ZodTuple",(e,t)=>{Re.init(e,t);let n=t.items;e._zod.parse=(o,r)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=[...n].reverse().findIndex(d=>d._zod.optin!=="optional"),c=a===-1?0:n.length-a;if(!t.rest){let d=i.length>n.length,p=i.length<c-1;if(d||p)return o.issues.push({...d?{code:"too_big",maximum:n.length,inclusive:!0}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),o}let u=-1;for(let d of n){if(u++,u>=i.length&&u>=c)continue;let p=d._zod.run({value:i[u],issues:[]},r);p instanceof Promise?s.push(p.then(f=>Qb(f,o,u))):Qb(p,o,u)}if(t.rest){let d=i.slice(n.length);for(let p of d){u++;let f=t.rest._zod.run({value:p,issues:[]},r);f instanceof Promise?s.push(f.then(m=>Qb(m,o,u))):Qb(f,o,u)}}return s.length?Promise.all(s).then(()=>o):o}});sB=x("$ZodRecord",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!fc(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[],s=t.keyType._zod.values;if(s){n.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let d=t.valueType._zod.run({value:r[u],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...qr(u,p.issues)),n.value[u]=p.value})):(d.issues.length&&n.issues.push(...qr(u,d.issues)),n.value[u]=d.value)}let c;for(let u in r)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(let a of Reflect.ownKeys(r)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Wb.test(a)&&c.issues.length){let p=t.keyType._zod.run({value:Number(a),issues:[]},o);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?n.value[a]=r[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>Nr(p,o,Lt())),input:a,path:[a],inst:e});continue}let d=t.valueType._zod.run({value:r[a],issues:[]},o);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...qr(a,p.issues)),n.value[c.value]=p.value})):(d.issues.length&&n.issues.push(...qr(a,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),aB=x("$ZodMap",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,a]of r){let c=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);c instanceof Promise||u instanceof Promise?i.push(Promise.all([c,u]).then(([d,p])=>{Rue(d,p,n,s,r,e,o)})):Rue(c,u,n,s,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});cB=x("$ZodSet",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(c=>Iue(c,n))):Iue(a,n)}return i.length?Promise.all(i).then(()=>n):n}});uB=x("$ZodEnum",(e,t)=>{Re.init(e,t);let n=Th(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter(r=>Ah.has(typeof r)).map(r=>typeof r=="string"?bo(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{let s=r.value;return o.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),lB=x("$ZodLiteral",(e,t)=>{if(Re.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(o=>typeof o=="string"?bo(o):o?bo(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),dB=x("$ZodFile",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),pB=x("$ZodTransform",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new lc(e.constructor.name);let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new Xo;return n.value=r,n}});aN=x("$ZodOptional",(e,t)=>{Re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sh(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>{if(t.innerType._zod.optin==="optional"){let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>bue(i,n.value)):bue(r,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,o)}}),fB=x("$ZodExactOptional",(e,t)=>{aN.init(e,t),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,o)=>t.innerType._zod.run(n,o)}),mB=x("$ZodNullable",(e,t)=>{Re.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Sh(n.source)}|null)$`):void 0}),xe(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),_B=x("$ZodDefault",(e,t)=>{Re.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Nue(i,t)):Nue(r,t)}});gB=x("$ZodPrefault",(e,t)=>{Re.init(e,t),e._zod.optin="optional",xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(o.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),hB=x("$ZodNonOptional",(e,t)=>{Re.init(e,t),xe(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Oue(i,e)):Oue(r,e)}});EB=x("$ZodSuccess",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new lc("ZodSuccess");let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),TB=x("$ZodCatch",(e,t)=>{Re.init(e,t),xe(e._zod,"optin",()=>t.innerType._zod.optin),xe(e._zod,"optout",()=>t.innerType._zod.optout),xe(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Nr(s,o,Lt()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Nr(i,o,Lt()))},input:n.value}),n.issues=[]),n)}}),SB=x("$ZodNaN",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),AB=x("$ZodPipe",(e,t)=>{Re.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),xe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(s=>eN(s,t.in,o)):eN(i,t.in,o)}let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>eN(i,t.out,o)):eN(r,t.out,o)}});Mh=x("$ZodCodec",(e,t)=>{Re.init(e,t),xe(e._zod,"values",()=>t.in._zod.values),xe(e._zod,"optin",()=>t.in._zod.optin),xe(e._zod,"optout",()=>t.out._zod.optout),xe(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(n,o);return i instanceof Promise?i.then(s=>tN(s,t,o)):tN(i,t,o)}else{let i=t.out._zod.run(n,o);return i instanceof Promise?i.then(s=>tN(s,t,o)):tN(i,t,o)}}});yB=x("$ZodReadonly",(e,t)=>{Re.init(e,t),xe(e._zod,"propValues",()=>t.innerType._zod.propValues),xe(e._zod,"values",()=>t.innerType._zod.values),xe(e._zod,"optin",()=>t.innerType?._zod?.optin),xe(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,o)=>{if(o.direction==="backward")return t.innerType._zod.run(n,o);let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(Cue):Cue(r)}});RB=x("$ZodTemplateLiteral",(e,t)=>{Re.init(e,t);let n=[];for(let o of t.parts)if(typeof o=="object"&&o!==null){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||fU.has(typeof o))n.push(bo(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o)}),IB=x("$ZodFunction",(e,t)=>(Re.init(e,t),e._def=t,e._zod.def=t,e.implement=n=>{if(typeof n!="function")throw new Error("implement() must be called with a function");return function(...o){let r=e._def.input?Ub(e._def.input,o):o,i=Reflect.apply(n,this,r);return e._def.output?Ub(e._def.output,i):i}},e.implementAsync=n=>{if(typeof n!="function")throw new Error("implementAsync() must be called with a function");return async function(...o){let r=e._def.input?await $b(e._def.input,o):o,i=await Reflect.apply(n,this,r);return e._def.output?await $b(e._def.output,i):i}},e._zod.parse=(n,o)=>typeof n.value!="function"?(n.issues.push({code:"invalid_type",expected:"function",input:n.value,inst:e}),n):(e._def.output&&e._def.output._zod.def.type==="promise"?n.value=e.implementAsync(n.value):n.value=e.implement(n.value),n),e.input=(...n)=>{let o=e.constructor;return Array.isArray(n[0])?new o({type:"function",input:new sN({type:"tuple",items:n[0],rest:n[1]}),output:e._def.output}):new o({type:"function",input:n[0],output:e._def.output})},e.output=n=>{let o=e.constructor;return new o({type:"function",input:e._def.input,output:n})},e)),bB=x("$ZodPromise",(e,t)=>{Re.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),NB=x("$ZodLazy",(e,t)=>{Re.init(e,t),xe(e._zod,"innerType",()=>t.getter()),xe(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),xe(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),xe(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),xe(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),OB=x("$ZodCustom",(e,t)=>{st.init(e,t),Re.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>vue(i,n,o,e));vue(r,n,o,e)}})});function Due(){return{localeError:M1e()}}var M1e,kue=I(()=>{l();fe();M1e=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${V(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${n[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${L(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function Uue(){return{localeError:L1e()}}var L1e,$ue=I(()=>{l();fe();L1e=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${r.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${V(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function Bue(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}function Gue(){return{localeError:w1e()}}var w1e,jue=I(()=>{l();fe();w1e=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${V(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=Bue(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=Bue(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function Vue(){return{localeError:D1e()}}var D1e,Fue=I(()=>{l();fe();D1e=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${V(r.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${r.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return i.format==="emoji"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="datetime"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="date"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),i.format==="time"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),i.format==="duration"&&(s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${s} ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${r.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u043E\u0432\u0435":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}}});function Hue(){return{localeError:k1e()}}var k1e,zue=I(()=>{l();fe();k1e=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${r.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${V(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${L(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}}});function que(){return{localeError:U1e()}}var U1e,Yue=I(()=>{l();fe();U1e=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${r.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${V(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${n[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${L(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}}});function Wue(){return{localeError:$1e()}}var $1e,Kue=I(()=>{l();fe();$1e=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldigt input: forventede instanceof ${r.expected}, fik ${a}`:`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig v\xE6rdi: forventede ${V(r.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),a=o[r.origin]??r.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${i} ${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),a=o[r.origin]??r.origin;return s?`For lille: forventede ${a} ${s.verb} ${i} ${r.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: skal starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: skal ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: skal indeholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${r.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${r.origin}`;default:return"Ugyldigt input"}}}});function Zue(){return{localeError:B1e()}}var B1e,Jue=I(()=>{l();fe();B1e=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${r.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${V(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function cN(){return{localeError:G1e()}}var G1e,vB=I(()=>{l();fe();G1e=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${V(r.values[0])}`:`Invalid option: expected one of ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Too big: expected ${r.origin??"value"} to have ${i}${r.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${r.origin??"value"} to be ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Too small: expected ${r.origin} to have ${i}${r.minimum.toString()} ${s.unit}`:`Too small: expected ${r.origin} to be ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${r.divisor}`;case"unrecognized_keys":return`Unrecognized key${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Invalid key in ${r.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${r.origin}`;default:return"Invalid input"}}}});function Xue(){return{localeError:j1e()}}var j1e,Que=I(()=>{l();fe();j1e=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(r){return e[r]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${r.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":return r.values.length===1?`Nevalida enigo: atendi\u011Dis ${V(r.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${r.origin??"valoro"} havu ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Tro malgranda: atendi\u011Dis ke ${r.origin} havu ${i}${r.minimum.toString()} ${s.unit}`:`Tro malgranda: atendi\u011Dis ke ${r.origin} estu ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`:i.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`:i.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${i.includes}"`:i.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`:`Nevalida ${n[i.format]??r.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${r.divisor}`;case"unrecognized_keys":return`Nekonata${r.keys.length>1?"j":""} \u015Dlosilo${r.keys.length>1?"j":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${r.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${r.origin}`;default:return"Nevalida enigo"}}}});function ele(){return{localeError:V1e()}}var V1e,tle=I(()=>{l();fe();V1e=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${r.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${V(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),a=o[r.origin]??r.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),a=o[r.origin]??r.origin;return s?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${n[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[r.origin]??r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[r.origin]??r.origin}`;default:return"Entrada inv\xE1lida"}}}});function nle(){return{localeError:F1e()}}var F1e,rle=I(()=>{l();fe();F1e=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${V(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${L(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${L(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function ole(){return{localeError:H1e()}}var H1e,ile=I(()=>{l();fe();H1e=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Virheellinen tyyppi: odotettiin instanceof ${r.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${V(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${n[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${L(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function sle(){return{localeError:z1e()}}var z1e,ale=I(()=>{l();fe();z1e=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN",number:"nombre",array:"tableau"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : instanceof ${r.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${V(r.values[0])} attendu`:`Option invalide : une valeur parmi ${L(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${L(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function cle(){return{localeError:q1e()}}var q1e,ule=I(()=>{l();fe();q1e=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Entr\xE9e invalide : attendu instanceof ${r.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${V(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${L(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function lle(){return{localeError:Y1e()}}var Y1e,dle=I(()=>{l();fe();Y1e=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},n=u=>u?e[u]:void 0,o=u=>{let d=n(u);return d?d.label:u??e.unknown.label},r=u=>`\u05D4${o(u)}`,i=u=>(n(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=u=>u?t[u]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return u=>{switch(u.code){case"invalid_type":{let d=u.expected,p=c[d??""]??o(d),f=H(u.input),m=c[f]??e[f]?.label??f;return/^[A-Z]/.test(u.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${p}, \u05D4\u05EA\u05E7\u05D1\u05DC ${m}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${V(u.values[0])}`;let d=u.values.map(m=>V(m));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let p=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${p}`}case"too_big":{let d=s(u.origin),p=r(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let _=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(u.origin==="array"||u.origin==="set"){let _=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",h=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=u.inclusive?"<=":"<",m=i(u.origin??"value");return d?.unit?`${d.longLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${f}${u.maximum.toString()} ${d.unit}`:`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${p} ${m} ${f}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),p=r(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let _=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${_}`}if(u.origin==="array"||u.origin==="set"){let _=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let E=(u.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${E}`}let h=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${p} ${_} \u05DC\u05D4\u05DB\u05D9\u05DC ${h}`.trim()}let f=u.inclusive?">=":">",m=i(u.origin??"value");return d?.unit?`${d.shortLabel} \u05DE\u05D3\u05D9: ${p} ${m} ${f}${u.minimum.toString()} ${d.unit}`:`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${p} ${m} ${f}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let p=a[d.format],f=p?.label??d.format,_=(p?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${f} \u05DC\u05D0 ${_}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${L(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function ple(){return{localeError:W1e()}}var W1e,fle=I(()=>{l();fe();W1e=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${r.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${V(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function mle(e,t,n){return Math.abs(e)===1?t:n}function Ef(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],n=e[e.length-1];return e+(t.includes(n)?"\u0576":"\u0568")}function _le(){return{localeError:K1e()}}var K1e,gle=I(()=>{l();fe();K1e=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(r){return e[r]??null}let n={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${r.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":return r.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${V(r.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=mle(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ef(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ef(r.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=mle(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ef(r.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${r.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Ef(r.origin)} \u056C\u056B\u0576\u056B ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`:i.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`:i.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`:i.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${n[i.format]??r.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${r.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${r.keys.length>1?"\u0576\u0565\u0580":""}. ${L(r.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Ef(r.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Ef(r.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}}});function hle(){return{localeError:Z1e()}}var Z1e,Ele=I(()=>{l();fe();Z1e=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak valid: diharapkan instanceof ${r.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${V(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${n[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}}});function Tle(){return{localeError:J1e()}}var J1e,Sle=I(()=>{l();fe();J1e=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(r){return e[r]??null}let n={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${r.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":return r.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${V(r.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} hafi ${i}${r.maximum.toString()} ${s.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin??"gildi"} s\xE9 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} hafi ${i}${r.minimum.toString()} ${s.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${r.origin} s\xE9 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`:i.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`:i.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`:i.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`:`Rangt ${n[i.format]??r.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${r.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${r.keys.length>1?"ir lyklar":"ur lykill"}: ${L(r.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${r.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${r.origin}`;default:return"Rangt gildi"}}}});function Ale(){return{localeError:X1e()}}var X1e,yle=I(()=>{l();fe();X1e=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input non valido: atteso instanceof ${r.expected}, ricevuto ${a}`:`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":return r.values.length===1?`Input non valido: atteso ${V(r.values[0])}`:`Opzione non valida: atteso uno tra ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${L(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}}});function Rle(){return{localeError:Q1e()}}var Q1e,Ile=I(()=>{l();fe();Q1e=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${V(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${L(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${L(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function ble(){return{localeError:eje()}}var eje,Nle=I(()=>{l();fe();eje=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(r){return e[r]??null}let n={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",json_string:"JSON \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${r.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":return r.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${V(r.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${L(r.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${r.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`:i.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`:i.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`:i.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E1\u10E2\u10E0\u10D8\u10DC\u10D2\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${r.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${r.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${r.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${r.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}}});function uN(){return{localeError:tje()}}var tje,PB=I(()=>{l();fe();tje=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${V(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${L(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Ole(){return uN()}var Cle=I(()=>{l();PB()});function vle(){return{localeError:nje()}}var nje,Ple=I(()=>{l();fe();nje=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${V(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${L(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${c} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),c=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${c} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${L(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function xle(e){let t=Math.abs(e),n=t%10,o=t%100;return o>=11&&o<=19||n===0?"many":n===1?"one":"few"}function Mle(){return{localeError:rje()}}var Lh,rje,Lle=I(()=>{l();fe();Lh=e=>e.charAt(0).toUpperCase()+e.slice(1);rje=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(r,i,s,a){let c=e[r]??null;return c===null?c:{unit:c.unit[i],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let n={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${r.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":return r.values.length===1?`Privalo b\u016Bti ${V(r.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${L(r.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[r.origin]??r.origin,s=t(r.origin,xle(Number(r.maximum)),r.inclusive??!1,"smaller");if(s?.verb)return`${Lh(i??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.maximum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Lh(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[r.origin]??r.origin,s=t(r.origin,xle(Number(r.minimum)),r.inclusive??!1,"bigger");if(s?.verb)return`${Lh(i??r.origin??"reik\u0161m\u0117")} ${s.verb} ${r.minimum.toString()} ${s.unit??"element\u0173"}`;let a=r.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Lh(i??r.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${r.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`:i.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${i.suffix}"`:i.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`:i.format==="regex"?`Eilut\u0117 privalo atitikti ${i.pattern}`:`Neteisingas ${n[i.format]??r.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${r.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${r.keys.length>1?"i":"as"} rakt${r.keys.length>1?"ai":"as"}: ${L(r.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[r.origin]??r.origin;return`${Lh(i??r.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}}});function wle(){return{localeError:oje()}}var oje,Dle=I(()=>{l();fe();oje=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`Invalid input: expected ${V(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function kle(){return{localeError:ije()}}var ije,Ule=I(()=>{l();fe();ije=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Input tidak sah: dijangka instanceof ${r.expected}, diterima ${a}`:`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${V(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${n[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${L(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}}});function $le(){return{localeError:sje()}}var sje,Ble=I(()=>{l();fe();sje=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(r){return e[r]??null}let n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ongeldige invoer: verwacht instanceof ${r.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${V(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin),a=r.origin==="date"?"laat":r.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin),a=r.origin==="date"?"vroeg":r.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${n[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}}});function Gle(){return{localeError:aje()}}var aje,jle=I(()=>{l();fe();aje=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ugyldig input: forventet instanceof ${r.expected}, fikk ${a}`:`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${V(r.values[0])}`:`Ugyldig valg: forventet en av ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}}});function Vle(){return{localeError:cje()}}var cje,Fle=I(()=>{l();fe();cje=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`F\xE2sit giren: umulan instanceof ${r.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${V(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function Hle(){return{localeError:uje()}}var uje,zle=I(()=>{l();fe();uje=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${V(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${L(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${L(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function qle(){return{localeError:lje()}}var lje,Yle=I(()=>{l();fe();lje=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${r.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${V(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function Wle(){return{localeError:dje()}}var dje,Kle=I(()=>{l();fe();dje=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Tipo inv\xE1lido: esperado instanceof ${r.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${V(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${n[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${L(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}}});function Zle(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}function Jle(){return{localeError:pje()}}var pje,Xle=I(()=>{l();fe();pje=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${V(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),c=Zle(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),c=Zle(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function Qle(){return{localeError:fje()}}var fje,ede=I(()=>{l();fe();fje=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${r.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${V(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${n[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${L(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}}});function tde(){return{localeError:mje()}}var mje,nde=I(()=>{l();fe();mje=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${r.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${V(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${n[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${L(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function rde(){return{localeError:_je()}}var _je,ode=I(()=>{l();fe();_je=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${V(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${L(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function ide(){return{localeError:gje()}}var gje,sde=I(()=>{l();fe();gje=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${V(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${L(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function ade(){return{localeError:hje()}}var hje,cde=I(()=>{l();fe();hje=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(r){return e[r]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${r.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":return r.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${V(r.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${r.origin??"de\u011Fer"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`:i.format==="ends_with"?`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`:i.format==="includes"?`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`:i.format==="regex"?`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[i.format]??r.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${r.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${r.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function lN(){return{localeError:Eje()}}var Eje,xB=I(()=>{l();fe();Eje=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${V(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${L(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function ude(){return lN()}var lde=I(()=>{l();xB()});function dde(){return{localeError:Tje()}}var Tje,pde=I(()=>{l();fe();Tje=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${V(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${L(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${L(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function fde(){return{localeError:Sje()}}var Sje,mde=I(()=>{l();fe();Sje=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"}};function t(r){return e[r]??null}let n={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${r.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":return r.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${V(r.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${r.origin??"qiymat"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`:i.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`:i.format==="includes"?`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`:i.format==="regex"?`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${n[i.format]??r.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${r.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${r.keys.length>1?"lar":""}: ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${r.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}}});function _de(){return{localeError:Aje()}}var Aje,gde=I(()=>{l();fe();Aje=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${V(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${n[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${L(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function hde(){return{localeError:yje()}}var yje,Ede=I(()=>{l();fe();yje=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${V(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${n[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${L(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Tde(){return{localeError:Rje()}}var Rje,Sde=I(()=>{l();fe();Rje=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${r.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${V(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${n[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${L(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});function Ade(){return{localeError:Ije()}}var Ije,yde=I(()=>{l();fe();Ije=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(r){return e[r]??null}let n={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return r=>{switch(r.code){case"invalid_type":{let i=o[r.expected]??r.expected,s=H(r.input),a=o[s]??s;return/^[A-Z]/.test(r.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${r.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":return r.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${V(r.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${L(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin??"iye"} ${s.verb} ${i}${r.maximum} ${s.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.maximum}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${r.origin} ${s.verb} ${i}${r.minimum} ${s.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${r.minimum}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`:i.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`:i.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`:i.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`:`A\u1E63\xEC\u1E63e: ${n[i.format]??r.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${r.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${L(r.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${r.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}}});var wh={};ft(wh,{ar:()=>Due,az:()=>Uue,be:()=>Gue,bg:()=>Vue,ca:()=>Hue,cs:()=>que,da:()=>Wue,de:()=>Zue,en:()=>cN,eo:()=>Xue,es:()=>ele,fa:()=>nle,fi:()=>ole,fr:()=>sle,frCA:()=>cle,he:()=>lle,hu:()=>ple,hy:()=>_le,id:()=>hle,is:()=>Tle,it:()=>Ale,ja:()=>Rle,ka:()=>ble,kh:()=>Ole,km:()=>uN,ko:()=>vle,lt:()=>Mle,mk:()=>wle,ms:()=>kle,nl:()=>$le,no:()=>Gle,ota:()=>Vle,pl:()=>qle,ps:()=>Hle,pt:()=>Wle,ru:()=>Jle,sl:()=>Qle,sv:()=>tde,ta:()=>rde,th:()=>ide,tr:()=>ade,ua:()=>ude,uk:()=>lN,ur:()=>dde,uz:()=>fde,vi:()=>_de,yo:()=>Ade,zhCN:()=>hde,zhTW:()=>Tde});var MB=I(()=>{l();kue();$ue();jue();Fue();zue();Yue();Kue();Jue();vB();Que();tle();rle();ile();ale();ule();dle();fle();gle();Ele();Sle();yle();Ile();Nle();Cle();PB();Ple();Lle();Dle();Ule();Ble();jle();Fle();zle();Yle();Kle();Xle();ede();nde();ode();sde();cde();lde();xB();pde();mde();gde();Ede();Sde();yde()});function pN(){return new dN}var Rde,LB,wB,dN,bn,Dh=I(()=>{l();LB=Symbol("ZodOutput"),wB=Symbol("ZodInput"),dN=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let o=n[0];return this._map.set(t,o),o&&typeof o=="object"&&"id"in o&&this._idmap.set(o.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};delete o.id;let r={...o,...this._map.get(t)};return Object.keys(r).length?r:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};(Rde=globalThis).__zod_globalRegistry??(Rde.__zod_globalRegistry=pN());bn=globalThis.__zod_globalRegistry});function DB(e,t){return new e({type:"string",...W(t)})}function kB(e,t){return new e({type:"string",coerce:!0,...W(t)})}function fN(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...W(t)})}function kh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...W(t)})}function mN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...W(t)})}function _N(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...W(t)})}function gN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...W(t)})}function hN(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...W(t)})}function Uh(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...W(t)})}function EN(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...W(t)})}function TN(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...W(t)})}function SN(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...W(t)})}function AN(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...W(t)})}function yN(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...W(t)})}function RN(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...W(t)})}function IN(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...W(t)})}function bN(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...W(t)})}function NN(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...W(t)})}function UB(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...W(t)})}function ON(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...W(t)})}function CN(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...W(t)})}function vN(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...W(t)})}function PN(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...W(t)})}function xN(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...W(t)})}function MN(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...W(t)})}function BB(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...W(t)})}function GB(e,t){return new e({type:"string",format:"date",check:"string_format",...W(t)})}function jB(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...W(t)})}function VB(e,t){return new e({type:"string",format:"duration",check:"string_format",...W(t)})}function FB(e,t){return new e({type:"number",checks:[],...W(t)})}function HB(e,t){return new e({type:"number",coerce:!0,checks:[],...W(t)})}function zB(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...W(t)})}function qB(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...W(t)})}function YB(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...W(t)})}function WB(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...W(t)})}function KB(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...W(t)})}function ZB(e,t){return new e({type:"boolean",...W(t)})}function JB(e,t){return new e({type:"boolean",coerce:!0,...W(t)})}function XB(e,t){return new e({type:"bigint",...W(t)})}function QB(e,t){return new e({type:"bigint",coerce:!0,...W(t)})}function eG(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...W(t)})}function tG(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...W(t)})}function nG(e,t){return new e({type:"symbol",...W(t)})}function rG(e,t){return new e({type:"undefined",...W(t)})}function oG(e,t){return new e({type:"null",...W(t)})}function iG(e){return new e({type:"any"})}function sG(e){return new e({type:"unknown"})}function aG(e,t){return new e({type:"never",...W(t)})}function cG(e,t){return new e({type:"void",...W(t)})}function uG(e,t){return new e({type:"date",...W(t)})}function lG(e,t){return new e({type:"date",coerce:!0,...W(t)})}function dG(e,t){return new e({type:"nan",...W(t)})}function Ji(e,t){return new Zb({check:"less_than",...W(t),value:e,inclusive:!1})}function Yr(e,t){return new Zb({check:"less_than",...W(t),value:e,inclusive:!0})}function Xi(e,t){return new Jb({check:"greater_than",...W(t),value:e,inclusive:!1})}function lr(e,t){return new Jb({check:"greater_than",...W(t),value:e,inclusive:!0})}function LN(e){return Xi(0,e)}function wN(e){return Ji(0,e)}function DN(e){return Yr(0,e)}function kN(e){return lr(0,e)}function _c(e,t){return new JU({check:"multiple_of",...W(t),value:e})}function gc(e,t){return new e$({check:"max_size",...W(t),maximum:e})}function Qi(e,t){return new t$({check:"min_size",...W(t),minimum:e})}function _l(e,t){return new n$({check:"size_equals",...W(t),size:e})}function gl(e,t){return new r$({check:"max_length",...W(t),maximum:e})}function Hs(e,t){return new o$({check:"min_length",...W(t),minimum:e})}function hl(e,t){return new i$({check:"length_equals",...W(t),length:e})}function Tf(e,t){return new s$({check:"string_format",format:"regex",...W(t),pattern:e})}function Sf(e){return new a$({check:"string_format",format:"lowercase",...W(e)})}function Af(e){return new c$({check:"string_format",format:"uppercase",...W(e)})}function yf(e,t){return new u$({check:"string_format",format:"includes",...W(t),includes:e})}function Rf(e,t){return new l$({check:"string_format",format:"starts_with",...W(t),prefix:e})}function If(e,t){return new d$({check:"string_format",format:"ends_with",...W(t),suffix:e})}function UN(e,t,n){return new p$({check:"property",property:e,schema:t,...W(n)})}function bf(e,t){return new f$({check:"mime_type",mime:e,...W(t)})}function Qo(e){return new m$({check:"overwrite",tx:e})}function Nf(e){return Qo(t=>t.normalize(e))}function Of(){return Qo(e=>e.trim())}function Cf(){return Qo(e=>e.toLowerCase())}function vf(){return Qo(e=>e.toUpperCase())}function Pf(){return Qo(e=>lU(e))}function pG(e,t,n){return new e({type:"array",element:t,...W(n)})}function Nje(e,t,n){return new e({type:"union",options:t,...W(n)})}function Oje(e,t,n){return new e({type:"union",options:t,inclusive:!1,...W(n)})}function Cje(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...W(o)})}function vje(e,t,n){return new e({type:"intersection",left:t,right:n})}function Pje(e,t,n,o){let r=n instanceof Re,i=r?o:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...W(i)})}function xje(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...W(o)})}function Mje(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...W(o)})}function Lje(e,t,n){return new e({type:"set",valueType:t,...W(n)})}function wje(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...W(n)})}function Dje(e,t,n){return new e({type:"enum",entries:t,...W(n)})}function kje(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...W(n)})}function fG(e,t){return new e({type:"file",...W(t)})}function Uje(e,t){return new e({type:"transform",transform:t})}function $je(e,t){return new e({type:"optional",innerType:t})}function Bje(e,t){return new e({type:"nullable",innerType:t})}function Gje(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():pU(n)}})}function jje(e,t,n){return new e({type:"nonoptional",innerType:t,...W(n)})}function Vje(e,t){return new e({type:"success",innerType:t})}function Fje(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function Hje(e,t,n){return new e({type:"pipe",in:t,out:n})}function zje(e,t){return new e({type:"readonly",innerType:t})}function qje(e,t,n){return new e({type:"template_literal",parts:t,...W(n)})}function Yje(e,t){return new e({type:"lazy",getter:t})}function Wje(e,t){return new e({type:"promise",innerType:t})}function mG(e,t,n){let o=W(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function _G(e,t,n){return new e({type:"custom",check:"custom",fn:t,...W(n)})}function gG(e){let t=Ide(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(pf(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(pf(r))}},e(n.value,n)));return t}function Ide(e,t){let n=new st({check:"custom",...W(t)});return n._zod.check=e,n}function hG(e){let t=new st({check:"describe"});return t._zod.onattach=[n=>{let o=bn.get(n)??{};bn.add(n,{...o,description:e})}],t._zod.check=()=>{},t}function EG(e){let t=new st({check:"meta"});return t._zod.onattach=[n=>{let o=bn.get(n)??{};bn.add(n,{...o,...e})}],t._zod.check=()=>{},t}function TG(e,t){let n=W(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(m=>typeof m=="string"?m.toLowerCase():m),r=r.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(o),s=new Set(r),a=e.Codec??Mh,c=e.Boolean??Ph,u=e.String??ml,d=new u({type:"string",error:n.error}),p=new c({type:"boolean",error:n.error}),f=new a({type:"pipe",in:d,out:p,transform:((m,_)=>{let h=m;return n.case!=="sensitive"&&(h=h.toLowerCase()),i.has(h)?!0:s.has(h)?!1:(_.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:_.value,inst:f,continue:!1}),{})}),reverseTransform:((m,_)=>m===!0?o[0]||"true":r[0]||"false"),error:n.error});return f}function xf(e,t,n,o={}){let r=W(o),i={...W(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var $B,bde=I(()=>{l();Xb();Dh();CB();fe();$B={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function hc(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??bn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Ze(e,t,n={path:[],schemaPath:[]}){var o;let r=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let f=s.schema,m=t.processors[r.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);m(e,t,f,d)}let p=e._zod.parent;p&&(s.ref||(s.ref=p),Ze(p,t,d),t.seen.get(p).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),t.io==="input"&&dr(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Ec(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let r=s=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=e.external.registry.get(s[0])?.id,f=e.external.uri??(_=>_);if(p)return{ref:f(p)};let m=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=m,{defId:m,ref:`${f("__shared")}#/${a}/${m}`}}if(s[1]===n)return{ref:"#"};let u=`#/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=s=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=r(s);a.def={...a.schema},u&&(a.defId=u);let d=a.schema;for(let p in d)delete d[p];d.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
798
+
799
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1&&e.reused==="ref"){i(s);continue}}}function Tc(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=s=>{let a=e.seen.get(s);if(a.ref===null)return;let c=a.def??a.schema,u={...c},d=a.ref;if(a.ref=null,d){o(d);let f=e.seen.get(d),m=f.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(m)):Object.assign(c,m),Object.assign(c,u),s._zod.parent===d)for(let h in c)h==="$ref"||h==="allOf"||h in u||delete c[h];if(m.$ref&&f.def)for(let h in c)h==="$ref"||h==="allOf"||h in f.def&&JSON.stringify(c[h])===JSON.stringify(f.def[h])&&delete c[h]}let p=s._zod.parent;if(p&&p!==d){o(p);let f=e.seen.get(p);if(f?.schema.$ref&&(c.$ref=f.schema.$ref,f.def))for(let m in c)m==="$ref"||m==="allOf"||m in f.def&&JSON.stringify(c[m])===JSON.stringify(f.def[m])&&delete c[m]}e.override({zodSchema:s,jsonSchema:c,path:a.path??[]})};for(let s of[...e.seen.entries()].reverse())o(s[0]);let r={};if(e.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let s=e.external.registry.get(t)?.id;if(!s)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(s)}Object.assign(r,n.def??n.schema);let i=e.external?.defs??{};for(let s of e.seen.entries()){let a=s[1];a.def&&a.defId&&(i[a.defId]=a.def)}e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?r.$defs=i:r.definitions=i);try{let s=JSON.parse(JSON.stringify(r));return Object.defineProperty(s,"~standard",{value:{...t["~standard"],jsonSchema:{input:Mf(t,"input",e.processors),output:Mf(t,"output",e.processors)}},enumerable:!1,writable:!1}),s}catch{throw new Error("Error converting schema to JSON.")}}function dr(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return dr(o.element,n);if(o.type==="set")return dr(o.valueType,n);if(o.type==="lazy")return dr(o.getter(),n);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return dr(o.innerType,n);if(o.type==="intersection")return dr(o.left,n)||dr(o.right,n);if(o.type==="record"||o.type==="map")return dr(o.keyType,n)||dr(o.valueType,n);if(o.type==="pipe")return dr(o.in,n)||dr(o.out,n);if(o.type==="object"){for(let r in o.shape)if(dr(o.shape[r],n))return!0;return!1}if(o.type==="union"){for(let r of o.options)if(dr(r,n))return!0;return!1}if(o.type==="tuple"){for(let r of o.items)if(dr(r,n))return!0;return!!(o.rest&&dr(o.rest,n))}return!1}var SG,Mf,$h=I(()=>{l();Dh();SG=(e,t={})=>n=>{let o=hc({...n,processors:t});return Ze(e,o),Ec(o,e),Tc(o,e)},Mf=(e,t,n={})=>o=>{let{libraryOptions:r,target:i}=o??{},s=hc({...r??{},target:i,io:t,processors:n});return Ze(e,s),Ec(s,e),Tc(s,e)}});function jN(e,t){if("_idmap"in e){let o=e,r=hc({...t,processors:$N}),i={};for(let c of o._idmap.entries()){let[u,d]=c;Ze(d,r)}let s={},a={registry:o,uri:t?.uri,defs:i};r.external=a;for(let c of o._idmap.entries()){let[u,d]=c;Ec(r,d),s[u]=Tc(r,d)}if(Object.keys(i).length>0){let c=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let n=hc({...t,processors:$N});return Ze(e,n),Ec(n,e),Tc(n,e)}var Kje,AG,yG,RG,IG,bG,NG,OG,CG,vG,PG,xG,MG,LG,wG,DG,kG,UG,$G,BG,GG,jG,VG,FG,HG,zG,BN,qG,YG,WG,KG,ZG,JG,XG,QG,e1,t1,n1,GN,r1,$N,Bh=I(()=>{l();$h();fe();Kje={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},AG=(e,t,n,o)=>{let r=n;r.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i=="number"&&(r.minLength=i),typeof s=="number"&&(r.maxLength=s),a&&(r.format=Kje[a]??a,r.format===""&&delete r.format,a==="time"&&delete r.format),u&&(r.contentEncoding=u),c&&c.size>0){let d=[...c];d.length===1?r.pattern=d[0].source:d.length>1&&(r.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},yG=(e,t,n,o)=>{let r=n,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof a=="string"&&a.includes("int")?r.type="integer":r.type="number",typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.minimum=d,r.exclusiveMinimum=!0):r.exclusiveMinimum=d),typeof i=="number"&&(r.minimum=i,typeof d=="number"&&t.target!=="draft-04"&&(d>=i?delete r.minimum:delete r.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u),typeof s=="number"&&(r.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete r.maximum:delete r.exclusiveMaximum)),typeof c=="number"&&(r.multipleOf=c)},RG=(e,t,n,o)=>{n.type="boolean"},IG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},bG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},NG=(e,t,n,o)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},OG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},CG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},vG=(e,t,n,o)=>{n.not={}},PG=(e,t,n,o)=>{},xG=(e,t,n,o)=>{},MG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},LG=(e,t,n,o)=>{let r=e._zod.def,i=Th(r.entries);i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),n.enum=i},wG=(e,t,n,o)=>{let r=e._zod.def,i=[];for(let s of r.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(s))}else i.push(s);if(i.length!==0)if(i.length===1){let s=i[0];n.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[s]:n.const=s}else i.every(s=>typeof s=="number")&&(n.type="number"),i.every(s=>typeof s=="string")&&(n.type="string"),i.every(s=>typeof s=="boolean")&&(n.type="boolean"),i.every(s=>s===null)&&(n.type="null"),n.enum=i},DG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},kG=(e,t,n,o)=>{let r=n,i=e._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");r.type="string",r.pattern=i.source},UG=(e,t,n,o)=>{let r=n,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;s!==void 0&&(i.minLength=s),a!==void 0&&(i.maxLength=a),c?c.length===1?(i.contentMediaType=c[0],Object.assign(r,i)):(Object.assign(r,i),r.anyOf=c.map(u=>({contentMediaType:u}))):Object.assign(r,i)},$G=(e,t,n,o)=>{n.type="boolean"},BG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},GG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},jG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},VG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},FG=(e,t,n,o)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},HG=(e,t,n,o)=>{let r=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(r.minItems=s),typeof a=="number"&&(r.maxItems=a),r.type="array",r.items=Ze(i.element,t,{...o,path:[...o.path,"items"]})},zG=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object",r.properties={};let s=i.shape;for(let u in s)r.properties[u]=Ze(s[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{let d=i.shape[u]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(r.required=Array.from(c)),i.catchall?._zod.def.type==="never"?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=Ze(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):t.io==="output"&&(r.additionalProperties=!1)},BN=(e,t,n,o)=>{let r=e._zod.def,i=r.inclusive===!1,s=r.options.map((a,c)=>Ze(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));i?n.oneOf=s:n.anyOf=s},qG=(e,t,n,o)=>{let r=e._zod.def,i=Ze(r.left,t,{...o,path:[...o.path,"allOf",0]}),s=Ze(r.right,t,{...o,path:[...o.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c},YG=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((f,m)=>Ze(f,t,{...o,path:[...o.path,s,m]})),u=i.rest?Ze(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;t.target==="draft-2020-12"?(r.prefixItems=c,u&&(r.items=u)):t.target==="openapi-3.0"?(r.items={anyOf:c},u&&r.items.anyOf.push(u),r.minItems=c.length,u||(r.maxItems=c.length)):(r.items=c,u&&(r.additionalItems=u));let{minimum:d,maximum:p}=e._zod.bag;typeof d=="number"&&(r.minItems=d),typeof p=="number"&&(r.maxItems=p)},WG=(e,t,n,o)=>{let r=n,i=e._zod.def;r.type="object";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let d=Ze(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(let p of c)r.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(r.propertyNames=Ze(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=Ze(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});let u=s._zod.values;if(u){let d=[...u].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(r.required=d)}},KG=(e,t,n,o)=>{let r=e._zod.def,i=Ze(r.innerType,t,o),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},ZG=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},JG=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))},XG=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))},QG=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType;let s;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s},e1=(e,t,n,o)=>{let r=e._zod.def,i=t.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;Ze(i,t,o);let s=t.seen.get(e);s.ref=i},t1=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType,n.readOnly=!0},n1=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},GN=(e,t,n,o)=>{let r=e._zod.def;Ze(r.innerType,t,o);let i=t.seen.get(e);i.ref=r.innerType},r1=(e,t,n,o)=>{let r=e._zod.innerType;Ze(r,t,o);let i=t.seen.get(e);i.ref=r},$N={string:AG,number:yG,boolean:RG,bigint:IG,symbol:bG,null:NG,undefined:OG,void:CG,never:vG,any:PG,unknown:xG,date:MG,enum:LG,literal:wG,nan:DG,template_literal:kG,file:UG,success:$G,custom:BG,function:GG,transform:jG,map:VG,set:FG,array:HG,object:zG,union:BN,intersection:qG,tuple:YG,record:WG,nullable:KG,nonoptional:ZG,default:JG,prefault:XG,catch:QG,pipe:e1,readonly:t1,promise:n1,optional:GN,lazy:r1}});var VN,Nde=I(()=>{l();Bh();$h();VN=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let n=t?.target??"draft-2020-12";n==="draft-4"&&(n="draft-04"),n==="draft-7"&&(n="draft-07"),this.ctx=hc({processors:$N,target:n,...t?.metadata&&{metadata:t.metadata},...t?.unrepresentable&&{unrepresentable:t.unrepresentable},...t?.override&&{override:t.override},...t?.io&&{io:t.io}})}process(t,n={path:[],schemaPath:[]}){return Ze(t,this.ctx,n)}emit(t,n){n&&(n.cycles&&(this.ctx.cycles=n.cycles),n.reused&&(this.ctx.reused=n.reused),n.external&&(this.ctx.external=n.external)),Ec(this.ctx,t);let o=Tc(this.ctx,t),{"~standard":r,...i}=o;return i}}});var Ode={};var Cde=I(()=>{l()});var zs={};ft(zs,{$ZodAny:()=>Z$,$ZodArray:()=>tB,$ZodAsyncError:()=>Xo,$ZodBase64:()=>G$,$ZodBase64URL:()=>j$,$ZodBigInt:()=>iN,$ZodBigIntFormat:()=>q$,$ZodBoolean:()=>Ph,$ZodCIDRv4:()=>U$,$ZodCIDRv6:()=>$$,$ZodCUID:()=>b$,$ZodCUID2:()=>N$,$ZodCatch:()=>TB,$ZodCheck:()=>st,$ZodCheckBigIntFormat:()=>QU,$ZodCheckEndsWith:()=>d$,$ZodCheckGreaterThan:()=>Jb,$ZodCheckIncludes:()=>u$,$ZodCheckLengthEquals:()=>i$,$ZodCheckLessThan:()=>Zb,$ZodCheckLowerCase:()=>a$,$ZodCheckMaxLength:()=>r$,$ZodCheckMaxSize:()=>e$,$ZodCheckMimeType:()=>f$,$ZodCheckMinLength:()=>o$,$ZodCheckMinSize:()=>t$,$ZodCheckMultipleOf:()=>JU,$ZodCheckNumberFormat:()=>XU,$ZodCheckOverwrite:()=>m$,$ZodCheckProperty:()=>p$,$ZodCheckRegex:()=>s$,$ZodCheckSizeEquals:()=>n$,$ZodCheckStartsWith:()=>l$,$ZodCheckStringFormat:()=>hf,$ZodCheckUpperCase:()=>c$,$ZodCodec:()=>Mh,$ZodCustom:()=>OB,$ZodCustomStringFormat:()=>H$,$ZodDate:()=>eB,$ZodDefault:()=>_B,$ZodDiscriminatedUnion:()=>oB,$ZodE164:()=>V$,$ZodEmail:()=>A$,$ZodEmoji:()=>R$,$ZodEncodeError:()=>lc,$ZodEnum:()=>uB,$ZodError:()=>Ih,$ZodExactOptional:()=>fB,$ZodFile:()=>dB,$ZodFunction:()=>IB,$ZodGUID:()=>T$,$ZodIPv4:()=>w$,$ZodIPv6:()=>D$,$ZodISODate:()=>x$,$ZodISODateTime:()=>P$,$ZodISODuration:()=>L$,$ZodISOTime:()=>M$,$ZodIntersection:()=>iB,$ZodJWT:()=>F$,$ZodKSUID:()=>v$,$ZodLazy:()=>NB,$ZodLiteral:()=>lB,$ZodMAC:()=>k$,$ZodMap:()=>aB,$ZodNaN:()=>SB,$ZodNanoID:()=>I$,$ZodNever:()=>X$,$ZodNonOptional:()=>hB,$ZodNull:()=>K$,$ZodNullable:()=>mB,$ZodNumber:()=>oN,$ZodNumberFormat:()=>z$,$ZodObject:()=>wue,$ZodObjectJIT:()=>nB,$ZodOptional:()=>aN,$ZodPipe:()=>AB,$ZodPrefault:()=>gB,$ZodPromise:()=>bB,$ZodReadonly:()=>yB,$ZodRealError:()=>Or,$ZodRecord:()=>sB,$ZodRegistry:()=>dN,$ZodSet:()=>cB,$ZodString:()=>ml,$ZodStringFormat:()=>nt,$ZodSuccess:()=>EB,$ZodSymbol:()=>Y$,$ZodTemplateLiteral:()=>RB,$ZodTransform:()=>pB,$ZodTuple:()=>sN,$ZodType:()=>Re,$ZodULID:()=>O$,$ZodURL:()=>y$,$ZodUUID:()=>S$,$ZodUndefined:()=>W$,$ZodUnion:()=>xh,$ZodUnknown:()=>J$,$ZodVoid:()=>Q$,$ZodXID:()=>C$,$ZodXor:()=>rB,$brand:()=>wb,$constructor:()=>x,$input:()=>wB,$output:()=>LB,Doc:()=>vh,JSONSchema:()=>Ode,JSONSchemaGenerator:()=>VN,NEVER:()=>sU,TimePrecision:()=>$B,_any:()=>iG,_array:()=>pG,_base64:()=>vN,_base64url:()=>PN,_bigint:()=>XB,_boolean:()=>ZB,_catch:()=>Fje,_check:()=>Ide,_cidrv4:()=>ON,_cidrv6:()=>CN,_coercedBigint:()=>QB,_coercedBoolean:()=>JB,_coercedDate:()=>lG,_coercedNumber:()=>HB,_coercedString:()=>kB,_cuid:()=>SN,_cuid2:()=>AN,_custom:()=>mG,_date:()=>uG,_decode:()=>Gb,_decodeAsync:()=>Vb,_default:()=>Gje,_discriminatedUnion:()=>Cje,_e164:()=>xN,_email:()=>fN,_emoji:()=>EN,_encode:()=>Bb,_encodeAsync:()=>jb,_endsWith:()=>If,_enum:()=>wje,_file:()=>fG,_float32:()=>qB,_float64:()=>YB,_gt:()=>Xi,_gte:()=>lr,_guid:()=>kh,_includes:()=>yf,_int:()=>zB,_int32:()=>WB,_int64:()=>eG,_intersection:()=>vje,_ipv4:()=>bN,_ipv6:()=>NN,_isoDate:()=>GB,_isoDateTime:()=>BB,_isoDuration:()=>VB,_isoTime:()=>jB,_jwt:()=>MN,_ksuid:()=>IN,_lazy:()=>Yje,_length:()=>hl,_literal:()=>kje,_lowercase:()=>Sf,_lt:()=>Ji,_lte:()=>Yr,_mac:()=>UB,_map:()=>Mje,_max:()=>Yr,_maxLength:()=>gl,_maxSize:()=>gc,_mime:()=>bf,_min:()=>lr,_minLength:()=>Hs,_minSize:()=>Qi,_multipleOf:()=>_c,_nan:()=>dG,_nanoid:()=>TN,_nativeEnum:()=>Dje,_negative:()=>wN,_never:()=>aG,_nonnegative:()=>kN,_nonoptional:()=>jje,_nonpositive:()=>DN,_normalize:()=>Nf,_null:()=>oG,_nullable:()=>Bje,_number:()=>FB,_optional:()=>$je,_overwrite:()=>Qo,_parse:()=>ff,_parseAsync:()=>mf,_pipe:()=>Hje,_positive:()=>LN,_promise:()=>Wje,_property:()=>UN,_readonly:()=>zje,_record:()=>xje,_refine:()=>_G,_regex:()=>Tf,_safeDecode:()=>Hb,_safeDecodeAsync:()=>qb,_safeEncode:()=>Fb,_safeEncodeAsync:()=>zb,_safeParse:()=>_f,_safeParseAsync:()=>gf,_set:()=>Lje,_size:()=>_l,_slugify:()=>Pf,_startsWith:()=>Rf,_string:()=>DB,_stringFormat:()=>xf,_stringbool:()=>TG,_success:()=>Vje,_superRefine:()=>gG,_symbol:()=>nG,_templateLiteral:()=>qje,_toLowerCase:()=>Cf,_toUpperCase:()=>vf,_transform:()=>Uje,_trim:()=>Of,_tuple:()=>Pje,_uint32:()=>KB,_uint64:()=>tG,_ulid:()=>yN,_undefined:()=>rG,_union:()=>Nje,_unknown:()=>sG,_uppercase:()=>Af,_url:()=>Uh,_uuid:()=>mN,_uuidv4:()=>_N,_uuidv6:()=>gN,_uuidv7:()=>hN,_void:()=>cG,_xid:()=>RN,_xor:()=>Oje,clone:()=>ur,config:()=>Lt,createStandardJSONSchemaMethod:()=>Mf,createToJSONSchemaMethod:()=>SG,decode:()=>JGe,decodeAsync:()=>QGe,describe:()=>hG,encode:()=>ZGe,encodeAsync:()=>XGe,extractDefs:()=>Ec,finalize:()=>Tc,flattenError:()=>bh,formatError:()=>Nh,globalConfig:()=>hh,globalRegistry:()=>bn,initializeContext:()=>hc,isValidBase64:()=>B$,isValidBase64URL:()=>Pue,isValidJWT:()=>xue,locales:()=>wh,meta:()=>EG,parse:()=>Ub,parseAsync:()=>$b,prettifyError:()=>EU,process:()=>Ze,regexes:()=>No,registry:()=>pN,safeDecode:()=>t1e,safeDecodeAsync:()=>r1e,safeEncode:()=>e1e,safeEncodeAsync:()=>n1e,safeParse:()=>SU,safeParseAsync:()=>AU,toDotPath:()=>pue,toJSONSchema:()=>jN,treeifyError:()=>hU,util:()=>Y,version:()=>g$});var Cr=I(()=>{l();uf();yU();TU();CB();Xb();h$();fe();Kb();MB();Dh();_$();bde();$h();Bh();Nde();Cde()});var FN={};ft(FN,{endsWith:()=>If,gt:()=>Xi,gte:()=>lr,includes:()=>yf,length:()=>hl,lowercase:()=>Sf,lt:()=>Ji,lte:()=>Yr,maxLength:()=>gl,maxSize:()=>gc,mime:()=>bf,minLength:()=>Hs,minSize:()=>Qi,multipleOf:()=>_c,negative:()=>wN,nonnegative:()=>kN,nonpositive:()=>DN,normalize:()=>Nf,overwrite:()=>Qo,positive:()=>LN,property:()=>UN,regex:()=>Tf,size:()=>_l,slugify:()=>Pf,startsWith:()=>Rf,toLowerCase:()=>Cf,toUpperCase:()=>vf,trim:()=>Of,uppercase:()=>Af});var HN=I(()=>{l();Cr()});var Lf={};ft(Lf,{ZodISODate:()=>qN,ZodISODateTime:()=>zN,ZodISODuration:()=>WN,ZodISOTime:()=>YN,date:()=>i1,datetime:()=>o1,duration:()=>a1,time:()=>s1});function o1(e){return BB(zN,e)}function i1(e){return GB(qN,e)}function s1(e){return jB(YN,e)}function a1(e){return VB(WN,e)}var zN,qN,YN,WN,Gh=I(()=>{l();Cr();Vh();zN=x("ZodISODateTime",(e,t)=>{P$.init(e,t),rt.init(e,t)});qN=x("ZodISODate",(e,t)=>{x$.init(e,t),rt.init(e,t)});YN=x("ZodISOTime",(e,t)=>{M$.init(e,t),rt.init(e,t)});WN=x("ZodISODuration",(e,t)=>{L$.init(e,t),rt.init(e,t)})});var vde,Jje,vr,c1=I(()=>{l();Cr();Cr();fe();vde=(e,t)=>{Ih.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Nh(e,n)},flatten:{value:n=>bh(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,lf,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,lf,2)}},isEmpty:{get(){return e.issues.length===0}}})},Jje=x("ZodError",vde),vr=x("ZodError",vde,{Parent:Error})});var u1,l1,d1,p1,f1,m1,_1,g1,h1,E1,T1,S1,A1=I(()=>{l();Cr();c1();u1=ff(vr),l1=mf(vr),d1=_f(vr),p1=gf(vr),f1=Bb(vr),m1=Gb(vr),_1=jb(vr),g1=Vb(vr),h1=Fb(vr),E1=Hb(vr),T1=zb(vr),S1=qb(vr)});var jh={};ft(jh,{ZodAny:()=>v1,ZodArray:()=>L1,ZodBase64:()=>lO,ZodBase64URL:()=>dO,ZodBigInt:()=>Bf,ZodBigIntFormat:()=>mO,ZodBoolean:()=>$f,ZodCIDRv4:()=>cO,ZodCIDRv6:()=>uO,ZodCUID:()=>tO,ZodCUID2:()=>nO,ZodCatch:()=>tj,ZodCodec:()=>yO,ZodCustom:()=>Qh,ZodCustomStringFormat:()=>kf,ZodDate:()=>Wh,ZodDefault:()=>K1,ZodDiscriminatedUnion:()=>D1,ZodE164:()=>pO,ZodEmail:()=>XN,ZodEmoji:()=>QN,ZodEnum:()=>wf,ZodExactOptional:()=>q1,ZodFile:()=>H1,ZodFunction:()=>lj,ZodGUID:()=>Fh,ZodIPv4:()=>sO,ZodIPv6:()=>aO,ZodIntersection:()=>k1,ZodJWT:()=>fO,ZodKSUID:()=>iO,ZodLazy:()=>aj,ZodLiteral:()=>F1,ZodMAC:()=>y1,ZodMap:()=>j1,ZodNaN:()=>rj,ZodNanoID:()=>eO,ZodNever:()=>x1,ZodNonOptional:()=>SO,ZodNull:()=>O1,ZodNullable:()=>W1,ZodNumber:()=>Uf,ZodNumberFormat:()=>Tl,ZodObject:()=>Zh,ZodOptional:()=>TO,ZodPipe:()=>AO,ZodPrefault:()=>J1,ZodPromise:()=>uj,ZodReadonly:()=>oj,ZodRecord:()=>Xh,ZodSet:()=>V1,ZodString:()=>Df,ZodStringFormat:()=>rt,ZodSuccess:()=>ej,ZodSymbol:()=>b1,ZodTemplateLiteral:()=>sj,ZodTransform:()=>z1,ZodTuple:()=>$1,ZodType:()=>Ce,ZodULID:()=>rO,ZodURL:()=>Yh,ZodUUID:()=>es,ZodUndefined:()=>N1,ZodUnion:()=>Jh,ZodUnknown:()=>P1,ZodVoid:()=>M1,ZodXID:()=>oO,ZodXor:()=>w1,_ZodString:()=>JN,_default:()=>Z1,_function:()=>Dpe,any:()=>fpe,array:()=>Kh,base64:()=>Zde,base64url:()=>Jde,bigint:()=>cpe,boolean:()=>I1,catch:()=>nj,check:()=>kpe,cidrv4:()=>Wde,cidrv6:()=>Kde,codec:()=>Mpe,cuid:()=>Gde,cuid2:()=>jde,custom:()=>Upe,date:()=>_pe,describe:()=>$pe,discriminatedUnion:()=>Ape,e164:()=>Xde,email:()=>Pde,emoji:()=>$de,enum:()=>hO,exactOptional:()=>Y1,file:()=>Cpe,float32:()=>ope,float64:()=>ipe,function:()=>Dpe,guid:()=>xde,hash:()=>rpe,hex:()=>npe,hostname:()=>tpe,httpUrl:()=>Ude,instanceof:()=>Gpe,int:()=>ZN,int32:()=>spe,int64:()=>upe,intersection:()=>U1,ipv4:()=>zde,ipv6:()=>Yde,json:()=>Vpe,jwt:()=>Qde,keyof:()=>gpe,ksuid:()=>Hde,lazy:()=>cj,literal:()=>Ope,looseObject:()=>Tpe,looseRecord:()=>Rpe,mac:()=>qde,map:()=>Ipe,meta:()=>Bpe,nan:()=>xpe,nanoid:()=>Bde,nativeEnum:()=>Npe,never:()=>_O,nonoptional:()=>Q1,null:()=>C1,nullable:()=>zh,nullish:()=>vpe,number:()=>R1,object:()=>hpe,optional:()=>Hh,partialRecord:()=>ype,pipe:()=>qh,prefault:()=>X1,preprocess:()=>Fpe,promise:()=>wpe,readonly:()=>ij,record:()=>G1,refine:()=>dj,set:()=>bpe,strictObject:()=>Epe,string:()=>KN,stringFormat:()=>epe,stringbool:()=>jpe,success:()=>Ppe,superRefine:()=>pj,symbol:()=>dpe,templateLiteral:()=>Lpe,transform:()=>EO,tuple:()=>B1,uint32:()=>ape,uint64:()=>lpe,ulid:()=>Vde,undefined:()=>ppe,union:()=>gO,unknown:()=>El,url:()=>kde,uuid:()=>Mde,uuidv4:()=>Lde,uuidv6:()=>wde,uuidv7:()=>Dde,void:()=>mpe,xid:()=>Fde,xor:()=>Spe});function KN(e){return DB(Df,e)}function Pde(e){return fN(XN,e)}function xde(e){return kh(Fh,e)}function Mde(e){return mN(es,e)}function Lde(e){return _N(es,e)}function wde(e){return gN(es,e)}function Dde(e){return hN(es,e)}function kde(e){return Uh(Yh,e)}function Ude(e){return Uh(Yh,{protocol:/^https?$/,hostname:No.domain,...Y.normalizeParams(e)})}function $de(e){return EN(QN,e)}function Bde(e){return TN(eO,e)}function Gde(e){return SN(tO,e)}function jde(e){return AN(nO,e)}function Vde(e){return yN(rO,e)}function Fde(e){return RN(oO,e)}function Hde(e){return IN(iO,e)}function zde(e){return bN(sO,e)}function qde(e){return UB(y1,e)}function Yde(e){return NN(aO,e)}function Wde(e){return ON(cO,e)}function Kde(e){return CN(uO,e)}function Zde(e){return vN(lO,e)}function Jde(e){return PN(dO,e)}function Xde(e){return xN(pO,e)}function Qde(e){return MN(fO,e)}function epe(e,t,n={}){return xf(kf,e,t,n)}function tpe(e){return xf(kf,"hostname",No.hostname,e)}function npe(e){return xf(kf,"hex",No.hex,e)}function rpe(e,t){let n=t?.enc??"hex",o=`${e}_${n}`,r=No[o];if(!r)throw new Error(`Unrecognized hash format: ${o}`);return xf(kf,o,r,t)}function R1(e){return FB(Uf,e)}function ZN(e){return zB(Tl,e)}function ope(e){return qB(Tl,e)}function ipe(e){return YB(Tl,e)}function spe(e){return WB(Tl,e)}function ape(e){return KB(Tl,e)}function I1(e){return ZB($f,e)}function cpe(e){return XB(Bf,e)}function upe(e){return eG(mO,e)}function lpe(e){return tG(mO,e)}function dpe(e){return nG(b1,e)}function ppe(e){return rG(N1,e)}function C1(e){return oG(O1,e)}function fpe(){return iG(v1)}function El(){return sG(P1)}function _O(e){return aG(x1,e)}function mpe(e){return cG(M1,e)}function _pe(e){return uG(Wh,e)}function Kh(e,t){return pG(L1,e,t)}function gpe(e){let t=e._zod.def.shape;return hO(Object.keys(t))}function hpe(e,t){let n={type:"object",shape:e??{},...Y.normalizeParams(t)};return new Zh(n)}function Epe(e,t){return new Zh({type:"object",shape:e,catchall:_O(),...Y.normalizeParams(t)})}function Tpe(e,t){return new Zh({type:"object",shape:e,catchall:El(),...Y.normalizeParams(t)})}function gO(e,t){return new Jh({type:"union",options:e,...Y.normalizeParams(t)})}function Spe(e,t){return new w1({type:"union",options:e,inclusive:!1,...Y.normalizeParams(t)})}function Ape(e,t,n){return new D1({type:"union",options:t,discriminator:e,...Y.normalizeParams(n)})}function U1(e,t){return new k1({type:"intersection",left:e,right:t})}function B1(e,t,n){let o=t instanceof Re,r=o?n:t,i=o?t:null;return new $1({type:"tuple",items:e,rest:i,...Y.normalizeParams(r)})}function G1(e,t,n){return new Xh({type:"record",keyType:e,valueType:t,...Y.normalizeParams(n)})}function ype(e,t,n){let o=ur(e);return o._zod.values=void 0,new Xh({type:"record",keyType:o,valueType:t,...Y.normalizeParams(n)})}function Rpe(e,t,n){return new Xh({type:"record",keyType:e,valueType:t,mode:"loose",...Y.normalizeParams(n)})}function Ipe(e,t,n){return new j1({type:"map",keyType:e,valueType:t,...Y.normalizeParams(n)})}function bpe(e,t){return new V1({type:"set",valueType:e,...Y.normalizeParams(t)})}function hO(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new wf({type:"enum",entries:n,...Y.normalizeParams(t)})}function Npe(e,t){return new wf({type:"enum",entries:e,...Y.normalizeParams(t)})}function Ope(e,t){return new F1({type:"literal",values:Array.isArray(e)?e:[e],...Y.normalizeParams(t)})}function Cpe(e){return fG(H1,e)}function EO(e){return new z1({type:"transform",transform:e})}function Hh(e){return new TO({type:"optional",innerType:e})}function Y1(e){return new q1({type:"optional",innerType:e})}function zh(e){return new W1({type:"nullable",innerType:e})}function vpe(e){return Hh(zh(e))}function Z1(e,t){return new K1({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Y.shallowClone(t)}})}function X1(e,t){return new J1({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Y.shallowClone(t)}})}function Q1(e,t){return new SO({type:"nonoptional",innerType:e,...Y.normalizeParams(t)})}function Ppe(e){return new ej({type:"success",innerType:e})}function nj(e,t){return new tj({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function xpe(e){return dG(rj,e)}function qh(e,t){return new AO({type:"pipe",in:e,out:t})}function Mpe(e,t,n){return new yO({type:"pipe",in:e,out:t,transform:n.decode,reverseTransform:n.encode})}function ij(e){return new oj({type:"readonly",innerType:e})}function Lpe(e,t){return new sj({type:"template_literal",parts:e,...Y.normalizeParams(t)})}function cj(e){return new aj({type:"lazy",getter:e})}function wpe(e){return new uj({type:"promise",innerType:e})}function Dpe(e){return new lj({type:"function",input:Array.isArray(e?.input)?B1(e?.input):e?.input??Kh(El()),output:e?.output??El()})}function kpe(e){let t=new st({check:"custom"});return t._zod.check=e,t}function Upe(e,t){return mG(Qh,e??(()=>!0),t)}function dj(e,t={}){return _G(Qh,e,t)}function pj(e){return gG(e)}function Gpe(e,t={}){let n=new Qh({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...Y.normalizeParams(t)});return n._zod.bag.Class=e,n._zod.check=o=>{o.value instanceof e||o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:n,path:[...n._zod.def.path??[]]})},n}function Vpe(e){let t=cj(()=>gO([KN(e),R1(),I1(),C1(),Kh(t),G1(KN(),t)]));return t}function Fpe(e,t){return qh(EO(e),t)}var Ce,JN,Df,rt,XN,Fh,es,Yh,QN,eO,tO,nO,rO,oO,iO,sO,y1,aO,cO,uO,lO,dO,pO,fO,kf,Uf,Tl,$f,Bf,mO,b1,N1,O1,v1,P1,x1,M1,Wh,L1,Zh,Jh,w1,D1,k1,$1,Xh,j1,V1,wf,F1,H1,z1,TO,q1,W1,K1,J1,SO,ej,tj,rj,AO,yO,oj,sj,aj,uj,lj,Qh,$pe,Bpe,jpe,Vh=I(()=>{l();Cr();Cr();Bh();$h();HN();Gh();A1();Ce=x("ZodType",(e,t)=>(Re.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Mf(e,"input"),output:Mf(e,"output")}}),e.toJSONSchema=SG(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Y.mergeDefs(t,{checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0}),e.with=e.check,e.clone=(n,o)=>ur(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>u1(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>d1(e,n,o),e.parseAsync=async(n,o)=>l1(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>p1(e,n,o),e.spa=e.safeParseAsync,e.encode=(n,o)=>f1(e,n,o),e.decode=(n,o)=>m1(e,n,o),e.encodeAsync=async(n,o)=>_1(e,n,o),e.decodeAsync=async(n,o)=>g1(e,n,o),e.safeEncode=(n,o)=>h1(e,n,o),e.safeDecode=(n,o)=>E1(e,n,o),e.safeEncodeAsync=async(n,o)=>T1(e,n,o),e.safeDecodeAsync=async(n,o)=>S1(e,n,o),e.refine=(n,o)=>e.check(dj(n,o)),e.superRefine=n=>e.check(pj(n)),e.overwrite=n=>e.check(Qo(n)),e.optional=()=>Hh(e),e.exactOptional=()=>Y1(e),e.nullable=()=>zh(e),e.nullish=()=>Hh(zh(e)),e.nonoptional=n=>Q1(e,n),e.array=()=>Kh(e),e.or=n=>gO([e,n]),e.and=n=>U1(e,n),e.transform=n=>qh(e,EO(n)),e.default=n=>Z1(e,n),e.prefault=n=>X1(e,n),e.catch=n=>nj(e,n),e.pipe=n=>qh(e,n),e.readonly=()=>ij(e),e.describe=n=>{let o=e.clone();return bn.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return bn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return bn.get(e);let o=e.clone();return bn.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),JN=x("_ZodString",(e,t)=>{ml.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,i)=>AG(e,o,r,i);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Tf(...o)),e.includes=(...o)=>e.check(yf(...o)),e.startsWith=(...o)=>e.check(Rf(...o)),e.endsWith=(...o)=>e.check(If(...o)),e.min=(...o)=>e.check(Hs(...o)),e.max=(...o)=>e.check(gl(...o)),e.length=(...o)=>e.check(hl(...o)),e.nonempty=(...o)=>e.check(Hs(1,...o)),e.lowercase=o=>e.check(Sf(o)),e.uppercase=o=>e.check(Af(o)),e.trim=()=>e.check(Of()),e.normalize=(...o)=>e.check(Nf(...o)),e.toLowerCase=()=>e.check(Cf()),e.toUpperCase=()=>e.check(vf()),e.slugify=()=>e.check(Pf())}),Df=x("ZodString",(e,t)=>{ml.init(e,t),JN.init(e,t),e.email=n=>e.check(fN(XN,n)),e.url=n=>e.check(Uh(Yh,n)),e.jwt=n=>e.check(MN(fO,n)),e.emoji=n=>e.check(EN(QN,n)),e.guid=n=>e.check(kh(Fh,n)),e.uuid=n=>e.check(mN(es,n)),e.uuidv4=n=>e.check(_N(es,n)),e.uuidv6=n=>e.check(gN(es,n)),e.uuidv7=n=>e.check(hN(es,n)),e.nanoid=n=>e.check(TN(eO,n)),e.guid=n=>e.check(kh(Fh,n)),e.cuid=n=>e.check(SN(tO,n)),e.cuid2=n=>e.check(AN(nO,n)),e.ulid=n=>e.check(yN(rO,n)),e.base64=n=>e.check(vN(lO,n)),e.base64url=n=>e.check(PN(dO,n)),e.xid=n=>e.check(RN(oO,n)),e.ksuid=n=>e.check(IN(iO,n)),e.ipv4=n=>e.check(bN(sO,n)),e.ipv6=n=>e.check(NN(aO,n)),e.cidrv4=n=>e.check(ON(cO,n)),e.cidrv6=n=>e.check(CN(uO,n)),e.e164=n=>e.check(xN(pO,n)),e.datetime=n=>e.check(o1(n)),e.date=n=>e.check(i1(n)),e.time=n=>e.check(s1(n)),e.duration=n=>e.check(a1(n))});rt=x("ZodStringFormat",(e,t)=>{nt.init(e,t),JN.init(e,t)}),XN=x("ZodEmail",(e,t)=>{A$.init(e,t),rt.init(e,t)});Fh=x("ZodGUID",(e,t)=>{T$.init(e,t),rt.init(e,t)});es=x("ZodUUID",(e,t)=>{S$.init(e,t),rt.init(e,t)});Yh=x("ZodURL",(e,t)=>{y$.init(e,t),rt.init(e,t)});QN=x("ZodEmoji",(e,t)=>{R$.init(e,t),rt.init(e,t)});eO=x("ZodNanoID",(e,t)=>{I$.init(e,t),rt.init(e,t)});tO=x("ZodCUID",(e,t)=>{b$.init(e,t),rt.init(e,t)});nO=x("ZodCUID2",(e,t)=>{N$.init(e,t),rt.init(e,t)});rO=x("ZodULID",(e,t)=>{O$.init(e,t),rt.init(e,t)});oO=x("ZodXID",(e,t)=>{C$.init(e,t),rt.init(e,t)});iO=x("ZodKSUID",(e,t)=>{v$.init(e,t),rt.init(e,t)});sO=x("ZodIPv4",(e,t)=>{w$.init(e,t),rt.init(e,t)});y1=x("ZodMAC",(e,t)=>{k$.init(e,t),rt.init(e,t)});aO=x("ZodIPv6",(e,t)=>{D$.init(e,t),rt.init(e,t)});cO=x("ZodCIDRv4",(e,t)=>{U$.init(e,t),rt.init(e,t)});uO=x("ZodCIDRv6",(e,t)=>{$$.init(e,t),rt.init(e,t)});lO=x("ZodBase64",(e,t)=>{G$.init(e,t),rt.init(e,t)});dO=x("ZodBase64URL",(e,t)=>{j$.init(e,t),rt.init(e,t)});pO=x("ZodE164",(e,t)=>{V$.init(e,t),rt.init(e,t)});fO=x("ZodJWT",(e,t)=>{F$.init(e,t),rt.init(e,t)});kf=x("ZodCustomStringFormat",(e,t)=>{H$.init(e,t),rt.init(e,t)});Uf=x("ZodNumber",(e,t)=>{oN.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,i)=>yG(e,o,r,i),e.gt=(o,r)=>e.check(Xi(o,r)),e.gte=(o,r)=>e.check(lr(o,r)),e.min=(o,r)=>e.check(lr(o,r)),e.lt=(o,r)=>e.check(Ji(o,r)),e.lte=(o,r)=>e.check(Yr(o,r)),e.max=(o,r)=>e.check(Yr(o,r)),e.int=o=>e.check(ZN(o)),e.safe=o=>e.check(ZN(o)),e.positive=o=>e.check(Xi(0,o)),e.nonnegative=o=>e.check(lr(0,o)),e.negative=o=>e.check(Ji(0,o)),e.nonpositive=o=>e.check(Yr(0,o)),e.multipleOf=(o,r)=>e.check(_c(o,r)),e.step=(o,r)=>e.check(_c(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});Tl=x("ZodNumberFormat",(e,t)=>{z$.init(e,t),Uf.init(e,t)});$f=x("ZodBoolean",(e,t)=>{Ph.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>RG(e,n,o,r)});Bf=x("ZodBigInt",(e,t)=>{iN.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,i)=>IG(e,o,r,i),e.gte=(o,r)=>e.check(lr(o,r)),e.min=(o,r)=>e.check(lr(o,r)),e.gt=(o,r)=>e.check(Xi(o,r)),e.gte=(o,r)=>e.check(lr(o,r)),e.min=(o,r)=>e.check(lr(o,r)),e.lt=(o,r)=>e.check(Ji(o,r)),e.lte=(o,r)=>e.check(Yr(o,r)),e.max=(o,r)=>e.check(Yr(o,r)),e.positive=o=>e.check(Xi(BigInt(0),o)),e.negative=o=>e.check(Ji(BigInt(0),o)),e.nonpositive=o=>e.check(Yr(BigInt(0),o)),e.nonnegative=o=>e.check(lr(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(_c(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});mO=x("ZodBigIntFormat",(e,t)=>{q$.init(e,t),Bf.init(e,t)});b1=x("ZodSymbol",(e,t)=>{Y$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>bG(e,n,o,r)});N1=x("ZodUndefined",(e,t)=>{W$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>OG(e,n,o,r)});O1=x("ZodNull",(e,t)=>{K$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>NG(e,n,o,r)});v1=x("ZodAny",(e,t)=>{Z$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>PG(e,n,o,r)});P1=x("ZodUnknown",(e,t)=>{J$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>xG(e,n,o,r)});x1=x("ZodNever",(e,t)=>{X$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>vG(e,n,o,r)});M1=x("ZodVoid",(e,t)=>{Q$.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>CG(e,n,o,r)});Wh=x("ZodDate",(e,t)=>{eB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,i)=>MG(e,o,r,i),e.min=(o,r)=>e.check(lr(o,r)),e.max=(o,r)=>e.check(Yr(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});L1=x("ZodArray",(e,t)=>{tB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>HG(e,n,o,r),e.element=t.element,e.min=(n,o)=>e.check(Hs(n,o)),e.nonempty=n=>e.check(Hs(1,n)),e.max=(n,o)=>e.check(gl(n,o)),e.length=(n,o)=>e.check(hl(n,o)),e.unwrap=()=>e.element});Zh=x("ZodObject",(e,t)=>{nB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>zG(e,n,o,r),Y.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>hO(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:El()}),e.loose=()=>e.clone({...e._zod.def,catchall:El()}),e.strict=()=>e.clone({...e._zod.def,catchall:_O()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>Y.extend(e,n),e.safeExtend=n=>Y.safeExtend(e,n),e.merge=n=>Y.merge(e,n),e.pick=n=>Y.pick(e,n),e.omit=n=>Y.omit(e,n),e.partial=(...n)=>Y.partial(TO,e,n[0]),e.required=(...n)=>Y.required(SO,e,n[0])});Jh=x("ZodUnion",(e,t)=>{xh.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>BN(e,n,o,r),e.options=t.options});w1=x("ZodXor",(e,t)=>{Jh.init(e,t),rB.init(e,t),e._zod.processJSONSchema=(n,o,r)=>BN(e,n,o,r),e.options=t.options});D1=x("ZodDiscriminatedUnion",(e,t)=>{Jh.init(e,t),oB.init(e,t)});k1=x("ZodIntersection",(e,t)=>{iB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>qG(e,n,o,r)});$1=x("ZodTuple",(e,t)=>{sN.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>YG(e,n,o,r),e.rest=n=>e.clone({...e._zod.def,rest:n})});Xh=x("ZodRecord",(e,t)=>{sB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>WG(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType});j1=x("ZodMap",(e,t)=>{aB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>VG(e,n,o,r),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...n)=>e.check(Qi(...n)),e.nonempty=n=>e.check(Qi(1,n)),e.max=(...n)=>e.check(gc(...n)),e.size=(...n)=>e.check(_l(...n))});V1=x("ZodSet",(e,t)=>{cB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>FG(e,n,o,r),e.min=(...n)=>e.check(Qi(...n)),e.nonempty=n=>e.check(Qi(1,n)),e.max=(...n)=>e.check(gc(...n)),e.size=(...n)=>e.check(_l(...n))});wf=x("ZodEnum",(e,t)=>{uB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(o,r,i)=>LG(e,o,r,i),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new wf({...t,checks:[],...Y.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new wf({...t,checks:[],...Y.normalizeParams(r),entries:i})}});F1=x("ZodLiteral",(e,t)=>{lB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>wG(e,n,o,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});H1=x("ZodFile",(e,t)=>{dB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>UG(e,n,o,r),e.min=(n,o)=>e.check(Qi(n,o)),e.max=(n,o)=>e.check(gc(n,o)),e.mime=(n,o)=>e.check(bf(Array.isArray(n)?n:[n],o))});z1=x("ZodTransform",(e,t)=>{pB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>jG(e,n,o,r),e._zod.parse=(n,o)=>{if(o.direction==="backward")throw new lc(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Y.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),n.issues.push(Y.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});TO=x("ZodOptional",(e,t)=>{aN.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>GN(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});q1=x("ZodExactOptional",(e,t)=>{fB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>GN(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});W1=x("ZodNullable",(e,t)=>{mB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>KG(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});K1=x("ZodDefault",(e,t)=>{_B.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>JG(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});J1=x("ZodPrefault",(e,t)=>{gB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>XG(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});SO=x("ZodNonOptional",(e,t)=>{hB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>ZG(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});ej=x("ZodSuccess",(e,t)=>{EB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>$G(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});tj=x("ZodCatch",(e,t)=>{TB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>QG(e,n,o,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});rj=x("ZodNaN",(e,t)=>{SB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>DG(e,n,o,r)});AO=x("ZodPipe",(e,t)=>{AB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>e1(e,n,o,r),e.in=t.in,e.out=t.out});yO=x("ZodCodec",(e,t)=>{AO.init(e,t),Mh.init(e,t)});oj=x("ZodReadonly",(e,t)=>{yB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>t1(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});sj=x("ZodTemplateLiteral",(e,t)=>{RB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>kG(e,n,o,r)});aj=x("ZodLazy",(e,t)=>{NB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>r1(e,n,o,r),e.unwrap=()=>e._zod.def.getter()});uj=x("ZodPromise",(e,t)=>{bB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>n1(e,n,o,r),e.unwrap=()=>e._zod.def.innerType});lj=x("ZodFunction",(e,t)=>{IB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>GG(e,n,o,r)});Qh=x("ZodCustom",(e,t)=>{OB.init(e,t),Ce.init(e,t),e._zod.processJSONSchema=(n,o,r)=>BG(e,n,o,r)});$pe=hG,Bpe=EG;jpe=(...e)=>TG({Codec:yO,Boolean:$f,String:Df},...e)});function eVe(e){Lt({customError:e})}function tVe(){return Lt().customError}var Qje,fj,Hpe=I(()=>{l();Cr();Cr();Qje={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};fj||(fj={})});function rVe(e,t){let n=e.$schema;return n==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":n==="http://json-schema.org/draft-07/schema#"?"draft-7":n==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function oVe(e,t){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let n=e.slice(1).split("/").filter(Boolean);if(n.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(n[0]===o){let r=n[1];if(!r||!t.defs[r])throw new Error(`Reference not found: ${e}`);return t.defs[r]}throw new Error(`Reference not found: ${e}`)}function zpe(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return ee.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return ee.lazy(()=>{if(!t.refs.has(r))throw new Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let i=oVe(r,t),s=jn(i,t);return t.refs.set(r,s),t.processing.delete(r),s}if(e.enum!==void 0){let r=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&r.length===1&&r[0]===null)return ee.null();if(r.length===0)return ee.never();if(r.length===1)return ee.literal(r[0]);if(r.every(s=>typeof s=="string"))return ee.enum(r);let i=r.map(s=>ee.literal(s));return i.length<2?i[0]:ee.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return ee.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(i=>{let s={...e,type:i};return zpe(s,t)});return r.length===0?ee.never():r.length===1?r[0]:ee.union(r)}if(!n)return ee.any();let o;switch(n){case"string":{let r=ee.string();if(e.format){let i=e.format;i==="email"?r=r.check(ee.email()):i==="uri"||i==="uri-reference"?r=r.check(ee.url()):i==="uuid"||i==="guid"?r=r.check(ee.uuid()):i==="date-time"?r=r.check(ee.iso.datetime()):i==="date"?r=r.check(ee.iso.date()):i==="time"?r=r.check(ee.iso.time()):i==="duration"?r=r.check(ee.iso.duration()):i==="ipv4"?r=r.check(ee.ipv4()):i==="ipv6"?r=r.check(ee.ipv6()):i==="mac"?r=r.check(ee.mac()):i==="cidr"?r=r.check(ee.cidrv4()):i==="cidr-v6"?r=r.check(ee.cidrv6()):i==="base64"?r=r.check(ee.base64()):i==="base64url"?r=r.check(ee.base64url()):i==="e164"?r=r.check(ee.e164()):i==="jwt"?r=r.check(ee.jwt()):i==="emoji"?r=r.check(ee.emoji()):i==="nanoid"?r=r.check(ee.nanoid()):i==="cuid"?r=r.check(ee.cuid()):i==="cuid2"?r=r.check(ee.cuid2()):i==="ulid"?r=r.check(ee.ulid()):i==="xid"?r=r.check(ee.xid()):i==="ksuid"&&(r=r.check(ee.ksuid()))}typeof e.minLength=="number"&&(r=r.min(e.minLength)),typeof e.maxLength=="number"&&(r=r.max(e.maxLength)),e.pattern&&(r=r.regex(new RegExp(e.pattern))),o=r;break}case"number":case"integer":{let r=n==="integer"?ee.number().int():ee.number();typeof e.minimum=="number"&&(r=r.min(e.minimum)),typeof e.maximum=="number"&&(r=r.max(e.maximum)),typeof e.exclusiveMinimum=="number"?r=r.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(r=r.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?r=r.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(r=r.lt(e.maximum)),typeof e.multipleOf=="number"&&(r=r.multipleOf(e.multipleOf)),o=r;break}case"boolean":{o=ee.boolean();break}case"null":{o=ee.null();break}case"object":{let r={},i=e.properties||{},s=new Set(e.required||[]);for(let[c,u]of Object.entries(i)){let d=jn(u,t);r[c]=s.has(c)?d:d.optional()}if(e.propertyNames){let c=jn(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?jn(e.additionalProperties,t):ee.any();if(Object.keys(r).length===0){o=ee.record(c,u);break}let d=ee.object(r).passthrough(),p=ee.looseRecord(c,u);o=ee.intersection(d,p);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let f of u){let m=jn(c[f],t),_=ee.string().regex(new RegExp(f));d.push(ee.looseRecord(_,m))}let p=[];if(Object.keys(r).length>0&&p.push(ee.object(r).passthrough()),p.push(...d),p.length===0)o=ee.object({}).passthrough();else if(p.length===1)o=p[0];else{let f=ee.intersection(p[0],p[1]);for(let m=2;m<p.length;m++)f=ee.intersection(f,p[m]);o=f}break}let a=ee.object(r);e.additionalProperties===!1?o=a.strict():typeof e.additionalProperties=="object"?o=a.catchall(jn(e.additionalProperties,t)):o=a.passthrough();break}case"array":{let r=e.prefixItems,i=e.items;if(r&&Array.isArray(r)){let s=r.map(c=>jn(c,t)),a=i&&typeof i=="object"&&!Array.isArray(i)?jn(i,t):void 0;a?o=ee.tuple(s).rest(a):o=ee.tuple(s),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(Array.isArray(i)){let s=i.map(c=>jn(c,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?jn(e.additionalItems,t):void 0;a?o=ee.tuple(s).rest(a):o=ee.tuple(s),typeof e.minItems=="number"&&(o=o.check(ee.minLength(e.minItems))),typeof e.maxItems=="number"&&(o=o.check(ee.maxLength(e.maxItems)))}else if(i!==void 0){let s=jn(i,t),a=ee.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),o=a}else o=ee.array(ee.any());break}default:throw new Error(`Unsupported type: ${n}`)}return e.description&&(o=o.describe(e.description)),e.default!==void 0&&(o=o.default(e.default)),o}function jn(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let n=zpe(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>jn(u,t)),c=ee.union(a);n=o?ee.intersection(n,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>jn(u,t)),c=ee.xor(a);n=o?ee.intersection(n,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)n=o?n:ee.any();else{let a=o?n:jn(e.allOf[0],t),c=o?0:1;for(let u=c;u<e.allOf.length;u++)a=ee.intersection(a,jn(e.allOf[u],t));n=a}e.nullable===!0&&t.version==="openapi-3.0"&&(n=ee.nullable(n)),e.readOnly===!0&&(n=ee.readonly(n));let r={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)a in e&&(r[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(r[a]=e[a]);for(let a of Object.keys(e))nVe.has(a)||(r[a]=e[a]);return Object.keys(r).length>0&&t.registry.add(n,r),n}function qpe(e,t){if(typeof e=="boolean")return e?ee.any():ee.never();let n=rVe(e,t?.defaultTarget),o=e.$defs||e.definitions||{},r={version:n,defs:o,refs:new Map,processing:new Set,rootSchema:e,registry:t?.registry??bn};return jn(e,r)}var ee,nVe,Ype=I(()=>{l();Dh();HN();Gh();Vh();ee={...jh,...FN,iso:Lf},nVe=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var mj={};ft(mj,{bigint:()=>cVe,boolean:()=>aVe,date:()=>uVe,number:()=>sVe,string:()=>iVe});function iVe(e){return kB(Df,e)}function sVe(e){return HB(Uf,e)}function aVe(e){return JB($f,e)}function cVe(e){return QB(Bf,e)}function uVe(e){return lG(Wh,e)}var Wpe=I(()=>{l();Cr();Vh()});var Te={};ft(Te,{$brand:()=>wb,$input:()=>wB,$output:()=>LB,NEVER:()=>sU,TimePrecision:()=>$B,ZodAny:()=>v1,ZodArray:()=>L1,ZodBase64:()=>lO,ZodBase64URL:()=>dO,ZodBigInt:()=>Bf,ZodBigIntFormat:()=>mO,ZodBoolean:()=>$f,ZodCIDRv4:()=>cO,ZodCIDRv6:()=>uO,ZodCUID:()=>tO,ZodCUID2:()=>nO,ZodCatch:()=>tj,ZodCodec:()=>yO,ZodCustom:()=>Qh,ZodCustomStringFormat:()=>kf,ZodDate:()=>Wh,ZodDefault:()=>K1,ZodDiscriminatedUnion:()=>D1,ZodE164:()=>pO,ZodEmail:()=>XN,ZodEmoji:()=>QN,ZodEnum:()=>wf,ZodError:()=>Jje,ZodExactOptional:()=>q1,ZodFile:()=>H1,ZodFirstPartyTypeKind:()=>fj,ZodFunction:()=>lj,ZodGUID:()=>Fh,ZodIPv4:()=>sO,ZodIPv6:()=>aO,ZodISODate:()=>qN,ZodISODateTime:()=>zN,ZodISODuration:()=>WN,ZodISOTime:()=>YN,ZodIntersection:()=>k1,ZodIssueCode:()=>Qje,ZodJWT:()=>fO,ZodKSUID:()=>iO,ZodLazy:()=>aj,ZodLiteral:()=>F1,ZodMAC:()=>y1,ZodMap:()=>j1,ZodNaN:()=>rj,ZodNanoID:()=>eO,ZodNever:()=>x1,ZodNonOptional:()=>SO,ZodNull:()=>O1,ZodNullable:()=>W1,ZodNumber:()=>Uf,ZodNumberFormat:()=>Tl,ZodObject:()=>Zh,ZodOptional:()=>TO,ZodPipe:()=>AO,ZodPrefault:()=>J1,ZodPromise:()=>uj,ZodReadonly:()=>oj,ZodRealError:()=>vr,ZodRecord:()=>Xh,ZodSet:()=>V1,ZodString:()=>Df,ZodStringFormat:()=>rt,ZodSuccess:()=>ej,ZodSymbol:()=>b1,ZodTemplateLiteral:()=>sj,ZodTransform:()=>z1,ZodTuple:()=>$1,ZodType:()=>Ce,ZodULID:()=>rO,ZodURL:()=>Yh,ZodUUID:()=>es,ZodUndefined:()=>N1,ZodUnion:()=>Jh,ZodUnknown:()=>P1,ZodVoid:()=>M1,ZodXID:()=>oO,ZodXor:()=>w1,_ZodString:()=>JN,_default:()=>Z1,_function:()=>Dpe,any:()=>fpe,array:()=>Kh,base64:()=>Zde,base64url:()=>Jde,bigint:()=>cpe,boolean:()=>I1,catch:()=>nj,check:()=>kpe,cidrv4:()=>Wde,cidrv6:()=>Kde,clone:()=>ur,codec:()=>Mpe,coerce:()=>mj,config:()=>Lt,core:()=>zs,cuid:()=>Gde,cuid2:()=>jde,custom:()=>Upe,date:()=>_pe,decode:()=>m1,decodeAsync:()=>g1,describe:()=>$pe,discriminatedUnion:()=>Ape,e164:()=>Xde,email:()=>Pde,emoji:()=>$de,encode:()=>f1,encodeAsync:()=>_1,endsWith:()=>If,enum:()=>hO,exactOptional:()=>Y1,file:()=>Cpe,flattenError:()=>bh,float32:()=>ope,float64:()=>ipe,formatError:()=>Nh,fromJSONSchema:()=>qpe,function:()=>Dpe,getErrorMap:()=>tVe,globalRegistry:()=>bn,gt:()=>Xi,gte:()=>lr,guid:()=>xde,hash:()=>rpe,hex:()=>npe,hostname:()=>tpe,httpUrl:()=>Ude,includes:()=>yf,instanceof:()=>Gpe,int:()=>ZN,int32:()=>spe,int64:()=>upe,intersection:()=>U1,ipv4:()=>zde,ipv6:()=>Yde,iso:()=>Lf,json:()=>Vpe,jwt:()=>Qde,keyof:()=>gpe,ksuid:()=>Hde,lazy:()=>cj,length:()=>hl,literal:()=>Ope,locales:()=>wh,looseObject:()=>Tpe,looseRecord:()=>Rpe,lowercase:()=>Sf,lt:()=>Ji,lte:()=>Yr,mac:()=>qde,map:()=>Ipe,maxLength:()=>gl,maxSize:()=>gc,meta:()=>Bpe,mime:()=>bf,minLength:()=>Hs,minSize:()=>Qi,multipleOf:()=>_c,nan:()=>xpe,nanoid:()=>Bde,nativeEnum:()=>Npe,negative:()=>wN,never:()=>_O,nonnegative:()=>kN,nonoptional:()=>Q1,nonpositive:()=>DN,normalize:()=>Nf,null:()=>C1,nullable:()=>zh,nullish:()=>vpe,number:()=>R1,object:()=>hpe,optional:()=>Hh,overwrite:()=>Qo,parse:()=>u1,parseAsync:()=>l1,partialRecord:()=>ype,pipe:()=>qh,positive:()=>LN,prefault:()=>X1,preprocess:()=>Fpe,prettifyError:()=>EU,promise:()=>wpe,property:()=>UN,readonly:()=>ij,record:()=>G1,refine:()=>dj,regex:()=>Tf,regexes:()=>No,registry:()=>pN,safeDecode:()=>E1,safeDecodeAsync:()=>S1,safeEncode:()=>h1,safeEncodeAsync:()=>T1,safeParse:()=>d1,safeParseAsync:()=>p1,set:()=>bpe,setErrorMap:()=>eVe,size:()=>_l,slugify:()=>Pf,startsWith:()=>Rf,strictObject:()=>Epe,string:()=>KN,stringFormat:()=>epe,stringbool:()=>jpe,success:()=>Ppe,superRefine:()=>pj,symbol:()=>dpe,templateLiteral:()=>Lpe,toJSONSchema:()=>jN,toLowerCase:()=>Cf,toUpperCase:()=>vf,transform:()=>EO,treeifyError:()=>hU,trim:()=>Of,tuple:()=>B1,uint32:()=>ape,uint64:()=>lpe,ulid:()=>Vde,undefined:()=>ppe,union:()=>gO,unknown:()=>El,uppercase:()=>Af,url:()=>kde,util:()=>Y,uuid:()=>Mde,uuidv4:()=>Lde,uuidv6:()=>wde,uuidv7:()=>Dde,void:()=>mpe,xid:()=>Fde,xor:()=>Spe});var _j=I(()=>{l();Cr();Vh();HN();c1();A1();Hpe();Cr();vB();Cr();Bh();Ype();MB();Gh();Gh();Wpe();Lt(cN())});var Kpe=I(()=>{l();_j();_j()});function ze(){return eE}async function hj(e){let t=(0,Zpe.join)(e,".lore.json");if((0,RO.existsSync)(t)){let n=JSON.parse((0,RO.readFileSync)(t,"utf8"));return eE=gj.parse(n),eE}return eE=gj.parse({}),eE}var RO,Zpe,gj,eE,Sl=I(()=>{"use strict";l();Kpe();RO=require("node:fs"),Zpe=require("node:path"),gj=Te.object({model:Te.object({providerID:Te.string(),modelID:Te.string()}).optional(),workerModel:Te.object({providerID:Te.string(),modelID:Te.string()}).optional(),budget:Te.object({distilled:Te.number().min(.05).max(.5).default(.25),raw:Te.number().min(.1).max(.7).default(.4),output:Te.number().min(.1).max(.5).default(.25),ltm:Te.number().min(.02).max(.3).default(.05),targetCacheReadCostPerTurn:Te.number().min(0).default(.1),maxLayer0Tokens:Te.number().min(0).optional()}).default({distilled:.25,raw:.4,output:.25,ltm:.05,targetCacheReadCostPerTurn:.1}),idleResumeMinutes:Te.number().min(0).max(1440).default(5),distillation:Te.object({minMessages:Te.number().min(3).default(5),maxSegment:Te.number().min(5).default(30),metaThreshold:Te.number().min(3).default(10),toolOutputMaxChars:Te.number().min(0).default(2e3)}).default({minMessages:5,maxSegment:30,metaThreshold:10,toolOutputMaxChars:2e3}),knowledge:Te.object({enabled:Te.boolean().default(!0)}).default({enabled:!0}),curator:Te.object({enabled:Te.boolean().default(!0),onIdle:Te.boolean().default(!0),afterTurns:Te.number().min(1).default(3),maxEntries:Te.number().min(10).default(25)}).default({enabled:!0,onIdle:!0,afterTurns:3,maxEntries:25}),pruning:Te.object({retention:Te.number().min(1).default(120),maxStorage:Te.number().min(50).default(1024)}).default({retention:120,maxStorage:1024}),search:Te.object({ftsWeights:Te.object({title:Te.number().min(0).default(6),content:Te.number().min(0).default(2),category:Te.number().min(0).default(3)}).default({title:6,content:2,category:3}),recallLimit:Te.number().min(1).max(50).default(10),queryExpansion:Te.boolean().default(!1),embeddings:Te.object({enabled:Te.boolean().default(!0),provider:Te.enum(["local","voyage","openai"]).default("local"),model:Te.string().default("BGESmallENV15"),dimensions:Te.number().min(64).max(2048).default(384)}).default({enabled:!0,provider:"local",model:"BGESmallENV15",dimensions:384})}).default({ftsWeights:{title:6,content:2,category:3},recallLimit:10,queryExpansion:!1,embeddings:{enabled:!0,provider:"local",model:"BGESmallENV15",dimensions:384}}),crossProject:Te.boolean().default(!1),agentsFile:Te.object({enabled:Te.boolean().default(!0),path:Te.string().default("AGENTS.md")}).default({enabled:!0,path:"AGENTS.md"})}),eE=gj.parse({})});function Jpe(e){let t=pVe[e];return t?process.env[t]:void 0}function Qpe(){if(ei!==void 0)return ei;let e=ze().search.embeddings;if(e.enabled===!1)return ei=null,null;let t=e.provider,n=e.model;switch(t){case"local":{try{ei=new Sj(n)}catch{Fe("local embedding provider unavailable (fastembed not installed)"),ei=null}break}case"voyage":{let o=Jpe(t);if(!o)return ei=null,null;ei=new Ej(o,n,e.dimensions);break}case"openai":{let o=Jpe(t);if(!o)return ei=null,null;ei=new Tj(o,n,e.dimensions);break}default:Fe(`unknown embedding provider: ${t}`),ei=null}return ei}function Sc(){return Qpe()!==null}async function IO(e,t){let n=Qpe();if(!n)throw new Error("No embedding provider available");return n.embed(e,t)}function efe(e,t){let n=Math.min(e.length,t.length),o=0,r=0,i=0;for(let a=0;a<n;a++)o+=e[a]*t[a],r+=e[a]*e[a],i+=t[a]*t[a];let s=Math.sqrt(r)*Math.sqrt(i);return s===0?0:o/s}function tfe(e){return Buffer.from(e.buffer,e.byteOffset,e.byteLength)}function nfe(e){let t=new Uint8Array(e);return new Float32Array(t.buffer,t.byteOffset,t.byteLength/4)}function rfe(e,t=10){let n=j().query("SELECT id, embedding FROM knowledge WHERE embedding IS NOT NULL AND confidence > 0.2").all(),o=[];for(let r of n){let i=nfe(r.embedding),s=efe(e,i);o.push({id:r.id,similarity:s})}return o.sort((r,i)=>i.similarity-r.similarity),o.slice(0,t)}function ofe(e,t=10){let n=j().query("SELECT id, embedding FROM distillations WHERE embedding IS NOT NULL AND archived = 0").all(),o=[];for(let r of n){let i=nfe(r.embedding),s=efe(e,i);o.push({id:r.id,similarity:s})}return o.sort((r,i)=>i.similarity-r.similarity),o.slice(0,t)}function Aj(e,t,n){let o=`${t}
800
+ ${n}`;IO([o],"document").then(([r])=>{j().query("UPDATE knowledge SET embedding = ? WHERE id = ?").run(tfe(r),e)}).catch(r=>{Fe("embedding failed for knowledge entry",e,":",r)})}function yj(e,t){IO([t],"document").then(([n])=>{j().query("UPDATE distillations SET embedding = ? WHERE id = ?").run(tfe(n),e)}).catch(n=>{Fe("embedding failed for distillation",e,":",n)})}var Xpe,lVe,Ej,dVe,Tj,Sj,pVe,ei,tE=I(()=>{"use strict";l();Ki();Sl();Zi();Xpe=1e4,lVe="https://api.voyageai.com/v1/embeddings",Ej=class{maxBatchSize=128;apiKey;model;dimensions;constructor(t,n,o){this.apiKey=t,this.model=n,this.dimensions=o}async embed(t,n){let o=await fetch(lVe,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({input:t,model:this.model,input_type:n,output_dimension:this.dimensions}),signal:AbortSignal.timeout(Xpe)});if(!o.ok){let s=await o.text().catch(()=>"");throw new Error(`Voyage API ${o.status}: ${s}`)}return[...(await o.json()).data].sort((s,a)=>s.index-a.index).map(s=>new Float32Array(s.embedding))}},dVe="https://api.openai.com/v1/embeddings",Tj=class{maxBatchSize=2048;apiKey;model;dimensions;constructor(t,n,o){this.apiKey=t,this.model=n,this.dimensions=o}async embed(t,n){let o={input:t,model:this.model};this.model.startsWith("text-embedding-3")&&(o.dimensions=this.dimensions);let r=await fetch(dVe,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(o),signal:AbortSignal.timeout(Xpe)});if(!r.ok){let a=await r.text().catch(()=>"");throw new Error(`OpenAI API ${r.status}: ${a}`)}return[...(await r.json()).data].sort((a,c)=>a.index-c.index).map(a=>new Float32Array(a.embedding))}},Sj=class{maxBatchSize=256;model=null;initPromise=null;modelName;constructor(t){this.modelName=t}async getModel(){return this.model?this.model:(this.initPromise||(this.initPromise=(async()=>{let{EmbeddingModel:t,FlagEmbedding:n}=await import("fastembed"),o=t[this.modelName],r=await n.init({model:o??this.modelName});return this.model=r,r})()),this.initPromise)}async embed(t,n){let o=await this.getModel();if(n==="query"&&t.length===1){let i=await o.queryEmbed(t[0]);return[new Float32Array(i)]}let r=[];for await(let i of o.passageEmbed(t))for(let s of i)r.push(new Float32Array(s));return r}},pVe={voyage:"VOYAGE_API_KEY",openai:"OPENAI_API_KEY"}});var jf={};ft(jf,{count:()=>TVe,hasLatDir:()=>Gf,parseSections:()=>ife,refresh:()=>EVe,scoreForSession:()=>Ij,searchScored:()=>Rj});function mVe(e){return Math.ceil(e.length/3)}function _Ve(e){return e.children.filter(t=>t.type==="text").map(t=>t.value).join("")}function gVe(e){let t=[];for(let n of e.children)if(n.type==="text")t.push(n.value);else if(n.type==="inlineCode")t.push("`"+n.value+"`");else if("children"in n)for(let o of n.children)"value"in o&&typeof o.value=="string"&&t.push(o.value);return t.join("")}function ife(e,t,n){let o=fVe.parse(t),r=(0,Al.relative)(n,e).replace(/\.md$/,""),i=t.split(`
801
+ `),s=[];for(let u of o.children)u.type==="heading"&&u.position&&s.push({node:u,text:_Ve(u),line:u.position.start.line,depth:u.depth});if(!s.length)return[];let a=[],c=[];for(let u=0;u<s.length;u++){let{text:d,depth:p,line:f}=s[u];for(;a.length>0&&a[a.length-1].depth>=p;)a.pop();let m=a.length>0?a[a.length-1]:null,_=m?`${m.id}#${d}`:`${r}#${d}`;a.push({id:_,depth:p});let h=f,E=u+1<s.length?s[u+1].line-1:i.length,R=i.slice(h,E).join(`
802
+ `).trim(),C=null;for(let P of o.children)if(P.position&&!(P.position.start.line<=h)){if(u+1<s.length&&P.position.start.line>=s[u+1].line)break;if(P.type==="paragraph"){let M=gVe(P);C=M.length>250?M.slice(0,250):M;break}}c.push({id:_,file:r,heading:d,depth:p,content:R,first_paragraph:C})}return c}function sfe(e){let t=[];try{let n=(0,ts.readdirSync)(e,{withFileTypes:!0});for(let o of n){let r=(0,Al.join)(e,o.name);o.isDirectory()&&!o.name.startsWith(".")?t.push(...sfe(r)):o.isFile()&&o.name.endsWith(".md")&&t.push(r)}}catch{}return t.sort()}function hVe(e){return zI(e)}function Gf(e){let t=(0,Al.join)(e,"lat.md");return(0,ts.existsSync)(t)&&(0,ts.statSync)(t).isDirectory()}function EVe(e){let t=(0,Al.join)(e,"lat.md");if(!(0,ts.existsSync)(t)||!(0,ts.statSync)(t).isDirectory())return 0;let n=De(e),o=sfe(t),r=0,i=new Set,s=j().query(`INSERT OR REPLACE INTO lat_sections (id, project_id, file, heading, depth, content, content_hash, first_paragraph, updated_at)
803
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let u of o){let d;try{d=(0,ts.readFileSync)(u,"utf-8")}catch{continue}let p=(0,Al.relative)(e,u);i.add(p);let f=hVe(d),m=j().query("SELECT content_hash FROM lat_sections WHERE project_id = ? AND file = ? LIMIT 1").get(n,p.replace(/\.md$/,""));if(m&&m.content_hash===f)continue;j().query("DELETE FROM lat_sections WHERE project_id = ? AND file = ?").run(n,p.replace(/\.md$/,""));let _=ife(u,d,e),h=Date.now();for(let E of _)s.run(E.id,n,E.file,E.heading,E.depth,E.content,f,E.first_paragraph,h),r++}let a=new Set([...i].map(u=>u.replace(/\.md$/,""))),c=j().query("SELECT DISTINCT file FROM lat_sections WHERE project_id = ?").all(n);for(let u of c)a.has(u.file)||(j().query("DELETE FROM lat_sections WHERE project_id = ? AND file = ?").run(n,u.file),Fe(`lat-reader: removed sections for deleted file ${u.file}`));return r>0&&Fe(`lat-reader: indexed ${r} sections from ${o.length} files`),r}function Rj(e){let t=e.limit??10,n=Ir(e.query);if(n===It)return[];let o=De(e.projectPath),r=`SELECT s.id, s.project_id, s.file, s.heading, s.depth, s.content,
804
+ s.content_hash, s.first_paragraph, s.updated_at,
805
+ bm25(lat_sections_fts, 6.0, 2.0) as rank
806
+ FROM lat_sections_fts f
807
+ CROSS JOIN lat_sections s ON s.rowid = f.rowid
808
+ WHERE lat_sections_fts MATCH ?
809
+ AND s.project_id = ?
810
+ ORDER BY rank LIMIT ?`;try{let i=j().query(r).all(n,o,t);if(i.length)return i;let s=Io(e.query);return s===It?[]:j().query(r).all(s,o,t)}catch{return[]}}function Ij(e,t,n){if(!Gf(e))return[];let o=De(e),r=mh(t);if(!r.length)return[];let i=r.map(d=>`${d}*`).join(" OR "),s;try{s=j().query(`SELECT s.id, s.project_id, s.file, s.heading, s.depth, s.content,
811
+ s.content_hash, s.first_paragraph, s.updated_at,
812
+ bm25(lat_sections_fts, 6.0, 2.0) as rank
813
+ FROM lat_sections_fts f
814
+ CROSS JOIN lat_sections s ON s.rowid = f.rowid
815
+ WHERE lat_sections_fts MATCH ?
816
+ AND s.project_id = ?
817
+ ORDER BY rank`).all(i,o)}catch{return[]}if(!s.length)return[];let c=10,u=[];for(let d of s){if(c>=n)break;let p=mVe(d.heading+(d.first_paragraph??d.content))+5;c+p>n||(u.push(d),c+=p)}return u}function TVe(e){let t=De(e);return j().query("SELECT COUNT(*) as cnt FROM lat_sections WHERE project_id = ?").get(t).cnt}var ts,Al,fVe,NO=I(()=>{"use strict";l();ts=require("fs"),Al=require("path");j0();Ki();qI();af();Zi();fVe=Nb()});var Wr={};ft(Wr,{all:()=>RVe,cascadeRefReplace:()=>OVe,check:()=>vVe,cleanDeadRefs:()=>CVe,create:()=>Rl,extractRefs:()=>pfe,forProject:()=>Il,forSession:()=>yVe,get:()=>Oo,pruneOversized:()=>bVe,remove:()=>OO,resolveRef:()=>dfe,search:()=>lfe,searchScored:()=>bj,searchScoredOtherProjects:()=>Nj,syncRefs:()=>Oj,update:()=>yl});function afe(e){return Math.ceil(e.length/3)}function Rl(e){let t=e.scope==="project"&&e.projectPath?De(e.projectPath):null;if(!e.id){let r=t!==null?j().query("SELECT id FROM knowledge WHERE project_id = ? AND LOWER(title) = LOWER(?) AND confidence > 0 LIMIT 1").get(t,e.title):j().query("SELECT id FROM knowledge WHERE project_id IS NULL AND LOWER(title) = LOWER(?) AND confidence > 0 LIMIT 1").get(e.title);if(r)return yl(r.id,{content:e.content}),r.id;let i=j().query("SELECT id FROM knowledge WHERE cross_project = 1 AND LOWER(title) = LOWER(?) AND confidence > 0 LIMIT 1").get(e.title);if(i)return yl(i.id,{content:e.content}),i.id}let n=e.id??sue(),o=Date.now();return j().query(`INSERT INTO knowledge (id, project_id, category, title, content, source_session, cross_project, confidence, created_at, updated_at)
818
+ VALUES (?, ?, ?, ?, ?, ?, ?, 1.0, ?, ?)`).run(n,t,e.category,e.title,e.content,e.session??null,e.crossProject??!1?1:0,o,o),Sc()&&Aj(n,e.title,e.content),n}function yl(e,t){let n=[],o=[];if(t.content!==void 0&&(n.push("content = ?"),o.push(t.content)),t.confidence!==void 0&&(n.push("confidence = ?"),o.push(t.confidence)),n.push("updated_at = ?"),o.push(Date.now()),o.push(e),j().query(`UPDATE knowledge SET ${n.join(", ")} WHERE id = ?`).run(...o),Sc()&&t.content!==void 0){let r=Oo(e);r&&Aj(e,r.title,t.content)}}function OO(e){j().query("DELETE FROM knowledge WHERE id = ?").run(e)}function Il(e,t=!0){let n=De(e);return t?j().query(`SELECT ${Ac} FROM knowledge
819
+ WHERE (project_id = ? OR (project_id IS NULL) OR (cross_project = 1))
820
+ AND confidence > 0.2
821
+ ORDER BY confidence DESC, updated_at DESC`).all(n):j().query(`SELECT ${Ac} FROM knowledge
822
+ WHERE project_id = ?
823
+ AND confidence > 0.2
824
+ ORDER BY confidence DESC, updated_at DESC`).all(n)}function CO(){return ze().search.ftsWeights}function AVe(e){let t=mh(e);if(!t.length)return new Map;let n=t.map(s=>`${s}*`).join(" OR "),{title:o,content:r,category:i}=CO();try{let s=j().query(`SELECT k.id, bm25(knowledge_fts, ?, ?, ?) as rank
825
+ FROM knowledge_fts f
826
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
827
+ WHERE knowledge_fts MATCH ?
828
+ AND k.confidence > 0.2`).all(o,r,i,n);if(!s.length)return new Map;let a=s.map(p=>p.rank),c=Math.min(...a),u=Math.max(...a),d=new Map;for(let p of s){let f=c===u?1:(u-p.rank)/(u-c);d.set(p.id,f)}return d}catch{return new Map}}function yVe(e,t,n){let o=De(e),r=j().query(`SELECT ${Ac} FROM knowledge
829
+ WHERE project_id = ? AND cross_project = 0 AND confidence > 0.2
830
+ ORDER BY confidence DESC, updated_at DESC`).all(o),i=j().query(`SELECT ${Ac} FROM knowledge
831
+ WHERE (project_id IS NULL OR cross_project = 1) AND confidence > 0.2
832
+ ORDER BY confidence DESC, updated_at DESC`).all();if(!i.length&&!r.length)return[];let s="";if(t){let m=j().query(`SELECT observations FROM distillations
833
+ WHERE project_id = ? AND session_id = ?
834
+ ORDER BY created_at DESC LIMIT 1`).get(o,t);m?.observations&&(s+=m.observations+`
835
+ `);let _=j().query(`SELECT content FROM temporal_messages
836
+ WHERE project_id = ? AND session_id = ?
837
+ ORDER BY created_at DESC LIMIT 10`).all(o,t);_.length&&(s+=_.map(h=>h.content).join(`
838
+ `))}let a,c;if(s.trim().length>20){let m=AVe(s),h=r.map(R=>({entry:R,score:(m.get(R.id)??0)*R.confidence})).filter(R=>R.score>0),E=new Set(h.map(R=>R.entry.id)),T=r.filter(R=>!E.has(R.id)).slice(0,SVe).map(R=>({entry:R,score:.001*R.confidence}));a=[...h,...T],c=i.filter(R=>m.has(R.id)).map(R=>({entry:R,score:(m.get(R.id)??0)*R.confidence}))}else a=r.slice(0,cfe).map(m=>({entry:m,score:m.confidence})),c=i.slice(0,cfe).map(m=>({entry:m,score:m.confidence}));let u=[...a,...c];u.sort((m,_)=>_.score-m.score);let p=15,f=[];for(let{entry:m}of u){if(p>=n)break;let _=afe(m.title+m.content)+10;p+_>n||(f.push(m),p+=_)}if(Gf(e)&&p<n){let m=Ij(e,s,n-p);for(let _ of m){if(p>=n)break;let h=_.first_paragraph??_.content,E=afe(_.heading+h)+10;p+E>n||(f.push({id:_.id,project_id:_.project_id,category:"lat.md",title:`[${_.file}] ${_.heading}`,content:h,source_session:null,cross_project:0,confidence:1,created_at:_.updated_at,updated_at:_.updated_at,metadata:null}),p+=E)}}return f}function RVe(){return j().query(`SELECT ${Ac} FROM knowledge WHERE confidence > 0.2 ORDER BY confidence DESC, updated_at DESC`).all()}function IVe(e){let t=e.query.toLowerCase().split(/\s+/).filter(r=>r.length>2);if(!t.length)return[];let n=t.map(()=>"(LOWER(title) LIKE ? OR LOWER(content) LIKE ?)").join(" AND "),o=t.flatMap(r=>[`%${r}%`,`%${r}%`]);if(e.projectPath){let r=De(e.projectPath);return j().query(`SELECT ${Ac} FROM knowledge WHERE (project_id = ? OR project_id IS NULL OR cross_project = 1) AND confidence > 0.2 AND ${n} ORDER BY updated_at DESC LIMIT ?`).all(r,...o,e.limit)}return j().query(`SELECT ${Ac} FROM knowledge WHERE confidence > 0.2 AND ${n} ORDER BY updated_at DESC LIMIT ?`).all(...o,e.limit)}function lfe(e){let t=e.limit??20,n=Ir(e.query);if(n===It)return[];let o=e.projectPath?De(e.projectPath):null,r=o?`SELECT ${nE} FROM knowledge_fts f
839
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
840
+ WHERE knowledge_fts MATCH ?
841
+ AND (k.project_id = ? OR k.project_id IS NULL OR k.cross_project = 1)
842
+ AND k.confidence > 0.2
843
+ ORDER BY bm25(knowledge_fts, ?, ?, ?) LIMIT ?`:`SELECT ${nE} FROM knowledge_fts f
844
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
845
+ WHERE knowledge_fts MATCH ?
846
+ AND k.confidence > 0.2
847
+ ORDER BY bm25(knowledge_fts, ?, ?, ?) LIMIT ?`,{title:i,content:s,category:a}=CO(),c=o?[n,o,i,s,a,t]:[n,i,s,a,t];try{let u=j().query(r).all(...c);if(u.length)return u;let d=Io(e.query);if(d===It)return[];let p=o?[d,o,i,s,a,t]:[d,i,s,a,t];return j().query(r).all(...p)}catch{return IVe({query:e.query,projectPath:e.projectPath,limit:t})}}function bj(e){let t=e.limit??20,n=Ir(e.query);if(n===It)return[];let o=e.projectPath?De(e.projectPath):null,{title:r,content:i,category:s}=CO(),a=o?`SELECT ${nE}, bm25(knowledge_fts, ?, ?, ?) as rank FROM knowledge_fts f
848
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
849
+ WHERE knowledge_fts MATCH ?
850
+ AND (k.project_id = ? OR k.project_id IS NULL OR k.cross_project = 1)
851
+ AND k.confidence > 0.2
852
+ ORDER BY rank LIMIT ?`:`SELECT ${nE}, bm25(knowledge_fts, ?, ?, ?) as rank FROM knowledge_fts f
853
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
854
+ WHERE knowledge_fts MATCH ?
855
+ AND k.confidence > 0.2
856
+ ORDER BY rank LIMIT ?`,c=o?[r,i,s,n,o,t]:[r,i,s,n,t];try{let u=j().query(a).all(...c);if(u.length)return u;let d=Io(e.query);if(d===It)return[];let p=o?[r,i,s,d,o,t]:[r,i,s,d,t];return j().query(a).all(...p)}catch{return[]}}function Nj(e){let t=e.limit??10,n=Ir(e.query);if(n===It)return[];let o=De(e.excludeProjectPath),{title:r,content:i,category:s}=CO(),a=`SELECT ${nE}, bm25(knowledge_fts, ?, ?, ?) as rank FROM knowledge_fts f
857
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
858
+ WHERE knowledge_fts MATCH ?
859
+ AND k.project_id IS NOT NULL
860
+ AND k.project_id != ?
861
+ AND k.cross_project = 0
862
+ AND k.confidence > 0.2
863
+ ORDER BY rank LIMIT ?`,c=[r,i,s,n,o,t];try{let u=j().query(a).all(...c);if(u.length)return u;let d=Io(e.query);if(d===It)return[];let p=[r,i,s,d,o,t];return j().query(a).all(...p)}catch{return[]}}function Oo(e){return j().query(`SELECT ${Ac} FROM knowledge WHERE id = ?`).get(e)}function bVe(e){let t=j().query("UPDATE knowledge SET confidence = 0, updated_at = ? WHERE LENGTH(content) > ? AND confidence > 0").run(Date.now(),e);return Number(t.changes)}function dfe(e){if(NVe.test(e)){let n=Oo(e);return n?n.id:null}let t=lfe({query:e,limit:1});return t.length?t[0].id:null}function pfe(e){let t=[],n,o=new RegExp(ufe.source,ufe.flags);for(;(n=o.exec(e))!==null;)t.push(n[1]);return t}function Oj(e){let t=Oo(e);if(!t)return 0;j().query("DELETE FROM knowledge_refs WHERE from_id = ?").run(e);let n=pfe(t.content);if(!n.length)return 0;let o=0,r=j().query("INSERT OR IGNORE INTO knowledge_refs (from_id, to_id) VALUES (?, ?)");for(let i of n){let s=dfe(i);s&&s!==e&&(r.run(e,s),o++)}return o}function OVe(e,t){let n=`[[${e}]]`,o=`[[${t}]]`,r=j().query(`UPDATE knowledge SET content = REPLACE(content, ?, ?), updated_at = ?
864
+ WHERE content LIKE ?`).run(n,o,Date.now(),`%${n}%`);return j().query("UPDATE OR IGNORE knowledge_refs SET to_id = ? WHERE to_id = ?").run(t,e),j().query("UPDATE OR IGNORE knowledge_refs SET from_id = ? WHERE from_id = ?").run(t,e),j().query("DELETE FROM knowledge_refs WHERE from_id = to_id").run(),Number(r.changes)}function CVe(){let e=j().query(`SELECT DISTINCT kr.from_id, kr.to_id FROM knowledge_refs kr
865
+ WHERE NOT EXISTS (SELECT 1 FROM knowledge k WHERE k.id = kr.to_id)`).all();if(!e.length)return 0;let t=Date.now(),n=0;for(let o of e){let r=`[[${o.to_id}]]`;j().query(`UPDATE knowledge SET content = REPLACE(content, ?, ''), updated_at = ?
866
+ WHERE id = ? AND content LIKE ?`).run(r,t,o.from_id,`%${r}%`).changes>0&&n++}return j().query("DELETE FROM knowledge_refs WHERE to_id NOT IN (SELECT id FROM knowledge)").run(),n>0&&Fe(`cleaned ${n} entries with dead [[ref]] links`),n}function vVe(e){let t=Il(e,!1),n=[];for(let r of t)r.content.length>1200&&n.push({entryId:r.id,type:"oversized",description:`Content is ${r.content.length} chars (max 1200)`,suggestion:"Trim or split into multiple entries"});for(let r of t)r.content.trim().length<10&&n.push({entryId:r.id,type:"empty",description:`Content is empty or near-empty (${r.content.trim().length} chars)`,suggestion:"Delete or add meaningful content"});let o=new Set;for(let r of t){if(o.has(r.id))continue;let i=Ir(r.title);if(i!==It){try{let{title:s,content:a,category:c}=ze().search.ftsWeights,u=j().query(`SELECT k.id, k.title FROM knowledge_fts f
867
+ CROSS JOIN knowledge k ON k.rowid = f.rowid
868
+ WHERE knowledge_fts MATCH ?
869
+ AND k.id != ?
870
+ AND k.confidence > 0.2
871
+ ORDER BY bm25(knowledge_fts, ?, ?, ?) LIMIT 3`).all(i,r.id,s,a,c);for(let d of u){if(o.has(d.id))continue;let p=r.title.toLowerCase(),f=d.title.toLowerCase(),m=new Set(p.split(/\s+/)),_=new Set(f.split(/\s+/));[...m].filter(T=>_.has(T)).length/Math.min(m.size,_.size)>=.7&&(n.push({entryId:r.id,type:"duplicate",description:`Possibly duplicates "${d.title}" (${d.id.slice(0,8)}...)`,suggestion:`Merge with ${d.id}`}),o.add(d.id))}}catch{}o.add(r.id)}}return n}var Ac,nE,cfe,SVe,NVe,ufe,Vf=I(()=>{"use strict";l();aue();Ki();Sl();af();tE();NO();Zi();Ac="id, project_id, category, title, content, source_session, cross_project, confidence, created_at, updated_at, metadata",nE="k.id, k.project_id, k.category, k.title, k.content, k.source_session, k.cross_project, k.confidence, k.created_at, k.updated_at, k.metadata";cfe=10,SVe=5;NVe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,ufe=/\[\[([^\]]+)\]\]/g});function Cj(e){let t=[],n=new Set;for(let{regex:o,category:r,titleFn:i}of PVe){o.lastIndex=0;let s;for(;(s=o.exec(e))!==null;){let a=i(s),c=a.toLowerCase();n.has(c)||(n.add(c),t.push({category:r,title:a,content:s[0].trim()}))}}return t}var PVe,vj=I(()=>{"use strict";l();PVe=[{regex:/decided to (?:use |switch to |go with |adopt )(.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Decided to use ${e[1].trim()}`},{regex:/chose (.+?) over (.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Chose ${e[1].trim()} over ${e[2].trim()}`},{regex:/switched from (.+?) to (.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Switched from ${e[1].trim()} to ${e[2].trim()}`},{regex:/going with (.+?) (?:because|for|due to)(.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Going with ${e[1].trim()}`},{regex:/migrat(?:ed|ing) (?:from .+? )?to (.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Migrated to ${e[1].trim()}`},{regex:/adopted (.+?) (?:for|as|instead)(.+?)(?:\.|,|$)/gi,category:"decision",titleFn:e=>`Adopted ${e[1].trim()}`},{regex:/prefers? (.+?) (?:over|to|instead of|rather than) (.+?)(?:\.|,|$)/gi,category:"preference",titleFn:e=>`Prefers ${e[1].trim()} over ${e[2].trim()}`},{regex:/(?:user |team |we )(?:always |usually |typically )(?:use|prefer|go with) (.+?)(?:\.|,|$)/gi,category:"preference",titleFn:e=>`Typically uses ${e[1].trim()}`}]});function vO(e){return Math.ceil(e.length/3)}function LVe(e){let t=0;for(let n of e)uc(n)||_h(n)&&n.text?t+=vO(n.text):cr(n)&&n.state.status==="completed"?t+=vO(n.state.output)+vO(n.tool)+50:t+=20;return t}function Co(e){return LVe(e.parts)+20}function Tfe(){return{lastKnownInput:0,lastKnownLtm:0,lastKnownMessageCount:0,lastTransformedCount:0,lastLayer:0,lastWindowMessageIDs:new Set,forceMinLayer:0,lastTransformEstimate:0,ltmTokens:0,prefixCache:null,rawWindowCache:null,lastTurnAt:0,cameOutOfIdle:!1,postIdleCompact:!1,consecutiveHighLayer:0,distillationSnapshot:null}}function Ff(e){let t=wO.get(e);return t||(t=Tfe(),t.forceMinLayer=vk(e),wO.set(e,t)),t}function Lj(e,t,n=Date.now()){if(t<=0)return{triggered:!1};let o=Ff(e);if(o.lastTurnAt===0)return{triggered:!1};let r=n-o.lastTurnAt;return r<t?{triggered:!1}:(o.prefixCache=null,o.rawWindowCache=null,o.distillationSnapshot=null,o.cameOutOfIdle=!0,o.postIdleCompact=!0,{triggered:!0,idleMs:r})}function DO(e){let t=wO.get(e);return!t||!t.cameOutOfIdle?!1:(t.cameOutOfIdle=!1,!0)}function wj(e){xO=e.context||2e5,MO=Math.min(e.output||32e3,32e3)}function kO(e){LO=Math.max(0,Math.floor(e))}function Dj(e,t){if(e<=0||t<=0)return 0;let n=Math.floor(e/t);return Math.max(n,wVe)}function bl(e,t){t&&(Ff(t).ltmTokens=e),Sfe=e}function kj(e){let t=rE??Efe,n=Math.max(0,xO-MO-t);return Math.floor(n*e)}function Uj(e,t,n){let o=t?Ff(t).lastTransformEstimate:0;if(o>0||e===0){let r=Math.max(0,e-o);rE=rE===null?r:Math.round(rE*.7+r*.3)}if(t!==void 0){let r=Ff(t);r.lastKnownInput=e,r.lastKnownLtm=r.ltmTokens,n!==void 0&&(r.lastKnownMessageCount=n)}}function DVe(){return rE??Efe}function $j(e){return wO.get(e)?.lastTransformedCount??0}function kVe(e,t){let n=De(e),o=t?"SELECT id, observations, generation, token_count, created_at, session_id FROM distillations WHERE project_id = ? AND session_id = ? AND archived = 0 ORDER BY created_at ASC":"SELECT id, observations, generation, token_count, created_at, session_id FROM distillations WHERE project_id = ? AND archived = 0 ORDER BY created_at ASC",r=t?[n,t]:[n];return j().query(o).all(...r)}function UVe(e,t,n,o){let r=null;for(let a=n.length-1;a>=0;a--)if(n[a].info.role==="user"){r=n[a].info.id;break}let i=o.distillationSnapshot;if(i&&i.lastUserMsgId===r)return i.rows;let s=kVe(e,t);return o.distillationSnapshot={rows:s,lastUserMsgId:r},Fe(`distillation refresh: ${s.length} rows (user msg ${r?.substring(0,16)??"none"})`),s}function $Ve(e){return e.replace(/<system-reminder>[\s\S]*?<\/system-reminder>\n?/g,t=>{let n=t.match(/The user sent the following message:\n([\s\S]*?)\n\nPlease address/);return n?n[1].trim()+`
872
+ `:""}).replace(/\n{3,}/g,`
873
+
874
+ `).trim()}function iE(e){let n=e.map(o=>{if(!uc(o))return o;let r=$Ve(o.text);return r===o.text?o:{...o,text:r}}).filter(o=>!uc(o)||o.text.trim().length>0);if(n.length===0&&e.length>0){let o=e[0];if(uc(o))return[{...o,text:"..."}]}return n.length>0?n:e}function UO(e,t){let n=t.split(`
875
+ `).length,o=/\b(?:error|fail(?:ed|ure)?|exception|panic|traceback)\b/i.test(t),r=[];if(t.indexOf("/")!==-1){let a=(t.length>ffe?t.slice(0,ffe):t).match(BVe);a&&(r=[...new Set(a)].slice(0,5))}let i=`[output omitted \u2014 ${e}: ${n} lines`;return o&&(i+=", contained errors"),r.length>0&&(i+=`, paths: ${r.join(", ")}`),i+=" \u2014 use recall for details]",i}function _fe(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=t*16777619>>>0;return t}function gfe(e){try{let t=JSON.parse(e),n=t.path||t.filePath||t.file;if(!n)return;let o=typeof t.offset=="number"?t.offset:void 0,r=typeof t.limit=="number"?t.limit:void 0;return{path:n,offset:o,limit:r}}catch{let t=e.match(/(?:[\w.-]+\/)+[\w.-]+\.\w{1,5}/);return t?{path:t[0],offset:void 0,limit:void 0}:void 0}}function GVe(e,t){if(e.path!==t.path)return!1;if(e.offset===void 0&&e.limit===void 0)return!0;if(t.offset===void 0&&t.limit===void 0)return!1;let n=e.offset??1,o=t.offset??1;if(e.limit===void 0)return n<=o;if(t.limit===void 0)return!1;let r=n+e.limit,i=o+t.limit;return n<=o&&r>=i}function jVe(e){return e.offset!==void 0&&e.limit!==void 0?` lines ${e.offset}-${e.offset+e.limit-1}`:e.offset!==void 0?` from line ${e.offset}`:""}function VVe(e,t,n){if(t){let o=n?jVe(n):"";return`[earlier read of ${t}${o} \u2014 see latest read below for current content]`}return`[duplicate output \u2014 same content as later ${e} in this session \u2014 use recall for details]`}function FVe(e,t){let n=new Map,o=new Map;for(let s=0;s<e.length;s++)for(let a of e[s].parts){if(!cr(a)||a.state.status!=="completed")continue;let c=a.state.output;if(!c||c.length<mfe)continue;let u=`${a.tool}:${_fe(c)}`;if(n.set(u,s),a.tool==="read_file"||a.tool==="read"){let d=typeof a.state.input=="string"?a.state.input:JSON.stringify(a.state.input),p=gfe(d);if(p){let f=o.get(p.path);f||(f=[],o.set(p.path,f)),f.push({range:p,msgIdx:s})}}}let r=!1,i=e.map((s,a)=>{if(a>=t)return s;let c=!1,u=s.parts.map(d=>{if(!cr(d)||d.state.status!=="completed")return d;let p=d.state.output;if(!p||p.length<mfe)return d;let f=`${d.tool}:${_fe(p)}`,m=n.get(f)===a,_,h=!1;if(d.tool==="read_file"||d.tool==="read"){let E=typeof d.state.input=="string"?d.state.input:JSON.stringify(d.state.input);if(_=gfe(E),_){let T=o.get(_.path);if(T){for(let R of T)if(R.msgIdx>a&&GVe(R.range,_)){h=!0;break}}}}return m&&!h?d:(c=!0,{...d,state:{...d.state,output:VVe(d.tool,_?.path,_)}})});return c?(r=!0,{...s,parts:u}):s});return r?i:e}function HVe(e){let t=!1,n=e.map(o=>{if(o.info.role!=="assistant")return o;let r=!1,i=o.parts.map(s=>{if(!cr(s))return s;let{status:a}=s.state;if(a==="completed"||a==="error")return s;r=!0;let c="time"in s.state?s.state.time.start:0;return{...s,state:{status:"error",input:s.state.input,error:"[tool execution interrupted \u2014 session recovered]",metadata:"metadata"in s.state?s.state.metadata:void 0,time:{start:c,end:c}}}});return r?(t=!0,{...o,parts:i}):o});return t?n:e}function hfe(e){return e.map(t=>!cr(t)||t.state.status!=="completed"?t:{...t,state:{...t.state,output:UO(t.tool,t.state.output)}})}function xj(e){return[{info:{id:"lore-distilled-user",sessionID:"",role:"user",time:{created:0},agent:"",model:{providerID:"",modelID:""}},parts:[{id:"lore-distilled-user-part",sessionID:"",messageID:"lore-distilled-user",type:"text",text:"[Memory context follows \u2014 do not reference this format in your responses]",time:{start:0,end:0}}]},{info:{id:"lore-distilled-assistant",sessionID:"",role:"assistant",time:{created:0},parentID:"lore-distilled-user",modelID:"",providerID:"",mode:"memory",path:{cwd:"",root:""},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}},parts:[{id:"lore-distilled-assistant-part",sessionID:"",messageID:"lore-distilled-assistant",type:"text",text:e+`
876
+
877
+ I'm ready to continue.`,time:{start:0,end:0}}]}]}function Pj(e){if(!e.length)return[];let t=lh(e);return t?xj(t):[]}function zVe(e,t,n){if(!e.length)return n.prefixCache=null,{messages:[],tokens:0};let o=e[e.length-1],r=n.prefixCache;if(r!==null&&r.sessionID===t&&r.rowCount<=e.length&&(r.rowCount===0||e[r.rowCount-1]?.id===r.lastDistillationID)){if(r.lastDistillationID===o.id)return{messages:r.prefixMessages,tokens:r.prefixTokens};let u=e.slice(r.rowCount),d=lh(u);if(d){let p=r.cachedText+`
878
+
879
+ `+d,f=xj(p),m=f.reduce((_,h)=>_+Co(h),0);return n.prefixCache={sessionID:t,lastDistillationID:o.id,rowCount:e.length,cachedText:p,prefixMessages:f,prefixTokens:m},{messages:f,tokens:m}}}let s=lh(e);if(!s)return n.prefixCache=null,{messages:[],tokens:0};let a=xj(s),c=a.reduce((u,d)=>u+Co(d),0);return n.prefixCache={sessionID:t,lastDistillationID:o.id,rowCount:e.length,cachedText:s,prefixMessages:a,prefixTokens:c},{messages:a,tokens:c}}function qVe(e){if(e.prefixTokens>e.distilledBudget&&e.prefix.length>0)return null;let t=e.sessState.rawWindowCache;if(t!==null&&t.sessionID===e.sessionID){let r=Math.max(0,e.messages.length-t.pinnedTotalCount),i=t.pinnedRawCount+r,s=Math.max(0,e.messages.length-i),a=e.messages.slice(s),c=a.reduce((p,f)=>p+Co(f),0),d=Math.max(t.pinnedBudget,e.rawBudget)*1.15;if(c<=d){c>t.pinnedBudget*1.15&&(e.sessState.rawWindowCache={...t,pinnedRawCount:a.length,pinnedTotalCount:e.messages.length,pinnedBudget:e.rawBudget});let p=a.map(m=>{let _=iE(m.parts);return _!==m.parts?{info:m.info,parts:_}:m}),f=e.prefixTokens+c;return{messages:[...e.prefix,...p],distilledTokens:e.prefixTokens,rawTokens:c,totalTokens:f}}Fe(`pin-overflow: session=${e.sessionID} pinnedTokens=${c} pinnedBudget=${t.pinnedBudget} effectiveBudget=${Math.round(d)} currentRawBudget=${e.rawBudget} windowSize=${a.length}`)}let o=PO({messages:e.messages,prefix:e.prefix,prefixTokens:e.prefixTokens,distilledBudget:e.distilledBudget,rawBudget:e.rawBudget,strip:"none"});if(o){let r=o.messages.length-e.prefix.length;r>0&&(e.sessState.rawWindowCache={sessionID:e.sessionID,pinnedRawCount:r,pinnedTotalCount:e.messages.length,pinnedBudget:e.rawBudget})}return o}function sE(){let e=oE;return oE=!1,e}function YVe(e){let t=ze(),n=DVe(),o=e.sessionID??e.messages[0]?.info.sessionID,r=o?Ff(o):Tfe(),i=o?r.ltmTokens:Sfe,s=Math.max(0,xO-MO-n-i),a=Math.floor(s*t.budget.distilled),c=Math.floor(s*t.budget.raw),u=r.forceMinLayer;r.forceMinLayer=0,o&&u>0&&Pk(o,0);let d=xO-MO,p=r.lastKnownInput>0,f=1.5;function m(Me){return Me?p?!0:Me.totalTokens*f<=d:!1}p&&r.lastLayer>=1&&e.messages.length>=r.lastKnownMessageCount&&(u=Math.max(u,r.lastLayer)),r.postIdleCompact&&(r.postIdleCompact=!1,u=Math.max(u,1),c=Math.floor(s*.2),Fe(`post-idle compact: session=${o} rawBudget=${c} (${Math.floor(s*t.budget.raw)}\u2192${c})`));let h;if(p){let N=(r.lastWindowMessageIDs.size>0?e.messages.filter(vo=>!r.lastWindowMessageIDs.has(vo.info.id)):e.messages.slice(-Math.max(0,e.messages.length-r.lastKnownMessageCount))).reduce((vo,nm)=>vo+Co(nm),0),bt=i-r.lastKnownLtm;h=r.lastKnownInput+N+bt}else h=e.messages.reduce((N,bt)=>N+Co(bt),0)+n+i;let E=p?h:h*f,T=LO>0?Math.min(d,LO):d;if(!p&&T<d&&(T=Math.floor(T*.7)),u===0&&E<=T){let Me=p?h-(i-r.lastKnownLtm):h-n-i;return{messages:e.messages,layer:0,distilledTokens:0,rawTokens:Math.max(0,Me),totalTokens:Math.max(0,Me),usable:s,distilledBudget:a,rawBudget:c}}let R=Mj(e.messages),C=FVe(e.messages,R),P=o?UVe(e.projectPath,o,e.messages,r):[],M=o?zVe(P,o,r):(()=>{let Me=Pj(P);return{messages:Me,tokens:Me.reduce((N,bt)=>N+Co(bt),0)}})();if(u<=1){let Me=o?qVe({messages:C,prefix:M.messages,prefixTokens:M.tokens,distilledBudget:a,rawBudget:c,sessionID:o,sessState:r}):PO({messages:C,prefix:M.messages,prefixTokens:M.tokens,distilledBudget:a,rawBudget:c,strip:"none"});if(m(Me))return{...Me,layer:1,usable:s,distilledBudget:a,rawBudget:c}}if(r.rawWindowCache=null,u<=2){let Me=PO({messages:C,prefix:M.messages,prefixTokens:M.tokens,distilledBudget:a,rawBudget:Math.floor(s*.5),strip:"old-tools",protectedTurns:2});if(m(Me))return oE=!0,{...Me,layer:2,usable:s,distilledBudget:a,rawBudget:c}}let O=P.slice(-5),z=Pj(O),ie=z.reduce((Me,N)=>Me+Co(N),0),$=PO({messages:C,prefix:z,prefixTokens:ie,distilledBudget:Math.floor(s*.15),rawBudget:Math.floor(s*.55),strip:"all-tools"});if(m($))return oE=!0,{...$,layer:3,usable:s,distilledBudget:a,rawBudget:c};oE=!0;let q=P.slice(-2),J=Pj(q),Z=J.reduce((Me,N)=>Me+Co(N),0),k=Math.max(2e3,Math.min(8e3,Math.floor(s*.25))),ue=Mj(e.messages),le=e.messages.slice(ue).map(Me=>({info:Me.info,parts:iE(Me.parts)})),Ae=le.reduce((Me,N)=>Me+Co(N),0),ye=[],at=0,Yt=Math.max(0,k-Ae);for(let Me=ue-1;Me>=0&&at<Yt;Me--){let N=e.messages[Me],bt=Co(N);if(at+bt>Yt)break;ye.unshift({info:N.info,parts:iE(N.parts)}),at+=bt}let v=[...ye,...le],Fn=at+Ae;return{messages:[...J,...v],layer:4,distilledTokens:Z,rawTokens:Fn,totalTokens:Z+Fn,usable:s,distilledBudget:a,rawBudget:c}}function Bj(e){let t=YVe(e);t.messages=HVe(t.messages);let n=e.sessionID??e.messages[0]?.info.sessionID;if(n){let o=Ff(n);o.lastTransformedCount=t.messages.length,o.lastTransformEstimate=t.totalTokens,o.lastLayer=t.layer,o.lastWindowMessageIDs=new Set(t.messages.map(r=>r.info.id)),o.lastTurnAt=Date.now(),t.layer>=2?(o.consecutiveHighLayer++,o.consecutiveHighLayer===3&&Fe(`session ${n} has been at gradient layer ${t.layer}+ for 3 consecutive turns. Consider running /compact to reset the context window.`)):o.consecutiveHighLayer=0,Fe(`gradient: session=${n} layer=${t.layer} tokens=${t.totalTokens} (distilled=${t.distilledTokens} raw=${t.rawTokens}) usable=${t.usable} cap=${LO||"off"}`)}return t}function Mj(e){if(e.length===0)return 0;let t=e.length;for(let n=e.length-1;n>=0;n--)if(e[n].info.role==="user"){t=n;break}if(t===e.length)return 0;for(let n=t-1;n>=0;n--){let o=e[n];if(o.parts.some(cr)){t=n;continue}if(o.info.role==="user"){t=n;continue}break}return t}function PO(e){if(e.prefixTokens>e.distilledBudget&&e.prefix.length>0)return null;let t=Mj(e.messages),n=e.messages.slice(t),o=n.reduce((_,h)=>_+Co(h),0);if(o>e.rawBudget)return null;let r=e.messages.slice(0,t),i=e.rawBudget-o,s=0,a=r.length,c=e.protectedTurns??0;for(let _=r.length-1;_>=0;_--){let h=r[_],E=Co(h);if(s+E>i){a=_+1;break}s+=E,_===0&&(a=0)}let u=[...r.slice(a),...n],d=s+o,p=new Set(n.map(_=>_.info.id)),f=u.map((_,h)=>{let E=u.length-h,R=p.has(_.info.id)||e.strip==="none"||e.strip==="old-tools"&&E<=c*2,C=iE(R?_.parts:(e.strip==="all-tools",hfe(_.parts)));return C!==_.parts?{info:_.info,parts:C}:_}),m=e.prefixTokens+d;return{messages:[...e.prefix,...f],distilledTokens:e.prefixTokens,rawTokens:d,totalTokens:m}}var xO,MO,LO,wVe,Efe,rE,wO,Sfe,ffe,BVe,mfe,oE,Gj=I(()=>{"use strict";l();Pb();Ki();Sl();dl();ll();Zi();xO=2e5,MO=32e3,LO=0,wVe=4e4,Efe=15e3,rE=null;wO=new Map;Sfe=0;ffe=64*1024,BVe=/(?:[\w.-]+\/)+[\w.-]+\.\w{1,5}/g;mfe=600;oE=!1});var jj,Vj=I(()=>{"use strict";l();jj=new Set});var ti={};ft(ti,{backfillMetrics:()=>sFe,compressionRatio:()=>zj,detectSegments:()=>Rfe,latestMetaObservations:()=>XVe,loadForSession:()=>QVe,messagesToText:()=>bfe,metaDistill:()=>vfe,parseSourceIds:()=>aE,run:()=>oFe,truncateToolOutputsInContent:()=>Ife,workerSessionIDs:()=>jj});function zj(e,t){return t<=0?0:e/Math.sqrt(t)}function Rfe(e,t){return e.length<=t?[e]:Hj(e,t)}function Hj(e,t){if(e.length<=t)return[e];let n=KVe(e,t),o=e.slice(0,n),r=e.slice(n),i=Hj(o,t);return r.length<Fj?i[i.length-1].push(...r):i.push(...Hj(r,t)),i}function KVe(e,t){let n=[];for(let s=1;s<e.length;s++)n.push({index:s,gap:e[s].created_at-e[s-1].created_at});if(n.length===0)return t;let o=n.map(s=>s.gap).sort((s,a)=>s-a),r=o[Math.floor(o.length/2)],i={index:-1,gap:0};for(let s of n)s.gap>i.gap&&s.index>=Fj&&e.length-s.index>=Fj&&(i=s);return i.index>0&&i.gap>=r*WVe?i.index:t}function ZVe(e){let t=new Date(e),n=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0");return`${n}:${o}`}function Ife(e,t){if(t<=0||e.length===0)return e;if(e.indexOf(gh)===-1)return yfe(e,t);let n=e.split(Afe),o=!1;for(let i of n)if(i.startsWith("[tool:")){o=!0;break}return o?n.map(i=>yfe(i,t)).join(Afe):e}function yfe(e,t){if(!e.startsWith("[tool:"))return e;let n=e.indexOf("] ");if(n<0)return e;let o=e.slice(6,n),r=e.slice(n+2);return r.length<=t?e:`[tool:${o}] ${UO(o,r)}`}function bfe(e,t){let n=t??ze().distillation.toolOutputMaxChars;return e.map(o=>{let r=o.role==="user"?o.content:Ife(o.content,n);return`[${o.role}] (${ZVe(o.created_at)}) ${r}`}).join(`
880
+
881
+ `)}function Nfe(e){let t=e.match(/<observations>([\s\S]*?)<\/observations>/i),n=t?t[1].trim():e.trim();return n?{observations:n}:null}function JVe(e,t){let n=De(e);return j().query("SELECT observations FROM distillations WHERE project_id = ? AND session_id = ? ORDER BY created_at DESC LIMIT 1").get(n,t)?.observations||void 0}function XVe(e,t){return Ofe(e,t)?.observations}function Ofe(e,t){let n=De(e),o=j().query(`SELECT observations, generation FROM distillations
882
+ WHERE project_id = ? AND session_id = ? AND generation > 0
883
+ ORDER BY generation DESC, created_at DESC LIMIT 1`).get(n,t);if(!(!o||!o.observations))return o}function aE(e){try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return sf("corrupt source_ids in distillation, defaulting to []"),[]}}function QVe(e,t,n=!1){let o=De(e),r=n?"SELECT id, project_id, session_id, observations, source_ids, generation, token_count, created_at, r_compression, c_norm FROM distillations WHERE project_id = ? AND session_id = ? ORDER BY created_at ASC":"SELECT id, project_id, session_id, observations, source_ids, generation, token_count, created_at, r_compression, c_norm FROM distillations WHERE project_id = ? AND session_id = ? AND archived = 0 ORDER BY created_at ASC";return j().query(r).all(o,t).map(s=>({...s,source_ids:aE(s.source_ids)}))}function Cfe(e){let t=De(e.projectPath),n=crypto.randomUUID(),o=JSON.stringify(e.sourceIDs),r=Math.ceil(e.observations.length/3);return j().query(`INSERT INTO distillations (id, project_id, session_id, narrative, facts, observations, source_ids, generation, token_count, created_at, r_compression, c_norm)
884
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n,t,e.sessionID,"","[]",e.observations,o,e.generation,r,Date.now(),e.rCompression??null,e.cNorm??null),n}function eFe(e,t){let n=De(e);return j().query("SELECT COUNT(*) as count FROM distillations WHERE project_id = ? AND session_id = ? AND generation = 0 AND archived = 0").get(n,t).count}function tFe(e,t){let n=De(e);return j().query("SELECT id, project_id, session_id, observations, source_ids, generation, token_count, created_at, r_compression, c_norm FROM distillations WHERE project_id = ? AND session_id = ? AND generation = 0 AND archived = 0 ORDER BY created_at ASC").all(n,t).map(r=>({...r,source_ids:aE(r.source_ids)}))}function nFe(e){if(!e.length)return;let t=e.map(()=>"?").join(",");j().query(`UPDATE distillations SET archived = 1 WHERE id IN (${t})`).run(...e)}function rFe(e,t){let n=De(e),o=j().query("SELECT source_ids FROM distillations WHERE project_id = ? AND session_id = ?").all(n,t),r=new Set;for(let c of o)for(let u of aE(c.source_ids))r.add(u);if(o.length===0){let c=j().query("UPDATE temporal_messages SET distilled = 0 WHERE project_id = ? AND session_id = ? AND distilled = 1").run(n,t);return Number(c.changes)}let s=j().query("SELECT id FROM temporal_messages WHERE project_id = ? AND session_id = ? AND distilled = 1").all(n,t).filter(c=>!r.has(c.id)).map(c=>c.id);if(!s.length)return 0;let a=500;for(let c=0;c<s.length;c+=a){let u=s.slice(c,c+a),d=u.map(()=>"?").join(",");j().query(`UPDATE temporal_messages SET distilled = 0 WHERE id IN (${d})`).run(...u)}return s.length}async function oFe(e){let t=rFe(e.projectPath,e.sessionID);t>0&&Fe(`Reset ${t} orphaned messages for re-observation`);let n=ze(),o=3,r=0,i=0;for(let s=0;s<o;s++){let a=eU(e.projectPath,e.sessionID);if(!e.force&&a.length<n.distillation.minMessages&&s===0)break;if(a.length>0){let c=Rfe(a,n.distillation.maxSegment);for(let u of c)await iFe({llm:e.llm,projectPath:e.projectPath,sessionID:e.sessionID,messages:u,model:e.model,urgent:e.urgent})&&(i+=u.length,r++)}if(!e.skipMeta&&eFe(e.projectPath,e.sessionID)>=n.distillation.metaThreshold&&(await vfe({llm:e.llm,projectPath:e.projectPath,sessionID:e.sessionID,model:e.model,urgent:e.urgent}),r++),!sE())break}return{rounds:r,distilled:i}}async function iFe(e){let t=JVe(e.projectPath,e.sessionID),n=bfe(e.messages),o=e.messages[0],r=o?new Date(o.created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"unknown date",i=uh({priorObservations:t,date:r,messages:n}),s=e.model??ze().model,a=await e.llm.prompt(ch,i,{model:s,workerID:"lore-distill",thinking:!1,urgent:e.urgent,sessionID:e.sessionID});if(!a)return null;let c=Nfe(a);if(!c)return null;let u=Math.ceil(c.observations.length/3),d=e.messages.reduce((_,h)=>_+h.tokens,0),p=zj(u,d),f=xb(e.messages.map(_=>_.created_at)),m=Cfe({projectPath:e.projectPath,sessionID:e.sessionID,observations:c.observations,sourceIDs:e.messages.map(_=>_.id),generation:0,rCompression:p,cNorm:f});if(nU(e.messages.map(_=>_.id)),Fe(`distill segment: ${e.messages.length} msgs, ${d}\u2192${u} tokens, R=${p.toFixed(2)}, C_norm=${f.toFixed(3)}`),Sc()&&yj(m,c.observations),ze().knowledge.enabled)for(let _ of Cj(c.observations))try{Rl({projectPath:e.projectPath,category:_.category,title:_.title,content:_.content,session:e.sessionID,scope:"project"})}catch{}return c}async function vfe(e){let t=tFe(e.projectPath,e.sessionID),n=Ofe(e.projectPath,e.sessionID);if(n){if(t.length===0)return null}else if(t.length<3)return null;let o=F0(t,n?.observations),r=e.model??ze().model,i=await e.llm.prompt(V0,o,{model:r,workerID:"lore-distill",thinking:!1,urgent:e.urgent,sessionID:e.sessionID});if(!i)return null;let s=Nfe(i);if(!s)return null;let a=Math.max(...t.map(d=>d.generation),n?.generation??0),c=t.flatMap(d=>d.source_ids),u;j().exec("BEGIN IMMEDIATE");try{u=Cfe({projectPath:e.projectPath,sessionID:e.sessionID,observations:s.observations,sourceIDs:c,generation:a+1}),nFe(t.map(d=>d.id)),j().exec("COMMIT")}catch(d){throw j().exec("ROLLBACK"),d}if(Sc()&&yj(u,s.observations),ze().knowledge.enabled)for(let d of Cj(s.observations))try{Rl({projectPath:e.projectPath,category:d.category,title:d.title,content:d.content,session:e.sessionID,scope:"project"})}catch{}return s}function sFe(){let e=j().query("SELECT id, source_ids, token_count FROM distillations WHERE r_compression IS NULL").all();if(!e.length)return 0;let t=j().prepare("UPDATE distillations SET r_compression = ?, c_norm = ? WHERE id = ?"),n=0;for(let o of e){let r=aE(o.source_ids);if(!r.length)continue;let i=r.map(()=>"?").join(","),s=j().query(`SELECT tokens, created_at FROM temporal_messages WHERE id IN (${i})`).all(...r);if(!s.length)continue;let a=s.reduce((p,f)=>p+f.tokens,0),c=s.map(p=>p.created_at),u=zj(o.token_count,a),d=xb(c);t.run(u,d,o.id),n++}return n>0&&Fe(`backfilled metrics for ${n} distillations (${e.length-n} skipped \u2014 missing sources)`),n}var Fj,WVe,Afe,Pfe=I(()=>{"use strict";l();Ki();Sl();cf();cf();tE();Vf();Zi();vj();dl();Gj();Vj();Fj=3,WVe=3;Afe=`
885
+ `+gh});var Nl={};ft(Nl,{consolidate:()=>uFe,resetCurationTracker:()=>cFe,run:()=>aFe});function xfe(e){let t=e.trim().replace(/^```json?\s*/i,"").replace(/\s*```$/i,"");try{let n=JSON.parse(t);return Array.isArray(n)?n.filter(o=>typeof o=="object"&&o!==null&&"op"in o&&typeof o.op=="string"):[]}catch{return[]}}async function aFe(e){let t=ze();if(!t.curator.enabled)return{created:0,updated:0,deleted:0};let n=tU(e.projectPath,e.sessionID),o=$O.get(e.sessionID)??0,r=n.filter(E=>E.created_at>o);if(r.length<3)return{created:0,updated:0,deleted:0};let i=r.map(E=>`[${E.role}] ${E.content}`).join(`
886
+
887
+ `),a=Il(e.projectPath,!1).map(E=>({id:E.id,category:E.category,title:E.title,content:E.content})),c=z0({messages:i,existing:a}),u=e.model??t.model,d=await e.llm.prompt(H0,c,{model:u,workerID:"lore-curator",thinking:!1,sessionID:e.sessionID});if(!d)return{created:0,updated:0,deleted:0};let p=xfe(d),f=0,m=0,_=0,h=[];for(let E of p)if(E.op==="create"){let T=E.content.length>Hf?E.content.slice(0,Hf)+" [truncated \u2014 entry too long]":E.content,R=Rl({projectPath:E.scope==="project"?e.projectPath:void 0,category:E.category,title:E.title,content:T,session:e.sessionID,scope:E.scope,crossProject:E.crossProject??!0});h.push(R),f++}else if(E.op==="update"){if(Oo(E.id)){let R=E.content!==void 0&&E.content.length>Hf?E.content.slice(0,Hf)+" [truncated \u2014 entry too long]":E.content;yl(E.id,{content:R,confidence:E.confidence}),E.content!==void 0&&h.push(E.id),m++}}else E.op==="delete"&&Oo(E.id)&&(OO(E.id),_++);for(let E of h)Oj(E);return $O.set(e.sessionID,Date.now()),{created:f,updated:m,deleted:_}}function cFe(e){e?$O.delete(e):$O.clear()}async function uFe(e){let t=ze();if(!t.curator.enabled)return{updated:0,deleted:0};let n=Il(e.projectPath,!1);if(n.length<=t.curator.maxEntries)return{updated:0,deleted:0};let o=n.map(d=>({id:d.id,category:d.category,title:d.title,content:d.content})),r=Y0({entries:o,targetMax:t.curator.maxEntries}),i=e.model??t.model,s=await e.llm.prompt(q0,r,{model:i,workerID:"lore-curator",thinking:!1,sessionID:e.sessionID});if(!s)return{updated:0,deleted:0};let a=xfe(s),c=0,u=0;for(let d of a)if(d.op==="update"){if(Oo(d.id)){let f=d.content!==void 0&&d.content.length>Hf?d.content.slice(0,Hf)+" [truncated \u2014 entry too long]":d.content;yl(d.id,{content:f,confidence:d.confidence}),c++}}else d.op==="delete"&&Oo(d.id)&&(OO(d.id),u++);return{updated:c,deleted:u}}var Hf,$O,Mfe=I(()=>{"use strict";l();Sl();cf();Vf();dl();Hf=1200;$O=new Map});function lFe(e){switch(e.source){case"knowledge":case"cross-knowledge":return`${e.item.title} ${e.item.content}`;case"distillation":return e.item.observations;case"temporal":return e.item.content;case"lat-section":return`${e.item.heading} ${e.item.content}`}}function dFe(e){switch(e.source){case"knowledge":return`k:${e.item.id}`;case"cross-knowledge":return`xk:${e.item.id}`;case"distillation":return`d:${e.item.id}`;case"temporal":return`t:${e.item.id}`;case"lat-section":return`lat:${e.item.id}`}}function pFe(e){let t=e.query.toLowerCase().split(/\s+/).filter(s=>s.length>1);if(!t.length)return[];let n=t.map(()=>"LOWER(observations) LIKE ?").join(" AND "),o=t.map(s=>`%${s}%`),r=e.sessionID?`SELECT id, observations, generation, created_at, session_id, c_norm FROM distillations WHERE project_id = ? AND session_id = ? AND ${n} ORDER BY created_at DESC LIMIT ?`:`SELECT id, observations, generation, created_at, session_id, c_norm FROM distillations WHERE project_id = ? AND ${n} ORDER BY created_at DESC LIMIT ?`,i=e.sessionID?[e.pid,e.sessionID,...o,e.limit]:[e.pid,...o,e.limit];return j().query(r).all(...i)}function fFe(e){let t=De(e.projectPath),n=e.limit??10,o=Ir(e.query);if(o===It)return[];let r=e.sessionID?`SELECT d.id, d.observations, d.generation, d.created_at, d.session_id, d.c_norm, rank
888
+ FROM distillation_fts f
889
+ CROSS JOIN distillations d ON d.rowid = f.rowid
890
+ WHERE distillation_fts MATCH ?
891
+ AND d.project_id = ? AND d.session_id = ?
892
+ ORDER BY rank LIMIT ?`:`SELECT d.id, d.observations, d.generation, d.created_at, d.session_id, d.c_norm, rank
893
+ FROM distillation_fts f
894
+ CROSS JOIN distillations d ON d.rowid = f.rowid
895
+ WHERE distillation_fts MATCH ?
896
+ AND d.project_id = ?
897
+ ORDER BY rank LIMIT ?`,i=e.sessionID?[o,t,e.sessionID,n]:[o,t,n];try{let s=j().query(r).all(...i);if(s.length)return s;let a=Io(e.query);if(a===It)return[];let c=e.sessionID?[a,t,e.sessionID,n]:[a,t,n];return j().query(r).all(...c)}catch{return pFe({pid:t,query:e.query,sessionID:e.sessionID,limit:n}).map((s,a)=>({...s,rank:-(10-a)}))}}function mFe(e,t){if(!e.length)return"No results found for this query.";let n=e.slice(0,t).map(({item:o})=>{switch(o.source){case"knowledge":{let r=o.item;return Vs(Ro(`**[knowledge/${r.category}]** ${In(r.title)}: ${In(r.content)}`))}case"cross-knowledge":{let r=o.item;return Vs(Ro(`**[knowledge/${r.category} from: ${o.projectLabel}]** ${In(r.title)}: ${In(r.content)}`))}case"distillation":{let r=o.item,i=r.observations.length>500?r.observations.slice(0,500)+"...":r.observations;return Cb(`**[distilled]** ${In(i)}`)}case"temporal":{let r=o.item,i=r.content.length>500?r.content.slice(0,500)+"...":r.content;return Cb(`**[temporal/${r.role}]** (session: ${r.session_id.slice(0,8)}...) ${In(i)}`)}case"lat-section":{let r=o.item,i=r.first_paragraph?In(r.first_paragraph):In(r.content.length>300?r.content.slice(0,300)+"...":r.content);return Vs(Ro(`**[lat.md/${r.file}]** ${In(r.heading)}: ${i}`))}}});return al(ul(of(2,"Recall Results"),cl(n)))}async function qj(e){let{query:t,scope:n="all",projectPath:o,sessionID:r,knowledgeEnabled:i=!0,llm:s,searchConfig:a}=e,c=a?.recallLimit??10;if(Ir(t)===It)return"Query too vague \u2014 try using specific keywords, file names, or technical terms.";let u=[t];if(a?.queryExpansion&&s)try{u=await Q0(s,t,void 0,r)}catch(f){Fe("recall: query expansion failed, using original:",f)}let d=[];for(let f of u){let m=[];if(i&&n!=="session")try{m.push(...bj({query:f,projectPath:o,limit:c}))}catch(E){ph("recall: knowledge search failed:",E)}let _=[];if(n!=="knowledge")try{_.push(...fFe({projectPath:o,query:f,sessionID:n==="session"?r:void 0,limit:c}))}catch(E){ph("recall: distillation search failed:",E)}let h=[];if(n!=="knowledge")try{h.push(...rU({projectPath:o,query:f,sessionID:n==="session"?r:void 0,limit:c}))}catch(E){ph("recall: temporal search failed:",E)}if(d.push({items:m.map(E=>({source:"knowledge",item:E})),key:E=>`k:${E.item.id}`},{items:_.map(E=>({source:"distillation",item:E})),key:E=>`d:${E.item.id}`},{items:h.map(E=>({source:"temporal",item:E})),key:E=>`t:${E.item.id}`}),h.length>0){let E=[...h].sort((T,R)=>R.created_at-T.created_at);d.push({items:E.map(T=>({source:"temporal",item:T})),key:T=>`t:${T.item.id}`})}}if(Sc()&&n!=="session")try{let[f]=await IO([t],"query");if(i){let m=rfe(f,c),_=[];for(let h of m){let E=Oo(h.id);E&&_.push({source:"knowledge",item:{...E,rank:-h.similarity}})}_.length&&d.push({items:_,key:h=>`k:${h.item.id}`})}if(n!=="knowledge"){let _=ofe(f,c).map(h=>{let E=j().query("SELECT id, observations, generation, created_at, session_id, c_norm FROM distillations WHERE id = ?").get(h.id);return E?{source:"distillation",item:{...E,rank:-h.similarity}}:null}).filter(h=>h!==null);_.length&&d.push({items:_,key:h=>`d:${h.item.id}`})}}catch(f){Fe("recall: vector search failed:",f)}if(n!=="session"&&Gf(o))try{let f=Rj({query:t,projectPath:o,limit:c});f.length&&d.push({items:f.map(m=>({source:"lat-section",item:m})),key:m=>`lat:${m.item.id}`})}catch(f){Fe("recall: lat.md section search failed:",f)}if(i&&n==="all")try{let f=Nj({query:t,excludeProjectPath:o,limit:c});f.length&&d.push({items:f.map(m=>{let _=(m.project_id?Ck(m.project_id):null)??"other";return{source:"cross-knowledge",item:m,projectLabel:_}}),key:m=>`xk:${m.item.id}`})}catch(f){Fe("recall: cross-project knowledge search failed:",f)}{let f=[];for(let m of d)for(let _ of m.items){if(_.source!=="distillation")continue;let h=`d:${_.item.id}`,E=_.item,T=E.c_norm??0,R=Math.min((Date.now()-E.created_at)/864e5,90),C=T+R/90*.1;f.push({tagged:_,key:h,qualityScore:C})}if(f.length>1){let m=new Set,_=f.filter(h=>m.has(h.key)?!1:(m.add(h.key),!0));_.sort((h,E)=>h.qualityScore-E.qualityScore),d.push({items:_.map(h=>h.tagged),key:h=>`d:${h.item.id}`})}}if(fh(t).length>0&&d.length>0){let f=new Map;for(let h of d)for(let E of h.items){let T=h.key(E);f.has(T)||f.set(T,E)}let m=[...f.entries()],_=X0(m,([,h])=>lFe(h),t);_.length&&d.push({items:_.map(([,h])=>h),key:dFe})}let p=J0(d);return mFe(p,20)}var Yj,BO,Lfe=I(()=>{"use strict";l();NO();Vf();cf();tE();Zi();Ki();af();ll();Yj="Search your persistent memory for this project. Your visible context is a trimmed window \u2014 older messages, decisions, and details may not be visible to you even within the current session. Use this tool whenever you need information that isn't in your current context: file paths, past decisions, user preferences, prior approaches, or anything from earlier in this conversation or previous sessions. Always prefer recall over assuming you don't have the information. Searches long-term knowledge, distilled history, and raw message archives.",BO={query:"What to search for \u2014 be specific. Include keywords, file names, or concepts.",scope:"Search scope: 'all' (default) searches everything, 'session' searches current session only, 'project' searches all sessions in this project, 'knowledge' searches only long-term knowledge."}});function EFe(e){let t=[],n=0;for(;n<e.length;){let s=-1,a=0;for(let d of gFe){let p=e.indexOf(d,n);p!==-1&&(s===-1||p<s)&&(s=p,a=d.length)}if(s===-1)break;let c=s+a,u=e.indexOf(GO,c);if(u===-1){t.push({markerStart:s,bodyStart:c,bodyEnd:e.length,spanEnd:e.length});break}t.push({markerStart:s,bodyStart:c,bodyEnd:u,spanEnd:u+GO.length}),n=u+GO.length}if(t.length===0)return{before:e,section:null,after:""};let o=e.slice(0,t[0].markerStart),r=e.slice(t[0].bodyStart,t[0].bodyEnd),i=e.slice(t[t.length-1].spanEnd);return{before:o,section:r,after:i}}function TFe(e){let t=Il(e,!1);if(!t.length)return`
898
+ `;let n=new Map;for(let r of t){let i=n.get(r.category)??[];i.push(r),n.set(r.category,i)}let o=[""];o.push("## Long-term Knowledge");for(let[r,i]of[...n.entries()].sort((s,a)=>s[0].localeCompare(a[0]))){o.push(""),o.push(`### ${r.charAt(0).toUpperCase()+r.slice(1)}`),o.push("");let s=[...i].sort((a,c)=>a.title.localeCompare(c.title,void 0,{sensitivity:"base"}));for(let a=0;a<s.length;a++){a>0&&o.push(""),o.push(`<!-- lore:${s[a].id} -->`);let c=al(ul(cl([Vs(ah(In(s[a].title)),Ro(": "+In(s[a].content)))]))).trimEnd();o.push(c)}}return o.push(""),o.join(`
899
+ `)}function Wj(e){VO(e.projectPath);let n=wfe+`
900
+ ## Long-term Knowledge
901
+
902
+ For long-term knowledge entries managed by [lore](https://github.com/BYK/loreai) (gotchas, patterns, decisions, architecture), see [\`.lore.md\`](.lore.md) in the project root.
903
+ `+GO+`
904
+ `,o="";(0,qs.existsSync)(e.filePath)&&(o=(0,qs.readFileSync)(e.filePath,"utf8"));let{before:r,after:i}=EFe(o),s=r.trimEnd(),a=s.length>0?s+`
905
+
906
+ `:"",c=i.trimStart(),u=c.length>0?`
907
+ `+c:"",d=a+n+u;(0,qs.mkdirSync)((0,jO.dirname)(e.filePath),{recursive:!0}),(0,qs.writeFileSync)(e.filePath,d,"utf8")}function VO(e){let t=TFe(e),n=hFe+`
908
+ `+t;(0,qs.writeFileSync)((0,jO.join)(e,Dfe),n,"utf8")}var qs,jO,wfe,GO,gFe,Dfe,hFe,kfe=I(()=>{"use strict";l();qs=require("fs"),jO=require("path");Vf();ll();wfe="<!-- This section is maintained by the coding agent via lore (https://github.com/BYK/loreai) -->",GO="<!-- End lore-managed section -->",gFe=[wfe,"<!-- This section is maintained by the coding agent via lore (https://github.com/BYK/opencode-lore) -->","<!-- This section is auto-maintained by lore (https://github.com/BYK/opencode-lore) -->"],Dfe=".lore.md",hFe="<!-- Managed by lore (https://github.com/BYK/loreai) \u2014 manual edits are imported on next session. -->"});var Ys={};ft(Ys,{WORKER_JUDGE_SYSTEM:()=>Vfe,clearValidatedWorkerModel:()=>Gfe,computeModelFingerprint:()=>Ufe,getValidatedWorkerModel:()=>$fe,isValidationStale:()=>AFe,parseJudgeScore:()=>Hfe,resolveWorkerModel:()=>RFe,runValidation:()=>yFe,selectWorkerCandidates:()=>SFe,storeValidatedWorkerModel:()=>Bfe,structuralCheck:()=>jfe,workerJudgeUser:()=>Ffe});function SFe(e,t){let n=t.filter(a=>a.providerID===e.providerID&&a.status==="active"&&a.capabilities.input.text);if(n.length===0)return[];let o=[...n].sort((a,c)=>{let u=a.cost.input-c.cost.input;if(u!==0)return u;let d=a.capabilities.reasoning?1:0,p=c.capabilities.reasoning?1:0;return d-p}),r=o[0],i=o.filter(a=>a.cost.input<e.cost.input).pop(),s=new Map;return s.set(r.id,r),i&&i.id!==r.id&&s.set(i.id,i),r.id===e.id||r.cost.input>=e.cost.input?[r]:[...s.values()]}function Ufe(e,t,n){let o=[...n].sort();return zI(JSON.stringify({providerID:e,sessionModelID:t,modelIDs:o}))}function $fe(e){let t=j().query("SELECT value FROM kv_meta WHERE key = ?").get(`${Kj}${e}`);if(!t)return null;try{return JSON.parse(t.value)}catch{return null}}function Bfe(e){let t=`${Kj}${e.providerID}`,n=JSON.stringify(e);j().query("INSERT INTO kv_meta (key, value) VALUES (?, ?) ON CONFLICT(key) DO UPDATE SET value = ?").run(t,n,n)}function Gfe(e){j().query("DELETE FROM kv_meta WHERE key = ?").run(`${Kj}${e}`)}function AFe(e,t){return e?e.fingerprint!==t:!0}function jfe(e,t){if(e==null||e.length===0)return{passed:!1,observationCount:0,tokenCount:0,reason:e===null?"parse_failed":"empty"};let n=a=>a.split(`
909
+ `).filter(c=>c.trim().length>0).length,o=n(t),r=n(e),i=Math.ceil(e.length/3);if(o>0&&(r<o*.5||r>o*1.5))return{passed:!1,observationCount:r,tokenCount:i,reason:`observation_count_${r}_vs_ref_${o}`};let s=Math.ceil(t.length/3);return i===0?{passed:!1,observationCount:r,tokenCount:i,reason:"empty"}:s>0&&i>s*3?{passed:!1,observationCount:r,tokenCount:i,reason:`token_count_${i}_vs_ref_${s}_3x`}:{passed:!0,observationCount:r,tokenCount:i}}function Ffe(e,t){return`<reference>
910
+ ${e}
911
+ </reference>
912
+
913
+ <candidate>
914
+ ${t}
915
+ </candidate>`}function Hfe(e){let t=e.trim().match(/^([1-5])/);return t?parseInt(t[1],10):null}async function yFe(e){let{llm:t,candidates:n,referenceObservations:o,sourceMessagesText:r,date:i}=e,s=uh({messages:r,date:i});for(let a of n){if(a.id===e.sessionModelID)continue;let c=null;try{let m=await t.prompt(ch,s,{model:{providerID:a.providerID,modelID:a.id},workerID:"lore-distill",thinking:!1});if(m){let _=m.match(/<observations>([\s\S]*?)<\/observations>/);c=_?_[1].trim():m.trim()}}catch(m){sf(`worker model validation: candidate ${a.id} failed:`,m);continue}let u=jfe(c,o);if(!u.passed){Fe(`worker model validation: ${a.id} failed structural check: ${u.reason}`);continue}let d=null;try{let m=await t.prompt(Vfe,Ffe(o,c),{workerID:"lore-distill",thinking:!1});m&&(d=Hfe(m))}catch(m){sf(`worker model validation: judge call failed for ${a.id}:`,m)}if(d!==null&&d<3){Fe(`worker model validation: ${a.id} failed judge (score=${d})`);continue}let p=Ufe(e.providerID,e.sessionModelID,n.map(m=>m.id)),f={modelID:a.id,providerID:a.providerID,fingerprint:p,validatedAt:Date.now(),judgeScore:d};return Bfe(f),Fe(`worker model validated: ${a.id} (judge=${d}) for provider ${e.providerID}`),f}return Gfe(e.providerID),Fe(`worker model validation: no candidate passed for ${e.providerID} \u2014 cleared stale entry`),null}function RFe(e,t,n){if(t)return t;let o=$fe(e),r=1440*60*1e3;return o&&Date.now()-o.validatedAt<=r?{providerID:o.providerID,modelID:o.modelID}:n}var Kj,Vfe,zfe=I(()=>{"use strict";l();Ki();qI();Zi();dl();Kj="lore:worker_model:";Vfe=`You are evaluating distillation quality. You will be given a REFERENCE distillation (produced by a capable model) and a CANDIDATE distillation (produced by a cheaper model) of the same conversation segment.
916
+
917
+ Rate the candidate on a scale of 1-5:
918
+ 5 = Captures all key facts and decisions, equivalent to reference
919
+ 4 = Captures most facts, minor omissions
920
+ 3 = Captures the essential facts, some detail loss acceptable
921
+ 2 = Missing important facts or technical details
922
+ 1 = Significantly incomplete or inaccurate
923
+
924
+ Respond with ONLY a single digit (1-5).`});var ns=I(()=>{"use strict";l();cf();Vf();Pfe();Mfe();tE();NO();vj();Zi();Lfe();Pb();Sl();Ki();Gj();dl();kfe();Vj();zfe();af();ll()});var qe,Ol=I(()=>{"use strict";l();qe="0.14.1"});function FO(){let e=process.env;return{port:OFe(e.LORE_LISTEN_PORT,6969),host:e.LORE_LISTEN_HOST||"127.0.0.1",upstreamAnthropic:qfe(e.LORE_UPSTREAM_ANTHROPIC||"https://api.anthropic.com"),upstreamOpenAI:qfe(e.LORE_UPSTREAM_OPENAI||"https://api.openai.com"),idleTimeoutSeconds:CFe(e.LORE_IDLE_TIMEOUT,60),debug:vFe(e.LORE_DEBUG)}}function Yfe(e){for(let t of IFe)if(e.startsWith(t.prefix))return{url:t.url,protocol:t.protocol};return null}function NFe(e){for(let t of bFe){let n=t.exec(e);if(n?.[1])return n[1].replace(/\/+$/,"")||null}return null}function Zj(e,t){let n=t["x-lore-project"];if(n)return n;let o=NFe(e);return o||process.cwd()}function OFe(e,t){if(!e)return t;let n=Number.parseInt(e,10);return Number.isNaN(n)||n<0||n>65535?t:n}function CFe(e,t){if(!e)return t;let n=Number.parseInt(e,10);return Number.isNaN(n)||n<=0?t:n}function vFe(e){return e==="1"||e?.toLowerCase()==="true"}function qfe(e){return e.replace(/\/+$/,"")}var IFe,bFe,HO=I(()=>{"use strict";l();IFe=[{prefix:"claude-",url:"https://api.anthropic.com",protocol:"anthropic"},{prefix:"nvidia/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"meta/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"mistralai/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"google/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"qwen/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"deepseek/",url:"https://integrate.api.nvidia.com",protocol:"openai"},{prefix:"gpt-",url:"https://api.openai.com",protocol:"openai"},{prefix:"o1-",url:"https://api.openai.com",protocol:"openai"},{prefix:"o3-",url:"https://api.openai.com",protocol:"openai"},{prefix:"o4-",url:"https://api.openai.com",protocol:"openai"},{prefix:"grok-",url:"https://api.x.ai",protocol:"openai"},{prefix:"mistral-",url:"https://api.mistral.ai",protocol:"openai"},{prefix:"codestral-",url:"https://api.mistral.ai",protocol:"openai"},{prefix:"gemini-",url:"https://generativelanguage.googleapis.com",protocol:"openai"}];bFe=[/["']?cwd["']?\s*[:=]\s*["']?(\/(?:home|Users)\/[^\s"',}]+)/,/[Ww]orking\s+directory[:=]\s*(\/(?:home|Users)\/[^\s"',]+)/,/(\/(?:home|Users)\/[^\s"',]+)\/(?:CLAUDE|AGENTS|\.lore)\.md/,/(\/(?:home|Users)\/[\w./-]+)/]});function yc(e){let t=e["x-api-key"]||e["X-Api-Key"];if(t)return{scheme:"api-key",value:t};let n=e.authorization||e.Authorization;if(n){let o=/^Bearer\s+(\S+)$/i.exec(n);if(o)return{scheme:"bearer",value:o[1]}}return null}function rs(e){switch(e.scheme){case"api-key":return{"x-api-key":e.value};case"bearer":return{Authorization:`Bearer ${e.value}`}}}function Jj(e){return e.value.slice(-8)}function Kfe(e,t){Wfe.set(e,t)}function PFe(e){return Wfe.get(e)??null}function Xj(e){Zfe=e}function xFe(){return Zfe}function zO(e){if(e){let t=PFe(e);if(t)return t}return xFe()}var Wfe,Zfe,Cl=I(()=>{"use strict";l();Wfe=new Map;Zfe=null});function wFe(e){switch(e.type){case"text":return{type:"text",text:String(e.text??"")};case"thinking":return{type:"thinking",thinking:String(e.thinking??""),...e.signature!=null?{signature:String(e.signature)}:void 0};case"tool_use":return{type:"tool_use",id:String(e.id??""),name:String(e.name??""),input:e.input};case"tool_result":{let t="";return typeof e.content=="string"?t=e.content:Array.isArray(e.content)&&(t=e.content.filter(n=>n.type==="text").map(n=>String(n.text??"")).join(`
925
+ `)),{type:"tool_result",toolUseId:String(e.tool_use_id??""),content:t,...e.is_error?{isError:!0}:void 0}}default:return{type:"text",text:JSON.stringify(e)}}}function DFe(e){return typeof e=="string"?[{type:"text",text:e}]:Array.isArray(e)?e.map(t=>wFe(t)):[]}function kFe(e){return e==null?"":typeof e=="string"?e:Array.isArray(e)?e.filter(t=>t.type==="text").map(t=>String(t.text??"")).join(`
926
+ `):String(e)}function Jfe(e){switch(e.type){case"text":return{type:"text",text:e.text};case"thinking":return{type:"thinking",thinking:e.thinking,...e.signature!=null?{signature:e.signature}:void 0};case"tool_use":return{type:"tool_use",id:e.id,name:e.name,input:e.input};case"tool_result":{let t={type:"tool_result",tool_use_id:e.toolUseId,content:e.content};return e.isError&&(t.is_error=!0),t}}}function Xfe(e,t){let n=e??{},o=String(n.model??""),r=kFe(n.system),i=n.stream===!0,s=typeof n.max_tokens=="number"?n.max_tokens:4096,c=(Array.isArray(n.messages)?n.messages:[]).map(f=>({role:f.role==="assistant"?"assistant":"user",content:DFe(f.content)})),d=(Array.isArray(n.tools)?n.tools:[]).map(f=>({name:String(f.name??""),description:String(f.description??""),inputSchema:f.input_schema??{}})),p={};for(let[f,m]of Object.entries(n))LFe.has(f)||(p[f]=m);return{protocol:"anthropic",model:o,system:r,messages:c,tools:d,stream:i,maxTokens:s,metadata:p,rawHeaders:t}}function Qfe(e,t){let n={"content-type":"application/json","anthropic-version":MFe},o=yc(e.rawHeaders);o&&Object.assign(n,rs(o));let r=e.rawHeaders["anthropic-beta"]||e.rawHeaders["Anthropic-Beta"]||"";r&&(n["anthropic-beta"]=r);let i={model:e.model,max_tokens:e.maxTokens,stream:e.stream};if(e.system){let a=t?.systemTTL,c=t?.ltmSystem;if(a){let u=a==="1h"?{type:"ephemeral",ttl:"1h"}:{type:"ephemeral"},d=[{type:"text",text:e.system,cache_control:u}];c&&d.push({type:"text",text:c}),i.system=d}else i.system=c?`${e.system}
927
+
928
+ ${c}`:e.system}let s=e.messages.map(a=>({role:a.role,content:a.content.map(Jfe)}));if(t?.cacheConversation&&s.length>0){let a=s[s.length-1];if(a.content.length>0){let c=a.content[a.content.length-1];c.cache_control={type:"ephemeral"}}}if(i.messages=s,e.tools.length>0){let a=e.tools.map(c=>({name:c.name,description:c.description,input_schema:c.inputSchema}));if(t?.cacheTools&&a.length>0){let c=a[a.length-1];c.cache_control={type:"ephemeral",ttl:"1h"}}i.tools=a}for(let[a,c]of Object.entries(e.metadata))i[a]=c;return{url:"/v1/messages",headers:n,body:i}}function eme(e){let t={input_tokens:e.usage.inputTokens,output_tokens:e.usage.outputTokens};return e.usage.cacheReadInputTokens!=null&&(t.cache_read_input_tokens=e.usage.cacheReadInputTokens),e.usage.cacheCreationInputTokens!=null&&(t.cache_creation_input_tokens=e.usage.cacheCreationInputTokens),{id:e.id,type:"message",role:"assistant",model:e.model,content:e.content.map(Jfe),stop_reason:e.stopReason,stop_sequence:null,usage:t}}var MFe,LFe,Qj=I(()=>{"use strict";l();Cl();MFe="2023-06-01",LFe=new Set(["model","system","messages","tools","max_tokens","stream"])});function tme(e,t){let n=e??{},o=String(n.model??""),r=n.stream===!0,i=typeof n.max_tokens=="number"?n.max_tokens:4096,s={};typeof n.temperature=="number"&&(s.temperature=n.temperature),typeof n.top_p=="number"&&(s.top_p=n.top_p),typeof n.frequency_penalty=="number"&&(s.frequency_penalty=n.frequency_penalty),typeof n.presence_penalty=="number"&&(s.presence_penalty=n.presence_penalty),typeof n.user=="string"&&(s.user=n.user),(n.logprobs===!0||n.logprobs===!1)&&(s.logprobs=n.logprobs),typeof n.top_logprobs=="number"&&(s.top_logprobs=n.top_logprobs);let a=Array.isArray(n.messages)?n.messages:[],c="",u=[];for(let f of a){let m=f.role,_=f.content;if(m==="system"){let h=typeof _=="string"?_:"";c?c+=`
929
+
930
+ `+h:c=h;continue}if(m==="user"){let h=UFe(_,f.tool_calls);u.push({role:"user",content:h});continue}if(m==="assistant"){let h=$Fe(_,f.tool_calls);u.push({role:"assistant",content:h});continue}if(m==="tool"){let h=BFe(f);h.length>0&&u.push({role:"user",content:h});continue}}let p=(Array.isArray(n.tools)?n.tools:[]).map(f=>{let m=f.function;return{name:String(m?.name??f.name??""),description:String(m?.description??""),inputSchema:m?.parameters??{}}});return{protocol:"openai",model:o,system:c,messages:u,tools:p,stream:r,maxTokens:i,metadata:{},rawHeaders:{...t,"x-api-key":t["x-api-key"]??""},extras:s}}function UFe(e,t){let n=[];if(typeof e=="string"&&e)n.push({type:"text",text:e});else if(Array.isArray(e))for(let o of e)o.type==="text"?n.push({type:"text",text:String(o.text??"")}):o.type==="tool_use"&&n.push({type:"tool_use",id:String(o.id??""),name:String(o.name??""),input:o.input??{}});if(t)for(let o of t){let r=o.function;n.push({type:"tool_use",id:String(o.id??""),name:String(r?.name??""),input:r?.arguments?JSON.parse(r.arguments):{}})}return n}function $Fe(e,t){let n=[];if(typeof e=="string"&&e)n.push({type:"text",text:e});else if(Array.isArray(e))for(let o of e)o.type==="text"?n.push({type:"text",text:String(o.text??"")}):o.type==="tool_use"&&n.push({type:"tool_use",id:String(o.id??""),name:String(o.name??""),input:o.input??{}});if(t)for(let o of t){let r=o.function;n.push({type:"tool_use",id:String(o.id??""),name:String(r?.name??""),input:r?.arguments?JSON.parse(r.arguments):{}})}return n}function BFe(e){let t=[],n=String(e.tool_call_id??""),o=e.content;if(typeof o=="string"&&o)t.push({type:"tool_result",toolUseId:n,content:o});else if(Array.isArray(o))for(let r of o)r.type==="text"&&t.push({type:"tool_result",toolUseId:n,content:String(r.text??"")});return t}function eV(e,t){return t?jFe(e):GFe(e)}function GFe(e){let t=[],n="",o=[];for(let s of e.content)s.type==="text"?n+=s.text:s.type==="tool_use"&&o.push({id:s.id,type:"function",function:{name:s.name,arguments:JSON.stringify(s.input)}});let r={role:"assistant",content:n||null};o.length>0&&(r.tool_calls=o);let i={id:e.id.startsWith("chatcmpl-")?e.id:`chatcmpl-${e.id}`,object:"chat.completion",created:Math.floor(Date.now()/1e3),model:e.model,choices:[{index:0,message:r,finish_reason:nme(e.stopReason),logprobs:null}],usage:{prompt_tokens:e.usage.inputTokens,completion_tokens:e.usage.outputTokens,total_tokens:e.usage.inputTokens+e.usage.outputTokens}};return new Response(JSON.stringify(i),{status:200,headers:{"content-type":"application/json"}})}function nme(e){switch(e){case"end_turn":case"stop":case"stop_sequence":return"stop";case"max_tokens":case"length":return"length";case"tool_use":return"tool_calls";default:return"stop"}}function jFe(e){let t=new TextEncoder,n=0,o=new ReadableStream({start(r){let i=e.id.startsWith("chatcmpl-")?e.id:`chatcmpl-${e.id}`,s=Math.floor(Date.now()/1e3);function a(c,u){let d={id:i,object:"chat.completion.chunk",created:s,model:e.model,choices:[{index:0,delta:c,finish_reason:u}]};r.enqueue(t.encode(`data: ${JSON.stringify(d)}
931
+
932
+ `))}a({role:"assistant"},null);for(let c of e.content)if(c.type==="text"){let u=c.text,d=0;for(;d<u.length;){let p=u.slice(d,d+10);a({content:p},null),d+=10}}else c.type==="tool_use"&&(a({tool_calls:[{index:n,id:c.id,type:"function",function:{name:c.name,arguments:JSON.stringify(c.input)}}]},null),n++);a({},nme(e.stopReason)),r.enqueue(t.encode(`data: [DONE]
933
+
934
+ `)),r.close()}});return new Response(o,{status:200,headers:{"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive"}})}function rme(e,t){let n={"content-type":"application/json"},o=yc(e.rawHeaders);o&&(n.Authorization=`Bearer ${o.value}`);let r={model:e.model,messages:VFe(e.messages,e.system),stream:e.stream};return e.maxTokens&&(r.max_tokens=e.maxTokens),e.tools.length>0&&(r.tools=e.tools.map(i=>({type:"function",function:{name:i.name,description:i.description,parameters:i.inputSchema}}))),e.extras&&(e.extras.temperature!==void 0&&(r.temperature=e.extras.temperature),e.extras.top_p!==void 0&&(r.top_p=e.extras.top_p),e.extras.frequency_penalty!==void 0&&(r.frequency_penalty=e.extras.frequency_penalty),e.extras.presence_penalty!==void 0&&(r.presence_penalty=e.extras.presence_penalty),e.extras.user!==void 0&&(r.user=e.extras.user),e.extras.logprobs!==void 0&&(r.logprobs=e.extras.logprobs),e.extras.top_logprobs!==void 0&&(r.top_logprobs=e.extras.top_logprobs)),{url:`${t}/v1/chat/completions`,headers:n,body:r}}function VFe(e,t){let n=[];t&&n.push({role:"system",content:t});for(let o of e){let r=o.content,i=o.role,s=[],a=[];for(let u of r)u.type==="text"?s.push(u.text):u.type==="tool_use"?a.push({id:u.id,type:"function",function:{name:u.name,arguments:JSON.stringify(u.input)}}):u.type;let c={role:i};s.length>0&&(c.content=s.join("")),a.length>0&&(c.tool_calls=a),n.push(c)}return n}var tV=I(()=>{"use strict";l();Cl()});function dn(e,t){return`event: ${e}
935
+ data: ${t}
936
+
937
+ `}async function*nV(e){let t=new TextDecoder,n="";for(;;){let{done:o,value:r}=await e.read();r&&(n+=t.decode(r,{stream:!0}));let i;for(;(i=n.indexOf(`
938
+
939
+ `))!==-1;){let s=n.slice(0,i);if(n=n.slice(i+2),s.trim()==="")continue;let a="message",c=[];for(let u of s.split(`
940
+ `))u.startsWith("event:")?a=u.slice(6).trim():u.startsWith("data:")&&c.push(u.slice(5).trimStart());c.length>0&&(yield{event:a,data:c.join(`
941
+ `)})}if(o){if(n.trim()){let s="message",a=[];for(let c of n.split(`
942
+ `))c.startsWith("event:")?s=c.slice(6).trim():c.startsWith("data:")&&a.push(c.slice(5).trimStart());a.length>0&&(yield{event:s,data:a.join(`
943
+ `)})}break}}}function qO(){let e="",t="",n="",o=!1,r={inputTokens:0,outputTokens:0},i=new Map,s=[],a=new Set;function c(h,E){let T=dn(h,E),R;try{R=JSON.parse(E)}catch{return T}switch(h){case"message_start":u(R);break;case"content_block_start":d(R);break;case"content_block_delta":p(R);break;case"content_block_stop":f(R);break;case"message_delta":m(R);break;case"message_stop":o=!0;break}return T}function u(h){let E=h.message;if(!E)return;typeof E.id=="string"&&(e=E.id),typeof E.model=="string"&&(t=E.model);let T=E.usage;T&&(typeof T.input_tokens=="number"&&(r.inputTokens=T.input_tokens),typeof T.output_tokens=="number"&&(r.outputTokens=T.output_tokens),typeof T.cache_read_input_tokens=="number"&&(r.cacheReadInputTokens=T.cache_read_input_tokens),typeof T.cache_creation_input_tokens=="number"&&(r.cacheCreationInputTokens=T.cache_creation_input_tokens))}function d(h){let E=h.index;if(typeof E!="number")return;let T=h.content_block;if(!(!T||typeof T.type!="string"))switch(T.type){case"text":i.set(E,{type:"text",text:typeof T.text=="string"?T.text:""});break;case"thinking":i.set(E,{type:"thinking",thinking:typeof T.thinking=="string"?T.thinking:"",signature:""});break;case"tool_use":i.set(E,{type:"tool_use",id:typeof T.id=="string"?T.id:"",name:typeof T.name=="string"?T.name:"",partialJson:""});break}}function p(h){let E=h.index;if(typeof E!="number")return;let T=h.delta;if(!T||typeof T.type!="string")return;let R=i.get(E);if(R)switch(T.type){case"text_delta":R.type==="text"&&typeof T.text=="string"&&(R.text+=T.text);break;case"thinking_delta":R.type==="thinking"&&typeof T.thinking=="string"&&(R.thinking+=T.thinking);break;case"signature_delta":R.type==="thinking"&&typeof T.signature=="string"&&(R.signature+=T.signature);break;case"input_json_delta":R.type==="tool_use"&&typeof T.partial_json=="string"&&(R.partialJson+=T.partial_json);break}}function f(h){let E=h.index;if(typeof E!="number")return;let T=i.get(E);if(!(!T||a.has(E)))switch(a.add(E),T.type){case"text":s.push({type:"text",text:T.text});break;case"thinking":{let R={type:"thinking",thinking:T.thinking};T.signature&&(R.signature=T.signature),s.push(R);break}case"tool_use":{let R={};if(T.partialJson)try{R=JSON.parse(T.partialJson)}catch{R=T.partialJson}s.push({type:"tool_use",id:T.id,name:T.name,input:R});break}}}function m(h){let E=h.delta;E&&typeof E.stop_reason=="string"&&(n=E.stop_reason);let T=h.usage;T&&typeof T.output_tokens=="number"&&(r.outputTokens=T.output_tokens)}function _(){for(let[h,E]of i)if(!a.has(h))switch(a.add(h),E.type){case"text":s.push({type:"text",text:E.text});break;case"thinking":s.push({type:"thinking",thinking:E.thinking,...E.signature?{signature:E.signature}:{}});break;case"tool_use":{let T={};if(E.partialJson)try{T=JSON.parse(E.partialJson)}catch{T=E.partialJson}s.push({type:"tool_use",id:E.id,name:E.name,input:T});break}}return{id:e,model:t,content:s,stopReason:n,usage:{...r}}}return{processEvent:c,getResponse:_,isDone:()=>o}}function ome(e,t,n,o){let r=[];return r.push(dn("message_start",JSON.stringify({type:"message_start",message:{id:e,type:"message",role:"assistant",content:[],model:t,stop_reason:null,stop_sequence:null,usage:{input_tokens:o.inputTokens,output_tokens:1}}}))),r.push(dn("content_block_start",JSON.stringify({type:"content_block_start",index:0,content_block:{type:"text",text:""}}))),r.push(dn("content_block_delta",JSON.stringify({type:"content_block_delta",index:0,delta:{type:"text_delta",text:n}}))),r.push(dn("content_block_stop",JSON.stringify({type:"content_block_stop",index:0}))),r.push(dn("message_delta",JSON.stringify({type:"message_delta",delta:{stop_reason:"end_turn",stop_sequence:null},usage:{output_tokens:o.outputTokens}}))),r.push(dn("message_stop",JSON.stringify({type:"message_stop"}))),r.join("")}function ime(e="recall"){let t=qO(),n=new Set,o=new Set,r=0,i=-1,s=0,a="",c=!1;function u(d,p){t.processEvent(d,p);let f;try{f=JSON.parse(p)}catch{return dn(d,p)}switch(d){case"content_block_start":{let m=f.index;if(typeof m!="number")break;let _=f.content_block;if(_?.type==="tool_use"&&_.name===e)return n.add(m),r++,c=!0,i<0&&(i=m),"";if(_?.type==="tool_use"&&o.add(m),s++,r>0){let h={...f,index:m-r};return dn(d,JSON.stringify(h))}break}case"content_block_delta":case"content_block_stop":{let m=f.index;if(typeof m=="number"&&n.has(m))return"";if(r>0&&typeof f.index=="number"){let _={...f,index:f.index-r};return dn(d,JSON.stringify(_))}break}case"message_delta":case"message_stop":{if(c)return a+=dn(d,p),"";break}}return dn(d,p)}return{processEvent:u,getResponse:()=>t.getResponse(),isDone:()=>t.isDone(),hasRecall:()=>c,hasOtherTools:()=>o.size>0,recallBlockIndex:()=>i,clientBlockCount:()=>s,heldBackEvents:()=>a}}async function sme(e){let t=qO(),n=await e.text();for(let o of n.split(`
944
+
945
+ `)){if(!o.trim())continue;let r="message",i=[];for(let s of o.split(`
946
+ `))s.startsWith("event:")?r=s.slice(6).trim():s.startsWith("data:")&&i.push(s.slice(5).trimStart());i.length>0&&t.processEvent(r,i.join(`
947
+ `))}return t.getResponse()}var rV=I(()=>{"use strict";l()});function FFe(e,t=0){let n=0n;for(let r of e)n=n<<8n|BigInt(r);if(n===0n)return oV[0].repeat(Math.max(1,t));let o=[];for(;n>0n;)o.push(oV[Number(n%ame)]),n/=ame;for(o.reverse();o.length<t;)o.unshift(oV[0]);return o.join("")}function cme(){let e=new Uint8Array(12);crypto.getRandomValues(e.subarray(0,8));let t=Math.floor(Date.now()/1e3);return new DataView(e.buffer,e.byteOffset,e.byteLength).setUint32(8,t>>>0,!1),FFe(e,HFe)}function zFe(e){if(typeof e=="string")return[e];if(Array.isArray(e)){let t=[];for(let n of e)n&&typeof n=="object"&&"type"in n&&n.type==="text"&&"text"in n&&typeof n.text=="string"&&t.push(n.text);return t}return[]}async function iV(e,t){let n="";for(let c of e)if(c.role==="user"){n=zFe(c.content).join("");break}let o=n+(t?.model??"")+(t?.authSuffix??""),r=new TextEncoder().encode(o),i=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(i),a="";for(let c=0;c<8;c++)a+=s[c].toString(16).padStart(2,"0");return a}var oV,ame,HFe,ume,lme=I(()=>{"use strict";l();oV="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ame=62n;HFe=17;ume=20});function dme(e){for(let t=e.messages.length-1;t>=0;t--){let n=e.messages[t];if(n.role==="user")return n.content.filter(o=>o.type==="text").map(o=>o.text).join(`
948
+ `)}return""}function KFe(e){return Math.ceil(e.length/4)}function sV(e){let t=e.system.toLowerCase();for(let o of qFe)if(t.includes(o.toLowerCase()))return!0;let n=dme(e);if(e.tools.length===0&&n){for(let o of YFe)if(n.includes(o))return!0}if(n.includes("<template>")){let o=0;for(let r of WFe)n.includes(r)&&o++;if(o>=4)return!0}return!1}function pme(e){let t=dme(e);return ZFe.exec(t)?.[1]??void 0}function fme(e){return sV(e)?!1:e.tools.length<=XFe&&e.messages.length<=QFe&&e.system.length<JFe}function mme(e,t,n){return{id:`msg_lore_compact_${crypto.randomUUID().slice(0,8)}`,model:n,content:[{type:"text",text:t}],stopReason:"end_turn",usage:{inputTokens:0,outputTokens:KFe(t)}}}var qFe,YFe,WFe,ZFe,JFe,XFe,QFe,_me=I(()=>{"use strict";l();qFe=["anchored context summarization assistant"],YFe=["anchored summary from the conversation history above","Update the anchored summary below","<previous-summary>"],WFe=["## Goal","## Progress","## Key Decisions","## Next Steps","## Critical Context","## Relevant Files"];ZFe=/<previous-summary>\n(.*?)\n<\/previous-summary>/s;JFe=500,XFe=2,QFe=2});function eHe(e,t,n){let o=(0,cE.createHash)("sha256");o.update(`${e}:${t}:`);for(let r of n)switch(r.type){case"text":o.update(`text:${r.text}`);break;case"thinking":o.update(`thinking:${r.thinking}`);break;case"tool_use":o.update(`tool_use:${r.id}:${r.name}:${JSON.stringify(r.input)}`);break;case"tool_result":o.update(`tool_result:${r.toolUseId}:${r.content}`);break}return o.digest("hex").slice(0,32)}function tHe(e,t){let n=(0,cE.createHash)("sha256");return n.update(`${e}:part:${t}`),n.digest("hex").slice(0,32)}function nHe(e,t,n,o){let r=Date.now(),i=tHe(n,o);switch(e.type){case"text":return{id:i,sessionID:t,messageID:n,type:"text",text:e.text,time:{start:r,end:r}};case"thinking":return{id:i,sessionID:t,messageID:n,type:"reasoning",text:e.thinking,...e.signature!=null?{signature:e.signature}:void 0};case"tool_use":return{id:i,sessionID:t,messageID:n,type:"tool",tool:e.name,callID:e.id,state:{status:"pending",input:e.input}};case"tool_result":return{id:i,sessionID:t,messageID:n,type:"tool",tool:"result",callID:e.toolUseId,state:{status:"completed",input:null,output:e.content,time:{start:r,end:r}}}}}function YO(e,t){let n=[],o=Date.now();for(let r=0;r<e.length;r++){let i=e[r],s=eHe(i.role,r,i.content),a=i.content.map((c,u)=>nHe(c,t,s,u));if(i.role==="user"){let c={id:s,sessionID:t,role:"user",time:{created:o},agent:"gateway",model:{providerID:"anthropic",modelID:"unknown"}};n.push({info:c,parts:a})}else{let c={id:s,sessionID:t,role:"assistant",time:{created:o},parentID:"",modelID:"unknown",providerID:"anthropic",mode:"gateway",path:{cwd:"",root:""},cost:0,tokens:{input:0,output:0,reasoning:0,cache:{read:0,write:0}}};n.push({info:c,parts:a})}}return n}function gme(e,t,n){let o=e.info;o.role==="assistant"&&(o.tokens.input=t.inputTokens,o.tokens.output=t.outputTokens,o.tokens.cache.read=t.cacheReadInputTokens??0,o.tokens.cache.write=t.cacheCreationInputTokens??0,o.modelID=n)}function aV(e){let t=new Map;for(let o of e)for(let r of o.parts)cr(r)&&r.tool==="result"&&r.state.status==="completed"&&t.set(r.callID,{output:r.state.output,isError:!1});let n=Date.now();for(let o of e)for(let r of o.parts)if(cr(r)&&r.tool!=="result"&&r.state.status==="pending"){let i=t.get(r.callID);i&&(r.state={status:"completed",input:r.state.input,output:i.output,time:{start:n,end:n}})}for(let o of e){if(o.info.role!=="user")continue;let r=o.parts.length;o.parts=o.parts.filter(i=>!(cr(i)&&i.tool==="result")),o.parts.length===0&&r>0&&(o.parts=[{id:(0,cE.randomUUID)(),sessionID:"",messageID:o.info.id,type:"text",text:"[tool results provided]",time:{start:0,end:0}}])}}var cE,hme=I(()=>{"use strict";l();cE=require("crypto");ns()});function oHe(e){let t=e.headers.get("retry-after");if(!t)return null;let n=Number(t);if(!Number.isNaN(n))return n*1e3;let o=Date.parse(t);return Number.isNaN(o)?null:Math.max(0,o-Date.now())}function Tme(e,t){return e===0&&t!=null?Math.min(t,3e4):Math.min(1e3*2**e,8e3)}function Sme(e){return new Promise(t=>setTimeout(t,e))}function Ame(e,t,n){return{async prompt(o,r,i){let s=t(i?.sessionID);if(!s)return F.warn("no auth credentials available for worker call"),null;let a=i?.model??n,c=`${e.replace(/\/$/,"")}/v1/messages`,u=`gw-worker-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;Eme.add(u);try{let d=o?[{type:"text",text:o,cache_control:{type:"ephemeral",ttl:"1h"}}]:void 0,p=JSON.stringify({model:a.modelID,max_tokens:8192,system:d??o,messages:[{role:"user",content:r}]}),f={"Content-Type":"application/json","anthropic-version":"2023-06-01",...rs(s)};for(let m=0;;m++){let _;try{_=await fetch(c,{method:"POST",headers:f,body:p})}catch(E){if(m<uE){let T=Tme(m,null);F.warn(`worker request network error (attempt ${m+1}/${uE+1}), retrying in ${T}ms`),await Sme(T);continue}throw E}if(_.ok)return(await _.json()).content?.find(R=>R.type==="text"&&typeof R.text=="string")?.text??null;if(!rHe.has(_.status)){let E=await _.text().catch(()=>"(no body)");return F.error(`worker upstream request failed: ${_.status} ${_.statusText} \u2014 ${E}`),null}if(m<uE){let E=oHe(_),T=Tme(m,E);F.warn(`worker upstream ${_.status} (attempt ${m+1}/${uE+1}), retrying in ${T}ms`),await Sme(T);continue}let h=await _.text().catch(()=>"(no body)");return F.error(`worker upstream request failed after ${uE+1} attempts: ${_.status} ${_.statusText} \u2014 ${h}`),null}}catch(d){return F.error("worker prompt failed:",d),null}finally{Eme.delete(u)}}}}var Eme,rHe,uE,yme=I(()=>{"use strict";l();ns();Cl();Eme=new Set,rHe=new Set([429,500,502,503,529]),uE=3});function lHe(){let e=Date.now().toString(36),t=(uHe++).toString(36),n=Math.random().toString(36).slice(2,8);return`lore-${e}-${t}-${n}`}function cV(e){return`${e.scheme}:${e.value}`}function Rme(e,t,n,o,r){let i=r?.flushIntervalMs??iHe,s=r?.maxQueueSize??sHe,a=r?.pollIntervalMs??aHe,c=r?.maxBatchAgeMs??cHe,u=[],d=new Map,p=null,f=!1,m=new Set,_=0,h=0,E=0,T=0,R=0,C=0;async function P($,q){let J=q.map(Z=>({custom_id:Z.customId,params:Z.params}));F.info(`batch flush: submitting ${q.length} requests`);try{let Z=`${t.replace(/\/$/,"")}/v1/messages/batches`,k=await fetch(Z,{method:"POST",headers:{"Content-Type":"application/json","anthropic-version":"2023-06-01",...rs($)},body:JSON.stringify({requests:J})});if(!k.ok){let ye=await k.text().catch(()=>"(no body)");if(k.status===401||k.status===403){let at=cV($);m.has(at)||(m.add(at),F.warn(`batch API disabled for this credential (${k.status}): ${ye}. Future worker calls will use individual requests.`))}else F.error(`batch create failed: ${k.status} ${k.statusText} \u2014 ${ye}`);await ie(q);return}let ue=await k.json();h+=q.length;let le=new Map;for(let ye of q)le.set(ye.customId,ye);let Ae=setInterval(()=>O(ue.id).catch(ye=>F.error("batch poll error:",ye)),a);d.set(ue.id,{batchId:ue.id,requests:le,submittedAt:Date.now(),pollTimer:Ae,auth:$}),F.info(`batch created: ${ue.id} with ${q.length} requests`)}catch(Z){F.error("batch create error:",Z),await ie(q)}}async function M(){if(u.length===0)return;let $=u.splice(0),q=new Map;for(let J of $){let Z=cV(J.auth),k=q.get(Z);k||(k={auth:J.auth,items:[]},q.set(Z,k)),k.items.push(J)}for(let{auth:J,items:Z}of q.values()){if(m.has(cV(J))){await ie(Z);continue}await P(J,Z)}}async function O($){let q=d.get($);if(q){if(Date.now()-q.submittedAt>c){F.warn(`batch ${$} exceeded max age \u2014 falling back to synchronous`),clearInterval(q.pollTimer),d.delete($),await ie([...q.requests.values()]);return}try{let J=`${t.replace(/\/$/,"")}/v1/messages/batches/${$}`,Z=await fetch(J,{headers:{"anthropic-version":"2023-06-01",...rs(q.auth)}});if(!Z.ok){F.error(`batch poll failed for ${$}: ${Z.status}`);return}let k=await Z.json();if(k.processing_status!=="ended")return;F.info(`batch ${$} ended \u2014 retrieving results`),k.results_url?await z($,k.results_url):await z($,`${t.replace(/\/$/,"")}/v1/messages/batches/${$}/results`)}catch(J){F.error(`batch poll error for ${$}:`,J)}}}async function z($,q){let J=d.get($);if(J)try{let Z=await fetch(q,{headers:{"anthropic-version":"2023-06-01",...rs(J.auth)}});if(!Z.ok){F.error(`batch results fetch failed for ${$}: ${Z.status}`);return}let ue=(await Z.text()).split(`
949
+ `).filter(le=>le.trim());for(let le of ue)try{let Ae=JSON.parse(le),ye=J.requests.get(Ae.custom_id);if(!ye)continue;switch(Ae.result.type){case"succeeded":{let at=Ae.result.message?.content?.find(Yt=>Yt.type==="text"&&typeof Yt.text=="string");ye.resolve(at?.text??null),R++;break}case"errored":ye.resolve(null),C++,F.error(`batch item ${Ae.custom_id} errored: ${Ae.result.error?.type??"unknown"} \u2014 ${Ae.result.error?.message??JSON.stringify(Ae.result.error)}`);break;case"canceled":case"expired":ye.resolve(null),C++,F.warn(`batch item ${Ae.custom_id} ${Ae.result.type}`);break}J.requests.delete(Ae.custom_id)}catch{F.error(`failed to parse batch result line: ${le.slice(0,200)}`)}for(let[,le]of J.requests)le.resolve(null),C++;clearInterval(J.pollTimer),d.delete($),F.info(`batch ${$} fully resolved (${R} ok, ${C} failed total)`)}catch(Z){F.error(`batch results retrieval error for ${$}:`,Z)}}async function ie($){T+=$.length,F.info(`batch fallback: processing ${$.length} items synchronously`);let q=5;for(let J=0;J<$.length;J+=q){let Z=$.slice(J,J+q);await Promise.all(Z.map(async k=>{try{let ue=typeof k.params.system=="string"?k.params.system:k.params.system.map(ye=>ye.text).join(`
950
+ `),le=k.params.messages[0]?.content??"",Ae=await e.prompt(ue,le,{urgent:!0});k.resolve(Ae)}catch(ue){F.error(`batch fallback error for ${k.customId}:`,ue),k.resolve(null)}}))}}return p=setInterval(()=>{M().catch($=>F.error("batch flush timer error:",$))},i),{async prompt($,q,J){if(J?.urgent||f)return E++,e.prompt($,q,J);let Z=n(J?.sessionID);if(!Z)return E++,e.prompt($,q,J);_++;let k=J?.model??o,ue=$&&[{type:"text",text:$,cache_control:{type:"ephemeral",ttl:"1h"}}],le=lHe(),Ae=new Promise((ye,at)=>{u.push({customId:le,params:{model:k.modelID,max_tokens:8192,system:ue??$,messages:[{role:"user",content:q}]},resolve:ye,reject:at,enqueuedAt:Date.now(),auth:Z})});return u.length>=s&&M().catch(ye=>F.error("batch auto-flush error:",ye)),Ae},async shutdown(){f=!0,p&&(clearInterval(p),p=null),u.length>0&&(F.info(`batch shutdown: processing ${u.length} remaining items synchronously`),await ie(u.splice(0)));for(let[$,q]of d){clearInterval(q.pollTimer);for(let[,J]of q.requests)J.resolve(null);F.warn(`batch shutdown: abandoned inflight batch ${$}`)}d.clear()},stats(){return{queued:u.length,inflightBatches:d.size,inflightRequests:[...d.values()].reduce(($,q)=>$+q.requests.size,0),totalQueued:_,totalBatched:h,totalUrgent:E,totalFallback:T,totalResolved:R,totalFailed:C}}}}var iHe,sHe,aHe,cHe,uHe,Ime=I(()=>{"use strict";l();ns();Cl();iHe=3e4,sHe=50,aHe=6e4,cHe=36e5,uHe=0});function dV(e){for(let{prefix:t,inputCostPerToken:n}of fHe)if(e.startsWith(t))return n;return 100/1e6}async function mHe(){if(vl&&Date.now()-uV<pHe)return vl;try{let e=new AbortController,t=setTimeout(()=>e.abort(),1e4),n=await fetch(dHe,{signal:e.signal});if(clearTimeout(t),!n.ok)return F.warn(`models.dev API failed: ${n.status} ${n.statusText}`),vl??new Map;let r=(await n.json()).anthropic?.models;if(!r)return F.warn("models.dev API: no anthropic provider found"),vl??new Map;let i=new Map;for(let[s,a]of Object.entries(r))a.cost?.input!=null&&i.set(s,a.cost.input);return vl=i,uV=Date.now(),F.info(`models.dev: loaded costs for ${i.size} anthropic models`),i}catch(e){return F.warn("models.dev API error:",e),vl??new Map}}function _He(){vl=null,uV=0}async function gHe(e){let t=await mHe(),n=new Map;for(let o of e){let r=t.get(o);r!=null?n.set(o,r/1e6):n.set(o,dV(o))}return n}async function EHe(e,t){if(zf&&Date.now()-lV<hHe)return zf;try{let n=[],o;do{let a=new URL(`${e}/v1/models`);a.searchParams.set("limit","1000"),o&&a.searchParams.set("after_id",o);let c=await fetch(a.toString(),{headers:{"content-type":"application/json","anthropic-version":"2023-06-01",...rs(t)}});if(!c.ok){let d=await c.text().catch(()=>"(no body)");return F.warn(`model discovery failed: ${c.status} ${c.statusText} \u2014 ${d}`),zf??[]}let u=await c.json();for(let d of u.data)n.push(d);o=u.has_more?u.last_id:void 0}while(o);let r=n.map(a=>a.id),i=await gHe(r),s=n.map(a=>({id:a.id,providerID:"anthropic",cost:{input:i.get(a.id)??dV(a.id)},status:"active",capabilities:{input:{text:!0},reasoning:a.capabilities?.thinking?.supported??!1}}));return zf=s,lV=Date.now(),F.info(`model discovery: found ${s.length} models (${s.map(a=>a.id).join(", ")})`),s}catch(n){return F.warn("model discovery error:",n),zf??[]}}function THe(){zf=null,lV=0}async function bme(e,t,n,o,r,i){if(WO||ze().workerModel)return;let a=await EHe(t,n);if(a.length===0)return;let c=a.find(O=>O.id===e),u={id:e,providerID:"anthropic",cost:{input:c?.cost.input??dV(e)}},d=Ys.selectWorkerCandidates(u,a);if(d.length===0||d.length===1&&d[0].id===e)return;let p=Ys.computeModelFingerprint("anthropic",e,a.filter(O=>O.providerID==="anthropic").map(O=>O.id)),f=Ys.getValidatedWorkerModel("anthropic");if(!Ys.isValidationStale(f,p))return;let _=ti.loadForSession(r,i,!0).filter(O=>O.generation===0);if(_.length===0)return;let h=_[_.length-1],E=h.source_ids;if(E.length===0)return;let T=br.bySession(r,i),R=new Set(E),C=T.filter(O=>R.has(O.id));if(C.length===0)return;let P=C.map(O=>O.content).join(`
951
+ `),M=new Date(C[0].created_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});WO=!0;try{let O=await Ys.runValidation({llm:o,providerID:"anthropic",sessionModelID:e,candidates:d,referenceObservations:h.observations,sourceMessagesText:P,date:M});O&&F.info(`worker model validated: ${O.modelID} (judge=${O.judgeScore}) \u2014 saving 50%+ on worker calls`)}catch(O){F.error("worker model validation error:",O)}finally{WO=!1}}function lE(){let e=ze();return Ys.resolveWorkerModel("anthropic",e.workerModel,e.model)}function Nme(){THe(),_He(),WO=!1}var dHe,vl,uV,pHe,fHe,zf,lV,hHe,WO,pV=I(()=>{"use strict";l();ns();Cl();dHe="https://models.dev/api.json",vl=null,uV=0,pHe=3600*1e3,fHe=[{prefix:"claude-opus-4",inputCostPerToken:15/1e6},{prefix:"claude-sonnet-4",inputCostPerToken:3/1e6},{prefix:"claude-haiku-4",inputCostPerToken:1/1e6},{prefix:"claude-haiku-3-5",inputCostPerToken:.8/1e6},{prefix:"claude-sonnet-3-5",inputCostPerToken:3/1e6},{prefix:"claude-3-haiku",inputCostPerToken:.25/1e6},{prefix:"claude-3-sonnet",inputCostPerToken:3/1e6},{prefix:"claude-3-opus",inputCostPerToken:15/1e6}];zf=null,lV=0,hHe=3600*1e3;WO=!1});function Cme(e,t,n){let o=new Set,r=setInterval(()=>{let i=Date.now(),s=e.idleTimeoutSeconds*1e3;for(let[a,c]of t)o.has(a)||i-c.lastRequestTime<s||(o.add(a),n(a,c).catch(u=>F.error(`idle work failed for session ${a}:`,u)).finally(()=>o.delete(a)))},SHe);return()=>clearInterval(r)}function vme(e,t,n,o,r){return async(i,s)=>{let a=ze();try{let u=o();u&&await bme(r,n,u,t,e,i)}catch(u){F.error("idle worker model validation error:",u)}let c=lE();try{br.undistilledCount(e,i)>0&&await ti.run({llm:t,projectPath:e,sessionID:i,model:c,force:!0})}catch(u){F.error("idle distillation error:",u)}if(a.knowledge.enabled&&a.curator.onIdle)try{s.turnsSinceCuration>=a.curator.afterTurns&&(await Nl.run({llm:t,projectPath:e,sessionID:i,model:c}),s.turnsSinceCuration=0)}catch(u){F.error("idle curation error:",u)}if(a.knowledge.enabled)try{let u=Wr.forProject(e,!1);if(u.length>a.curator.maxEntries){F.info(`entry count ${u.length} exceeds maxEntries ${a.curator.maxEntries} \u2014 running consolidation`);let{updated:d,deleted:p}=await Nl.consolidate({llm:t,projectPath:e,sessionID:i,model:c});(d>0||p>0)&&F.info(`consolidation: ${d} updated, ${p} deleted`)}}catch(u){F.error("idle consolidation error:",u)}try{let{ttlDeleted:u,capDeleted:d}=br.prune({projectPath:e,retentionDays:a.pruning.retention,maxStorageMB:a.pruning.maxStorage});(u>0||d>0)&&F.info(`pruned temporal messages: ${u} by TTL, ${d} by size cap`)}catch(u){F.error("idle pruning error:",u)}if(a.knowledge.enabled)try{if(Wr.forProject(e,!1).length>0)if(a.agentsFile.enabled){let d=(0,Ome.join)(e,a.agentsFile.path);Wj({projectPath:e,filePath:d})}else VO(e)}catch(u){F.error("idle knowledge export error:",u)}if(a.knowledge.enabled)try{let u=Wr.cleanDeadRefs();u>0&&F.info(`cleaned ${u} dead knowledge cross-references`)}catch(u){F.error("idle dead-ref cleanup error:",u)}try{jf.refresh(e)}catch(u){F.error("idle lat-reader refresh error:",u)}}}var Ome,SHe,Pme=I(()=>{"use strict";l();Ome=require("node:path");ns();pV();SHe=3e4});function AHe(e){return Bun.zstdCompressSync(Buffer.from(e))}function yHe(e){return Buffer.from(Bun.zstdDecompressSync(e)).toString()}function RHe(e,t){let n=Math.min(e.length,t.length);for(let o=0;o<n;o++)if(e[o]!==t[o])return o;return n}function IHe(e,t){if(t>=e.length)return"<end>";if(t===0)return"<start>";let n=[],o=!1,r=!1,i="",s=!1;for(let c=0;c<e.length&&c<t;c++){let u=e[c];if(o){if(r){r=!1,s&&(i+=u);continue}if(u==="\\"){r=!0,s&&(i+=u);continue}if(u==='"'){o=!1,s=!1;continue}s&&(i+=u);continue}switch(u){case'"':o=!0,s=bHe(e,c),s&&(i="");break;case"{":n.push({kind:"object",key:""});break;case"[":n.push({kind:"array",index:0});break;case"}":case"]":n.pop();break;case":":if(i&&n.length>0){let d=n[n.length-1];d.kind==="object"&&(d.key=i),i=""}break;case",":if(n.length>0){let d=n[n.length-1];d.kind==="array"&&d.index++}break}}let a=[];for(let c of n)c.kind==="object"&&c.key?a.push(a.length===0?c.key:`.${c.key}`):c.kind==="array"&&a.push(`[${c.index}]`);return a.length===0?"<root>":a.join("")}function bHe(e,t){for(let n=t-1;n>=0;n--){let o=e[n];if(!(o===" "||o===`
952
+ `||o==="\r"||o===" "))return o==="{"||o===","}return!1}function NHe(e,t,n){if(e==="<end>")return n>t?"new content appended":"content truncated";if(e==="<start>")return"request structure changed from start";if(e==="<root>")return"top-level structure changed";if(e==="system"||e.startsWith("system"))return"system prompt changed";if(e==="model")return"model changed";if(e==="max_tokens")return"max_tokens changed";if(e==="tools"||e.startsWith("tools"))return"tool definitions changed";let o=e.match(/^messages\[(\d+)\]/);if(o){let r=parseInt(o[1],10),i=e.slice(o[0].length);if(!i)return`message ${r} structure changed`;if(i===".role")return`message ${r} role changed`;if(i.startsWith(".content"))return`message ${r} content changed`}return`changed at ${e}`}function xme(e,t,n,o){e.turnCount++;let r=n.cacheReadInputTokens??0,i=n.cacheCreationInputTokens??0,s=n.inputTokens??0,a=r+i+s,c=a>0?r/a:0;r===0&&i>0&&e.turnCount>1&&e.bustCount++;let u=0,d=0,p="<first-turn>",f="first turn \u2014 no previous request to compare";if(e.lastRequestBody!==null){let _=yHe(e.lastRequestBody),h=_.length,E=t.length;u=RHe(_,t);let T=Math.min(h,E);d=T>0?u/T:0,u<T?(p=IHe(t,u),f=NHe(p,h,E)):h!==E?(p="<end>",f=E>h?"new content appended (likely new messages)":"content truncated (context window compressed)"):(p="<identical>",f="request bodies are identical")}e.lastRequestBody=AHe(t),e.lastRequestBodyLength=t.length,e.lastCacheRead=r,e.lastCacheCreation=i;let m={turn:e.turnCount,cacheRead:r,cacheCreation:i,inputTokens:s,cacheHitRate:c,prefixMatchBytes:u,prefixMatchPercent:d,divergencePoint:p,divergenceReason:f};if(e.turnCount>1){let _=r===0&&i>0?" [BUST]":"",h=o?` session=${o.slice(0,16)}`:"";F.info(`cache-analytics:${h} turn=${m.turn} hit=${(m.cacheHitRate*100).toFixed(0)}% read=${r} create=${i} input=${s} prefixMatch=${(m.prefixMatchPercent*100).toFixed(1)}% (${u}/${e.lastRequestBodyLength}B) divergence="${p}" reason="${f}"`+_)}return m}var Mme=I(()=>{"use strict";l();ns()});function CHe(e="all"){return fV[e]??fV.all}function vHe(e){return OHe[e]??"all"}function mV(e,t="all"){return`\u{1F4DA} Searching ${CHe(t)} for "${e}"\u2026`}function Lme(e){let t=PHe.exec(e);return t?{query:t[2],scope:vHe(t[1])}:null}function dE(e,t="all"){return`${t}:${e}`}function wme(e,t){let n=!1;for(let o=0;o<e.messages.length;o++){let r=e.messages[o];if(r.role!=="assistant")continue;let i=-1,s=null;for(let f=0;f<r.content.length;f++){let m=r.content[f];if(m.type==="text"&&(s=Lme(m.text),s)){i=f;break}}if(i<0||!s)continue;let a=dE(s.query,s.scope),c=t.get(a);if(!c)continue;let u=r.content.slice(i+1),d=u.length>0&&u.some(f=>f.type!=="tool_use");r.content[i]={type:"tool_use",id:c.toolUseId,name:Ws,input:c.input},d&&(r.content.length=i+1);let p={role:"user",content:[{type:"tool_result",toolUseId:c.toolUseId,content:c.result}]};if(d){let f={role:"assistant",content:u};e.messages.splice(o+1,0,p,f),o+=2}else{let f=e.messages[o+1];f?.role==="user"?f.content.unshift({type:"tool_result",toolUseId:c.toolUseId,content:c.result}):(e.messages.splice(o+1,0,p),o+=1)}n=!0}return n}function Dme(e,t){if(t.size===0)return;let n=new Set;for(let o of e.messages)if(o.role==="assistant")for(let r of o.content){if(r.type!=="text")continue;let i=Lme(r.text);i&&n.add(dE(i.query,i.scope))}for(let o of t.keys())n.has(o)||t.delete(o)}function ZO(e){return e.content.find(t=>t.type==="tool_use"&&t.name===Ws)}function kme(e){return ZO(e)!==void 0}function Ume(e){return e.content.some(t=>t.type==="tool_use"&&t.name!==Ws)}function $me(e){return e.some(t=>t.name===Ws)}function xHe(e){let t=e.input;return{query:typeof t.query=="string"?t.query:"",scope:t.scope??"all"}}async function _V(e,t,n){let{query:o,scope:r}=xHe(e),i=ze();try{return{result:await qj({query:o,scope:r,projectPath:t,sessionID:n,knowledgeEnabled:i.knowledge?.enabled??!0,searchConfig:i.search}),input:{query:o,scope:r}}}catch(s){return F.error("gateway recall execution failed:",s),{result:"Recall search failed. The memory system encountered an error.",input:{query:o,scope:r}}}}function gV(e,t,n,o){let r={role:"assistant",content:[o]},i={role:"user",content:[{type:"tool_result",toolUseId:o.id,content:n||"[No results found.]"}]},s=e.tools.filter(a=>a.name!==Ws);return{...e,messages:[...e.messages,r,i],tools:s}}function qf(e){return{...e,content:e.content.map(t=>{if(t.type==="tool_use"&&t.name===Ws){let n=t.input,o=typeof n.query=="string"?n.query:"",r=n.scope??"all";return{type:"text",text:mV(o,r)}}return t})}}var KO,Ws,fV,OHe,PHe,Bme=I(()=>{"use strict";l();ns();KO={name:"recall",description:Yj,inputSchema:{type:"object",properties:{query:{type:"string",description:BO.query},scope:{type:"string",enum:["all","session","project","knowledge"],description:BO.scope}},required:["query"]}},Ws="recall",fV={all:"all archives",session:"session history",project:"project archives",knowledge:"knowledge base"},OHe=Object.fromEntries(Object.entries(fV).map(([e,t])=>[t,e]));PHe=/📚 Searching (.+?) for "(.+?)"…/});async function XO(){hV=!1,TV=null,gE.clear(),mE.clear(),EV.clear(),Rc&&"shutdown"in Rc&&await Rc.shutdown(),Rc=null,jme=void 0,_E&&(_E(),_E=null),SV=null,Nme()}function MHe(e,t){if(e===t)return 0;if(!e||!t)return 1;let n=Math.min(e.length,t.length),o=Math.max(e.length,t.length),r=0;for(let a=0;a<n&&e[a]===t[a];a++)r++;let i=0;for(let a=0;a<n-r&&e[e.length-1-a]===t[t.length-1-a];a++)i++;return 1-(r+i)/o}function DHe(e){for(let[t,n]of Object.entries(LHe))if(e.startsWith(t))return n;return wHe}async function Vme(e,t){if(!hV){if(await hj(e),De(e),hV=!0,TV=e,t&&!_E){let n=AV(t),o=SV??ze().model?.modelID??"claude-sonnet-4-20250514",r=vme(e,n,t.upstreamAnthropic,()=>zO(),o);_E=Cme(t,gE,r)}F.info(`gateway pipeline initialized: ${e}`)}}function AV(e){if(!Rc){let n=ze().model??{providerID:"anthropic",modelID:"claude-sonnet-4-20250514"},o=Ame(e.upstreamAnthropic,zO,n);process.env.LORE_BATCH_DISABLED==="1"?Rc=o:Rc=Rme(o,e.upstreamAnthropic,zO,n)}return Rc}function Fme(e,t){let n=gE.get(e);return n||(n={sessionID:e,projectPath:t,fingerprint:"",lastRequestTime:Date.now(),messageCount:0,turnsSinceCuration:0,recallStore:new Map,cacheAnalytics:{lastRequestBody:null,lastRequestBodyLength:0,lastCacheRead:0,lastCacheCreation:0,turnCount:0,bustCount:0}},gE.set(e,n)),n.lastRequestTime=Date.now(),n.recallStore||(n.recallStore=new Map),n}async function Hme(e,t){let n=e.messages.map(c=>({role:c.role,content:c.content})),o=yc(e.rawHeaders),r=await iV(n,{model:e.model,authSuffix:o?Jj(o):""}),i=e.messages.length,s=null;for(let[c,u]of gE){if(u.fingerprint!==r)continue;let d=i-u.messageCount;if(d<-ume)continue;let p=Math.abs(d);(!s||p<s.countDiff)&&(s={sid:c,countDiff:p})}return s?{sessionID:s.sid,isNew:!1}:{sessionID:cme(),isNew:!0}}async function JO(e,t,n,o){let r,i,s,a=Yfe(e.model),c=a?.protocol??e.protocol,u=a?.url??(c==="openai"?t.upstreamOpenAI:t.upstreamAnthropic);if(c==="openai"){let m=rme(e,u);r=m.url,i=m.headers,s=m.body}else{let m=Qfe(e,o);r=`${u}${m.url}`,i=m.headers,s=m.body}let d=JSON.stringify(s),p=n??jme;return p?{response:await p(s,e.model,e.stream,()=>fetch(r,{method:"POST",headers:i,body:d})),serializedBody:d}:{response:await fetch(r,{method:"POST",headers:i,body:d}),serializedBody:d}}function kHe(e,t,n){let o=n?ime(Ws):null,r=o??qO(),i=new TextEncoder,s=new ReadableStream({async start(a){try{let c=e.body.getReader();for await(let{event:d,data:p}of nV(c)){let f=r.processEvent(d,p);f&&a.enqueue(i.encode(f))}if(o?.hasRecall()){let d=o.getResponse(),p=ZO(d);if(p&&n){let{result:f,input:m}=await _V(p,n.sessionState.projectPath,n.sessionState.sessionID),_=m.scope??"all",h=dE(m.query,_),E=d.content.indexOf(p);n.sessionState.recallStore.set(h,{toolUseId:p.id,input:m,position:E,result:f});let T=mV(m.query,_),R=o.clientBlockCount(),C=[dn("content_block_start",JSON.stringify({type:"content_block_start",index:R,content_block:{type:"text",text:""}})),dn("content_block_delta",JSON.stringify({type:"content_block_delta",index:R,delta:{type:"text_delta",text:T}})),dn("content_block_stop",JSON.stringify({type:"content_block_stop",index:R}))].join("");if(a.enqueue(i.encode(C)),o.hasOtherTools()){F.info(`recall (stream, mixed): stored result for session ${n.sessionState.sessionID.slice(0,16)}`);let q=o.heldBackEvents();q&&a.enqueue(i.encode(q)),a.close();let J=qf(d);t(J);return}F.info(`recall (stream, only): executing follow-up for session ${n.sessionState.sessionID.slice(0,16)}`);let P=gV(n.modifiedReq,d,f,p),M;try{({response:M}=await JO(P,n.config,void 0,n.cacheOptions))}catch(q){F.error(`recall follow-up fetch error for session ${n.sessionState.sessionID.slice(0,16)}:`,q);let J=o.heldBackEvents();J&&a.enqueue(i.encode(J)),a.close();let Z=qf(d);t(Z);return}if(F.info(`recall follow-up response: status=${M.status} hasBody=${!!M.body} session=${n.sessionState.sessionID.slice(0,16)}`),!M.ok){let q=await M.text();F.error(`recall follow-up upstream error: ${M.status} ${q.slice(0,500)}`);let J=o.heldBackEvents();J&&a.enqueue(i.encode(J)),a.close();let Z=qf(d);t(Z);return}let O=o.clientBlockCount()+1,z=M.body.getReader(),ie=0;for await(let{event:q,data:J}of nV(z)){if(ie++,q==="message_start")continue;if(q==="content_block_start"||q==="content_block_delta"||q==="content_block_stop")try{let k=JSON.parse(J);if(typeof k.index=="number"){k.index=k.index+O;let ue=dn(q,JSON.stringify(k));a.enqueue(i.encode(ue));continue}}catch{}let Z=dn(q,J);a.enqueue(i.encode(Z))}F.info(`recall follow-up stream complete: ${ie} events piped, session=${n.sessionState.sessionID.slice(0,16)}`),a.close();let $=qf(d);t($);return}}a.close();let u=r.getResponse();t(u)}catch(c){F.error("streaming pipeline error:",c),a.error(c)}}});return new Response(s,{status:200,headers:{"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive"}})}async function Gme(e){let t=await e.json(),n=[],o=t.content;if(o)for(let i of o)switch(i.type){case"text":n.push({type:"text",text:String(i.text??"")});break;case"thinking":n.push({type:"thinking",thinking:String(i.thinking??""),...i.signature?{signature:String(i.signature)}:void 0});break;case"tool_use":n.push({type:"tool_use",id:String(i.id??""),name:String(i.name??""),input:i.input});break}let r=t.usage;return{id:String(t.id??""),model:String(t.model??""),content:n,stopReason:String(t.stop_reason??"end_turn"),usage:{inputTokens:r?.input_tokens??0,outputTokens:r?.output_tokens??0,cacheReadInputTokens:r?.cache_read_input_tokens,cacheCreationInputTokens:r?.cache_creation_input_tokens}}}function fE(e){let t=eme(e);return new Response(JSON.stringify(t),{status:200,headers:{"content-type":"application/json"}})}function UHe(e){let n=e.content.filter(r=>r.type==="text").map(r=>r.text).join(""),o=ome(e.id,e.model,n,{inputTokens:e.usage.inputTokens,outputTokens:e.usage.outputTokens});return new Response(o,{status:200,headers:{"content-type":"text/event-stream","cache-control":"no-cache",connection:"keep-alive"}})}function pE(e,t,n,o,r){let{sessionID:i,projectPath:s}=n;try{let a=(t.usage.inputTokens??0)+(t.usage.cacheReadInputTokens??0)+(t.usage.cacheCreationInputTokens??0);Uj(a,i,$j(i)),r&&xme(n.cacheAnalytics,r,t.usage,i);let c=YO(e.messages,i);aV(c);for(let d=c.length-1;d>=0;d--)if(c[d].info.role==="user"){br.store({projectPath:s,info:c[d].info,parts:c[d].parts});break}let u=YO([{role:"assistant",content:t.content}],i)[0];gme(u,t.usage,t.model),br.store({projectPath:s,info:u.info,parts:u.parts}),n.turnsSinceCuration=(n.turnsSinceCuration??0)+1,$He(n,o)}catch(a){F.error("post-response processing failed:",a)}}function $He(e,t){let{sessionID:n,projectPath:o}=e,r=AV(t),i=ze(),s=lE();sE()&&ti.run({llm:r,projectPath:o,sessionID:n,model:s,force:!0,urgent:!0}).catch(c=>F.error("background distillation failed:",c));let a=br.undistilledCount(o,n);a>=i.distillation.maxSegment&&(F.info(`incremental distillation: ${a} undistilled messages in ${n.slice(0,16)}`),ti.run({llm:r,projectPath:o,sessionID:n,model:s}).catch(c=>F.error("background distillation failed:",c))),i.knowledge.enabled&&i.curator.onIdle&&e.turnsSinceCuration>=i.curator.afterTurns&&Nl.run({llm:r,projectPath:o,sessionID:n,model:s}).then(()=>{e.turnsSinceCuration=0,mE.delete(n)}).catch(c=>F.error("background curation failed:",c))}async function BHe(e,t){let n=TV??Zj(e.system,e.rawHeaders);await Vme(n,t);let{sessionID:o}=await Hme(e,n),r=Fme(o,n),i=AV(t);F.info(`compaction intercepted for session ${o.slice(0,16)}`);let s=lE();await ti.run({llm:i,projectPath:n,sessionID:o,model:s,force:!0,urgent:!0});let a=ti.loadForSession(n,o),c=pme(e),u=ze(),d=u.knowledge.enabled?Wr.forProject(n,u.crossProject):[],p=d.length?vb(d.map(R=>({category:R.category,title:R.title,content:R.content}))):"",f=W0({hasDistillations:a.length>0,knowledge:p,previousSummary:c}),m="";a.length>0&&(m=`## Lore Pre-computed Session Summaries
953
+
954
+ The following ${a.length} summary chunk(s) were pre-computed from the conversation history. Use these as the authoritative source.
955
+
956
+ `+a.map((R,C)=>`### Chunk ${C+1}${R.generation>0?" (consolidated)":""}
957
+ ${R.observations}`).join(`
958
+
959
+ `));let _=m?`${m}
960
+
961
+ ---
962
+
963
+ ${f}`:f,E=await i.prompt(f,_,{model:u.model,workerID:"lore-compact",urgent:!0})??"(Compaction failed \u2014 no summary generated.)",T=mme(o,E,e.model);return e.stream?UHe(T):fE(T)}async function GHe(e,t){let{response:n}=await JO(e,t);if(e.stream&&n.body)return new Response(n.body,{status:n.status,headers:{"content-type":n.headers.get("content-type")??"text/event-stream"}});let o=await n.text();return new Response(o,{status:n.status,headers:{"content-type":"application/json"}})}async function jHe(e,t){let n=Zj(e.system,e.rawHeaders);await Vme(n,t);let o=yc(e.rawHeaders);o&&Xj(o);let{sessionID:r,isNew:i}=await Hme(e,n),s=Fme(r,n);if(o&&Kfe(r,o),i){let P=await iV(e.messages.map(M=>({role:M.role,content:M.content})),{model:e.model,authSuffix:o?Jj(o):""});s.fingerprint=P}s.messageCount=e.messages.length,SV=e.model,s.recallStore.size>0&&(wme(e,s.recallStore)&&F.info(`expanded recall markers for session ${r.slice(0,16)}`),Dme(e,s.recallStore)),F.info(`turn: session=${r.slice(0,16)} messages=${e.messages.length} model=${e.model} stream=${e.stream} new=${i}`);let a=DHe(e.model);wj({context:a.context,output:a.output});let c=ze();c.budget.maxLayer0Tokens!==void 0?kO(c.budget.maxLayer0Tokens):a.cacheReadCost&&c.budget.targetCacheReadCostPerTurn>0&&kO(Dj(c.budget.targetCacheReadCostPerTurn,a.cacheReadCost));let u=c.idleResumeMinutes*6e4,d=Lj(r,u);d.triggered&&(mE.delete(r),F.info(`session idle ${Math.round(d.idleMs/6e4)}min \u2014 refreshing caches`));let p;if(c.knowledge.enabled)try{let P=mE.get(r);if(!P){let M=c.budget.ltm,O=kj(M),z=Wr.forSession(n,r,O);if(z.length){let ie=vb(z.map($=>({category:$.category,title:$.title,content:$.content})),O);if(ie){let $=Math.ceil(ie.length/3);P={formatted:ie,tokenCount:$},mE.set(r,P)}}}if(P){let M=EV.get(r);M&&MHe(M.formatted,P.formatted)<.05?(p=M.formatted,bl(M.tokenCount,r)):(EV.set(r,P),p=P.formatted,bl(P.tokenCount,r))}else bl(0,r)}catch(P){F.error("LTM injection failed:",P),bl(0,r)}finally{DO(r)}else bl(0,r),DO(r);let f=YO(e.messages,r);aV(f);let m=Bj({messages:f,projectPath:n,sessionID:r});for(;m.messages.length>0&&m.messages.at(-1).info.role!=="user"&&!m.messages.at(-1).parts.some(O=>O.type==="tool");)m.messages.pop();let _=VHe(m.messages);FHe(_);let h={...e,messages:_};if(h.tools.length>0&&!$me(h.tools)){let P=c.knowledge.enabled?{...KO,description:KO.description+`
964
+
965
+ When making git commits, always check if .lore.md has unstaged changes and include it in the commit. This file contains shared project knowledge managed by lore and must be version-controlled.`}:KO;h.tools=[...h.tools,P]}let E={systemTTL:"1h",ltmSystem:p,cacheTools:!0,cacheConversation:!0},{response:T,serializedBody:R}=await JO(h,t,void 0,E);if(!T.ok){let P=await T.text();return F.error(`upstream error: ${T.status} ${P.slice(0,500)}`),new Response(P,{status:T.status,headers:{"content-type":"application/json"}})}if(e.stream&&T.body){let P=h.tools.some(M=>M.name===Ws);return kHe(T,M=>pE(e,M,s,t,R),P?{modifiedReq:h,config:t,sessionState:s,cacheOptions:E}:void 0)}let C=await Gme(T);if(kme(C)){let P=ZO(C),{result:M,input:O}=await _V(P,s.projectPath,s.sessionID),z=dE(O.query,O.scope??"all"),ie=C.content.indexOf(P);s.recallStore.set(z,{toolUseId:P.id,input:O,position:ie,result:M});let $=qf(C);if(Ume(C))return F.info(`recall (non-stream, mixed): stored result for session ${s.sessionID.slice(0,16)}`),pE(e,$,s,t,R),fE($);F.info(`recall (non-stream, only): executing follow-up for session ${s.sessionID.slice(0,16)}`);let q=gV(h,C,M,P),J;if({response:J}=await JO(q,t,void 0,E),!J.ok){let k=await J.text();return F.error(`recall follow-up upstream error: ${J.status} ${k.slice(0,500)}`),pE(e,$,s,t,R),fE($)}let Z=await Gme(J);return Z.usage.inputTokens+=C.usage.inputTokens,Z.usage.outputTokens+=C.usage.outputTokens,C.usage.cacheReadInputTokens&&(Z.usage.cacheReadInputTokens=(Z.usage.cacheReadInputTokens??0)+C.usage.cacheReadInputTokens),C.usage.cacheCreationInputTokens&&(Z.usage.cacheCreationInputTokens=(Z.usage.cacheCreationInputTokens??0)+C.usage.cacheCreationInputTokens),pE(e,Z,s,t,R),fE(Z)}return pE(e,C,s,t,R),fE(C)}function VHe(e){let t=[],n=[];for(let o of e){let r=[];o.info.role==="user"?(r.push(...n),n=[]):n=[];for(let i of o.parts)switch(i.type){case"text":r.push({type:"text",text:i.text});break;case"reasoning":r.push({type:"thinking",thinking:i.text??"",...i.signature!=null?{signature:i.signature}:void 0});break;case"tool":{let s=i;s.tool==="result"?r.push({type:"tool_result",toolUseId:s.callID,content:s.state.output??""}):(r.push({type:"tool_use",id:s.callID,name:s.tool,input:s.state.input??{}}),s.state.status==="completed"?n.push({type:"tool_result",toolUseId:s.callID,content:s.state.output??""}):s.state.status==="error"&&n.push({type:"tool_result",toolUseId:s.callID,content:s.state.error??"[error]",isError:!0}));break}default:"text"in i&&typeof i.text=="string"&&r.push({type:"text",text:i.text});break}t.push({role:o.info.role,content:r})}return t}function FHe(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.role!=="user"||!n.content.some(s=>s.type==="tool_result"))continue;let o=t>0&&e[t-1].role==="assistant"?e[t-1]:null,r=new Set((o?.content??[]).filter(s=>s.type==="tool_use").map(s=>s.id)),i=n.content.length;n.content=n.content.filter(s=>s.type!=="tool_result"||r.has(s.toolUseId)),n.content.length<i&&F.warn(`removed ${i-n.content.length} orphaned tool_result block(s) from message ${t}`),n.content.length===0&&(n.content=[{type:"text",text:"[tool results provided]"}])}}function HHe(e,t){return new Response(JSON.stringify({type:"error",error:{type:"server_error",message:t}}),{status:e,headers:{"content-type":"application/json"}})}async function hE(e,t){try{let n=yc(e.rawHeaders);return n&&Xj(n),sV(e)?await BHe(e,t):fme(e)?await GHe(e,t):await jHe(e,t)}catch(n){let o=n instanceof Error?n.message:"Unknown gateway error";return F.error("pipeline error:",n),HHe(502,o)}}var hV,jme,TV,gE,mE,EV,Rc,_E,SV,LHe,wHe,QO=I(()=>{"use strict";l();ns();HO();lme();_me();Qj();tV();rV();hme();yme();Ime();Cl();Pme();pV();Mme();Bme();hV=!1;TV=null,gE=new Map,mE=new Map,EV=new Map;Rc=null,_E=null,SV=null,LHe={"claude-opus-4":{context:2e5,output:32e3,cacheReadCost:15/1e6*.1},"claude-sonnet-4":{context:2e5,output:16e3,cacheReadCost:3/1e6*.1},"claude-sonnet-3-5":{context:2e5,output:8192,cacheReadCost:3/1e6*.1},"claude-haiku-3-5":{context:2e5,output:8192,cacheReadCost:.8/1e6*.1}},wHe={context:2e5,output:8192}});var zme=S((m$t,zHe)=>{zHe.exports={name:"@loreai/gateway",version:"0.14.1",type:"module",license:"FSL-1.1-Apache-2.0",description:"Lore as a transparent LLM proxy \u2014 context management for any AI coding client",main:"./dist/index.cjs",types:"./dist/index.d.cts",exports:{".":{bun:"./src/index.ts",types:"./dist/index.d.cts",require:"./dist/index.cjs",default:"./dist/index.cjs"}},bin:{lore:"./dist/bin.cjs","lore-gateway":"./dist/bin.cjs"},scripts:{typecheck:"tsc --noEmit",build:"bun run script/build.ts",bundle:"bun run script/bundle.ts","build:binary":"bun run script/build.ts --binary",start:"bun run src/index.ts"},dependencies:{},files:["dist/bin.cjs","dist/index.cjs","dist/index.d.cts"],engines:{node:">=22.15",bun:">=1.2.0"},repository:{type:"git",url:"git+https://github.com/BYK/loreai.git",directory:"packages/gateway"},publishConfig:{access:"public"},keywords:["lore","gateway","proxy","llm","context-management","anthropic","openai"],author:"BYK",devDependencies:{"@loreai/core":"workspace:*","@sentry/bun":"^10.52.0",binpunch:"^1.0.0"}}});function Pl(e){for(let[t,n]of Object.entries(qHe))e.headers.set(t,n);return e}function Yme(e){let t={};return e.forEach((n,o)=>{t[o]=n}),t}function Wme(e,t=200){return Pl(new Response(JSON.stringify(e),{status:t,headers:{"content-type":"application/json"}}))}function Ks(e,t,n){return Wme({type:"error",error:{type:t,message:n}},e)}async function YHe(e,t){let n;try{n=await e.json()}catch{return Ks(400,"invalid_request_error","Invalid JSON body")}let o;try{o=Xfe(n,Yme(e.headers))}catch(r){let i=r instanceof Error?r.message:"Failed to parse request";return Ks(400,"invalid_request_error",i)}try{let r=await hE(o,t);return Pl(r)}catch(r){let i=r instanceof Error?r.message:"Pipeline error";return console.error(`[lore] pipeline error: ${i}`),Ks(502,"api_error",`Gateway pipeline error: ${i}`)}}async function WHe(e){try{let t=await fetch(`${e.upstreamAnthropic}/v1/models`,{headers:{"content-type":"application/json"}}),n=new Response(t.body,{status:t.status,statusText:t.statusText,headers:new Headers(t.headers)});return Pl(n)}catch(t){let n=t instanceof Error?t.message:"Upstream unreachable";return Ks(502,"api_error",`Failed to fetch models: ${n}`)}}function KHe(){return Wme({status:"ok",version:qme})}async function ZHe(e,t){let n;try{n=await e.json()}catch{return Ks(400,"invalid_request_error","Invalid JSON body")}let o;try{o=tme(n,Yme(e.headers))}catch(a){let c=a instanceof Error?a.message:"Failed to parse request";return Ks(400,"invalid_request_error",c)}let r;try{r=await hE(o,t)}catch(a){let c=a instanceof Error?a.message:"Pipeline error";return console.error(`[lore] pipeline error: ${c}`),Ks(502,"api_error",`Gateway pipeline error: ${c}`)}if(!r.ok)return Pl(r);if((r.headers.get("content-type")??"").includes("text/event-stream")){let a=await sme(r);return Pl(eV(a,!0))}let s=await r.json();return Pl(eV(s,!1))}function eC(e){let t=Bun.serve({port:e.port,hostname:e.host,async fetch(n){let o=new URL(n.url),{pathname:r}=o,i=n.method;if(i==="OPTIONS")return Pl(new Response(null,{status:204}));e.debug&&console.error(`[lore] ${i} ${r}`);try{return i==="POST"&&r==="/v1/messages"?await YHe(n,e):i==="POST"&&r==="/v1/chat/completions"?await ZHe(n,e):i==="GET"&&r==="/v1/models"?await WHe(e):i==="GET"&&r==="/health"?KHe():Ks(404,"not_found",`No route for ${i} ${r}`)}catch(s){let a=s instanceof Error?s.message:"Internal server error";return console.error(`[lore] uncaught error: ${a}`),Ks(500,"api_error",a)}}});return{stop:()=>t.stop(),port:t.port??e.port}}var qme,qHe,yV=I(()=>{"use strict";l();Qj();tV();rV();QO();qme="unknown";try{let e=zme();e.version&&(qme=e.version)}catch{}qHe={"access-control-allow-origin":"*","access-control-allow-methods":"GET, POST, OPTIONS","access-control-allow-headers":"*","access-control-max-age":"86400"}});var Zme={};ft(Zme,{commandStart:()=>RV,startGateway:()=>nC});function nC(e={}){let t=FO();e.port!==void 0&&(t.port=e.port),e.host!==void 0&&(t.host=e.host),e.debug!==void 0&&(t.debug=e.debug);let n=eC(t),o=n.port;return{config:t,port:o,shutdown:async()=>{console.error("[lore] Shutting down\u2026"),n.stop(),await XO()}}}async function RV(e){let{config:t,port:n,shutdown:o}=nC(e),r=`http://${t.host}:${n}`;console.error(`[lore] Gateway listening on ${r}`),console.error("[lore] Model routing: claude-* \u2192 Anthropic, nvidia/* \u2192 Nvidia NIM, gpt-* \u2192 OpenAI, \u2026"),console.error(""),console.error("[lore] Point your AI agent at the gateway:"),console.error(` export ANTHROPIC_BASE_URL=${r}`),console.error(` export OPENAI_BASE_URL=${r}/v1`),console.error(""),console.error("[lore] Configuration (environment variables):"),console.error(` LORE_LISTEN_PORT Port to listen on (current: ${n})`),console.error(` LORE_LISTEN_HOST Host to bind to (current: ${t.host})`),console.error(` LORE_UPSTREAM_ANTHROPIC Anthropic API URL (current: ${t.upstreamAnthropic})`),console.error(` LORE_UPSTREAM_OPENAI OpenAI API URL (current: ${t.upstreamOpenAI})`),console.error(` LORE_IDLE_TIMEOUT Idle timeout in seconds (current: ${t.idleTimeoutSeconds})`),console.error(` LORE_DEBUG Enable debug logging (current: ${t.debug})`),console.error(` LORE_BATCH_DISABLED Disable batch background work (current: ${process.env.LORE_BATCH_DISABLED==="1"})`);let i=async()=>{await o(),process.exit(0)};return process.on("SIGINT",()=>i()),process.on("SIGTERM",()=>i()),new Promise(()=>{})}var rC=I(()=>{"use strict";l();HO();yV();QO()});function Jme(e){if(typeof e=="string")return e;if(e instanceof Error)return e.message;if(e&&typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}var Je,EE=I(()=>{"use strict";l();Je=class extends Error{reason;constructor(t,n){let o={network_error:"Failed to fetch version information.",execution_failed:"Upgrade command failed.",version_not_found:"The specified version was not found.",offline_cache_miss:"Cannot upgrade offline \u2014 no pre-downloaded update is available."};super(n??o[t]),this.name="UpgradeError",this.reason=t}}});var CV={};ft(CV,{GITHUB_RELEASES_URL:()=>Wf,KNOWN_CURL_DIRS:()=>IV,acquireLock:()=>Yf,cleanupOldBinary:()=>n_e,compareVersions:()=>e_e,determineInstallDir:()=>NV,fetchWithUpgradeError:()=>Zf,getBinaryDownloadUrl:()=>bV,getBinaryFilename:()=>oC,getBinaryPaths:()=>TE,getConfigDir:()=>Zs,getGitHubHeaders:()=>SE,getPlatformBinaryName:()=>Ic,getUserAgent:()=>ri,installBinary:()=>OV,isDowngrade:()=>Kf,isNightlyVersion:()=>bc,isProcessRunning:()=>r_e,releaseLock:()=>Jf,replaceBinarySync:()=>t_e});function Ic(){let e;process.platform==="darwin"?e="darwin":process.platform==="win32"?e="windows":e="linux";let t=process.arch==="arm64"?"arm64":"x64",n=process.platform==="win32"?".exe":"";return`lore-${e}-${t}${n}`}function bV(e){return`https://github.com/${Xme}/${Qme}/releases/download/${e}/${Ic()}`}function bc(e){return e.includes("-dev.")}function e_e(e,t){return Bun.semver.order(e,t)}function Kf(e,t){return e_e(e,t)===1}function oC(){return process.platform==="win32"?"lore.exe":"lore"}function TE(e){return{installPath:e,tempPath:`${e}.download`,oldPath:`${e}.old`,lockPath:`${e}.lock`}}function NV(e,t){let n=(t.PATH??"").split(ni.delimiter);if(t.LORE_INSTALL_DIR)return t.LORE_INSTALL_DIR;let o=[(0,ni.join)(e,".local","bin"),(0,ni.join)(e,"bin")];for(let r of o)if((0,Vn.existsSync)(r)&&n.includes(r))return r;return(0,ni.join)(e,".lore","bin")}function SE(){return{Accept:"application/vnd.github.v3+json","User-Agent":ri()}}function ri(){let e=typeof process.versions.bun<"u"?`bun/${process.versions.bun}`:`node/${process.versions.node}`;return`lore/${qe} (${process.platform}-${process.arch}) ${e}`}async function Zf(e,t,n){try{return await fetch(e,t)}catch(o){if(o instanceof Error&&o.name==="AbortError")throw o;let r=Jme(o);throw new Je("network_error",`Failed to connect to ${n}: ${r}`)}}function t_e(e,t){if(process.platform==="win32"){let n=`${t}.old`;try{(0,Vn.renameSync)(t,n)}catch{try{(0,Vn.unlinkSync)(n),(0,Vn.renameSync)(t,n)}catch{}}(0,Vn.renameSync)(e,t)}else(0,Vn.renameSync)(e,t)}function n_e(e){(0,xl.unlink)(e).catch(()=>{})}function r_e(e){try{return process.kill(e,0),!0}catch(t){return t.code==="EPERM"}}function Yf(e){try{(0,Vn.writeFileSync)(e,String(process.pid),{flag:"wx"})}catch(t){if(t.code!=="EEXIST")throw t;XHe(e)}}function XHe(e){let t;try{t=(0,Vn.readFileSync)(e,"utf-8").trim()}catch(o){if(o.code==="ENOENT"){Yf(e);return}throw o}let n=Number.parseInt(t,10);if(!Number.isNaN(n)&&r_e(n)){if(n===process.ppid){(0,Vn.writeFileSync)(e,String(process.pid));return}throw new Je("execution_failed","Another upgrade is already in progress")}try{(0,Vn.unlinkSync)(e)}catch(o){if(o.code!=="ENOENT")throw o}Yf(e)}function Jf(e){try{(0,Vn.unlinkSync)(e)}catch{}}async function OV(e,t){await(0,xl.mkdir)(t,{recursive:!0,mode:493});let n=(0,ni.join)(t,oC()),{tempPath:o,lockPath:r}=TE(n);Yf(r);try{if((0,ni.resolve)(e)!==(0,ni.resolve)(o)){try{await(0,xl.unlink)(o)}catch{}await Bun.write(o,Bun.file(e)),process.platform!=="win32"&&await(0,xl.chmod)(o,493)}t_e(o,n)}finally{Jf(r)}return n}function Zs(){if(process.env.LORE_CONFIG_DIR)return process.env.LORE_CONFIG_DIR;let e=process.env.HOME??process.env.USERPROFILE??require("node:os").homedir();return(0,ni.join)(e,".lore")}var Vn,xl,ni,Xme,Qme,Wf,IV,Js=I(()=>{"use strict";l();Vn=require("node:fs"),xl=require("node:fs/promises"),ni=require("node:path");Ol();EE();Xme="BYK",Qme="loreai",Wf=`https://api.github.com/repos/${Xme}/${Qme}/releases`,IV=[".local/bin","bin",".lore/bin"]});function Xf(e,t){let n=new DataView(e.buffer,e.byteOffset+t,8),o=n.getUint32(0,!0),r=n.getUint32(4,!0),i=r%2147483648*4294967296+o;return i!==0&&r>=2147483648?-i:i}function eze(e){if(e.byteLength<iC)throw new Error(`Patch too small: ${e.byteLength} bytes (need at least ${iC})`);let t=new TextDecoder().decode(e.subarray(0,8));if(t!==QHe)throw new Error(`Invalid patch format: expected TRDIFF10, got "${t}"`);let n=Xf(e,8),o=Xf(e,16),r=Xf(e,24);if(n<0||o<0||r<0)throw new Error("Corrupt patch: negative length in header");let i=iC+n+o;if(i>e.byteLength)throw new Error(`Corrupt patch: header lengths (${i}) exceed file size (${e.byteLength})`);return{controlLen:n,diffLen:o,newSize:r}}function o_e(e){let n=new ReadableStream({start(o){o.enqueue(e),o.close()}}).pipeThrough(new DecompressionStream("zstd"));return new PV(n.getReader())}async function tze(e){i_e+=1;let t=(0,a_e.join)((0,s_e.tmpdir)(),`lore-patch-old-${process.pid}-${i_e}`);try{return(0,sC.copyFileSync)(e,t,sC.constants.COPYFILE_FICLONE),{data:Bun.mmap(t,{shared:!1}),cleanup:()=>(0,vV.unlink)(t).catch(()=>{})}}catch{return await(0,vV.unlink)(t).catch(()=>{}),{data:new Uint8Array(await Bun.file(e).arrayBuffer()),cleanup:()=>{}}}}async function c_e(e,t,n){let{controlLen:o,diffLen:r,newSize:i}=eze(t),s=iC,a=s+o,c=a+r,u=Bun.zstdDecompressSync(t.subarray(s,a)),d=o_e(t.subarray(a,c)),p=o_e(t.subarray(c)),{data:f,cleanup:m}=await tze(e),_=Bun.file(n).writer(),h=new Bun.CryptoHasher("sha256"),E=0,T=0;try{for(let R=0;R<u.byteLength;R+=24){let C=Xf(u,R),P=Xf(u,R+8),M=Xf(u,R+16);if(C>0){let O=await d.read(C),z=new Uint8Array(C);for(let ie=0;ie<C;ie++)z[ie]=((f[E+ie]??0)+(O[ie]??0))%256;_.write(z),h.update(z),E+=C,T+=C}if(P>0){let O=await p.read(P);_.write(O),h.update(O),T+=P}E+=M}}finally{try{await _.end()}finally{await m()}}if(T!==i)throw new Error(`Output size mismatch: wrote ${T} bytes, expected ${i}`);return h.digest("hex")}var sC,vV,s_e,a_e,QHe,iC,PV,i_e,u_e=I(()=>{"use strict";l();sC=require("node:fs"),vV=require("node:fs/promises"),s_e=require("node:os"),a_e=require("node:path"),QHe="TRDIFF10",iC=32;PV=class{chunks=[];buffered=0;done=!1;reader;constructor(t){this.reader=t}async read(t){for(;this.buffered<t&&!this.done;){let r=await this.reader.read();if(r.done){this.done=!0;break}this.chunks.push(r.value),this.buffered+=r.value.byteLength}if(this.buffered<t)throw new Error(`Unexpected end of stream: needed ${t} bytes, have ${this.buffered}`);let n=new Uint8Array(t),o=0;for(;o<t;){let r=this.chunks[0];if(!r)break;let i=t-o;r.byteLength<=i?(n.set(r,o),o+=r.byteLength,this.buffered-=r.byteLength,this.chunks.shift()):(n.set(r.subarray(0,i),o),this.chunks[0]=r.subarray(i),this.buffered-=i,o=t)}return n}};i_e=0});function oze(e){if(e.name==="TimeoutError"||e.name==="AbortError")return!0;let t=e.message.toLowerCase();return t.includes("timeout")||t.includes("econnreset")||t.includes("econnrefused")||t.includes("network")||t.includes("fetch failed")}function d_e(e,t){let n=AbortSignal.timeout(e);return t?AbortSignal.any([n,t]):n}function ize(e,t){return!!(t?.aborted&&e.name==="AbortError")}async function xV(e,t,n,o){let r=o?.timeout??nze,i=o?.signal,s;for(let a=0;a<=l_e;a++)try{return await fetch(e,{...t,signal:d_e(r,i)})}catch(c){if(s=c instanceof Error?c:new Error(String(c)),ize(s,i)||a>=l_e||!oze(s))break}throw new Je("network_error",`${n}: ${s?.message??"unknown error"}`)}async function Qf(e){let t=`${cC}/token?scope=repository:${aC}:pull`,n=await xV(t,{headers:{"User-Agent":ri()}},"Failed to connect to GHCR",{signal:e});if(!n.ok)throw new Je("network_error",`GHCR token exchange failed: HTTP ${n.status}`);let o=await n.json();if(!o.token)throw new Je("network_error","GHCR token exchange returned no token");return o.token}async function Ml(e,t,n){let o=`${cC}/v2/${aC}/manifests/${t}`,r=await xV(o,{headers:{Authorization:`Bearer ${e}`,Accept:aze,"User-Agent":ri()}},`Failed to fetch manifest for tag "${t}"`,{signal:n});if(!r.ok)throw new Je("network_error",`Failed to fetch manifest for tag "${t}": HTTP ${r.status}`);return await r.json()}async function MV(e){return await Ml(e,sze)}function p_e(e){let t=e.annotations?.version;if(!t)throw new Je("network_error","Nightly manifest has no version annotation");return t}function f_e(e,t){let n=e.layers.find(o=>o.annotations?.["org.opencontainers.image.title"]===t);if(!n)throw new Je("version_not_found",`No nightly build found for ${t}`);return n}async function LV(e,t,n){let o=`${cC}/v2/${aC}/blobs/${t}`,r;try{r=await fetch(o,{headers:{Authorization:`Bearer ${e}`,"User-Agent":ri()},redirect:"manual",signal:d_e(rze,n)})}catch(i){let s=i instanceof Error?i.message:String(i);throw new Je("network_error",`Failed to connect to GHCR: ${s}`)}if(r.status===200)return r;if(r.status===301||r.status===302||r.status===307||r.status===308){let i=r.headers.get("location");if(!i)throw new Je("network_error",`GHCR blob redirect (${r.status}) had no Location header`);let s;try{s=await fetch(i,{headers:{"User-Agent":ri()},signal:n})}catch(a){let c=a instanceof Error?a.message:String(a);throw new Je("network_error",`Failed to download from blob storage: ${c}`)}if(!s.ok)throw new Je("network_error",`Blob storage download failed: HTTP ${s.status}`);return s}throw new Je("network_error",`Unexpected GHCR blob response: HTTP ${r.status}`)}async function cze(e,t,n){let o=`${cC}/v2/${aC}/tags/list?n=${m_e}`;t&&(o+=`&last=${encodeURIComponent(t)}`);let r=await xV(o,{headers:{Authorization:`Bearer ${e}`,"User-Agent":ri()}},"Failed to list GHCR tags",{signal:n});if(!r.ok)throw new Je("network_error",`Failed to list GHCR tags: HTTP ${r.status}`);return(await r.json()).tags??[]}async function wV(e,t,n){let o=[],r;for(;;){let i=await cze(e,r,n);if(i.length===0)break;for(let s of i)(!t||s.startsWith(t))&&o.push(s);if(i.length<m_e)break;r=i.at(-1)}return o}async function __e(e,t,n){return(await LV(e,t,n)).arrayBuffer()}var nze,l_e,rze,aC,sze,cC,aze,m_e,DV=I(()=>{"use strict";l();Js();EE();nze=1e4,l_e=1,rze=3e4;aC="BYK/loreai",sze="nightly",cC="https://ghcr.io",aze="application/vnd.oci.image.manifest.v1+json";m_e=100});function AE(){return(0,oi.join)(Zs(),uze)}async function pze(){await(0,ii.mkdir)(AE(),{recursive:!0,mode:448})}function uC(e){return e.replace(/[^a-zA-Z0-9.-]/g,"_")}function lC(e,t){return`${uC(e)}-${uC(t)}.patch`}function g_e(e,t){return`chain-${uC(e)}-${uC(t)}.json`}function dC(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"}async function kV(e,t){await pze();let n=AE();if(await Promise.all(e.patches.flatMap((o,r)=>{let i=t[r];if(!(i&&o))return[];let s=(0,oi.join)(n,lC(i.fromVersion,i.toVersion));return[Bun.write(s,o.data)]})),t.length>0){let o=t.at(0),r=t.at(-1);if(o&&r){let i={fromVersion:o.fromVersion,toVersion:r.toVersion,expectedSha256:e.expectedSha256,cachedAt:Date.now(),patches:t.map((a,c)=>({fromVersion:a.fromVersion,toVersion:a.toVersion,size:e.patches[c]?.size??0}))},s=(0,oi.join)(n,g_e(o.fromVersion,r.toVersion));await Bun.write(s,JSON.stringify(i))}}}async function fze(e){let t;try{t=await(0,ii.readdir)(e)}catch(r){if(dC(r))return[];throw r}let n=t.filter(r=>r.startsWith("chain-")&&r.endsWith(".json"));return(await Promise.all(n.map(async r=>{try{return await Bun.file((0,oi.join)(e,r)).json()}catch{return null}}))).filter(r=>r!==null)}function mze(e){let t=new Map;for(let n of e)for(let o of n.patches)t.set(o.fromVersion,{toVersion:o.toVersion,size:o.size});return t}function _ze(e,t,n){let o=[],r=t;for(;r!==n;){let i=e.get(r);if(!i||(o.push({fromVersion:r,toVersion:i.toVersion}),r=i.toVersion,o.length>dze))return null}return o.length>0?o:null}async function h_e(e,t){let n=AE(),o=await fze(n);if(o.length===0)return null;let r=mze(o),i=_ze(r,e,t);if(!i)return null;let s="";for(let d of o)if(d.toVersion===t&&d.expectedSha256){s=d.expectedSha256;break}if(!s)return null;let a=await Promise.all(i.map(async d=>{let p=(0,oi.join)(n,lC(d.fromVersion,d.toVersion));try{let f=new Uint8Array(await Bun.file(p).arrayBuffer());return{data:f,size:f.byteLength}}catch(f){if(dC(f))return null;throw f}})),c=[],u=0;for(let d of a){if(!d)return null;c.push(d),u+=d.size}return{patches:c,totalSize:u,expectedSha256:s}}async function gze(e,t,n){let o=[],r=new Set,i=await Promise.all(t.filter(a=>a.startsWith("chain-")&&a.endsWith(".json")).map(async a=>{try{let c=await Bun.file((0,oi.join)(e,a)).json();return{file:a,meta:c}}catch{return await(0,ii.unlink)((0,oi.join)(e,a)).catch(()=>{}),null}}));for(let a of i)if(a)if(n-a.meta.cachedAt>lze)o.push(a.meta);else for(let c of a.meta.patches)r.add(lC(c.fromVersion,c.toVersion));let s=[];for(let a of o){for(let c of a.patches){let u=lC(c.fromVersion,c.toVersion);r.has(u)||s.push((0,ii.unlink)((0,oi.join)(e,u)).catch(()=>{}))}s.push((0,ii.unlink)((0,oi.join)(e,g_e(a.fromVersion,a.toVersion))).catch(()=>{}))}await Promise.all(s)}async function E_e(){let e=AE(),t;try{t=await(0,ii.readdir)(e)}catch(n){if(dC(n))return;throw n}await gze(e,t,Date.now())}async function T_e(){let e=AE(),t;try{t=await(0,ii.readdir)(e)}catch(n){if(dC(n))return;throw n}await Promise.all(t.map(n=>(0,ii.unlink)((0,oi.join)(e,n)).catch(()=>{})))}var ii,oi,uze,lze,dze,pC=I(()=>{"use strict";l();ii=require("node:fs/promises"),oi=require("node:path");Js();uze="patch-cache",lze=10080*60*1e3,dze=10});function b_e(e){return!(qe==="dev"||qe==="0.0.0-dev"||bc(qe)!==bc(e)||Kf(qe,e))}async function Tze(e){let t=R_e+2,n;try{n=await fetch(`${Wf}?per_page=${t}`,{headers:{Accept:"application/vnd.github.v3+json","User-Agent":ri()},signal:e})}catch{return[]}return n.ok?await n.json():[]}function Sze(e){if(!e.digest)return null;let t=Eze.exec(e.digest);return t?t[1]?.toLowerCase()??null:null}async function Aze(e,t){let n;try{n=await fetch(e,{headers:{"User-Agent":ri()},signal:t})}catch{return null}return n.ok?new Uint8Array(await n.arrayBuffer()):null}function yze(e,t){let n=e.assets.find(o=>o.name===t);return n?Sze(n):null}function Rze(e){let{releases:t,currentVersion:n,targetVersion:o,binaryName:r,fullGzSize:i}=e,s=`${r}.patch`,a=t.findIndex(T=>T.tag_name===o),c=t.findIndex(T=>T.tag_name===n);if(a===-1||c===-1||a>=c)return null;let u=t.slice(a,c);if(u.length>R_e)return null;let d=u[0];if(!d)return null;let p=yze(d,r)??"";if(!p)return null;let f=[],m=0;for(let T of u){let R=T.assets.find(C=>C.name===s);if(!R||(f.push(R.browser_download_url),m+=R.size,m>i*I_e))return null}f.reverse();let _=[...u].reverse(),h=[],E=n;for(let T of _)h.push({fromVersion:E,toVersion:T.tag_name}),E=T.tag_name;return{patchUrls:f,expectedSha256:p,steps:h}}async function N_e(e,t,n){let o=Ic(),r=await Tze(n),i=r.find(p=>p.tag_name===t);if(!i)return null;let s=i.assets.find(p=>p.name===`${o}.gz`);if(!s)return null;let a=Rze({releases:r,currentVersion:e,targetVersion:t,binaryName:o,fullGzSize:s.size});if(!a)return null;let c=await Promise.all(a.patchUrls.map(p=>Aze(p,n))),u=[],d=0;for(let p of c){if(!p)return null;u.push({data:p,size:p.byteLength}),d+=p.byteLength}return{patches:u,totalSize:d,expectedSha256:a.expectedSha256,steps:a.steps}}function Ize(e){return e.annotations?.["from-version"]??null}function bze(e,t){return e.annotations?.[`sha256-${t}`]??null}function Nze(e,t,n){let o=[];for(let r of e){let i=r.slice(yE.length);Bun.semver.order(i,t)===1&&Bun.semver.order(i,n)!==1&&o.push({tag:r,version:i})}return o.sort((r,i)=>Bun.semver.order(r.version,i.version)),o.map(r=>r.tag)}function Oze(e,t){if(Ize(e)!==t.expectedFrom)return{ok:!1};let o=e.layers.find(r=>r.annotations?.["org.opencontainers.image.title"]===t.patchLayerName);return o?o.size>t.sizeLimit?{ok:!1}:{ok:!0,digest:o.digest,size:o.size}:{ok:!1}}function Cze(e){let{manifests:t,chainTags:n,currentVersion:o,targetVersion:r,patchLayerName:i,binaryName:s,fullGzSize:a}=e,c=[],u=0,d=o;for(let p=0;p<t.length;p++){let f=t[p],m=n[p];if(!(f&&m))return null;let _=a*I_e-u,h=Oze(f,{expectedFrom:d,patchLayerName:i,sizeLimit:_});if(!h.ok)return null;if(c.push(h.digest),u+=h.size,d=m.slice(yE.length),p===t.length-1){if(d!==r)return null;let E=bze(f,s)??"";return E?{digests:c,totalSize:u,expectedSha256:E}:null}}return null}async function vze(e){let{token:t,currentVersion:n,targetVersion:o,fullGzSize:r,preloadedTags:i,signal:s}=e,a=Ic(),c=`${a}.patch`,u=i??await wV(t,yE,s),d=Nze(u,n,o);if(d.length===0||d.length>hze)return null;let p=new Map,f=await Promise.all(d.map(async P=>{try{let M=await Ml(t,P,s);return{tag:P,manifest:M}}catch{return{tag:P,manifest:null}}}));for(let{tag:P,manifest:M}of f)M&&p.set(P,M);let m=d.map(P=>p.get(P));if(m.some(P=>!P))return null;let _=Cze({manifests:m,chainTags:d,currentVersion:n,targetVersion:o,patchLayerName:c,binaryName:a,fullGzSize:r});if(!_)return null;let h=await Promise.all(_.digests.map(P=>__e(t,P,s).then(M=>new Uint8Array(M)))),E=[],T=0;for(let P of h)E.push({data:P,size:P.byteLength}),T+=P.byteLength;let R=[],C=n;for(let P of d){let M=P.slice(yE.length);R.push({fromVersion:C,toVersion:M}),C=M}return{patches:E,totalSize:T,expectedSha256:_.expectedSha256,steps:R}}async function O_e(e,t,n,o){if(!b_e(e))return null;let r=bc(e)?"nightly":"stable";try{return r==="nightly"?await S_e({targetVersion:e,oldBinaryPath:t,destPath:n,resolveFromNetwork:()=>C_e(e),channel:"nightly",offline:o}):await S_e({targetVersion:e,oldBinaryPath:t,destPath:n,resolveFromNetwork:()=>N_e(qe,e),channel:"stable",offline:o})}catch(i){let s=i instanceof Error?i.message:String(i);return console.error(`[lore] Delta upgrade failed (${s}), falling back to full download`),null}}async function S_e(e){let{targetVersion:t,oldBinaryPath:n,destPath:o,resolveFromNetwork:r,channel:i,offline:s}=e,a=await Pze(qe,t);if(a)return await A_e(a,n,o);if(s)return null;let c=await r();return c?(c.steps&&kV(c,c.steps).catch(()=>{}),await A_e(c,n,o)):null}async function Pze(e,t){try{return await h_e(e,t)}catch{return null}}async function A_e(e,t,n){return{sha256:await Lze(e,t,n),patchBytes:e.totalSize,chainLength:e.patches.length}}async function C_e(e,t){let n=await Qf(t),o=Ic(),r=`nightly-${e}`,[i,s]=await Promise.all([Ml(n,r,t),wV(n,yE,t)]),a=i.layers.find(c=>c.annotations?.["org.opencontainers.image.title"]===`${o}.gz`);return a?await vze({token:n,currentVersion:qe,targetVersion:e,fullGzSize:a.size,preloadedTags:s,signal:t}):null}function xze(e){for(let t of[".patching.a",".patching.b"])try{(0,y_e.unlinkSync)(`${e}${t}`)}catch{}}async function Mze(e,t,n){let o=t,r="",i=`${n}.patching.a`,s=`${n}.patching.b`;try{for(let a=0;a<e.patches.length;a++){let c=e.patches[a];if(!c)throw new Error(`Missing patch at index ${a}`);let u=a===e.patches.length-1,d=a%2===0?i:s,p=u?n:d;r=await c_e(o,c.data,p),u||(o=p)}}finally{e.patches.length>1&&xze(n)}return r}async function Lze(e,t,n){let o=await Mze(e,t,n);if(o!==e.expectedSha256)throw new Error(`SHA-256 mismatch after patching: got ${o}, expected ${e.expectedSha256}`);return o}async function v_e(e,t,n){if(!b_e(e)||t?.aborted)return;let o=await n();!o?.steps||t?.aborted||await kV(o,o.steps)}function P_e(e,t){return v_e(e,t,()=>C_e(e,t))}function x_e(e,t){return v_e(e,t,()=>N_e(qe,e,t))}var y_e,R_e,hze,I_e,Eze,yE,UV=I(()=>{"use strict";l();y_e=require("node:fs");Js();u_e();Ol();DV();pC();R_e=10,hze=30,I_e=.6,Eze=/^sha256:([0-9a-f]+)$/i;yE="patch-"});function tm(){try{if(require("node:fs").readFileSync((0,RE.join)(Zs(),w_e),"utf-8").trim()==="nightly")return"nightly"}catch{}return"stable"}function D_e(e){try{let t=require("node:fs"),n=Zs();t.mkdirSync(n,{recursive:!0}),t.writeFileSync((0,RE.join)(n,w_e),e,"utf-8")}catch{}}function BV(){for(let t of Dze)if(process.execPath.startsWith(t))return TE(process.execPath);let e=(0,RE.join)((0,$V.homedir)(),".lore","bin",oC());return TE(e)}async function GV(e){let t=await Zf(`${Wf}/latest`,{headers:SE(),signal:e},"GitHub");if(!t.ok)throw new Je("network_error",`Failed to fetch from GitHub: ${t.status}`);let n=await t.json();if(!n.tag_name)throw new Je("network_error","No version found in GitHub release");return n.tag_name.replace(fC,"")}async function jV(e){if(e?.aborted)throw new Error("Aborted");let t=await Qf(e);if(e?.aborted)throw new Error("Aborted");let n=await MV(t);return p_e(n)}function k_e(e="stable",t){return e==="nightly"?jV(t):GV(t)}async function U_e(e,t){if(bc(e)||t==="nightly")try{let o=await Qf();return await Ml(o,`nightly-${e}`),!0}catch(o){if(o instanceof Je&&(o.message.includes("HTTP 404")||o.message.includes("HTTP 403")))return!1;throw o}return(await Zf(`${Wf}/tags/${e}`,{method:"HEAD",headers:SE()},"GitHub")).ok}async function $_e(e,t){let n=e.pipeThrough(new DecompressionStream("gzip")),o=Bun.file(t).writer();try{for await(let r of n)o.write(r)}finally{await o.end()}}function kze(){return`${Ic()}.gz`}async function Uze(e,t){let n=await Qf(),o=t?await Ml(n,`nightly-${t}`):await MV(n),r=kze(),i=f_e(o,r),s=await LV(n,i.digest);if(!s.body)throw new Je("execution_failed","GHCR blob response had no body");await $_e(s.body,e)}async function $ze(e,t){let n=bV(e),o=SE();try{let s=await Zf(`${n}.gz`,{headers:o},"GitHub");if(s.ok&&s.body){await $_e(s.body,t);return}}catch{}let r=await Zf(n,{headers:o},"GitHub");if(!r.ok)throw new Je("execution_failed",`Failed to download binary: HTTP ${r.status}`);let i=await r.arrayBuffer();await Bun.write(t,i)}function Gze(e){let t=(0,em.statSync)(e,{throwIfNoEntry:!1});return t?.isFile()&&t.size>0?t.size:null}async function jze(e){for(let t=1;t<=M_e;t++){let n=Gze(e);if(n!==null)return n;if(t===M_e)break;let o=Bze*2**(t-1);await Bun.sleep(o)}throw new Je("execution_failed",`Downloaded binary is missing or empty at ${e}. This is usually transient \u2014 rerun \`lore upgrade\` to retry.`)}function Vze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}async function Fze(e,t,n){let{tempPath:o,lockPath:r}=BV();Yf(r);try{try{(0,em.unlinkSync)(o)}catch{}let i=await O_e(e,process.execPath,o,!!n),s;if(i)s=i.patchBytes;else{if(n)throw new Je("offline_cache_miss",n==="explicit"?`Cannot upgrade to ${e} in offline mode \u2014 no pre-downloaded update is available. Run \`lore upgrade\` without \`--offline\` to download the update directly.`:`Cannot upgrade to ${e} \u2014 the network is unavailable and no pre-downloaded update was found. Check your internet connection and try again.`);bc(e)?await Uze(o,e):await $ze(t??e,o)}let a=await jze(o);return console.error(`[lore] Binary verified (${Vze(a)})`),T_e().catch(()=>{}),process.platform!=="win32"&&(0,em.chmodSync)(o,493),{tempBinaryPath:o,lockPath:r,patchBytes:s}}catch(i){throw Jf(r),i}}async function B_e(e,t,n){return Fze(e,t,n)}var em,$V,RE,fC,L_e,w_e,wze,Dze,M_e,Bze,VV=I(()=>{"use strict";l();em=require("node:fs"),$V=require("node:os"),RE=require("node:path");Js();UV();EE();DV();pC();fC=/^v/,L_e="nightly",w_e="channel";wze=require("node:path").sep,Dze=IV.map(e=>(0,RE.join)((0,$V.homedir)(),e)+wze);M_e=6,Bze=100});function _C(e){if(typeof Bun<"u"&&typeof Bun.which=="function")return Bun.which(e);try{let{execFileSync:t}=require("node:child_process"),n=process.platform==="win32"?"where":"which";return t(n,[e],{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim().split(`
966
+ `)[0]||null}catch{return null}}function Z_e(){let e=[];for(let t of HV){let n=t.detect();n&&e.push({def:t,path:n})}return e}var HV,J_e=I(()=>{"use strict";l();HV=[{name:"claude-code",displayName:"Claude Code",binary:"claude",detect:()=>_C("claude"),envVars:e=>({ANTHROPIC_BASE_URL:e})},{name:"codex",displayName:"Codex",binary:"codex",detect:()=>_C("codex"),envVars:e=>({OPENAI_BASE_URL:`${e}/v1`})},{name:"pi",displayName:"Pi",binary:"pi",detect:()=>_C("pi"),envVars:e=>({ANTHROPIC_BASE_URL:e})},{name:"opencode",displayName:"OpenCode",binary:"opencode",detect:()=>_C("opencode"),envVars:e=>({OPENAI_BASE_URL:`${e}/v1`})}]});var zV={};ft(zV,{commandRun:()=>aqe});async function oqe(e){console.error(`
967
+ [lore] Multiple AI agents detected:
968
+ `);for(let n=0;n<e.length;n++)console.error(` ${n+1}) ${e[n].def.displayName} (${e[n].path})`);console.error();let t=(0,Q_e.createInterface)({input:process.stdin,output:process.stderr});return new Promise(n=>{let o=()=>{t.question("Choose an agent [1]: ",r=>{let i=r.trim(),s=i===""?0:Number.parseInt(i,10)-1;Number.isInteger(s)&&s>=0&&s<e.length?(t.close(),n(e[s])):(console.error(` Invalid choice. Enter 1\u2013${e.length}.`),o())})};o()})}async function iqe(e,t){if(t.length>0){let r={};for(let i of HV)Object.assign(r,i.envVars(e));return{command:t[0],args:t.slice(1),env:r}}let n=Z_e();if(n.length===0)return console.error("[lore] No known AI agents found on PATH."),console.error("[lore] Install one of: Claude Code (claude), Codex (codex), Pi (pi), OpenCode (opencode)"),console.error("[lore] Or run with an explicit command: lore run <command>"),null;let o;if(n.length===1)o=n[0],console.error(`[lore] Detected ${o.def.displayName} at ${o.path}`);else if(process.stdin.isTTY)o=await oqe(n);else{console.error("[lore] Multiple agents detected but stdin is not a TTY."),console.error("[lore] Specify which agent to run: lore run <command>");for(let r of n)console.error(` - ${r.def.displayName}: lore run ${r.def.binary}`);return null}return{command:o.def.binary,args:[],env:o.def.envVars(e)}}function sqe(e){let t={...process.env,...e.env};return(0,X_e.spawn)(e.command,e.args,{env:t,stdio:"inherit"})}async function aqe(e,t){let{config:n,port:o,shutdown:r}=nC(e),i=`http://${n.host}:${o}`;console.error(`[lore] Gateway listening on ${i}`);let s=await iqe(i,t);if(!s){console.error("[lore] Running in server-only mode. Point your agent at the gateway manually."),console.error(`[lore] export ANTHROPIC_BASE_URL=${i}`);let u=async()=>{await r(),process.exit(0)};return process.on("SIGINT",()=>u()),process.on("SIGTERM",()=>u()),new Promise(()=>{})}console.error(`[lore] Launching: ${s.command} ${s.args.join(" ")}`.trimEnd());let a=sqe(s),c=u=>{a.kill(u)};return process.on("SIGINT",()=>c("SIGINT")),process.on("SIGTERM",()=>c("SIGTERM")),new Promise(u=>{a.on("exit",async(d,p)=>{if(await r(),p){let f={SIGHUP:1,SIGINT:2,SIGQUIT:3,SIGTERM:15};process.exit(128+(f[p]??1))}process.exit(d??0)}),a.on("error",async d=>{console.error(`[lore] Failed to launch ${s.command}: ${d.message}`),await r(),process.exit(1)})})}var X_e,Q_e,qV=I(()=>{"use strict";l();X_e=require("node:child_process"),Q_e=require("node:readline");rC();J_e()});var oge={};ft(oge,{commandUpgrade:()=>pqe});function cqe(e){let{values:t,positionals:n}=(0,nge.parseArgs)({args:e,options:{check:{type:"boolean",default:!1},force:{type:"boolean",default:!1},offline:{type:"boolean",default:!1},channel:{type:"string"}},allowPositionals:!0,strict:!1});return{flags:{check:!!t.check,force:!!t.force,offline:!!t.offline,channel:t.channel},versionArg:n[0]}}function uqe(e,t){let n=e?.toLowerCase();return n==="nightly"||n==="stable"?{channel:n,cleanVersionArg:void 0}:t==="nightly"||t==="stable"?{channel:t,cleanVersionArg:e}:{channel:tm(),cleanVersionArg:e}}function lqe(){try{let e=require("node:fs"),t=require("node:path"),{getConfigDir:n}=(Js(),hC(CV));return e.readFileSync(t.join(n(),"latest-version"),"utf-8").trim()||null}catch{return null}}function dqe(e){try{let t=require("node:fs"),n=require("node:path"),{getConfigDir:o}=(Js(),hC(CV)),r=o();t.mkdirSync(r,{recursive:!0}),t.writeFileSync(n.join(r,"latest-version"),e,"utf-8")}catch{}}function tge(e){if(e)return e.replace(fC,"");let t=lqe();if(!t)throw new Je("network_error","No cached version available. Run `lore upgrade` with network access first, then retry with --offline.");return t}async function pqe(e){let{flags:t,versionArg:n}=cqe(e),{channel:o,cleanVersionArg:r}=uqe(n,t.channel),i=tm(),s=o!==i;console.error(`[lore] Current version: ${qe}`),console.error(`[lore] Channel: ${o}`);let a,c=!1;if(t.offline)a=tge(r),c="explicit",console.error(`[lore] Offline mode: using cached target ${a}`);else try{let m=await k_e(o);a=r?.replace(fC,"")??m,dqe(m)}catch(m){if(m instanceof Je&&m.reason==="network_error")try{a=tge(r),c="network-fallback",console.error("[lore] Network unavailable, falling back to cached upgrade target")}catch{throw m}else throw m}if((s||ege.has(n??""))&&D_e(o),t.check){if(qe===a)console.error(`[lore] Already up to date (${qe})`);else{let m=Kf(qe,a)?"Downgrade":"Update";console.error(`[lore] ${m} available: ${qe} -> ${a}`),console.error("[lore] Run 'lore upgrade' to update.")}c&&console.error("[lore] (resolved from cache \u2014 network unavailable)");return}if(qe===a&&!t.force&&!s){console.error(`[lore] Already up to date (${qe})`);return}if(r&&!ege.has(r)&&!c&&!await U_e(a,o))throw new Je("version_not_found",`Version ${a} not found`);let u=Kf(qe,a);console.error(`[lore] ${u?"Downgrading":"Upgrading"} to ${a}...`);let f=await B_e(a,o==="nightly"&&!r?L_e:void 0,c);f.patchBytes&&console.error(`[lore] Applied delta patch (${fqe(f.patchBytes)} downloaded)`);try{let m=(0,rge.dirname)(BV().installPath),_=NV(require("node:os").homedir(),process.env),h=process.execPath.startsWith(m)?m:_,E=await OV(f.tempBinaryPath,h);console.error(`[lore] ${u?"Downgraded":"Upgraded"} successfully: ${qe} -> ${a}`),console.error(`[lore] Binary installed at: ${E}`),c&&console.error("[lore] (upgraded from cached patches)")}finally{Jf(f.lockPath)}}function fqe(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}var nge,rge,ege,ige=I(()=>{"use strict";l();nge=require("node:util"),rge=require("node:path");Ol();Js();EE();VV();ege=new Set(["nightly","stable"])});var hqe={};ft(hqe,{_cli:()=>age,handleRequest:()=>hE,loadConfig:()=>FO,resetPipelineState:()=>XO,startServer:()=>eC});module.exports=hC(hqe);l();l();l();l();l();l();l();l();var w=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;l();l();var ge=globalThis;l();l();l();l();var ve="10.52.0";function Nn(){return Xs(ge),ge}function Xs(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ve,t[ve]=t[ve]||{}}function xo(e,t,n=ge){let o=n.__SENTRY__=n.__SENTRY__||{},r=o[ve]=o[ve]||{};return r[e]||(r[e]=t())}var vc=["debug","info","warn","error","log","assert","trace"],Ige="Sentry Logger ",Mo={};function Tt(e){if(!("console"in ge))return e();let t=ge.console,n={},o=Object.keys(Mo);o.forEach(r=>{let i=Mo[r];n[r]=t[r],t[r]=i});try{return e()}finally{o.forEach(r=>{t[r]=n[r]})}}function bge(){TC().enabled=!0}function Nge(){TC().enabled=!1}function QV(){return TC().enabled}function Oge(...e){EC("log",...e)}function Cge(...e){EC("warn",...e)}function vge(...e){EC("error",...e)}function EC(e,...t){w&&QV()&&Tt(()=>{ge.console[e](`${Ige}[${e}]:`,...t)})}function TC(){return w?xo("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var b={enable:bge,disable:Nge,isEnabled:QV,log:Oge,warn:Cge,error:vge};l();var eF=/\(error: (.*)\)/,tF=/captureMessage|captureException/;function CE(...e){let t=e.sort((n,o)=>n[0]-o[0]).map(n=>n[1]);return(n,o=0,r=0)=>{let i=[],s=n.split(`
969
+ `);for(let a=o;a<s.length;a++){let c=s[a];c.length>1024&&(c=c.slice(0,1024));let u=eF.test(c)?c.replace(eF,"$1"):c;if(!u.includes("Error: ")){for(let d of t){let p=d(u);if(p){i.push(p);break}}if(i.length>=50+r)break}}return nF(i.slice(r))}}function AC(e){return Array.isArray(e)?CE(...e):e}function nF(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(OE(t).function||"")&&t.pop(),t.reverse(),tF.test(OE(t).function||"")&&(t.pop(),tF.test(OE(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||OE(t).filename,function:n.function||"?"}))}function OE(e){return e[e.length-1]||{}}var SC="<anonymous>";function sm(e){try{return!e||typeof e!="function"?SC:e.name||SC}catch{return SC}}function vE(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function rF(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var am={},oF={};function Pc(e,t){return am[e]=am[e]||[],am[e].push(t),()=>{let n=am[e];if(n){let o=n.indexOf(t);o!==-1&&n.splice(o,1)}}}function as(e,t){if(!oF[e]){oF[e]=!0;try{t()}catch(n){w&&b.error(`Error while instrumenting ${e}`,n)}}}function si(e,t){let n=e&&am[e];if(n)for(let o of n)try{o(t)}catch(r){w&&b.error(`Error while triggering instrumentation handler.
970
+ Type: ${e}
971
+ Name: ${sm(o)}
972
+ Error:`,r)}}var yC=null;function iF(e){let t="error";Pc(t,e),as(t,Pge)}function Pge(){yC=ge.onerror,ge.onerror=function(e,t,n,o,r){return si("error",{column:o,error:r,line:n,msg:e,url:t}),yC?yC.apply(this,arguments):!1},ge.onerror.__SENTRY_INSTRUMENTED__=!0}l();var RC=null;function sF(e){let t="unhandledrejection";Pc(t,e),as(t,xge)}function xge(){RC=ge.onunhandledrejection,ge.onunhandledrejection=function(e){return si("unhandledrejection",e),RC?RC.apply(this,arguments):!0},ge.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}l();l();l();l();l();l();l();l();l();l();var aF=Object.prototype.toString;function ai(e){switch(aF.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ci(e,Error)}}function PE(e,t){return aF.call(e)===`[object ${t}]`}function IC(e){return PE(e,"ErrorEvent")}function Qs(e){return PE(e,"String")}function ea(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function xc(e){return e===null||ea(e)||typeof e!="object"&&typeof e!="function"}function cs(e){return PE(e,"Object")}function bC(e){return typeof Event<"u"&&ci(e,Event)}function NC(e){return typeof Element<"u"&&ci(e,Element)}function OC(e){return PE(e,"RegExp")}function fn(e){return!!(e?.then&&typeof e.then=="function")}function CC(e){return cs(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ci(e,t){try{return e instanceof t}catch{return!1}}function cm(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}var Mge=ge,Lge=80;function cF(e,t={}){if(!e)return"<unknown>";try{let n=e,o=5,r=[],i=0,s=0,a=" > ",c=a.length,u,d=Array.isArray(t)?t:t.keyAttrs,p=!Array.isArray(t)&&t.maxStringLength||Lge;for(;n&&i++<o&&(u=wge(n,d),!(u==="html"||i>1&&s+r.length*c+u.length>=p));)r.push(u),s+=u.length,n=n.parentNode;return r.reverse().join(a)}catch{return"<unknown>"}}function wge(e,t){let n=e,o=[];if(!n?.tagName)return"";if(Mge.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}o.push(n.tagName.toLowerCase());let r=t?.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(r?.length)r.forEach(i=>{o.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&o.push(`#${n.id}`);let i=n.className;if(i&&Qs(i)){let s=i.split(/\s+/);for(let a of s)o.push(`.${a}`)}}for(let i of["aria-label","type","name","title","alt"]){let s=n.getAttribute(i);s&&o.push(`[${i}="${s}"]`)}return o.join("")}function um(e,t,n){if(!(t in e))return;let o=e[t];if(typeof o!="function")return;let r=n(o);typeof r=="function"&&Mc(r,o);try{e[t]=r}catch{w&&b.log(`Failed to replace method "${t}" in object`,e)}}function kt(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{w&&b.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Mc(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,kt(e,"__sentry_original__",t)}catch{}}function Lc(e,t,n,o=!0){let r=e[t];if(typeof r!="function")throw new Error(`Cannot wrap method: ${t} is not a function`);if(us(r))throw new Error(`Attempting to wrap method ${t} multiple times`);Mc(n,r),Object.defineProperty(e,t,{writable:!0,configurable:!0,enumerable:o,value:n})}function us(e){return e.__sentry_original__}function xE(e){if(ai(e))return{message:e.message,name:e.name,stack:e.stack,...lF(e)};if(bC(e)){let t={type:e.type,target:uF(e.target),currentTarget:uF(e.currentTarget),...lF(e)};return typeof CustomEvent<"u"&&ci(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function uF(e){try{return NC(e)?cF(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function lF(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function vC(e){let t=Object.keys(xE(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}l();var Dl;function wc(e){if(Dl!==void 0)return Dl?Dl(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=ge;return t in n&&typeof n[t]=="function"?(Dl=n[t],Dl(e)):(Dl=null,e())}function Ut(){return wc(()=>Math.random())}function Kr(){return wc(()=>Date.now())}l();function ta(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function PC(e,t){let n=e,o=n.length;if(o<=150)return n;t>o&&(t=o);let r=Math.max(t-60,0);r<5&&(r=0);let i=Math.min(r+140,o);return i>o-5&&(i=o),i===o&&(r=Math.max(i-140,0)),n=n.slice(r,i),r>0&&(n=`'{snip} ${n}`),i<o&&(n+=" {snip}"),n}function xC(e,t){if(!Array.isArray(e))return"";let n=[];for(let o=0;o<e.length;o++){let r=e[o];try{cm(r)?n.push(vE(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function ui(e,t,n=!1){return Qs(e)?OC(t)?t.test(e):Qs(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function li(e,t=[],n=!1){return t.some(o=>ui(e,o,n))}function Dge(){let e=ge;return e.crypto||e.msCrypto}var MC;function kge(){return Ut()*16}function Wt(e=Dge()){try{if(e?.randomUUID)return wc(()=>e.randomUUID()).replace(/-/g,"")}catch{}return MC||(MC="10000000100040008000"+1e11),MC.replace(/[018]/g,t=>(t^(kge()&15)>>t/4).toString(16))}function dF(e){return e.exception?.values?.[0]}function na(e){let{message:t,event_id:n}=e;if(t)return t;let o=dF(e);return o?o.type&&o.value?`${o.type}: ${o.value}`:o.type||o.value||n||"<unknown>":n||"<unknown>"}function wC(e,t,n){let o=e.exception=e.exception||{},r=o.values=o.values||[],i=r[0]=r[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function kl(e,t){let n=dF(e);if(!n)return;let o={type:"generic",handled:!0},r=n.mechanism;if(n.mechanism={...o,...r,...t},t&&"data"in t){let i={...r?.data,...t.data};n.mechanism.data=i}}var Uge=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function LC(e){return parseInt(e||"",10)}function DC(e){let t=e.match(Uge)||[],n=LC(t[1]),o=LC(t[2]),r=LC(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(o)?void 0:o,patch:isNaN(r)?void 0:r,prerelease:t[4]}}function ME(e){if(pF(e))return!0;try{kt(e,"__sentry_captured__",!0)}catch{}return!1}function pF(e){try{return e.__sentry_captured__}catch{}}l();var mF=1e3;function ls(){return Kr()/mF}function $ge(){let{performance:e}=ge;if(!e?.now||!e.timeOrigin)return ls;let t=e.timeOrigin;return()=>(t+wc(()=>e.now()))/mF}var fF;function di(){return(fF??(fF=$ge()))()}function _F(e){let t=di(),n={sid:Wt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Bge(n)};return e&&ds(n,e),n}function ds(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||di(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Wt()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function gF(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),ds(e,n)}function Bge(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}l();function ra(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let o={...e};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=ra(o[r],t[r],n-1));return o}l();function en(){return Wt()}function On(){return Wt().substring(16)}l();var kC="_sentrySpan";function oa(e,t){t?kt(e,kC,t):delete e[kC]}function ps(e){return e[kC]}var Gge=100,Hn=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:en(),sampleRand:Ut()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,oa(t,ps(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ds(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,o=n instanceof e?n.getScopeData():cs(n)?t:void 0,{tags:r,attributes:i,extra:s,user:a,contexts:c,level:u,fingerprint:d=[],propagationContext:p,conversationId:f}=o||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),d.length&&(this._fingerprint=d),p&&(this._propagationContext=p),f&&(this._conversationId=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,oa(this,void 0),this._attachments=[],this.setPropagationContext({traceId:en(),sampleRand:Ut()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let o=typeof n=="number"?n:Gge;if(o<=0)return this;let r={timestamp:ls(),...t,message:t.message?ta(t.message,2048):t.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>o&&(this._breadcrumbs=this._breadcrumbs.slice(-o),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ps(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ra(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let o=n?.event_id||Wt();if(!this._client)return w&&b.warn("No client configured on scope - will not capture exception!"),o;let r=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:r,...n,event_id:o},this),o}captureMessage(t,n,o){let r=o?.event_id||Wt();if(!this._client)return w&&b.warn("No client configured on scope - will not capture message!"),r;let i=o?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...o,event_id:r},this),r}captureEvent(t,n){let o=t.event_id||n?.event_id||Wt();return this._client?(this._client.captureEvent(t,{...n,event_id:o},this),o):(w&&b.warn("No client configured on scope - will not capture event!"),o)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Ul(){return xo("defaultCurrentScope",()=>new Hn)}function Zr(){return xo("defaultIsolationScope",()=>new Hn)}l();var hF=e=>e instanceof Promise&&!e[EF],EF=Symbol("chained PromiseLike"),LE=(e,t,n)=>{let o=e.then(r=>(t(r),r),r=>{throw n(r),r});return hF(o)&&hF(e)?o:jge(e,o)},jge=(e,t)=>{if(!t)return e;let n=!1;for(let o in e){if(o in t)continue;n=!0;let r=e[o];typeof r=="function"?Object.defineProperty(t,o,{value:(...i)=>r.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[o]=r}return n&&Object.assign(t,{[EF]:!0}),t};var UC=class{constructor(t,n){let o;t?o=t:o=new Hn;let r;n?r=n:r=new Hn,this._stack=[{scope:o}],this._isolationScope=r}withScope(t){let n=this._pushScope(),o;try{o=t(n)}catch(r){throw this._popScope(),r}return fn(o)?LE(o,()=>this._popScope(),()=>this._popScope()):(this._popScope(),o)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function $l(){let e=Nn(),t=Xs(e);return t.stack=t.stack||new UC(Ul(),Zr())}function Vge(e){return $l().withScope(e)}function Fge(e,t){let n=$l();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function TF(e){return $l().withScope(()=>e($l().getIsolationScope()))}function SF(){return{withIsolationScope:TF,withScope:Vge,withSetScope:Fge,withSetIsolationScope:(e,t)=>TF(t),getCurrentScope:()=>$l().getScope(),getIsolationScope:()=>$l().getIsolationScope()}}function $C(e){let t=Nn(),n=Xs(t);n.acs=e}function Jr(e){let t=Xs(e);return t.acs?t.acs:SF()}l();function Hge(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function zge(e,t){let{value:n,unit:o}=Hge(e)?e:{value:e,unit:void 0},r=qge(n),i=o&&typeof o=="string"?{unit:o}:{};if(r)return{...r,...i};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...i}}function Bl(e,t=!1){let n={};for(let[o,r]of Object.entries(e??{})){let i=zge(r,t);i&&(n[o]=i)}return n}function BC(e){if(!e)return 0;let t=0;for(let[n,o]of Object.entries(e)){t+=n.length*2,t+=o.type.length*2,t+=(o.unit?.length??0)*2;let r=o.value;Array.isArray(r)?t+=AF(r[0])*r.length:xc(r)?t+=AF(r):t+=100}return t}function AF(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function qge(e){let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}l();var yF;function RF(){return yF?.()}function GC(){return yF!==void 0}function Le(){let e=Nn();return Jr(e).getCurrentScope()}function Ie(){let e=Nn();return Jr(e).getIsolationScope()}function lm(){return xo("globalScope",()=>new Hn)}function Cn(...e){let t=Nn(),n=Jr(t);if(e.length===2){let[o,r]=e;return o?n.withSetScope(o,r):n.withScope(r)}return n.withScope(e[0])}function ia(...e){let t=Nn(),n=Jr(t);if(e.length===2){let[o,r]=e;return o?n.withSetIsolationScope(o,r):n.withIsolationScope(r)}return n.withIsolationScope(e[0])}function Q(){return Le().getClient()}function Dc(e){let t=RF();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:o,parentSpanId:r,propagationSpanId:i}=n,s={trace_id:o,span_id:i||On()};return r&&(s.parent_span_id=r),s}l();var Ge="sentry.source",Xr="sentry.sample_rate",jC="sentry.previous_trace_sample_rate",oe="sentry.op",ne="sentry.origin";var VC="sentry.measurement_unit",FC="sentry.measurement_value",HC="sentry.release",zC="sentry.environment",qC="sentry.segment.name",YC="sentry.segment.id",WC="sentry.sdk.name",KC="sentry.sdk.version",ZC="user.id",JC="user.email",dm="user.ip_address",XC="user.name",zn="sentry.custom_span_name",Gl="sentry.profile_id",jl="sentry.exclusive_time",QC="cache.hit",ev="cache.key",tv="cache.item_size",pm="http.request.method",kc="url.full";var nv="gen_ai.conversation.id";l();function Lo(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function fm(e,t){e.setAttribute("http.response.status_code",t);let n=Lo(t);n.message!=="unknown_error"&&e.setStatus(n)}l();l();function mm(e){try{let t=ge.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function _m(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var IF="_sentryScope",bF="_sentryIsolationScope";function gm(e,t,n){e&&(kt(e,bF,mm(n)),kt(e,IF,t))}function xr(e){let t=e;return{scope:t[IF],isolationScope:_m(t[bF])}}l();l();var fs="sentry-";var OF=8192;function wo(e){let t=Vl(e);if(!t)return;let n=Object.entries(t).reduce((o,[r,i])=>{if(r.startsWith(fs)){let s=r.slice(fs.length);o[s]=i}return o},{});if(Object.keys(n).length>0)return n}function Uc(e){if(!e)return;let t=Object.entries(e).reduce((n,[o,r])=>(r&&(n[`${fs}${o}`]=r),n),{});return rv(t)}function Vl(e){if(!(!e||!Qs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let o=NF(n);return Object.entries(o).forEach(([r,i])=>{t[r]=i}),t},{}):NF(e)}function NF(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let o=t.slice(0,n),r=t.slice(n+1);return[o,r].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,o])=>(n&&o&&(t[n]=o),t),{})}function rv(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,o],r)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(o)}`,s=r===0?i:`${t},${i}`;return s.length>OF?(w&&b.warn(`Not adding key: ${n} with val: ${o} to baggage header due to exceeding baggage size limits.`),t):s},"")}function Fl(e,t){if(!e)return t;let n=Vl(e),o=Vl(t);if(!o)return e;let r={},i=!1,s={},a={};for(let[c,u]of Object.entries(o))c.startsWith(fs)?(s[c]=u,i=!0):a[c]=u;if(n)for(let[c,u]of Object.entries(n))(!i||!c.startsWith(fs))&&(r[c]=u);i&&Object.assign(r,s);for(let[c,u]of Object.entries(a))r[c]??=u;return rv(r)}l();var Yge=/^o(\d+)\./,Wge=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Kge(e){return e==="http"||e==="https"}function qn(e,t=!1){let{host:n,path:o,pass:r,port:i,projectId:s,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&r?`:${r}`:""}@${n}${i?`:${i}`:""}/${o&&`${o}/`}${s}`}function Zge(e){let t=Wge.exec(e);if(!t){Tt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,o,r="",i="",s="",a=""]=t.slice(1),c="",u=a,d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){let p=u.match(/^\d+/);p&&(u=p[0])}return CF({host:i,pass:r,path:c,projectId:u,port:s,protocol:n,publicKey:o})}function CF(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Jge(e){if(!w)return!0;let{port:t,projectId:n,protocol:o}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(b.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?Kge(o)?t&&isNaN(parseInt(t,10))?(b.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(b.error(`Invalid Sentry Dsn: Invalid protocol ${o}`),!1):(b.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Xge(e){return e.match(Yge)?.[1]}function wE(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},o;return t.orgId?o=String(t.orgId):n&&(o=Xge(n)),o}function vF(e){let t=typeof e=="string"?Zge(e):CF(e);if(!(!t||!Jge(t)))return t}l();function Mr(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var DE=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function PF(e){if(!e)return;let t=e.match(DE);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function $c(e,t){let n=PF(e),o=wo(t);if(!n?.traceId)return{traceId:en(),sampleRand:Ut()};let r=Qge(n,o);o&&(o.sample_rand=r.toString());let{traceId:i,parentSpanId:s,parentSampled:a}=n;return{traceId:i,parentSpanId:s,sampled:a,dsc:o||{},sampleRand:r}}function sa(e=en(),t=On(),n){let o="";return n!==void 0&&(o=n?"-1":"-0"),`${e}-${t}${o}`}function aa(e=en(),t=On(),n){return`00-${e}-${t}-${n?"01":"00"}`}function Qge(e,t){let n=Mr(t?.sample_rand);if(n!==void 0)return n;let o=Mr(t?.sample_rate);return o&&e?.parentSampled!==void 0?e.parentSampled?Ut()*o:o+Ut()*(1-o):Ut()}function hm(e,t){let n=wE(e);return t&&n&&t!==n?(b.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(b.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var UE=0,Sm=1,xF=!1;function LF(e){let{spanId:t,traceId:n}=e.spanContext(),{data:o,op:r,parent_span_id:i,status:s,origin:a,links:c}=_e(e);return{parent_span_id:i,span_id:t,trace_id:n,data:o,op:r,status:s,origin:a,links:c}}function ca(e){let{spanId:t,traceId:n,isRemote:o}=e.spanContext(),r=o?t:_e(e).parent_span_id,i=xr(e).scope,s=o?i?.getPropagationContext().propagationSpanId||On():t;return{parent_span_id:r,span_id:s,trace_id:n}}function Am(e){let{traceId:t,spanId:n}=e.spanContext(),o=Lr(e);return sa(t,n,o)}function wF(e){let{traceId:t,spanId:n}=e.spanContext(),o=Lr(e);return aa(t,n,o)}function Bc(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:o,...r},attributes:i})=>({span_id:t,trace_id:n,sampled:o===Sm,attributes:i,...r}))}function iv(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:o},attributes:r})=>({span_id:t,trace_id:n,sampled:o===Sm,attributes:r}))}function vn(e){return typeof e=="number"?MF(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?MF(e.getTime()):di()}function MF(e){return e>9999999999?e/1e3:e}function _e(e){if($F(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(UF(e)){let{attributes:o,startTime:r,name:i,endTime:s,status:a,links:c}=e;return{span_id:t,trace_id:n,data:o,description:i,parent_span_id:DF(e),start_timestamp:vn(r),timestamp:vn(s)||void 0,status:Gc(a),op:o[oe],origin:o[ne],links:Bc(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function $E(e){if($F(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(UF(e)){let{attributes:o,startTime:r,name:i,endTime:s,status:a,links:c}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:DF(e),start_timestamp:vn(r),end_timestamp:vn(s),is_segment:e===Hl(e),status:sv(a),attributes:o,links:iv(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Hl(e)}}function DF(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function kF(e){return{...e,attributes:Bl(e.attributes),links:e.links?.map(t=>({...t,attributes:Bl(t.attributes)}))}}function UF(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function $F(e){return typeof e.getSpanJSON=="function"}function Lr(e){let{traceFlags:t}=e.spanContext();return t===Sm}function Gc(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function sv(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Em="_sentryChildSpans",ov="_sentryRootSpan";function zl(e,t){let n=e[ov]||e;kt(t,ov,n),e[Em]?e[Em].add(t):kt(e,Em,new Set([t]))}function ym(e){let t=new Set;function n(o){if(!t.has(o)&&Lr(o)){t.add(o);let r=o[Em]?Array.from(o[Em]):[];for(let i of r)n(i)}}return n(e),Array.from(t)}var mt=Hl;function Hl(e){return e[ov]||e}function Yn(){let e=Nn(),t=Jr(e);return t.getActiveSpan?t.getActiveSpan():ps(Le())}function jc(){xF||(Tt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),xF=!0)}var BF=!1;function GF(){if(BF)return;function e(){let t=Yn(),n=t&&mt(t);if(n){let o="internal_error";w&&b.log(`[Tracing] Root span: ${o} -> Global error occurred`),n.setStatus({code:2,message:o})}}e.tag="sentry_tracingErrorCallback",BF=!0,iF(e),sF(e)}l();function _t(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||Q()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}l();function jF(e){b.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Do(e,t){if(!t?.length)return!1;for(let n of t){if(the(n)){if(e.description&&ui(e.description,n))return w&&jF(e),!0;continue}let o=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!o)continue;let r=n.name?e.description&&ui(e.description,n.name):!0,i=n.op?e.op&&ui(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([a,c])=>ehe(e.attributes?.[a],c)):!0;if(r&&i&&s)return w&&jF(e),!0}return!1}function ehe(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?ui(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e===t}function VF(e,t){let n=t.parent_span_id,o=t.span_id;if(n)for(let r of e)r.parent_span_id===o&&(r.parent_span_id=n)}function the(e){return typeof e=="string"||e instanceof RegExp}l();l();var ql="production";var FF="_frozenDsc";function BE(e,t){kt(e,FF,t)}function av(e,t){let n=t.getOptions(),{publicKey:o}=t.getDsn()||{},r={environment:n.environment||ql,release:n.release,public_key:o,trace_id:e,org_id:wE(t)};return t.emit("createDsc",r),r}function pi(e,t){let n=t.getPropagationContext();return n.dsc||av(n.traceId,e)}function St(e){let t=Q();if(!t)return{};let n=mt(e),o=_e(n),r=o.data,i=n.spanContext().traceState,s=i?.get("sentry.sample_rate")??r[Xr]??r[jC];function a(_){return(typeof s=="number"||typeof s=="string")&&(_.sample_rate=`${s}`),_}let c=n[FF];if(c)return a(c);let u=i?.get("sentry.dsc"),d=u&&wo(u);if(d)return a(d);let p=av(e.spanContext().traceId,t),f=r[Ge]??r["sentry.span.source"],m=o.description;return f!=="url"&&m&&(p.transaction=m),_t()&&(p.sampled=String(Lr(n)),p.sample_rand=i?.get("sentry.sample_rand")??xr(n).scope?.getPropagationContext().sampleRand.toString()),a(p),t.emit("createDsc",p,n),p}l();var Qr=class{constructor(t={}){this._traceId=t.traceId||en(),this._spanId=t.spanId||On(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:UE}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,o){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};l();l();l();function ua(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}l();l();l();var nhe=Symbol.for("sentry.skipNormalization"),rhe=Symbol.for("sentry.overrideNormalizationDepth");function HF(e){return!!e[nhe]}function zF(e){let t=e[rhe];return typeof t=="number"?t:void 0}function ko(e,t=100,n=1/0){try{return cv("",e,t,n)}catch(o){return{ERROR:`**non-serializable** (${o})`}}}function uv(e,t=3,n=100*1024){let o=ko(e,t);return ahe(o)>n?uv(e,t-1,n):o}function cv(e,t,n=1/0,o=1/0,r=che()){let[i,s]=r;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=ohe(e,t);if(!a.startsWith("[object "))return a;if(HF(t))return t;let c=zF(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(i(t))return"[Circular ~]";let d=t;if(d&&typeof d.toJSON=="function")try{let _=d.toJSON();return cv("",_,u-1,o,r)}catch{}let p=Array.isArray(t)?[]:{},f=0,m=xE(t);for(let _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(f>=o){p[_]="[MaxProperties ~]";break}let h=m[_];p[_]=cv(_,h,u-1,o,r),f++}return s(t),p}function ohe(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(cm(t))return vE(t);if(CC(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${sm(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=ihe(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function ihe(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function she(e){return~-encodeURI(e).split(/%..|./).length}function ahe(e){return she(JSON.stringify(e))}function che(){let e=new WeakSet;function t(o){return e.has(o)?!0:(e.add(o),!1)}function n(o){e.delete(o)}return[t,n]}function mn(e,t=[]){return[e,t]}function dv(e,t){let[n,o]=e;return[n,[...o,t]]}function Rm(e,t){let n=e[1];for(let o of n){let r=o[0].type;if(t(o,r))return!0}return!1}function pv(e,t){return Rm(e,(n,o)=>t.includes(o))}function lv(e){let t=Xs(ge);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Im(e){let[t,n]=e,o=JSON.stringify(t);function r(i){typeof o=="string"?o=typeof i=="string"?o+i:[lv(o),i]:o.push(typeof i=="string"?lv(i):i)}for(let i of n){let[s,a]=i;if(r(`
973
+ ${JSON.stringify(s)}
974
+ `),typeof a=="string"||a instanceof Uint8Array)r(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(ko(a))}r(c)}}return typeof o=="string"?o:uhe(o)}function uhe(e){let t=e.reduce((r,i)=>r+i.length,0),n=new Uint8Array(t),o=0;for(let r of e)n.set(r,o),o+=r.length;return n}function fv(e){return[{type:"span"},e]}function mv(e){let t=typeof e.data=="string"?lv(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var qF={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function lhe(e){return e in qF}function GE(e){return lhe(e)?qF[e]:e}function Yl(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function _v(e,t,n,o){let r=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&o&&{dsn:qn(o)},...r&&{trace:r}}}function dhe(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function YF(e,t,n,o){let r=Yl(n),i={sent_at:new Date().toISOString(),...r&&{sdk:r},...!!o&&t&&{dsn:qn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return mn(i,[s])}function WF(e,t,n,o){let r=Yl(n),i=e.type&&e.type!=="replay_event"?e.type:"event";dhe(e,n?.sdk);let s=_v(e,r,o,t);return delete e.sdkProcessingMetadata,mn(s,[[{type:i},e]])}function KF(e,t){function n(m){return!!m.trace_id&&!!m.public_key}let o=St(e[0]),r=t?.getDsn(),i=t?.getOptions().tunnel,s={sent_at:new Date().toISOString(),...n(o)&&{trace:o},...!!i&&r&&{dsn:qn(r)}},{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(m=>{let _=_e(m);return!Do({description:_.description,op:_.op,attributes:_.data},c)}):e,d=e.length-u.length;d&&t?.recordDroppedEvent("before_send","span",d);let p=a?m=>{let _=_e(m),h=ua(a)?_:a(_);return h||(jc(),_)}:_e,f=[];for(let m of u){let _=p(m);_&&f.push(fv(_))}return mn(s,f)}l();function bm(e){if(!w)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:o}=_e(e),{spanId:r}=e.spanContext(),i=Lr(e),s=mt(e),a=s===e,c=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${r}`];if(o&&u.push(`parent ID: ${o}`),!a){let{op:d,description:p}=_e(s);u.push(`root ID: ${s.spanContext().spanId}`),d&&u.push(`root op: ${d}`),p&&u.push(`root description: ${p}`)}b.log(`${c}
975
+ ${u.join(`
976
+ `)}`)}function Nm(e){if(!w)return;let{description:t="< unknown name >",op:n="< unknown op >"}=_e(e),{spanId:o}=e.spanContext(),i=mt(e)===e,s=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${o}`;b.log(s)}l();function Vc(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let o=n.attributes||{},r=o[VC],i=o[FC];typeof r=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:r})}),t}l();function Pn(e){return e.getOptions().traceLifecycle==="stream"}var ZF=1e3,Wl=class{constructor(t={}){this._traceId=t.traceId||en(),this._spanId=t.spanId||On(),this._startTime=t.startTimestamp||di(),this._links=t.links,this._attributes={},this.setAttributes({[ne]:"manual",[oe]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:o}=this;return{spanId:t,traceId:n,traceFlags:o?Sm:UE}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=vn(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Ge,"custom"),this}end(t){this._endTime||(this._endTime=vn(t),Nm(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[oe],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Gc(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ne],profile_id:this._attributes[Gl],exclusive_time:this._attributes[jl],measurements:Vc(this._events),is_segment:this._isStandaloneSpan&&mt(this)===this||void 0,segment_id:this._isStandaloneSpan?mt(this).spanContext().spanId:void 0,links:Bc(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===mt(this),status:sv(this._status),attributes:this._attributes,links:iv(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,o){w&&b.log("[Tracing] Adding an event to span:",t);let r=JF(n)?n:o||di(),i=JF(n)?{}:n||{},s={name:t,time:vn(r),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=Q();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===mt(this)))return;if(this._isStandaloneSpan){this._sampled?fhe(KF([this],t)):(w&&b.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Pn(t)){t.emit("afterSegmentSpanEnd",this);return}let o=this._convertSpanToTransaction();o&&(xr(this).scope||Le()).captureEvent(o)}_convertSpanToTransaction(){if(!XF(_e(this)))return;this._name||(w&&b.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:t,isolationScope:n}=xr(this),o=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let i=ym(this).filter(d=>d!==this&&!phe(d)).map(d=>_e(d)).filter(XF),s=this._attributes[Ge];delete this._attributes[zn],i.forEach(d=>{delete d.data[zn]});let a={contexts:{trace:LF(this)},spans:i.length>ZF?i.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,ZF):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:St(this)},request:o,...s&&{transaction_info:{source:s}}},c=Vc(this._events);return c&&Object.keys(c).length&&(w&&b.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}};function JF(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function XF(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function phe(e){return e instanceof Wl&&e.isStandaloneSpan()}function fhe(e){let t=Q();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}l();l();function Uo(e,t,n=()=>{},o=()=>{}){let r;try{r=e()}catch(i){throw t(i),n(),i}return mhe(r,t,n,o)}function mhe(e,t,n,o){return fn(e)?LE(e,r=>{n(),o(r)},r=>{t(r),n()}):(n(),o(e),e)}l();function Om(e,t,n){if(!_t(e))return[!1];let o,r;typeof e.tracesSampler=="function"?(r=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),o=!0):t.parentSampled!==void 0?r=t.parentSampled:typeof e.tracesSampleRate<"u"&&(r=e.tracesSampleRate,o=!0);let i=Mr(r);if(i===void 0)return w&&b.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(r)} of type ${JSON.stringify(typeof r)}.`),[!1];if(!i)return w&&b.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,o];let s=n<i;return s||w&&b.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),[s,i,o]}var Kl="__SENTRY_SUPPRESS_TRACING__";function tn(e,t){let n=Zl();if(n.startSpan)return n.startSpan(e,t);let o=hv(e),{forceTransaction:r,parentSpan:i,scope:s}=e,a=s?.clone();return Cn(a,()=>eH(i)(()=>{let u=Le(),d=Ev(u,i),p=Q(),f=e.onlyIfParent&&!d,m=f?new Qr:gv({parentSpan:d,spanArguments:o,forceTransaction:r,scope:u});return f&&p?.recordDroppedEvent("no_parent_span","span"),(!tH(m)||!d)&&oa(u,m),Uo(()=>t(m),()=>{let{status:_}=_e(m);m.isRecording()&&(!_||_==="ok")&&m.setStatus({code:2,message:"internal_error"})},()=>{m.end()})}))}function dt(e,t){let n=Zl();if(n.startSpanManual)return n.startSpanManual(e,t);let o=hv(e),{forceTransaction:r,parentSpan:i,scope:s}=e,a=s?.clone();return Cn(a,()=>eH(i)(()=>{let u=Le(),d=Ev(u,i),p=e.onlyIfParent&&!d,f=p?new Qr:gv({parentSpan:d,spanArguments:o,forceTransaction:r,scope:u});return p&&Q()?.recordDroppedEvent("no_parent_span","span"),(!tH(f)||!d)&&oa(u,f),Uo(()=>t(f,()=>f.end()),()=>{let{status:m}=_e(f);f.isRecording()&&(!m||m==="ok")&&f.setStatus({code:2,message:"internal_error"})})}))}function Cm(e){let t=Zl();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=hv(e),{forceTransaction:o,parentSpan:r}=e;return(e.scope?s=>Cn(e.scope,s):r!==void 0?s=>eo(r,s):s=>s())(()=>{let s=Le(),a=Ev(s,r),c=Q();return e.onlyIfParent&&!a?(c?.recordDroppedEvent("no_parent_span","span"),new Qr):gv({parentSpan:a,spanArguments:n,forceTransaction:o,scope:s})})}var vm=(e,t)=>{let n=Nn(),o=Jr(n);if(o.continueTrace)return o.continueTrace(e,t);let{sentryTrace:r,baggage:i}=e,s=Q(),a=wo(i);return s&&!hm(s,a?.org_id)?jE(t):Cn(c=>{let u=$c(r,i);return c.setPropagationContext(u),oa(c,void 0),t()})};function eo(e,t){let n=Zl();return n.withActiveSpan?n.withActiveSpan(e,t):Cn(o=>(oa(o,e||void 0),t(o)))}function ms(e){let t=Zl();return t.suppressTracing?t.suppressTracing(e):Cn(n=>{n.setSDKProcessingMetadata({[Kl]:!0});let o=e();return n.setSDKProcessingMetadata({[Kl]:void 0}),o})}function jE(e){let t=Zl();return t.startNewTrace?t.startNewTrace(e):Cn(n=>(n.setPropagationContext({traceId:en(),sampleRand:Ut()}),w&&b.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),eo(null,e)))}function gv({parentSpan:e,spanArguments:t,forceTransaction:n,scope:o}){if(!_t()){let a=new Qr;if(n||!e){let c={sampled:"false",sample_rate:"0",transaction:t.name,...St(a)};BE(a,c)}return a}let r=Q();if(ghe(r,t))return Tv(o)||r?.recordDroppedEvent("ignored","span"),new Qr({dropReason:"ignored",traceId:e?.spanContext().traceId??o.getPropagationContext().traceId});let i=Ie(),s;if(e&&!n)s=_he(e,o,t),zl(e,s);else if(e){let a=St(e),{traceId:c,spanId:u}=e.spanContext(),d=Lr(e);s=QF({traceId:c,parentSpanId:u,...t},o,d),BE(s,a)}else{let{traceId:a,dsc:c,parentSpanId:u,sampled:d}={...i.getPropagationContext(),...o.getPropagationContext()};s=QF({traceId:a,parentSpanId:u,...t},o,d),c&&BE(s,c)}return bm(s),gm(s,o,i),s}function hv(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let o={...n};return o.startTimestamp=vn(e.startTime),delete o.startTime,o}return n}function Zl(){let e=Nn();return Jr(e)}function QF(e,t,n){let o=Q(),r=o?.getOptions()||{},{name:i=""}=e,s={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};o?.emit("beforeSampling",s,{decision:!1});let a=s.parentSampled??n,c=s.spanAttributes,u=t.getPropagationContext(),d=Tv(t),[p,f,m]=d?[!1]:Om(r,{name:i,parentSampled:a,attributes:c,parentSampleRate:Mr(u.dsc?.sample_rate)},u.sampleRand),_=new Wl({...e,attributes:{[Ge]:"custom",[Xr]:f!==void 0&&m?f:void 0,...c},sampled:p});return!p&&o&&!d&&(w&&b.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),o.recordDroppedEvent("sample_rate",Pn(o)?"span":"transaction")),o&&o.emit("spanStart",_),_}function _he(e,t,n){let{spanId:o,traceId:r}=e.spanContext(),i=Tv(t),s=i?!1:Lr(e),a=s?new Wl({...n,parentSpanId:o,traceId:r,sampled:s}):new Qr({traceId:r});zl(e,a);let c=Q();return c&&(Pn(c)&&a instanceof Qr&&(e instanceof Qr&&e.dropReason?(a.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),n.endTimestamp&&(c.emit("spanEnd",a),c.emit("afterSpanEnd",a))),a}function Ev(e,t){if(t)return t;if(t===null)return;let n=ps(e);if(!n)return;let o=Q();return(o?o.getOptions():{}).parentSpanIsAlwaysRootSpan?mt(n):n}function eH(e){return e!==void 0?t=>eo(e,t):t=>t()}function ghe(e,t){let n=e?.getOptions().ignoreSpans;return!e||!Pn(e)||!n?.length?!1:Do({description:t.name||"",op:t.attributes?.[oe]||t.op,attributes:t.attributes},n)}function tH(e){return e instanceof Qr&&e.dropReason==="ignored"}function Tv(e){return e.getScopeData().sdkProcessingMetadata[Kl]===!0}l();l();function rH(e,t){let{fingerprint:n,span:o,breadcrumbs:r,sdkProcessingMetadata:i}=t;hhe(e,t),o&&She(e,o),Ahe(e,n),Ehe(e,r),The(e,i)}function nH(e,t){let{extra:n,tags:o,attributes:r,user:i,contexts:s,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:d,eventProcessors:p,attachments:f,propagationContext:m,transactionName:_,span:h}=t;Pm(e,"extra",n),Pm(e,"tags",o),Pm(e,"attributes",r),Pm(e,"user",i),Pm(e,"contexts",s),e.sdkProcessingMetadata=ra(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),h&&(e.span=h),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),p.length&&(e.eventProcessors=[...e.eventProcessors,...p]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...m}}function Pm(e,t,n){e[t]=ra(e[t],n,1)}function la(e,t){let n=lm().getScopeData();return e&&nH(n,e.getScopeData()),t&&nH(n,t.getScopeData()),n}function hhe(e,t){let{extra:n,tags:o,user:r,contexts:i,level:s,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(o).length&&(e.tags={...o,...e.tags}),Object.keys(r).length&&(e.user={...r,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),s&&(e.level=s),a&&e.type!=="transaction"&&(e.transaction=a)}function Ehe(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function The(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function She(e,t){e.contexts={trace:ca(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:St(t),...e.sdkProcessingMetadata};let n=mt(t),o=_e(n).description;o&&!e.transaction&&e.type==="transaction"&&(e.transaction=o)}function Ahe(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}l();var yhe="thismessage:/";function xm(e){return"isRelative"in e}function Fc(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,o=t??(n?yhe:void 0);try{if("canParse"in URL&&!URL.canParse(e,o))return;let r=new URL(e,o);return n?{isRelative:n,pathname:r.pathname,search:r.search,hash:r.hash}:r}catch{}}function oH(e){if(xm(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Rhe(e,t,n,o){let r=n?.method?.toUpperCase()??"GET",i=o||(e?t==="client"?oH(e):e.pathname:"/");return`${r} ${i}`}function Sv(e,t,n,o,r){let i={[ne]:n,[Ge]:"url"};return r&&(i[t==="server"?"http.route":"url.template"]=r,i[Ge]="route"),o?.method&&(i[pm]=o.method.toUpperCase()),e&&(e.search&&(i["url.query"]=e.search),e.hash&&(i["url.fragment"]=e.hash),e.pathname&&(i["url.path"]=e.pathname,e.pathname==="/"&&(i[Ge]="route")),xm(e)||(i[kc]=e.href,e.port&&(i["url.port"]=e.port),e.protocol&&(i["url.scheme"]=e.protocol),e.hostname&&(i[t==="server"?"server.address":"url.domain"]=e.hostname))),[Rhe(e,t,o,r),i]}function fi(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",o=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:o,relative:t[5]+n+o}}function to(e){return e.split(/[?#]/,1)[0]}function mi(e){let{protocol:t,host:n,path:o}=e,r=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${t?`${t}://`:""}${r}${o}`}function Mm(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),o=n?n[1]:"text/plain",r=e.includes(";base64,"),i=e.indexOf(","),s="";if(t&&i!==-1){let a=e.slice(i+1);s=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${o}${r?",base64":""}${s?`,${s}`:""}`}return e}function yv(e,t){let n=$E(e),o=Hl(e),r=$E(o),{isolationScope:i,scope:s}=xr(e),a=la(i,s);Ihe(n,r,t,a);let c=e.kind;Nhe(n,c),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),d=u&&ua(u)?bhe(n,u):n,p=d.attributes?.[Ge];return p&&$t(d,{"sentry.span.source":p}),{...kF(d),_segmentSpan:o}}function $t(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([o,r])=>{r!=null&&!(o in n)&&(n[o]=r)})}function Ihe(e,t,n,o){let r=n.getSdkMetadata(),{release:i,environment:s,sendDefaultPii:a}=n.getOptions();$t(e,{[HC]:i,[zC]:s,[qC]:t.name,[YC]:t.span_id,[WC]:r?.sdk?.name,[KC]:r?.sdk?.version,...a?{[ZC]:o.user?.id,[JC]:o.user?.email,[dm]:o.user?.ip_address,[XC]:o.user?.username}:{},...o.attributes})}function bhe(e,t){let n=t(e);return n||(jc(),e)}var Av=1,iH=2;function Nhe(e,t){let n=e.attributes;if(!n)return;let o=n["http.request.method"]||n["http.method"];if(o){Ohe(e,n,t,o);return}let r=n["db.system.name"]||n["db.system"],i=typeof n[oe]=="string"&&`${n[oe]}`.startsWith("cache.");if(r&&!i){vhe(e,n);return}if(n["rpc.service"]){$t(e,{[oe]:"rpc"});return}if(n["messaging.system"]){$t(e,{[oe]:"message"});return}let s=n["faas.trigger"];s&&$t(e,{[oe]:`${s}`})}function Ohe(e,t,n,o){let r=["http"];n===iH?r.push("client"):n===Av&&r.push("server"),t["sentry.http.prefetch"]&&r.push("prefetch"),$t(e,{[oe]:r.join(".")});let i=t[zn];if(typeof i=="string"){e.name=i;return}if(t[Ge]==="custom")return;let s=t["http.route"];if(typeof s=="string")e.name=`${o} ${s}`,$t(e,{[Ge]:"route"});else{if(n===iH||n===Av){let a=Che(t,n);a&&(e.name=`${o} ${a}`)}$t(e,{[Ge]:"url"})}}function Che(e,t){let n=e["http.url"]||e["url.full"],o=e["http.target"],r=typeof n=="string"?fi(n):void 0,i=r?mi(r):void 0;if(t===Av&&typeof o=="string")return to(o);if(i)return i;if(typeof o=="string")return to(o)}function vhe(e,t){$t(e,{[oe]:"db"});let n=t[zn];if(typeof n=="string"){e.name=n;return}if(t[Ge]==="custom")return;let o=t["db.statement"];o&&(e.name=`${o}`,$t(e,{[Ge]:"task"}))}l();l();l();l();var Rv=0,sH=1,aH=2;function _s(e){return new VE(t=>{t(e)})}function Jl(e){return new VE((t,n)=>{n(e)})}var VE=class e{constructor(t){this._state=Rv,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((o,r)=>{this._handlers.push([!1,i=>{if(!t)o(i);else try{o(t(i))}catch(s){r(s)}},i=>{if(!n)r(i);else try{o(n(i))}catch(s){r(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,o)=>{let r,i;return this.then(s=>{i=!1,r=s,t&&t()},s=>{i=!0,r=s,t&&t()}).then(()=>{if(i){o(r);return}n(r)})})}_executeHandlers(){if(this._state===Rv)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===sH&&n[1](this._value),this._state===aH&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(i,s)=>{if(this._state===Rv){if(fn(s)){s.then(o,r);return}this._state=i,this._value=s,this._executeHandlers()}},o=i=>{n(sH,i)},r=i=>{n(aH,i)};try{t(o,r)}catch(i){r(i)}}};function cH(e,t,n,o=0){try{let r=Iv(t,n,e,o);return fn(r)?r:_s(r)}catch(r){return Jl(r)}}function Iv(e,t,n,o){let r=n[o];if(!e||!r)return e;let i=r({...e},t);return w&&i===null&&b.log(`Event processor "${r.id||"?"}" dropped event`),fn(i)?i.then(s=>Iv(s,t,n,o+1)):Iv(i,t,n,o+1)}l();var Hc,uH,lH,da;function dH(e){let t=ge._sentryDebugIds,n=ge._debugIds;if(!t&&!n)return{};let o=t?Object.keys(t):[],r=n?Object.keys(n):[];if(da&&o.length===uH&&r.length===lH)return da;uH=o.length,lH=r.length,da={},Hc||(Hc={});let i=(s,a)=>{for(let c of s){let u=a[c],d=Hc?.[c];if(d&&da&&u)da[d[0]]=u,Hc&&(Hc[c]=[d[0],u]);else if(u){let p=e(c);for(let f=p.length-1;f>=0;f--){let _=p[f]?.filename;if(_&&da&&Hc){da[_]=u,Hc[c]=[_,u];break}}}}};return t&&i(o,t),n&&i(r,n),da}function pH(e,t,n,o,r,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Wt(),timestamp:t.timestamp||ls()},u=n.integrations||e.integrations.map(T=>T.name);Phe(c,e),Lhe(c,u),r&&r.emit("applyFrameMetadata",t),t.type===void 0&&xhe(c,e.stackParser);let d=Dhe(o,n.captureContext);n.mechanism&&kl(c,n.mechanism);let p=r?r.getEventProcessors():[],f=la(i,d),m=[...n.attachments||[],...f.attachments];m.length&&(n.attachments=m),rH(c,f);let _=[...p,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?_s(c):cH(_,c,n)).then(T=>(T&&Mhe(T),typeof s=="number"&&s>0?whe(T,s,a):T))}function Phe(e,t){let{environment:n,release:o,dist:r,maxValueLength:i}=t;e.environment=e.environment||n||ql,!e.release&&o&&(e.release=o),!e.dist&&r&&(e.dist=r);let s=e.request;s?.url&&i&&(s.url=ta(s.url,i)),i&&e.exception?.values?.forEach(a=>{a.value&&(a.value=ta(a.value,i))})}function xhe(e,t){let n=dH(t);e.exception?.values?.forEach(o=>{o.stacktrace?.frames?.forEach(r=>{r.filename&&(r.debug_id=n[r.filename])})})}function Mhe(e){let t={};if(e.exception?.values?.forEach(o=>{o.stacktrace?.frames?.forEach(r=>{r.debug_id&&(r.abs_path?t[r.abs_path]=r.debug_id:r.filename&&(t[r.filename]=r.debug_id),delete r.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([o,r])=>{n.push({type:"sourcemap",code_file:o,debug_id:r})})}function Lhe(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function whe(e,t,n){if(!e)return null;let o={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(r=>({...r,...r.data&&{data:ko(r.data,t,n)}}))},...e.user&&{user:ko(e.user,t,n)},...e.contexts&&{contexts:ko(e.contexts,t,n)},...e.extra&&{extra:ko(e.extra,t,n)}};return e.contexts?.trace&&o.contexts&&(o.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(o.contexts.trace.data=ko(e.contexts.trace.data,t,n))),e.spans&&(o.spans=e.spans.map(r=>({...r,...r.data&&{data:ko(r.data,t,n)}}))),e.contexts?.flags&&o.contexts&&(o.contexts.flags=ko(e.contexts.flags,3,n)),o}function Dhe(e,t){if(!t)return e;let n=e?e.clone():new Hn;return n.update(t),n}function fH(e){if(e)return khe(e)?{captureContext:e}:$he(e)?{captureContext:e}:e}function khe(e){return e instanceof Hn||typeof e=="function"}var Uhe=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function $he(e){return Object.keys(e).some(t=>Uhe.includes(t))}function he(e,t){return Le().captureException(e,fH(t))}function Lm(e,t){return Le().captureEvent(e,t)}async function wm(e){let t=Q();return t?t.flush(e):(w&&b.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}function Dm(){return!!Q()}function km(){let e=Q();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Um(e){let t=Ie(),{user:n}=la(t,Le()),{userAgent:o}=ge.navigator||{},r=_F({user:n,...o&&{userAgent:o},...e}),i=t.getSession();return i?.status==="ok"&&ds(i,{status:"exited"}),Xl(),t.setSession(r),r}function Xl(){let e=Ie(),n=Le().getSession()||e.getSession();n&&gF(n),Bhe(),e.setSession()}function Bhe(){let e=Ie(),t=Q(),n=e.getSession();n&&t&&t.captureSession(n)}l();var Ghe="7";function jhe(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Vhe(e){return`${jhe(e)}${e.projectId}/envelope/`}function Fhe(e,t){let n={sentry_version:Ghe};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function mH(e,t,n){return t||`${Vhe(e)}?${Fhe(e,n)}`}l();l();var bv=[];function Hhe(e){let t={};return e.forEach(n=>{let{name:o}=n,r=t[o];r&&!r.isDefaultInstance&&n.isDefaultInstance||(t[o]=n)}),Object.values(t)}function Nv(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(r=>{r.isDefaultInstance=!0});let o;if(Array.isArray(n))o=[...t,...n];else if(typeof n=="function"){let r=n(t);o=Array.isArray(r)?r:[r]}else o=t;return Hhe(o)}function _H(e,t){let n={};return t.forEach(o=>{o?.beforeSetup&&o.beforeSetup(e)}),t.forEach(o=>{o&&Cv(e,o,n)}),n}function Ov(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Cv(e,t,n){if(n[t.name]){w&&b.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!bv.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),bv.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let o=t.preprocessEvent.bind(t);e.on("preprocessEvent",(r,i)=>o(r,i,e))}if(typeof t.processEvent=="function"){let o=t.processEvent.bind(t),r=Object.assign((i,s)=>o(i,s,e),{id:t.name});e.addEventProcessor(r)}["processSpan","processSegmentSpan"].forEach(o=>{let r=t[o];typeof r=="function"&&e.on(o,i=>r.call(t,i,e))}),w&&b.log(`Integration installed: ${t.name}`)}l();l();var zhe="sentry.timestamp.sequence",vv=0,Pv;function gH(e){let t=Math.floor(e*1e3);Pv!==void 0&&t!==Pv&&(vv=0);let n=vv;return vv++,Pv=t,{key:zhe,value:{value:n,type:"integer"}}}l();function FE(e,t){return t?Cn(t,()=>{let n=Yn(),o=n?ca(n):Dc(t);return[n?St(n):pi(e,t),o]}):[void 0,void 0]}l();var hH={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};l();l();l();l();function EH(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function TH(){return!EH()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Ql(){return typeof window<"u"&&(!TH()||qhe())}function qhe(){return ge.process?.type==="renderer"}function Yhe(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Ql()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function SH(e,t,n,o,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&o&&(i.dsn=qn(o)),mn(i,[Yhe(e,r)])}var Whe=100;function _i(e,t,n,o=!0){n&&(!e[t]||o)&&(e[t]=n)}function AH(e,t){let n=xv(),o=yH(e);o===void 0?n.set(e,[t]):o.length>=Whe?(zc(e,o),n.set(e,[t])):n.set(e,[...o,t])}function ed(e,t=Le(),n=AH){let o=t?.getClient()??Q();if(!o){w&&b.warn("No client available to capture log.");return}let{release:r,environment:i,enableLogs:s=!1,beforeSendLog:a}=o.getOptions();if(!s){w&&b.warn("logging option not enabled, log will not be captured.");return}let[,c]=FE(o,t),u={...e.attributes},{user:{id:d,email:p,username:f},attributes:m={}}=la(Ie(),t);_i(u,"user.id",d,!1),_i(u,"user.email",p,!1),_i(u,"user.name",f,!1),_i(u,"sentry.release",r),_i(u,"sentry.environment",i);let{name:_,version:h}=o.getSdkMetadata()?.sdk??{};_i(u,"sentry.sdk.name",_),_i(u,"sentry.sdk.version",h);let E=o.getIntegrationByName("Replay"),T=E?.getReplayId(!0);_i(u,"sentry.replay_id",T),T&&E?.getRecordingMode()==="buffer"&&_i(u,"sentry._internal.replay_is_buffering",!0);let R=e.message;if(ea(R)){let{__sentry_template_string__:k,__sentry_template_values__:ue=[]}=R;ue?.length&&(u["sentry.message.template"]=k),ue.forEach((le,Ae)=>{u[`sentry.message.parameter.${Ae}`]=le})}let C=ps(t);_i(u,"sentry.trace.parent_span_id",C?.spanContext().spanId);let P={...e,attributes:u};o.emit("beforeCaptureLog",P);let M=a?Tt(()=>a(P)):P;if(!M){o.recordDroppedEvent("before_send","log_item",1),w&&b.warn("beforeSendLog returned null, log will not be captured.");return}let{level:O,message:z,attributes:ie={},severityNumber:$}=M,q=di(),J=gH(q),Z={timestamp:q,level:O,body:z,trace_id:c?.trace_id,severity_number:$??hH[O],attributes:{...Bl(m),...Bl(ie,!0),[J.key]:J.value}};n(o,Z),o.emit("afterCaptureLog",M)}function zc(e,t){let n=t??yH(e)??[];if(n.length===0)return;let o=e.getOptions(),r=SH(n,o._metadata,o.tunnel,e.getDsn(),o.sendDefaultPii);xv().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(r)}function yH(e){return xv().get(e)}function xv(){return xo("clientToLogBufferMap",()=>new WeakMap)}l();l();function Khe(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Ql()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function RH(e,t,n,o,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&o&&(i.dsn=qn(o)),mn(i,[Khe(e,r)])}function IH(e,t){let n=t??Zhe(e)??[];if(n.length===0)return;let o=e.getOptions(),r=RH(n,o._metadata,o.tunnel,e.getDsn(),o.sendDefaultPii);bH().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(r)}function Zhe(e){return bH().get(e)}function bH(){return xo("clientToMetricBufferMap",()=>new WeakMap)}l();l();l();function td(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var $m=Symbol.for("SentryBufferFullError");function nd(e=100){let t=new Set;function n(){return t.size<e}function o(s){t.delete(s)}function r(s){if(!n())return Jl($m);let a=s();return t.add(a),a.then(()=>o(a),()=>o(a)),a}function i(s){if(!t.size)return _s(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return a;let c=[a,new Promise(u=>td(setTimeout(()=>u(!1),s)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:r,drain:i}}l();var Jhe=60*1e3;function Xhe(e,t=Kr()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let o=Date.parse(`${e}`);return isNaN(o)?Jhe:o-t}function Qhe(e,t){return e[t]||e.all||0}function NH(e,t,n=Kr()){return Qhe(e,t)>n}function OH(e,{statusCode:t,headers:n},o=Kr()){let r={...e},i=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u,,,d]=a.split(":",5),p=parseInt(c,10),f=(isNaN(p)?60:p)*1e3;if(!u)r.all=o+f;else for(let m of u.split(";"))m==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(r[m]=o+f):r[m]=o+f}else s?r.all=o+Xhe(s,o):t===429&&(r.all=o+60*1e3);return r}var Bm=64;function pa(e,t,n=nd(e.bufferSize||Bm)){let o={},r=s=>n.drain(s);function i(s){let a=[];if(Rm(s,(p,f)=>{let m=GE(f);NH(o,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(p)}),a.length===0)return Promise.resolve({});let c=mn(s[0],a),u=p=>{if(pv(c,["client_report"])){w&&b.warn(`Dropping client report. Will not send outcomes (reason: ${p}).`);return}Rm(c,(f,m)=>{e.recordDroppedEvent(p,GE(m))})},d=()=>t({body:Im(c)}).then(p=>p.statusCode===413?(w&&b.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),p):(w&&p.statusCode!==void 0&&(p.statusCode<200||p.statusCode>=300)&&b.warn(`Sentry responded with status code ${p.statusCode} to sent event.`),o=OH(o,p),p),p=>{throw u("network_error"),w&&b.error("Encountered error running transport request:",p),p});return n.add(d).then(p=>p,p=>{if(p===$m)return w&&b.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw p})}return{send:i,flush:r}}l();function CH(e,t,n){let o=[{type:"client_report"},{timestamp:n||ls(),discarded_events:e}];return mn(t?{dsn:t}:{},[o])}l();function HE(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}l();function vH(e){let{trace_id:t,parent_span_id:n,span_id:o,status:r,origin:i,data:s,op:a}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:a,parent_span_id:n,span_id:o??"",start_timestamp:e.start_timestamp??0,status:r,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:s?.[Gl],exclusive_time:s?.[jl],measurements:e.measurements,is_segment:!0}}function PH(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Gl]:e.profile_id},...e.exclusive_time&&{[jl]:e.exclusive_time}}}},measurements:e.measurements}}var xH="Not capturing exception because it's already been captured.",MH="Discarded session because of missing or non-string release",$H=Symbol.for("SentryInternalError"),BH=Symbol.for("SentryDoNotSendEventError"),eEe=5e3;function zE(e){return{message:e,[$H]:!0}}function Mv(e){return{message:e,[BH]:!0}}function LH(e){return!!e&&typeof e=="object"&&$H in e}function wH(e){return!!e&&typeof e=="object"&&BH in e}function DH(e,t,n,o,r){let i=0,s,a=!1;e.on(n,()=>{i=0,clearTimeout(s),a=!1}),e.on(t,c=>{i+=o(c),i>=8e5?r(e):a||(a=!0,s=td(setTimeout(()=>{r(e)},eEe)))}),e.on("flush",()=>{r(e)})}var qE=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=nd(t.transportOptions?.bufferSize??Bm),t.dsn?this._dsn=vF(t.dsn):w&&b.warn("No DSN provided, client will not send events."),this._dsn){let o=mH(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&DH(this,"afterCaptureLog","flushLogs",oEe,zc),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&DH(this,"afterCaptureMetric","flushMetrics",rEe,IH)}captureException(t,n,o){let r=Wt();if(ME(t))return w&&b.log(xH),r;let i={event_id:r,...n};return this._process(()=>this.eventFromException(t,i).then(s=>this._captureEvent(s,i,o)).then(s=>s),"error"),i.event_id}captureMessage(t,n,o,r){let i={event_id:Wt(),...o},s=ea(t)?t:String(t),a=xc(t),c=a?this.eventFromMessage(s,n,i):this.eventFromException(t,i);return this._process(()=>c.then(u=>this._captureEvent(u,i,r)),a?"unknown":"error"),i.event_id}captureEvent(t,n,o){let r=Wt();if(n?.originalException&&ME(n.originalException))return w&&b.log(xH),r;let i={event_id:r,...n},s=t.sdkProcessingMetadata||{},a=s.capturedSpanScope,c=s.capturedSpanIsolationScope,u=kH(t.type);return this._process(()=>this._captureEvent(t,i,a||o,c),u),i.event_id}captureSession(t){this.sendSession(t),ds(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let o=await this._isClientDoneProcessing(t),r=await n.flush(t);return o&&r}async close(t){zc(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Cv(this,t,this._integrations),n||Ov(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let o=WF(t,this._dsn,this._options._metadata,this._options.tunnel);for(let r of n.attachments||[])o=dv(o,mv(r));this.sendEnvelope(o).then(r=>this.emit("afterSendEvent",t,r))}sendSession(t){let{release:n,environment:o=ql}=this._options;if("aggregates"in t){let i=t.attrs||{};if(!i.release&&!n){w&&b.warn(MH);return}i.release=i.release||n,i.environment=i.environment||o,t.attrs=i}else{if(!t.release&&!n){w&&b.warn(MH);return}t.release=t.release||n,t.environment=t.environment||o}this.emit("beforeSendSession",t);let r=YF(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(t,n,o=1){if(this._options.sendClientReports){let r=`${t}:${n}`;w&&b.log(`Recording outcome: "${r}"${o>1?` (${o} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+o}}on(t,n){let o=this._hooks[t]=this._hooks[t]||new Set,r=(...i)=>n(...i);return o.add(r),()=>{o.delete(r)}}emit(t,...n){let o=this._hooks[t];o&&o.forEach(r=>r(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return w&&b.error("Error while sending envelope:",n),{}}return w&&b.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=_H(this,t),Ov(this,t)}_updateSessionFromEvent(t,n){let o=n.level==="fatal",r=!1,i=n.exception?.values;if(i){r=!0,o=!1;for(let c of i)if(c.mechanism?.handled===!1){o=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&o)&&(ds(t,{...o&&{status:"crashed"},errors:t.errors||Number(r||o)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(o=>setTimeout(o,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,o,r){let i=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s?.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||r.setLastEventId(t.event_id||n.event_id),pH(i,t,n,o,this,r).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Dc(o)},...a.contexts};let c=pi(this,o);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},o=Le(),r=Ie()){return w&&Lv(t)&&b.log(`Captured error event \`${HE(t)[0]||"<unknown>"}\``),this._processEvent(t,n,o,r).then(i=>i.event_id,i=>{w&&(wH(i)?b.log(i.message):LH(i)?b.warn(i.message):b.warn(i))})}_processEvent(t,n,o,r){let i=this.getOptions(),{sampleRate:s}=i,a=GH(t),c=Lv(t),d=`before send for type \`${t.type||"error"}\``,p=typeof s>"u"?void 0:Mr(s);if(c&&typeof p=="number"&&Ut()>p)return this.recordDroppedEvent("sample_rate","error"),Jl(Mv(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let f=kH(t.type);return this._prepareEvent(t,n,o,r).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",f),Mv("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let h=nEe(this,i,m,n);return tEe(h,d)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",f),a){let T=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",T)}throw Mv(`${d} returned \`null\`, will not send event.`)}let _=o.getSession()||r.getSession();if(c&&_&&this._updateSessionFromEvent(_,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,T=m.spans?m.spans.length:0,R=E-T;R>0&&this.recordDroppedEvent("before_send","span",R)}let h=m.transaction_info;if(a&&h&&m.transaction!==t.transaction){let E="custom";m.transaction_info={...h,source:E}}return this.sendEvent(m,n),m}).then(null,m=>{throw wH(m)||LH(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),zE(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
977
+ Reason: ${m}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(o=>(this._numProcessing--,o),o=>(this._numProcessing--,o===$m&&this.recordDroppedEvent("queue_overflow",n),o))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,o])=>{let[r,i]=n.split(":");return{reason:r,category:i,quantity:o}})}_flushOutcomes(){w&&b.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){w&&b.log("No outcomes to send");return}if(!this._dsn){w&&b.log("No dsn provided, will not send outcomes");return}w&&b.log("Sending outcomes:",t);let n=CH(t,this._options.tunnel&&qn(this._dsn));this.sendEnvelope(n)}};function kH(e){return e==="replay_event"?"replay":e||"error"}function tEe(e,t){let n=`${t} must return \`null\` or a valid event.`;if(fn(e))return e.then(o=>{if(!cs(o)&&o!==null)throw zE(n);return o},o=>{throw zE(`${t} rejected with ${o}`)});if(!cs(e)&&e!==null)throw zE(n);return e}function nEe(e,t,n,o){let{beforeSend:r,beforeSendTransaction:i,ignoreSpans:s}=t,a=!ua(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Lv(c)&&r)return r(c,o);if(GH(c)){if(a||s){let u=vH(c);if(s?.length&&Do({description:u.description,op:u.op,attributes:u.data},s))return null;if(a){let d=a(u);d?c=ra(n,PH(d)):jc()}if(c.spans){let d=[],p=c.spans;for(let m of p){if(s?.length&&Do({description:m.description,op:m.op,attributes:m.data},s)){VF(p,m);continue}if(a){let _=a(m);_?d.push(_):(jc(),d.push(m))}else d.push(m)}let f=c.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),c.spans=d}}if(i){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(c,o)}}return c}function Lv(e){return e.type===void 0}function GH(e){return e.type==="transaction"}function rEe(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+jH(e.attributes)}function oEe(e){let t=0;return e.message&&(t+=e.message.length*2),t+jH(e.attributes)}function jH(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*UH(n[0]):xc(n)?t+=UH(n):t+=100}),t}function UH(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}l();l();function VH(e,t,n,o,r){let i={sent_at:new Date().toISOString()};n?.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),o&&r&&(i.dsn=qn(r)),t&&(i.trace=t);let s=iEe(e);return mn(i,[s])}function iEe(e){return[{type:"check_in"},e]}l();function FH(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}l();function HH(e,t){return e(t.stack||"",1)}function sEe(e){return ai(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function aEe(e){return sEe(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function wv(e,t){let n={type:t.name||t.constructor.name,value:aEe(t)},o=HH(e,t);return o.length&&(n.stacktrace={frames:o}),n}function cEe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function uEe(e){if("name"in e&&typeof e.name=="string"){let o=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(o+=` with message '${e.message}'`),o}else if("message"in e&&typeof e.message=="string")return e.message;let t=vC(e);if(IC(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=lEe(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function lEe(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function dEe(e,t,n,o){if(ai(n))return[n,void 0];if(t.synthetic=!0,cs(n)){let i=e?.getOptions().normalizeDepth,s={__serialized__:uv(n,i)},a=cEe(n);if(a)return[a,s];let c=uEe(n),u=o?.syntheticException||new Error(c);return u.message=c,[u,s]}let r=o?.syntheticException||new Error(n);return r.message=`${n}`,[r,void 0]}function zH(e,t,n,o){let i=o?.data&&o.data.mechanism||{handled:!0,type:"generic"},[s,a]=dEe(e,i,n,o),c={exception:{values:[wv(t,s)]}};return a&&(c.extra=a),wC(c,void 0,void 0),kl(c,i),{...c,event_id:o?.event_id}}function qH(e,t,n="info",o,r){let i={event_id:o?.event_id,level:n};if(r&&o?.syntheticException){let s=HH(e,o.syntheticException);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]},kl(i,{synthetic:!0}))}if(ea(t)){let{__sentry_template_string__:s,__sentry_template_values__:a}=t;return i.logentry={message:s,params:a},i}return i.message=t,i}var Gm=class e extends qE{__init(){this._disposeCallbacks=[]}constructor(t){GF(),FH(t),super(t),e.prototype.__init.call(this),this._setUpMetricsProcessing()}eventFromException(t,n){let o=zH(this,this._options.stackParser,t,n);return o.level="error",_s(o)}eventFromMessage(t,n="info",o){return _s(qH(this._options.stackParser,t,n,o,this._options.attachStacktrace))}captureException(t,n,o){return YH(n),super.captureException(t,n,o)}captureEvent(t,n,o){return!t.type&&t.exception?.values&&t.exception.values.length>0&&YH(n),super.captureEvent(t,n,o)}captureCheckIn(t,n,o){let r="checkInId"in t&&t.checkInId?t.checkInId:Wt();if(!this._isEnabled())return w&&b.warn("SDK not enabled, will not capture check-in."),r;let i=this.getOptions(),{release:s,environment:a,tunnel:c}=i,u={check_in_id:r,monitor_slug:t.monitorSlug,status:t.status,release:s,environment:a};"duration"in t&&(u.duration=t.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[d,p]=FE(this,o);p&&(u.contexts={trace:p});let f=VH(u,d,this.getSdkMetadata(),c,this.getDsn());return w&&b.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(f),r}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){w&&b.log("Disposing client...");for(let t of this._disposeCallbacks)try{t()}catch{}this._disposeCallbacks.length=0;for(let t of Object.keys(this._hooks))this._hooks[t]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=nd(Bm)}_prepareEvent(t,n,o,r){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:t.contexts?.runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,n,o,r)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function YH(e){let t=Ie().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!=="crashed"?t.status="errored":n||(t.status="crashed")}}l();var Dv=new Set;function kv(e){e.forEach(t=>{Dv.add(t),w&&b.log(`AI provider "${t}" wrapping will be skipped`)})}function qc(e){return Dv.has(e)}function Uv(){Dv.clear(),w&&b.log("Cleared AI provider skip registrations")}l();var pEe=new Set(["false","f","n","no","off","0"]),fEe=new Set(["true","t","y","yes","on","1"]);function rd(e,t){let n=String(e).toLowerCase();return pEe.has(n)?!1:fEe.has(n)?!0:t?.strict?null:!!e}l();function YE(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}var jm=YE;l();function gs(e,t,n=[t],o="npm"){let r=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};r.name||(r.name=`sentry.javascript.${t}`,r.packages=n.map(i=>({name:`${o}:@sentry/${i}`,version:ve})),r.version=ve)}l();function Yc(e={}){let t=e.client||Q();if(!km()||!t)return{};let n=Nn(),o=Jr(n);if(o.getTraceData)return o.getTraceData(e);let r=e.scope||Le(),i=e.span||Yn();if(!i&&GC())return{};let s=i?Am(i):mEe(r),a=i?St(i):pi(t,r),c=Uc(a);if(!DE.test(s))return b.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let d={"sentry-trace":s,baggage:c};return e.propagateTraceparent&&(d.traceparent=i?wF(i):_Ee(r)),d}function mEe(e){let{traceId:t,sampled:n,propagationSpanId:o}=e.getPropagationContext();return sa(t,o,n)}function _Ee(e){let{traceId:t,sampled:n,propagationSpanId:o}=e.getPropagationContext();return aa(t,o,n)}l();var WH="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function Wc(e,t,n){if(typeof e!="string"||!t)return!0;let o=n?.get(e);if(o!==void 0)return w&&!o&&b.log(WH,e),o;let r=li(e,t);return n?.set(e,r),w&&!r&&b.log(WH,e),r}l();function $v(e,t,n){let o,r,i,s=n?.maxWait?Math.max(n.maxWait,t):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),o=e(),o}function u(){r!==void 0&&clearTimeout(r),i!==void 0&&clearTimeout(i),r=i=void 0}function d(){return r!==void 0||i!==void 0?c():o}function p(){return r&&clearTimeout(r),r=a(c,t),s&&i===void 0&&(i=a(c,s)),o}return p.cancel=u,p.flush=d,p}l();var XH=1024*1024;function Bv(e){return e==="small"?1e3:e==="medium"?1e4:XH}function QH(e){let t=Object.create(null);try{Object.entries(e).forEach(([n,o])=>{typeof o=="string"&&(t[n]=o)})}catch{}return t}function od(e){let t=e.headers||{},o=(typeof t["x-forwarded-host"]=="string"?t["x-forwarded-host"]:void 0)||(typeof t.host=="string"?t.host:void 0),i=(typeof t["x-forwarded-proto"]=="string"?t["x-forwarded-proto"]:void 0)||e.protocol||(e.socket?.encrypted?"https":"http"),s=e.url||"",a=gEe({url:s,host:o,protocol:i}),c=e.body||void 0,u=e.cookies;return{url:a,method:e.method,query_string:ez(s),headers:QH(t),cookies:u,data:c}}function gEe({url:e,protocol:t,host:n}){if(e?.startsWith("http"))return e;if(e&&n)return`${t}://${n}${e}`}var KH=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","set-cookie","cookie"],hEe=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"],EEe=["x-forwarded-","-user"];function $o(e,t=!1,n="request"){let o={};try{Object.entries(e).forEach(([r,i])=>{if(i==null)return;let s=r.toLowerCase();if((s==="cookie"||s==="set-cookie")&&typeof i=="string"&&i!==""){let c=s==="set-cookie",u=i.indexOf(";"),d=c&&u!==-1?i.substring(0,u):i,p=c?[d]:d.split("; ");for(let f of p){let m=f.indexOf("="),_=m!==-1?f.substring(0,m):f,h=m!==-1?f.substring(m+1):"",E=_.toLowerCase();JH({spanAttributes:o,headerKey:s,cookieKey:E,value:h,sendDefaultPii:t,lifecycle:n})}}else JH({spanAttributes:o,headerKey:s,value:i,sendDefaultPii:t,lifecycle:n})})}catch{}return o}function ZH(e){return e.replace(/-/g,"_")}function JH({spanAttributes:e,headerKey:t,cookieKey:n,value:o,sendDefaultPii:r,lifecycle:i}){let c=TEe(n||t,o,r,!!n);if(c==null)return;let u=`http.${i}.header.${ZH(t)}${n?`.${ZH(n)}`:""}`;e[u]=c}function TEe(e,t,n,o=!1){let r=o?[...KH,...hEe]:KH;if(n?r.some(s=>e.includes(s)):[...EEe,...r].some(s=>e.includes(s)))return"[Filtered]";if(Array.isArray(t))return t.map(s=>s!=null?String(s):s).join(";");if(typeof t=="string")return t}function ez(e){if(e)try{let t=new URL(e,"http://s.io").search.slice(1);return t.length?t:void 0}catch{return}}l();var SEe=100;function wr(e,t){let n=Q(),o=Ie();if(!n)return;let{beforeBreadcrumb:r=null,maxBreadcrumbs:i=SEe}=n.getOptions();if(i<=0)return;let a={timestamp:ls(),...e},c=r?Tt(()=>r(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),o.addBreadcrumb(c,i))}l();var tz,AEe="FunctionToString",nz=new WeakMap,yEe=(()=>({name:AEe,setupOnce(){tz=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=us(this),n=nz.has(Q())&&t!==void 0?t:this;return tz.apply(n,e)}}catch{}},setup(e){nz.set(e,!0)}})),Kc=yEe;l();var REe=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],IEe="EventFilters",KE=(e={})=>{let t;return{name:IEe,setup(n){let o=n.getOptions();t=rz(e,o)},processEvent(n,o,r){if(!t){let i=r.getOptions();t=rz(e,i)}return bEe(n,t)?null:n}}},Zc=((e={})=>({...KE(e),name:"InboundFilters"}));function rz(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:REe],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function bEe(e,t){if(e.type){if(e.type==="transaction"&&OEe(e,t.ignoreTransactions))return w&&b.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
978
+ Event: ${na(e)}`),!0}else{if(NEe(e,t.ignoreErrors))return w&&b.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
979
+ Event: ${na(e)}`),!0;if(xEe(e))return w&&b.warn(`Event dropped due to not having an error message, error type or stacktrace.
980
+ Event: ${na(e)}`),!0;if(CEe(e,t.denyUrls))return w&&b.warn(`Event dropped due to being matched by \`denyUrls\` option.
981
+ Event: ${na(e)}.
982
+ Url: ${WE(e)}`),!0;if(!vEe(e,t.allowUrls))return w&&b.warn(`Event dropped due to not being matched by \`allowUrls\` option.
983
+ Event: ${na(e)}.
984
+ Url: ${WE(e)}`),!0}return!1}function NEe(e,t){return t?.length?HE(e).some(n=>li(n,t)):!1}function OEe(e,t){if(!t?.length)return!1;let n=e.transaction;return n?li(n,t):!1}function CEe(e,t){if(!t?.length)return!1;let n=WE(e);return n?li(n,t):!1}function vEe(e,t){if(!t?.length)return!0;let n=WE(e);return n?li(n,t):!0}function PEe(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function WE(e){try{let n=[...e.exception?.values??[]].reverse().find(o=>o.mechanism?.parent_id===void 0&&o.stacktrace?.frames?.length)?.stacktrace?.frames;return n?PEe(n):null}catch{return w&&b.error(`Cannot extract url for event ${na(e)}`),null}}function xEe(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}l();l();function sz(e,t,n,o,r,i){if(!r.exception?.values||!i||!ci(i.originalException,Error))return;let s=r.exception.values.length>0?r.exception.values[r.exception.values.length-1]:void 0;s&&(r.exception.values=Gv(e,t,o,i.originalException,n,r.exception.values,s,0))}function Gv(e,t,n,o,r,i,s,a){if(i.length>=n+1)return i;let c=[...i];if(ci(o[r],Error)){oz(s,a,o);let u=e(t,o[r]),d=c.length;iz(u,r,d,a),c=Gv(e,t,n,o[r],r,[u,...c],u,d)}return az(o)&&o.errors.forEach((u,d)=>{if(ci(u,Error)){oz(s,a,o);let p=e(t,u),f=c.length;iz(p,`errors[${d}]`,f,a),c=Gv(e,t,n,u,r,[p,...c],p,f)}}),c}function az(e){return Array.isArray(e.errors)}function oz(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...az(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function iz(e,t,n,o){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:o}}var MEe="cause",LEe=5,wEe="LinkedErrors",DEe=((e={})=>{let t=e.limit||LEe,n=e.key||MEe;return{name:wEe,preprocessEvent(o,r,i){let s=i.getOptions();sz(wv,s.stackParser,n,t,o,r)}}}),Jc=DEe;l();l();function cz(e){let t={},n=0;for(;n<e.length;){let o=e.indexOf("=",n);if(o===-1)break;let r=e.indexOf(";",n);if(r===-1)r=e.length;else if(r<o){n=e.lastIndexOf(";",o-1)+1;continue}let i=e.slice(n,o).trim();if(t[i]===void 0){let s=e.slice(o+1,r).trim();s.charCodeAt(0)===34&&(s=s.slice(1,-1));try{t[i]=s.indexOf("%")!==-1?decodeURIComponent(s):s}catch{t[i]=s}}n=r+1}return t}l();var jv=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function Vv(e){let t={};for(let i of Object.keys(e))t[i.toLowerCase()]=e[i];return jv.map(i=>{let s=t[i.toLowerCase()],a=Array.isArray(s)?s.join(";"):s;return i==="Forwarded"?kEe(a):a?.split(",").map(c=>c.trim())}).reduce((i,s)=>s?i.concat(s):i,[]).find(i=>i!==null&&UEe(i))||null}function kEe(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function UEe(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var $Ee={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},BEe="RequestData",GEe=((e={})=>{let t={...$Ee,...e.include};return{name:BEe,processEvent(n,o,r){let{sdkProcessingMetadata:i={}}=n,{normalizedRequest:s,ipAddress:a}=i,c={...t,ip:t.ip??r.getOptions().sendDefaultPii};return s&&jEe(n,s,{ipAddress:a},c),n},processSegmentSpan(n,o){let{sdkProcessingMetadata:r={}}=Ie().getScopeData(),{normalizedRequest:i,ipAddress:s}=r;if(!i)return;let{sendDefaultPii:a}=o.getOptions(),c={...t,ip:t.ip??a};VEe(n,i,s,c,a)}}}),Xc=GEe;function jEe(e,t,n,o){if(e.request={...e.request,...uz(t,o)},o.ip){let r=t.headers&&Vv(t.headers)||n.ipAddress;r&&(e.user={...e.user,ip_address:r})}}function VEe(e,t,n,o,r){let i=uz(t,o),s={};if(i.url&&(s["url.full"]=i.url),i.method&&(s["http.request.method"]=i.method),i.query_string&&(s["url.query"]=FEe(i.query_string)),$t(e,s),i.cookies&&Object.keys(i.cookies).length>0){let a=Object.entries(i.cookies).map(([u,d])=>`${u}=${d}`).join("; "),c=$o({cookie:a},r??!1,"request");$t(e,c)}if(i.headers){let a=$o(i.headers,r??!1,"request");$t(e,a)}if(i.data!=null){let a=typeof i.data=="string"?i.data:JSON.stringify(i.data);a&&$t(e,{"http.request.body.data":a})}if(o.ip){let a=t.headers&&Vv(t.headers)||n||void 0;a&&$t(e,{[dm]:a})}}function uz(e,t){let n={},o={...e.headers};if(t.headers&&(n.headers=o,t.cookies||delete o.cookie,!t.ip)){let r=new Set(jv.map(i=>i.toLowerCase()));for(let i of Object.keys(o))r.has(i.toLowerCase())&&delete o[i]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){let r=e.cookies||(o?.cookie?cz(o.cookie):void 0);n.cookies=r||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function FEe(e){return typeof e=="string"?e||void 0:(Array.isArray(e)?e:Object.entries(e)).map(([o,r])=>`${o}=${r}`).join("&")||void 0}l();function lz(e){let t="console",n=Pc(t,e);return as(t,HEe),n}function HEe(){"console"in ge&&vc.forEach(function(e){e in ge.console&&um(ge.console,e,function(t){return Mo[e]=t,function(...n){si("console",{args:n,level:e}),Mo[e]?.apply(ge.console,n)}})})}l();function dz(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}l();l();l();var ZE=new WeakMap,pz=(e,t)=>{let n=ZE.get(e);n?n.push(t):ZE.set(e,[t])},Vm=e=>{let t=ZE.get(e);return t||(t=[],ZE.set(e,t)),t};l();var Qc="express.name",fz="http.route",eu="express.type",JE="router",mz="middleware",_z="request_handler";var Fv=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];function zEe(e){return e.includes(":")||e.includes("*")}var hz=(e,t,n)=>{if(t.name==="router"){let o=Ez("",t),r=o||n||e||"/";return{attributes:{[Qc]:r,[eu]:JE},name:`router - ${r}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[Qc]:(e||n)??"request handler",[eu]:_z},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[Qc]:t.name,[eu]:mz},name:`middleware - ${t.name}`}},Ez=(e,t)=>{let n=Array.isArray(t.handle?.stack)?t.handle?.stack?.[0]:void 0;return n?.route?.path?`${e}${n.route.path}`:n&&Array.isArray(n?.handle?.stack)?Ez(e,n):e},Tz=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(!Array.isArray(n?.ignoreLayers))return!1;try{return li(e,n.ignoreLayers,!0)}catch{}return!1};function Sz(e,t){let n=Vm(e);if(n.length===0)return;if(n.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;if(t==="*"||t.includes("/")&&(t.includes(",")||t.includes("\\")||t.includes("*")||t.includes("[")))return t;let o=t.startsWith("/")?t:`/${t}`;return o.length>0&&(e.originalUrl===o||e.originalUrl.startsWith(o)||zEe(o))?o:void 0}function Az(e){let t=Vm(e),n="";for(let o of t)o==="/"||o==="/*"||(n+=!n||n.endsWith("/")?o:`/${o}`);return n.replace(/\/{2,}/g,"/")}var XE=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>gz(n)||"").join(","):gz(t)},gz=e=>typeof e=="string"?e:e instanceof RegExp||typeof e=="number"?String(e):void 0,QE=e=>yz(e?.Router?.prototype),yz=e=>(typeof e=="object"||typeof e=="function")&&!!e&&"route"in e&&typeof e.route=="function",Rz=e=>yz(e.Router)&&!QE(e);l();l();function Iz(e){if(!Ie()?.getScopeData()?.sdkProcessingMetadata?.normalizedRequest){let n=od(e);Ie().setSDKProcessingMetadata({normalizedRequest:n})}}function eT(e,t,n){if(!t?.handle)return;let o=t,r=o.handle;if(us(r)||r.length===4)return;function i(s,a,...c){let u=e();Iz(s);let d=Yn();if(!d)return r.apply(this,[s,a,...c]);n&&pz(s,n);let p=Vm(s),f=!!n,m=Az(s),_=Sz(s,m);u.onRouteResolved?.(_);let h=hz(m,o,n),E=h.attributes[Qc],T=h.attributes[eu],R=Object.assign(h.attributes,{[ne]:"auto.http.express",[oe]:`${T}.express`});if(_&&(R[fz]=_),Tz(h.attributes[Qc],T,u))return f&&p.pop(),r.apply(this,[s,a,...c]);let C=Ie();if(C!==Zr()){if(T==="request_handler"){let P=s.method?s.method.toUpperCase():"GET";C.setTransactionName(`${P} ${m}`)}}else w&&b.warn("Isolation scope is still default isolation scope - skipping setting transactionName");return dt({name:E,attributes:R},P=>{let M=!1;h.attributes[eu]===JE&&(P.end(),M=!0);let O=()=>{M||(M=!0,P.end())};for(let z=0;z<c.length;z++){let ie=c[z];if(typeof ie=="function"){c[z]=function(...$){let q=$[0],J=!!q&&q!=="route"&&q!=="router";if(!M&&J){let[Z,k]=Fv(q);P.setStatus({code:2,message:k})}return M||(M=!0,a.removeListener("finish",O),P.end()),!(s.route&&J)&&f&&p.pop(),eo(d,()=>ie.apply(this,$))};break}}try{return r.apply(this,[s,a,...c])}catch(z){let[ie,$]=Fv(z);throw P.setStatus({code:2,message:$}),z}finally{M||a.once("finish",O)}})}for(let s in r)s in i||Object.defineProperty(i,s,{get(){return r[s]},set(a){r[s]=a}});Mc(i,r),Object.defineProperty(o,"handle",{enumerable:!0,configurable:!0,writable:!0,value:i})}l();function tT(e){return!!e&&typeof e=="object"&&"default"in e&&e.default||e}function qEe(e){return!!e.express}var bz=!1;function YEe(){bz||(bz=!0,w&&b.warn("[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead."))}function Hv(e,t){let n,o;if(!t&&qEe(e)){let{express:d,...p}=e;o=d,n=()=>p,YEe()}else{if(typeof t!="function")throw new TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback");n=t,o=e}let r=tT(o),i=QE(r)?r.Router.prototype:Rz(r)?r.Router:void 0;if(!i)throw new TypeError("no valid Express route function to instrument");let s=i.route;try{Lc(i,"route",function(...p){let f=s.apply(this,p),m=this.stack[this.stack.length-1];return eT(n,m,XE(p)),f})}catch(d){w&&b.error("Failed to patch express route method:",d)}let a=i.use;try{Lc(i,"use",function(...p){let f=a.apply(this,p),m=this.stack[this.stack.length-1];return m&&eT(n,m,XE(p)),f})}catch(d){w&&b.error("Failed to patch express use method:",d)}let{application:c}=r,u=c.use;try{Lc(c,"use",function(...p){let f=u.apply(this,p),m=QE(r)?this.router:this._router;if(m){let _=m.stack[m.stack.length-1];_&&eT(n,_,XE(p))}return f})}catch(d){w&&b.error("Failed to patch express application.use method:",d)}return r}l();var WEe=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function KEe(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=WEe.exec(t);return n?n.slice(1):[]}function zv(e){let t=KEe(e),n=t[0]||"",o=t[1];return!n&&!o?".":(o&&(o=o.slice(0,o.length-1)),n+o)}l();var ZEe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,nT=Symbol("sentryPostgresConnectionContext"),qv=Symbol.for("sentry.instrumented.postgresjs"),JEe=Symbol.for("sentry.query.from.instrumented.sql");function Kv(e,t){return!e||typeof e!="function"?(w&&b.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"),e):Wv(e,{requireParentSpan:!0,...t})}function Wv(e,t,n){if(e[qv])return e;let o=new Proxy(e,{apply(r,i,s){let a=Reflect.apply(r,i,s);return a&&typeof a=="object"&&"handle"in a&&Oz(a,o,t),a},get(r,i){let s=r[i];return typeof i!="string"||typeof s!="function"?s:i==="unsafe"||i==="file"?XEe(s,r,o,t):i==="begin"||i==="reserve"?QEe(s,r,o,t):s}});return n?o[nT]=n:oTe(e,o),e[qv]=!0,o[qv]=!0,o}function XEe(e,t,n,o){return function(...r){let i=Reflect.apply(e,t,r);return i&&typeof i=="object"&&"handle"in i&&Oz(i,n,o),i}}function QEe(e,t,n,o){return function(...r){let i=n[nT];if(!(typeof r[r.length-1]=="function")){let d=Reflect.apply(e,t,r);return d&&typeof d.then=="function"?d.then(p=>Wv(p,o,i)):d}let a=r.length===1?r[0]:r[1],c=function(d){let p=Wv(d,o,i);return a(p)},u=r.length===1?[c]:[r[0],c];return Reflect.apply(e,t,u)}}function Oz(e,t,n){if(e.handle?.__sentryWrapped)return;e[JEe]=!0;let o=e.handle,r=async function(...i){if(!eTe(n))return o.apply(this,i);let s=tTe(e.strings),a=nTe(s);return dt({name:a||"postgresjs.query",op:"db"},c=>{c.setAttribute(ne,"auto.db.postgresjs"),c.setAttributes({"db.system.name":"postgres","db.query.text":a});let u=t?t[nT]:void 0;if(rTe(c,u),n.requestHook)try{n.requestHook(c,a,u)}catch(p){c.setAttribute("sentry.hook.error","requestHook failed"),w&&b.error("Error in requestHook for PostgresJs instrumentation:",p)}let d=this;d.resolve=new Proxy(d.resolve,{apply:(p,f,m)=>{try{Nz(c,a,m?.[0]?.command),c.end()}catch(_){w&&b.error("Error ending span in resolve callback:",_)}return Reflect.apply(p,f,m)}}),d.reject=new Proxy(d.reject,{apply:(p,f,m)=>{try{c.setStatus({code:2,message:m?.[0]?.message||"unknown_error"}),c.setAttribute("db.response.status_code",m?.[0]?.code||"unknown"),c.setAttribute("error.type",m?.[0]?.name||"unknown"),Nz(c,a),c.end()}catch(_){w&&b.error("Error ending span in reject callback:",_)}return Reflect.apply(p,f,m)}});try{return o.apply(this,i)}catch(p){throw c.setStatus({code:2,message:p instanceof Error?p.message:"unknown_error"}),c.end(),p}})};r.__sentryWrapped=!0,e.handle=r}function eTe(e){return Yn()!==void 0||!e.requireParentSpan}function tTe(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((t,n,o)=>o===0?n:`${t}$${o}${n}`,"")}var Yv;function nTe(e){return e?(Yv||(Yv=new RegExp("(?<!\\$)-?\\b\\d+\\b","g")),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(Yv,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)")):"Unknown SQL Query"}function rTe(e,t){if(t&&(t.ATTR_DB_NAMESPACE&&e.setAttribute("db.namespace",t.ATTR_DB_NAMESPACE),t.ATTR_SERVER_ADDRESS&&e.setAttribute("server.address",t.ATTR_SERVER_ADDRESS),t.ATTR_SERVER_PORT!==void 0)){let n=parseInt(t.ATTR_SERVER_PORT,10);isNaN(n)||e.setAttribute("server.port",n)}}function Nz(e,t,n){if(n){e.setAttribute("db.operation.name",n);return}let o=t?.match(ZEe);o?.[1]&&e.setAttribute("db.operation.name",o[1].toUpperCase())}function oTe(e,t){let n=e;if(!n.options||typeof n.options!="object")return;let o=n.options,r=o.host?.[0]||"localhost",i=o.port?.[0]||5432,s={ATTR_DB_NAMESPACE:typeof o.database=="string"&&o.database!==""?o.database:void 0,ATTR_SERVER_ADDRESS:r,ATTR_SERVER_PORT:String(i)};t[nT]=s}l();var iTe="Console",Zv=(e={})=>{let t=new Set(e.levels||vc);return{name:iTe,setup(n){let o=lz(({args:r,level:i})=>{Q()!==n||!t.has(i)||sTe(i,r)});n.registerCleanup(o)}}};function sTe(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:dz(e),message:Cz(t)};if(e==="assert")if(t[0]===!1){let o=t.slice(1);n.message=o.length>0?`Assertion failed: ${Cz(o)}`:"Assertion failed",n.data.arguments=o}else return;wr(n,{input:t,level:e})}function Cz(e){return"util"in ge&&typeof ge.util.format=="function"?ge.util.format(...e):xC(e," ")}l();var aTe="ConversationId",cTe=(()=>({name:aTe,setup(e){e.on("spanStart",t=>{let n=Le().getScopeData(),o=Ie().getScopeData(),r=n.conversationId||o.conversationId;if(r){let{op:i,data:s,description:a}=_e(t);if(!i?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(nv,r)}})}})),Jv=cTe;l();l();var gi="@sentry/instrumentation-http",hs="http.client.request.created";l();l();l();function Fm(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}l();function rT(e){let t=e.host||"",n=/^(.*):(\d+)$/.exec(t),o=n?n[1]:t,r=e.port??(n?Number(n[2]):void 0);return{method:e.method,port:r,protocol:e.protocol,host:e.host,hostname:o,path:e.path,headers:e.getHeaders()}}function vz(e){return String(Pz(e))}function Pz(e){let t=e.protocol||"http:",o=e.headers?.host&&String(e.headers?.host)||e.hostname||e.host||"",r=!e.port||e.port===80||e.port===443||/^(.*):(\d+)$/.test(o)?"":`:${e.port}`,i=e.path?e.path:"/";return new URL(i,`${t}//${o}${r}`)}function Bo(e){return String(vz(rT(e)))}function xz(e,t){let n=Bo(e),o=fi(n),r=t?.statusCode,i=Fm(r);wr({category:"http",data:{status_code:r,url:mi(o),"http.method":e.method||"GET",...o.search?{"http.query":o.search}:{},...o.hash?{"http.fragment":o.hash}:{}},type:"http",level:i},{event:"response",request:e,response:t})}l();var pr=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let o=this._cache.keys().next().value;this._cache.delete(o)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};l();function Mz(e){let t=Bo(e),[n,o]=Sv(Fc(t),"client","auto.http.client",e),r=e.getHeader("user-agent");return{name:n,attributes:{[oe]:"http.client","otel.kind":"CLIENT","http.url":t,"http.method":e.method,"http.target":e.path||"/","net.peer.name":e.host,"http.host":e.getHeader("host"),...r?{"user_agent.original":r}:{},...o},onlyIfParent:!0}}function Lz(e,t){let{statusCode:n,statusMessage:o,httpVersion:r,socket:i}=e,s=r?.toUpperCase()!=="QUIC"?"ip_tcp":"ip_udp";t.setAttributes({"http.response.status_code":n,"network.protocol.version":r,"http.flavor":r,"network.transport":s,"net.transport":s,"http.status_text":o?.toUpperCase(),"http.status_code":n,...lTe(e),...uTe(i)})}function uTe(e){if(!e)return{};let{remoteAddress:t,remotePort:n}=e;return{"network.peer.address":t,"network.peer.port":n,"net.peer.ip":t,"net.peer.port":n}}function lTe(e){let{headers:t}=e,n=t["content-length"],o=n?parseInt(String(n),10):-1,r=t["content-encoding"];return o>=0?r&&r!=="identity"?{"http.response_content_length":o}:{"http.response_content_length_uncompressed":o}:{}}l();function oT(e,t){let n=Bo(e),o=Q()?.getOptions(),{tracePropagationTargets:r,propagateTraceparent:i}=o??{};if(!Wc(n,r,t)||!!e.getHeader("sentry-trace"))return;let a=Yc({propagateTraceparent:i});if(!a)return;let{"sentry-trace":c,baggage:u,traceparent:d}=a;if(c)try{e.setHeader("sentry-trace",c),w&&b.log(gi,"Added sentry-trace header")}catch(p){w&&b.error(gi,"Failed to set sentry-trace header:",ai(p)?p.message:"Unknown error")}if(d&&!e.getHeader("traceparent"))try{e.setHeader("traceparent",d),w&&b.log(gi,"Added traceparent header")}catch(p){w&&b.error(gi,"Failed to set traceparent header:",ai(p)?p.message:"Unknown error")}if(u){let p=Fl(e.getHeader("baggage"),u);if(p)try{e.setHeader("baggage",p),w&&b.log(gi,"Added baggage header")}catch(f){w&&b.error(gi,"Failed to set baggage header:",ai(f)?f.message:"Unknown error")}}}l();var wz=e=>typeof e.__unwrap=="function",dTe="Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation.",Dz=!1,Xv=w?e=>{Dz||(wz(e.request)||wz(e.get))&&(Dz=!0,b.warn(dTe))}:()=>{};function Hm(e){let t=new pr(100),n=()=>Q()?.getOptions(),o=r=>{if(Le().getScopeData().sdkProcessingMetadata[Kl]===!0)return;let i=n(),{errorMonitor:s="error",spans:a=i?_t(i):!0,propagateTrace:c=!1,breadcrumbs:u=!0,http:d,https:p,suppressOtelWarning:f=!1}=e,{request:m}=r;if(e.ignoreOutgoingRequests?.(Bo(m),m))return;let _=!1;function h(M,O){_||(_=!0,xz(M,O))}function E(M){M.on(s,()=>h(M,void 0)),M.prependListener("response",O=>{M.listenerCount("response")<=1&&O.resume(),O.on("end",()=>h(M,O)),O.on(s,()=>h(M,O))})}if(!a){u&&E(m),c&&oT(m,t);return}f||(d&&Xv(d),p&&Xv(p));let T=Cm(Mz(m));e.outgoingRequestHook?.(T,m),c&&(T.isRecording()?eo(T,()=>{oT(m,t)}):oT(m,t));let R=!1;function C(M){R||(R=!0,T.setStatus(M),T.end())}let P=()=>C({code:0});m.on("close",P),m.on(s,M=>{w&&b.log(gi,"outgoingRequest on request error()",M),u&&h(m,void 0),C({code:2})}),m.prependListener("response",M=>{m.removeListener("close",P),m.listenerCount("response")<=1&&M.resume(),Lz(M,T),e.outgoingResponseHook?.(T,M);let O=!1;function z(ie){if(!O){O=!0,ie&&w&&b.log(gi,"outgoingRequest on response error()",ie),u&&h(m,M);let $=M.aborted&&!M.complete,q=ie||typeof M.statusCode!="number"||$?{code:2}:Lo(M.statusCode);e.applyCustomAttributesOnSpan?.(T,m,M),C(q)}}M.on("end",()=>z()),M.on(s,z)})};return{[hs]:o}}function pTe(e,t){if(!us(e.request)){let{[hs]:n}=Hm({...t,http:e}),o=e.request;Lc(e,"request",function(...i){let s=o.apply(this,i);return n({request:s},hs),s})}}function fTe(e){us(e.get)||Lc(e,"get",function(n,o,r){let i=e.request.call(this,n,o,r);return i.end(),i})}function kz(e,t={}){let n=tT(e),o=e;if(n!==e){kz(n,t);for(let r of["get","request"]){let i=Object.getOwnPropertyDescriptor(n,r);i&&Object.defineProperty(o,r,i)}return o}return pTe(o,t),fTe(o),e}var iT=(e,t={})=>kz(e,t);var sT={};ft(sT,{debug:()=>_Te,error:()=>ETe,fatal:()=>TTe,fmt:()=>jm,info:()=>gTe,trace:()=>mTe,warn:()=>hTe});l();function id(e,t,n,o,r){ed({level:e,message:t,attributes:n,severityNumber:r},o)}function mTe(e,t,{scope:n}={}){id("trace",e,t,n)}function _Te(e,t,{scope:n}={}){id("debug",e,t,n)}function gTe(e,t,{scope:n}={}){id("info",e,t,n)}function hTe(e,t,{scope:n}={}){id("warn",e,t,n)}function ETe(e,t,{scope:n}={}){id("error",e,t,n)}function TTe(e,t,{scope:n}={}){id("fatal",e,t,n)}l();l();l();var Uz="gen_ai.prompt",hi="gen_ai.system",it="gen_ai.request.model",sd="gen_ai.request.stream",fa="gen_ai.request.temperature",ad="gen_ai.request.max_tokens",ma="gen_ai.request.frequency_penalty",cd="gen_ai.request.presence_penalty",_a="gen_ai.request.top_p",aT="gen_ai.request.top_k",cT="gen_ai.request.encoding_format",uT="gen_ai.request.dimensions",Ei="gen_ai.response.finish_reasons",Wn="gen_ai.response.model",ga="gen_ai.response.id",$z="gen_ai.response.stop_reason",gt="gen_ai.usage.input_tokens",Bt="gen_ai.usage.output_tokens",Kn="gen_ai.usage.total_tokens",Nt="gen_ai.operation.name",Zn="sentry.sdk_meta.gen_ai.input.messages.original_length",_n="gen_ai.input.messages",Bz="gen_ai.output.messages",Dr="gen_ai.system_instructions",xn="gen_ai.response.text",no="gen_ai.request.available_tools",Gz="gen_ai.response.streaming",fr="gen_ai.response.tool_calls",tu="gen_ai.agent.name",jz="gen_ai.pipeline.name",zm="gen_ai.conversation.id",Vz="gen_ai.usage.cache_creation_input_tokens",Fz="gen_ai.usage.cache_read_input_tokens",Qv="gen_ai.usage.input_tokens.cache_write",ha="gen_ai.usage.input_tokens.cached",Hz="gen_ai.invoke_agent",Ea="gen_ai.embeddings.input",eP="gen_ai.embeddings",tP="gen_ai.execute_tool",Ti="gen_ai.tool.name",qm="gen_ai.tool.call.id",Ym="gen_ai.tool.type",ud="gen_ai.tool.input",ld="gen_ai.tool.output",dd="gen_ai.tool.description";l();l();function Ta(e){return!e||typeof e!="object"?!1:ATe(e)||qz(e)||STe(e)||Yz(e)||Wz(e)||yTe(e)||RTe(e)||ITe(e)||bTe(e)||NTe(e)||OTe(e)||CTe(e)}function STe(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):zz(e):!1}function zz(e){return"image_url"in e&&!!e.image_url&&typeof e.image_url=="object"&&"url"in e.image_url&&typeof e.image_url.url=="string"&&e.image_url.url.startsWith("data:")}function ATe(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&Ta(e.source)}function qz(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function Yz(e){return"type"in e&&e.type==="input_audio"&&"input_audio"in e&&!!e.input_audio&&typeof e.input_audio=="object"&&"data"in e.input_audio&&typeof e.input_audio.data=="string"}function Wz(e){return"type"in e&&e.type==="file"&&"file"in e&&!!e.file&&typeof e.file=="object"&&"file_data"in e.file&&typeof e.file.file_data=="string"}function yTe(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function RTe(e){return"type"in e&&e.type==="file"&&"mediaType"in e&&typeof e.mediaType=="string"&&"data"in e&&typeof e.data=="string"&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}function ITe(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function bTe(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function NTe(e){return"b64_json"in e}function OTe(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function CTe(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}var Wm="[Blob substitute]",vTe=["image_url","data","content","b64_json","result","uri","image"];function nu(e){let t={...e};Ta(t.source)&&(t.source=nu(t.source)),qz(e)&&(t.inlineData={...e.inlineData,data:Wm}),zz(e)&&(t.image_url={...e.image_url,url:Wm}),Yz(e)&&(t.input_audio={...e.input_audio,data:Wm}),Wz(e)&&(t.file={...e.file,file_data:Wm});for(let n of vTe)typeof t[n]=="string"&&(t[n]=Wm);return t}var Zz=2e4,lT=e=>new TextEncoder().encode(e).length,rP=e=>lT(JSON.stringify(e));function dT(e,t){if(lT(e)<=t)return e;let n=0,o=e.length,r="";for(;n<=o;){let i=Math.floor((n+o)/2),s=e.slice(0,i);lT(s)<=t?(r=s,n=i+1):o=i-1}return r}function PTe(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function Kz(e,t){return typeof e=="string"?t:{...e,text:t}}function xTe(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function Jz(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function Xz(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function MTe(e,t){let n={...e,content:""},o=rP(n),r=t-o;if(r<=0)return[];let i=dT(e.content,r);return[{...e,content:i}]}function LTe(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}function wTe(e,t){let{key:n,items:o}=LTe(e);if(n===null||o.length===0)return[];let r=o.map(c=>Kz(c,"")),i=rP({...e,[n]:r}),s=t-i;if(s<=0)return[];let a=[];for(let c of o){let u=PTe(c),d=lT(u);if(d<=s)a.push(c),s-=d;else if(a.length===0){let p=dT(u,s);p&&a.push(Kz(c,p));break}else break}return a.length<=0?[]:[{...e,[n]:a}]}function DTe(e,t){if(!e)return[];if(typeof e=="string"){let n=dT(e,t);return n?[n]:[]}return typeof e!="object"?[]:xTe(e)?MTe(e,t):Jz(e)||Xz(e)?wTe(e,t):[]}function nP(e){return e.map(n=>{let o;return n&&typeof n=="object"&&(Jz(n)?o={...n,content:nP(n.content)}:"content"in n&&Ta(n.content)&&(o={...n,content:nu(n.content)}),Xz(n)&&(o={...o??n,parts:nP(n.parts)}),Ta(o)?o=nu(o):Ta(n)&&(o=nu(n))),o??n})}function kTe(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,o=e[e.length-1],r=nP([o]),i=r[0];return rP(i)<=n?r:DTe(i,n)}function Qz(e){return kTe(e,Zz)}function eq(e){return dT(e,Zz)}function kr(e){let t=!!Q()?.getOptions().sendDefaultPii;return{...e,recordInputs:e?.recordInputs??t,recordOutputs:e?.recordOutputs??t}}function Mn(e){let t=Q();return e??!(t&&Pn(t))}function pd(e,t){return e?`${e}.${t}`:t}function tq(e,t,n,o,r){if(t!==void 0&&e.setAttributes({[gt]:t}),n!==void 0&&e.setAttributes({[Bt]:n}),t!==void 0||n!==void 0||o!==void 0||r!==void 0){let i=(t??0)+(n??0)+(o??0)+(r??0);e.setAttributes({[Kn]:i})}}function ru(e,t,n){if(!e.isRecording())return;let o={[Gz]:!0};t.responseId&&(o[ga]=t.responseId),t.responseModel&&(o[Wn]=t.responseModel),t.promptTokens!==void 0&&(o[gt]=t.promptTokens),t.completionTokens!==void 0&&(o[Bt]=t.completionTokens),t.totalTokens!==void 0?o[Kn]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(o[Kn]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(o[Ei]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(o[xn]=t.responseTexts.join("")),n&&t.toolCalls.length&&(o[fr]=JSON.stringify(t.toolCalls)),e.setAttributes(o),e.end()}function mr(e){return typeof e=="string"?e:JSON.stringify(e)}function _r(e){if(typeof e=="string")return eq(e);if(Array.isArray(e)){let t=Qz(e);return JSON.stringify(t)}return JSON.stringify(e)}function Ur(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(s=>s&&typeof s=="object"&&"role"in s&&s.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],o=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!o)return{systemInstructions:void 0,filteredMessages:e};let r=JSON.stringify([{type:"text",content:o}]),i=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:r,filteredMessages:i}}async function UTe(e,t,n){let o=e.catch(s=>{throw he(s,{mechanism:{handled:!1,type:n}}),s}),r=await t,i=await o;return i&&typeof i=="object"&&"data"in i?{...i,data:r}:r}function fd(e,t,n){return fn(e)?new Proxy(e,{get(o,r){let s=r in Promise.prototype||r===Symbol.toStringTag?t:o,a=Reflect.get(s,r);return r==="withResponse"&&typeof a=="function"?function(){let u=a.call(o);return UTe(u,t,n)}:typeof a=="function"?a.bind(s):a}}):t}l();var Km=new Map,pT=new Map,oP=new Map([["ai.generateText","invoke_agent"],["ai.streamText","invoke_agent"],["ai.generateObject","invoke_agent"],["ai.streamObject","invoke_agent"],["ai.generateText.doGenerate","generate_content"],["ai.streamText.doStream","generate_content"],["ai.generateObject.doGenerate","generate_content"],["ai.streamObject.doStream","generate_content"],["ai.embed.doEmbed","embeddings"],["ai.embedMany.doEmbed","embeddings"],["ai.rerank.doRerank","rerank"],["ai.toolCall","execute_tool"]]);l();l();var fT="operation.name",mT="ai.operationId",_T="ai.prompt",nq="ai.schema",rq="ai.response.object",iP="ai.values",sP="ai.response.text",aP="ai.response.toolCalls",oq="ai.response.finishReason",ou="ai.prompt.messages",Es="ai.prompt.tools",Zm="ai.model.id",iq="ai.response.providerMetadata",sq="ai.usage.cachedInputTokens",aq="ai.telemetry.functionId",cq="ai.usage.completionTokens",uq="ai.usage.promptTokens",lq="ai.usage.tokens",cP="ai.toolCall.name",uP="ai.toolCall.id",dq="ai.toolCall.args",pq="ai.toolCall.result";function mq(e,t){let n=e.parent_span_id;if(!n)return;let o=e.data[gt],r=e.data[Bt];if(typeof o=="number"||typeof r=="number"){let i=t.get(n)||{inputTokens:0,outputTokens:0};typeof o=="number"&&(i.inputTokens+=o),typeof r=="number"&&(i.outputTokens+=r),t.set(n,i)}}function lP(e,t){let n=t.get(e.span_id);!n||!e.data||(n.inputTokens>0&&(e.data[gt]=n.inputTokens),n.outputTokens>0&&(e.data[Bt]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(e.data["gen_ai.usage.total_tokens"]=n.inputTokens+n.outputTokens))}function $Te(e){let t=new Map;for(let n of e){let o=n.data[no];if(typeof o=="string")try{let r=JSON.parse(o);for(let i of r)i.name&&i.description&&!t.has(i.name)&&t.set(i.name,i.description)}catch{}}return t}function _q(e,t){let n=$Te(e);for(let o of e){if(o.op==="gen_ai.execute_tool"){let r=o.data[Ti];if(typeof r=="string"){let i=n.get(r);i&&(o.data[dd]=i)}}o.op==="gen_ai.invoke_agent"&&lP(o,t)}}function dP(e){return Km.get(e)}function pP(e){Km.delete(e)}function gq(e){let t=e.map(n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n});return JSON.stringify(t)}function fq(e){return e.filter(t=>!!t&&typeof t=="object"&&"role"in t&&"content"in t)}function BTe(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{messages:n}=t,{prompt:o,system:r}=t,i=[];if(typeof r=="string"&&i.push({role:"system",content:r}),typeof n=="string")try{n=JSON.parse(n)}catch{}if(Array.isArray(n))return i.push(...fq(n)),i;if(Array.isArray(o))return i.push(...fq(o)),i;if(typeof o=="string"&&i.push({role:"user",content:o}),i.length>0)return i}}catch{}return[]}function hq(e,t,n){if(typeof t[_T]=="string"&&!t[_n]&&!t[ou]){let o=t[_T],r=BTe(o);if(r.length){let{systemInstructions:i,filteredMessages:s}=Ur(r);i&&e.setAttribute(Dr,i);let a=Array.isArray(s)?s.length:0,c=n?_r(s):mr(s);e.setAttributes({[_T]:c,[_n]:c,[Zn]:a})}}else if(typeof t[ou]=="string")try{let o=JSON.parse(t[ou]);if(Array.isArray(o)){let{systemInstructions:r,filteredMessages:i}=Ur(o);r&&e.setAttribute(Dr,r);let s=Array.isArray(i)?i.length:0,a=n?_r(i):mr(i);e.setAttributes({[ou]:a,[_n]:a,[Zn]:s})}}catch{}}function GTe(e){let{data:t,description:n}=_e(e);if(!n)return;if(t[cP]&&t[uP]&&n==="ai.toolCall"){qTe(e,t);return}if(!t[mT]&&!n.startsWith("ai."))return;let r=Q()?.getIntegrationByName("VercelAI"),i=Mn(r?.options?.enableTruncation);YTe(e,n,t,i)}function jTe(e){if(e.type==="transaction"&&e.spans){let t=new Map;for(let o of e.spans)HTe(o),mq(o,t);_q(e.spans,t);let n=e.contexts?.trace;n?.op==="gen_ai.invoke_agent"&&lP(n,t)}return e}function VTe(e){if(typeof e!="string")return"stop";switch(e){case"tool-calls":return"tool_call";case"stop":case"length":case"content_filter":case"error":return e;default:return e}}function FTe(e){let t=e[sP],n=e[aP],o=e[oq];if(t==null&&n==null)return;let r=[];if(typeof t=="string"&&t.length>0&&r.push({type:"text",content:t}),n!=null)try{let i=typeof n=="string"?JSON.parse(n):n;if(Array.isArray(i)){for(let s of i){let a=s.input??s.args;r.push({type:"tool_call",id:s.toolCallId,name:s.toolName,arguments:typeof a=="string"?a:JSON.stringify(a??{})})}delete e[aP]}}catch{}if(r.length>0){let i={role:"assistant",parts:r,finish_reason:VTe(o)};e[Bz]=JSON.stringify([i]),delete e[sP]}}function Eq(e){if(gn(e,cq,Bt),gn(e,uq,gt),gn(e,sq,ha),gn(e,"ai.usage.inputTokens",gt),gn(e,"ai.usage.outputTokens",Bt),gn(e,lq,gt),gn(e,"ai.response.avgOutputTokensPerSecond","ai.response.avgCompletionTokensPerSecond"),typeof e[gt]=="number"&&typeof e[ha]=="number"&&(e[gt]=e[gt]+e[ha]),typeof e[gt]=="number"){let t=typeof e[Bt]=="number"?e[Bt]:0;e[Kn]=t+e[gt]}if(e[Es]&&Array.isArray(e[Es])&&(e[Es]=gq(e[Es])),e[fT]){let t=e[mT]?e[mT]:e[fT],n=oP.get(t)??t;e[Nt]=n,delete e[fT]}if(gn(e,ou,_n),FTe(e),gn(e,rq,"gen_ai.response.object"),gn(e,Es,"gen_ai.request.available_tools"),gn(e,dq,ud),gn(e,pq,ld),gn(e,nq,"gen_ai.request.schema"),gn(e,Zm,it),Array.isArray(e[iP])){let t=e[iP].map(n=>{try{return JSON.parse(n)}catch{return n}});e[Ea]=t.length===1?t[0]:JSON.stringify(t)}WTe(e);for(let t of Object.keys(e))t.startsWith("ai.")&&gn(e,t,`vercel.${t}`)}function HTe(e){let{data:t,origin:n}=e;n==="auto.vercelai.otel"&&(e.status&&e.status!=="ok"&&(e.status="internal_error"),Eq(t))}function zTe(e){let t=e.attributes;if(t?.[ne]==="auto.vercelai.otel"){if(Eq(t),t[oe]==="gen_ai.execute_tool"&&e.parent_span_id){let n=pT.get(e.parent_span_id);if(n){let o=t[Ti];if(typeof o=="string"){let r=n.get(o);r&&(t[dd]=r)}}}pT.delete(e.span_id)}}function gn(e,t,n){e[t]!=null&&(e[n]=e[t],delete e[t])}function qTe(e,t){e.setAttribute(ne,"auto.vercelai.otel"),e.setAttribute(oe,"gen_ai.execute_tool"),e.setAttribute(Nt,"execute_tool"),gn(t,cP,Ti),gn(t,uP,qm);let n=t[qm];typeof n=="string"&&Km.set(n,e.spanContext()),t[Ym]||e.setAttribute(Ym,"function");let o=t[Ti];o&&e.updateName(`execute_tool ${o}`)}function YTe(e,t,n,o){e.setAttribute(ne,"auto.vercelai.otel");let r=t.replace("ai.","");e.setAttribute("ai.pipeline.name",r),e.updateName(r);let i=n[aq];i&&typeof i=="string"&&e.setAttribute("gen_ai.function_id",i),hq(e,n,o),n[Zm]&&!n[Wn]&&e.setAttribute(Wn,n[Zm]),e.setAttribute("ai.streaming",t.includes("stream"));let s=oP.get(t);if(s?e.setAttribute(oe,`gen_ai.${s}`):t.startsWith("ai.stream")&&e.setAttribute(oe,"ai.run"),s==="invoke_agent"){i&&typeof i=="string"?e.updateName(`invoke_agent ${i}`):e.updateName("invoke_agent");return}let a=n[Zm];a&&s&&e.updateName(`${s} ${a}`);let c=Q();if(c&&Pn(c)&&n[Es]&&Array.isArray(n[Es])){let u=new Map;for(let d of n[Es])try{let p=typeof d=="string"?JSON.parse(d):d;p?.name&&p?.description&&u.set(p.name,p.description)}catch{}if(u.size>0){let d=_e(e).parent_span_id;d&&pT.set(d,u)}}}function gT(e){e.on("spanStart",GTe),e.addEventProcessor(Object.assign(jTe,{id:"VercelAiEventProcessor"})),e.on("processSpan",t=>{zTe(t)})}function WTe(e){let t=e[iq];if(t)try{let n=JSON.parse(t),o=n.openai??n.azure;if(o&&(Go(e,ha,o.cachedPromptTokens),Go(e,"gen_ai.usage.output_tokens.reasoning",o.reasoningTokens),Go(e,"gen_ai.usage.output_tokens.prediction_accepted",o.acceptedPredictionTokens),Go(e,"gen_ai.usage.output_tokens.prediction_rejected",o.rejectedPredictionTokens),e["gen_ai.conversation.id"]||Go(e,"gen_ai.conversation.id",o.responseId)),n.anthropic){let r=n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens;Go(e,ha,r);let i=n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens;Go(e,Qv,i)}n.bedrock?.usage&&(Go(e,ha,n.bedrock.usage.cacheReadInputTokens),Go(e,Qv,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Go(e,ha,n.deepseek.promptCacheHitTokens),Go(e,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}function Go(e,t,n){n!=null&&(e[t]=n)}l();l();var Sa="OpenAI",Tq={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},KTe=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],Sq=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...KTe];l();l();function Aq(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function yq(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function Rq(e,t,n){if(!t||typeof t!="object")return;let o=t,r={};if(typeof o.id=="string"&&(r[ga]=o.id),typeof o.model=="string"&&(r[Wn]=o.model),o.object==="conversation"&&typeof o.id=="string"&&(r[zm]=o.id),o.usage&&typeof o.usage=="object"){let i=o.usage,s=i.prompt_tokens??i.input_tokens;typeof s=="number"&&(r[gt]=s);let a=i.completion_tokens??i.output_tokens;typeof a=="number"&&(r[Bt]=a),typeof i.total_tokens=="number"&&(r[Kn]=i.total_tokens)}if(Array.isArray(o.choices)){let i=o.choices,s=i.map(a=>a.finish_reason).filter(a=>typeof a=="string");if(s.length>0&&(r[Ei]=JSON.stringify(s)),n){let a=i.map(u=>u.message?.content||"");r[xn]=JSON.stringify(a);let c=i.map(u=>u.message?.tool_calls).filter(u=>Array.isArray(u)&&u.length>0).flat();c.length>0&&(r[fr]=JSON.stringify(c))}}if(typeof o.status=="string"&&(r[Ei]||(r[Ei]=JSON.stringify([o.status]))),n&&(typeof o.output_text=="string"&&!r[xn]&&(r[xn]=o.output_text),Array.isArray(o.output)&&o.output.length>0&&!r[fr])){let i=o.output.filter(s=>s?.type==="function_call");i.length>0&&(r[fr]=JSON.stringify(i))}e.setAttributes(r)}function ZTe(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function Iq(e){let t={[it]:e.model??"unknown"};"temperature"in e&&(t[fa]=e.temperature),"top_p"in e&&(t[_a]=e.top_p),"frequency_penalty"in e&&(t[ma]=e.frequency_penalty),"presence_penalty"in e&&(t[cd]=e.presence_penalty),"stream"in e&&(t[sd]=e.stream),"encoding_format"in e&&(t[cT]=e.encoding_format),"dimensions"in e&&(t[uT]=e.dimensions);let n=ZTe(e);return n&&(t[zm]=n),t}function JTe(e,t){for(let n of e){let o=n.index;if(!(o===void 0||!n.function))if(!(o in t.chatCompletionToolCalls))t.chatCompletionToolCalls[o]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let r=t.chatCompletionToolCalls[o];n.function.arguments&&r?.function&&(r.function.arguments+=n.function.arguments)}}}function XTe(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let o of e.choices??[])n&&(o.delta?.content&&t.responseTexts.push(o.delta.content),o.delta?.tool_calls&&JTe(o.delta.tool_calls,t)),o.finish_reason&&t.finishReasons.push(o.finish_reason)}function QTe(e,t,n,o){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){o.setStatus({code:2,message:"internal_error"}),he(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;let r=e;if(!Sq.includes(r.type)){t.eventTypes.push(r.type);return}if(n&&(r.type==="response.output_item.done"&&"item"in r&&t.responsesApiToolCalls.push(r.item),r.type==="response.output_text.delta"&&"delta"in r&&r.delta)){t.responseTexts.push(r.delta);return}if("response"in r){let{response:i}=r;t.responseId=i.id??t.responseId,t.responseModel=i.model??t.responseModel,i.usage&&(t.promptTokens=i.usage.input_tokens,t.completionTokens=i.usage.output_tokens,t.totalTokens=i.usage.total_tokens),i.status&&t.finishReasons.push(i.status),n&&i.output_text&&t.responseTexts.push(i.output_text)}}async function*bq(e,t,n){let o={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let r of e)yq(r)?XTe(r,o,n):Aq(r)&&QTe(r,o,n,t),yield r}finally{let r=[...Object.values(o.chatCompletionToolCalls),...o.responsesApiToolCalls];ru(t,{...o,toolCalls:r},n)}}function eSe(e){let t=Array.isArray(e.tools)?e.tools:[],o=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],r=[...t,...o];if(r.length!==0)try{return JSON.stringify(r)}catch(i){w&&b.error("Failed to serialize OpenAI tools:",i);return}}function tSe(e,t){let n={[hi]:"openai",[Nt]:t,[ne]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let o=e[0],r=eSe(o);r&&(n[no]=r),Object.assign(n,Iq(o))}else n[it]="unknown";return n}function Nq(e,t,n,o){if(n==="embeddings"&&"input"in t){let a=t.input;if(a==null||typeof a=="string"&&a.length===0||Array.isArray(a)&&a.length===0)return;e.setAttribute(Ea,typeof a=="string"?a:JSON.stringify(a));return}let r="input"in t?t.input:"messages"in t?t.messages:void 0;if(!r||Array.isArray(r)&&r.length===0)return;let{systemInstructions:i,filteredMessages:s}=Ur(r);i&&e.setAttribute(Dr,i),e.setAttribute(_n,o?_r(s):mr(s)),Array.isArray(s)?e.setAttribute(Zn,s.length):e.setAttribute(Zn,1)}function nSe(e,t,n,o,r){return function(...s){let a=n.operation||"unknown",c=tSe(s,a),u=c[it]||"unknown",d=s[0],p=d&&typeof d=="object"&&d.stream===!0,f={name:`${a} ${u}`,op:`gen_ai.${a}`,attributes:c};if(p){let h,E=dt(f,T=>(h=e.apply(o,s),r.recordInputs&&d&&Nq(T,d,a,Mn(r.enableTruncation)),(async()=>{try{let R=await h;return bq(R,T,r.recordOutputs??!1)}catch(R){throw T.setStatus({code:2,message:"internal_error"}),he(R,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),T.end(),R}})()));return fd(h,E,"auto.ai.openai")}let m,_=tn(f,h=>(m=e.apply(o,s),r.recordInputs&&d&&Nq(h,d,a,Mn(r.enableTruncation)),m.then(E=>(Rq(h,E,r.recordOutputs),E),E=>{throw he(E,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),E})));return fd(m,_,"auto.ai.openai")}}function Oq(e,t="",n){return new Proxy(e,{get(o,r){let i=o[r],s=pd(t,String(r)),a=Tq[s];return typeof i=="function"&&a?nSe(i,s,a,o,n):typeof i=="function"?i.bind(o):i&&typeof i=="object"?Oq(i,s,n):i}})}function Jm(e,t){return Oq(e,"",kr(t))}l();l();var Aa="Anthropic_AI",Cq={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};l();l();function vq(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:o,filteredMessages:r}=Ur(t);o&&e.setAttributes({[Dr]:o});let i=Array.isArray(r)?r.length:1;e.setAttributes({[_n]:n?_r(r):mr(r),[Zn]:i})}var rSe={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function fP(e){return e&&rSe[e]||"internal_error"}function Pq(e,t){t.error&&(e.setStatus({code:2,message:fP(t.error.type)}),he(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function xq(e){let{system:t,messages:n,input:o}=e,r=typeof t=="string"?[{role:"system",content:e.system}]:[],i=Array.isArray(o)?o:o!=null?[o]:void 0,s=Array.isArray(n)?n:n!=null?[n]:[],a=i??s;return[...r,...a]}function oSe(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:2,message:fP(e.error?.type)}),he(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0):!1}function iSe(e,t){if(e.type==="message_delta"&&e.usage&&"output_tokens"in e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function sSe(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function aSe(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){let o=t.activeToolBlocks[e.index];o&&o.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function cSe(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;let n=t.activeToolBlocks[e.index];if(!n)return;let o=n.inputJsonParts.join(""),r;try{r=o?JSON.parse(o):{}}catch{r={__unparsed:o}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:r}),delete t.activeToolBlocks[e.index]}function Mq(e,t,n,o){!(e&&typeof e=="object")||oSe(e,o)||(iSe(e,t),sSe(e,t),aSe(e,t,n),cSe(e,t))}async function*Lq(e,t,n){let o={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let r of e)Mq(r,o,n,t),yield r}finally{ru(t,o,n)}}function wq(e,t,n){let o={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",r=>{Mq(r,o,n,t)}),e.on("message",()=>{ru(t,o,n)}),e.on("error",r=>{he(r,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end())}),e}function uSe(e,t,n){let o={[hi]:"anthropic",[Nt]:n,[ne]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let r=e[0];r.tools&&Array.isArray(r.tools)&&(o[no]=JSON.stringify(r.tools)),o[it]=r.model??"unknown","temperature"in r&&(o[fa]=r.temperature),"top_p"in r&&(o[_a]=r.top_p),"stream"in r&&(o[sd]=r.stream),"top_k"in r&&(o[aT]=r.top_k),"frequency_penalty"in r&&(o[ma]=r.frequency_penalty),"max_tokens"in r&&(o[ad]=r.max_tokens)}else t==="models.retrieve"||t==="models.get"?o[it]=e[0]:o[it]="unknown";return o}function mP(e,t,n){let o=xq(t);vq(e,o,n),"prompt"in t&&e.setAttributes({[Uz]:JSON.stringify(t.prompt)})}function lSe(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[xn]:t.content.map(o=>o.text).filter(o=>!!o).join("")});let n=[];for(let o of t.content)(o.type==="tool_use"||o.type==="server_tool_use")&&n.push(o);n.length>0&&e.setAttributes({[fr]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[xn]:t.completion}),"input_tokens"in t&&e.setAttributes({[xn]:JSON.stringify(t.input_tokens)})}function dSe(e,t){"id"in t&&"model"in t&&(e.setAttributes({[ga]:t.id,[Wn]:t.model}),"usage"in t&&t.usage&&tq(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function pSe(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){Pq(e,t);return}n&&lSe(e,t),dSe(e,t)}}function Dq(e,t,n){throw he(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end()),e}function fSe(e,t,n,o,r,i,s,a,c,u,d){let p=r[it]??"unknown",f={name:`${i} ${p}`,op:`gen_ai.${i}`,attributes:r};if(u&&!d){let m,_=dt(f,h=>(m=e.apply(n,o),c.recordInputs&&a&&mP(h,a,Mn(c.enableTruncation)),(async()=>{try{let E=await m;return Lq(E,h,c.recordOutputs??!1)}catch(E){return Dq(E,h,s)}})()));return fd(m,_,"auto.ai.anthropic")}else return dt(f,m=>{try{c.recordInputs&&a&&mP(m,a,Mn(c.enableTruncation));let _=t.apply(n,o);return wq(_,m,c.recordOutputs??!1)}catch(_){return Dq(_,m,s)}})}function mSe(e,t,n,o,r){return new Proxy(e,{apply(i,s,a){let c=n.operation||"unknown",u=uSe(a,t,c),d=u[it]??"unknown",p=typeof a[0]=="object"?a[0]:void 0,f=!!p?.stream,m=n.streaming===!0;if(f||m)return fSe(e,i,o,a,u,c,t,p,r,f,m);let _,h=tn({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},E=>(_=i.apply(o,a),r.recordInputs&&p&&mP(E,p,Mn(r.enableTruncation)),_.then(T=>(pSe(E,T,r.recordOutputs),T),T=>{throw he(T,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),T})));return fd(_,h,"auto.ai.anthropic")}})}function kq(e,t="",n){return new Proxy(e,{get(o,r){let i=o[r],s=pd(t,String(r)),a=Cq[s];return typeof i=="function"&&a?mSe(i,s,a,o,n):typeof i=="function"?i.bind(o):i&&typeof i=="object"?kq(i,s,n):i}})}function Xm(e,t){return kq(e,"",kr(t))}l();l();var ya="Google_GenAI",Uq={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},$q="google_genai";l();function _Se(e,t){let n=e?.promptFeedback;if(n?.blockReason){let o=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:"internal_error"}),he(`Content blocked: ${o}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function gSe(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function hSe(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let o of e.candidates??[]){o?.finishReason&&!t.finishReasons.includes(o.finishReason)&&t.finishReasons.push(o.finishReason);for(let r of o?.content?.parts??[])n&&r.text&&t.responseTexts.push(r.text),r.functionCall&&t.toolCalls.push({type:"function",id:r.functionCall.id,name:r.functionCall.name,arguments:r.functionCall.args})}}function ESe(e,t,n,o){!e||_Se(e,o)||(gSe(e,t),hSe(e,t,n))}async function*Bq(e,t,n){let o={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let r of e)ESe(r,o,n,t),yield r}finally{ru(t,o,n)}}l();function md(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>md(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function Gq(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){let n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function TSe(e){let t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[fa]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[_a]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[aT]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[ad]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[ma]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[cd]=e.presencePenalty),t}function SSe(e,t,n){let o={[hi]:$q,[Nt]:e,[ne]:"auto.ai.google_genai"};if(t){if(o[it]=Gq(t,n),"config"in t&&typeof t.config=="object"&&t.config){let r=t.config;if(Object.assign(o,TSe(r)),"tools"in r&&Array.isArray(r.tools)){let i=r.tools.flatMap(s=>s.functionDeclarations);o[no]=JSON.stringify(i)}}}else o[it]=Gq({},n);return o}function jq(e,t,n,o){if(n){let i=t.contents;i!=null&&e.setAttribute(Ea,typeof i=="string"?i:JSON.stringify(i));return}let r=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&r.push(...md(t.config.systemInstruction,"system")),"history"in t&&r.push(...md(t.history,"user")),"contents"in t&&r.push(...md(t.contents,"user")),"message"in t&&r.push(...md(t.message,"user")),Array.isArray(r)&&r.length){let{systemInstructions:i,filteredMessages:s}=Ur(r);i&&e.setAttribute(Dr,i);let a=Array.isArray(s)?s.length:0;e.setAttributes({[Zn]:a,[_n]:o?_r(s):mr(s)})}}function ASe(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(Wn,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){let o=t.usageMetadata;typeof o.promptTokenCount=="number"&&e.setAttributes({[gt]:o.promptTokenCount}),typeof o.candidatesTokenCount=="number"&&e.setAttributes({[Bt]:o.candidatesTokenCount}),typeof o.totalTokenCount=="number"&&e.setAttributes({[Kn]:o.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let o=t.candidates.map(r=>r.content?.parts&&Array.isArray(r.content.parts)?r.content.parts.map(i=>typeof i.text=="string"?i.text:"").filter(i=>i.length>0).join(""):"").filter(r=>r.length>0);o.length>0&&e.setAttributes({[xn]:o.join("")})}if(n&&t.functionCalls){let o=t.functionCalls;Array.isArray(o)&&o.length>0&&e.setAttributes({[fr]:JSON.stringify(o)})}}}function ySe(e,t,n,o,r){let i=n.operation==="embeddings";return new Proxy(e,{apply(s,a,c){let u=n.operation||"unknown",d=c[0],p=SSe(u,d,o),f=p[it]??"unknown";return n.streaming?dt({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:p},async m=>{try{r.recordInputs&&d&&jq(m,d,i,Mn(r.enableTruncation));let _=await s.apply(o,c);return Bq(_,m,!!r.recordOutputs)}catch(_){throw m.setStatus({code:2,message:"internal_error"}),he(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),m.end(),_}}):tn({name:`${u} ${f}`,op:`gen_ai.${u}`,attributes:p},m=>(r.recordInputs&&d&&jq(m,d,i,Mn(r.enableTruncation)),Uo(()=>s.apply(o,c),_=>{he(_,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},_=>{i||ASe(m,_,r.recordOutputs)})))}})}function _P(e,t="",n){return new Proxy(e,{get:(o,r,i)=>{let s=Reflect.get(o,r,i),a=pd(t,String(r)),c=Uq[a];if(typeof s=="function"&&c){let u=c.operation?ySe(s,a,c,o,n):s.bind(o);return c.proxyResultPath?function(...d){let p=u(...d);return p&&typeof p=="object"?_P(p,c.proxyResultPath,n):p}:u}return typeof s=="function"?s.bind(o):s&&typeof s=="object"?_P(s,a,n):s}})}function Qm(e,t){return _P(e,"",kr(t))}l();l();var hT="LangChain",Ts="auto.ai.langchain",Vq={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};l();var ro=(e,t,n)=>{n!=null&&(e[t]=n)},$r=(e,t,n)=>{let o=Number(n);Number.isNaN(o)||(e[t]=o)};function iu(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function _d(e){if(Array.isArray(e))try{let t=e.map(n=>n&&typeof n=="object"&&Ta(n)?nu(n):n);return JSON.stringify(t)}catch{return String(e)}return iu(e)}function e_(e){let t=e.toLowerCase();return Vq[t]??t}function Fq(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function gP(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function t_(e){return e.map(t=>{let n=t._getType;if(typeof n=="function"){let r=n.call(t);return{role:e_(r),content:_d(t.content)}}if(t.lc===1&&t.kwargs){let r=t.id,i=Array.isArray(r)&&r.length>0?r[r.length-1]:"",s=typeof i=="string"?Fq(i):"user";return{role:e_(s),content:_d(t.kwargs?.content)}}if(t.type){let r=String(t.type).toLowerCase();return{role:e_(r),content:_d(t.content)}}if(t.role)return{role:e_(String(t.role)),content:_d(t.content)};let o=t.constructor?.name;return o&&o!=="Object"?{role:e_(Fq(o)),content:_d(t.content)}:{role:"user",content:_d(t.content)}})}function RSe(e,t,n){let o={},r="kwargs"in e?e.kwargs:void 0,i=t?.temperature??n?.ls_temperature??r?.temperature;$r(o,fa,i);let s=t?.max_tokens??n?.ls_max_tokens??r?.max_tokens;$r(o,ad,s);let a=t?.top_p??r?.top_p;$r(o,_a,a);let c=t?.frequency_penalty;$r(o,ma,c);let u=t?.presence_penalty;return $r(o,cd,u),t&&"stream"in t&&ro(o,sd,!!t.stream),o}function Hq(e,t,n,o,r){return{[hi]:iu(e??"langchain"),[Nt]:"chat",[it]:iu(t),[ne]:Ts,...RSe(n,o,r)}}function zq(e,t,n,o,r,i){let s=i?.ls_provider,a=r?.model??i?.ls_model_name??"unknown",c=Hq(s,a,e,r,i);if(n&&Array.isArray(t)&&t.length>0){ro(c,Zn,t.length);let u=t.map(d=>({role:"user",content:d}));ro(c,_n,o?_r(u):mr(u))}return c}function qq(e,t,n,o,r,i){let s=i?.ls_provider??e.id?.[2],a=r?.model??i?.ls_model_name??"unknown",c=Hq(s,a,e,r,i);if(n&&Array.isArray(t)&&t.length>0){let u=t_(t.flat()),{systemInstructions:d,filteredMessages:p}=Ur(u);d&&ro(c,Dr,d);let f=Array.isArray(p)?p.length:0;ro(c,Zn,f),ro(c,_n,o?_r(p):mr(p))}return c}function ISe(e,t){let n=[],o=e.flat();for(let r of o){let s=r.message?.tool_calls;if(Array.isArray(s)&&s.length>0)n.push(...s);else{let a=r.message?.content;if(Array.isArray(a))for(let c of a){let u=c;u.type==="tool_use"&&n.push(u)}}}n.length>0&&ro(t,fr,iu(n))}function bSe(e,t){if(!e)return;let n=e.tokenUsage,o=e.usage;if(n)$r(t,gt,n.promptTokens),$r(t,Bt,n.completionTokens),$r(t,Kn,n.totalTokens);else if(o){$r(t,gt,o.input_tokens),$r(t,Bt,o.output_tokens);let r=Number(o.input_tokens),i=Number(o.output_tokens),s=(Number.isNaN(r)?0:r)+(Number.isNaN(i)?0:i);s>0&&$r(t,Kn,s),o.cache_creation_input_tokens!==void 0&&$r(t,Vz,o.cache_creation_input_tokens),o.cache_read_input_tokens!==void 0&&$r(t,Fz,o.cache_read_input_tokens)}}function Yq(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let u=e.generations.flat().map(d=>d.generationInfo?.finish_reason?d.generationInfo.finish_reason:d.generation_info?.finish_reason?d.generation_info.finish_reason:null).filter(d=>typeof d=="string");if(u.length>0&&ro(n,Ei,iu(u)),ISe(e.generations,n),t){let d=e.generations.flat().map(p=>p.text??p.message?.content).filter(p=>typeof p=="string");d.length>0&&ro(n,xn,iu(d))}}bSe(e.llmOutput,n);let o=e.llmOutput,i=e.generations?.[0]?.[0]?.message,s=o?.model_name??o?.model??i?.response_metadata?.model_name;s&&ro(n,Wn,s);let a=o?.id??i?.id;a&&ro(n,ga,a);let c=o?.stop_reason??i?.response_metadata?.finish_reason;return c&&ro(n,$z,iu(c)),n}function ET(e){let t={},n=e?.lc_agent_name;return typeof n=="string"&&(t[tu]=n),t}function Wq(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(o=>{let r=o.function;return{type:"function",name:o.name??r?.name??"",description:o.description??r?.description}});return JSON.stringify(n)}function Ra(e={}){let{recordInputs:t,recordOutputs:n}=kr(e),o=Mn(e.enableTruncation),r=new Map,i=a=>{let c=r.get(a);c?.isRecording()&&(c.end(),r.delete(a))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(a,c,u,d,p,f,m,_){let h=gP(f),E=zq(a,c,t,o,h,m),T=E[it],R=E[Nt];dt({name:`${R} ${T}`,op:"gen_ai.chat",attributes:{...ET(m),...E,[oe]:"gen_ai.chat"}},C=>(r.set(u,C),C))},handleChatModelStart(a,c,u,d,p,f,m,_){let h=gP(f),E=qq(a,c,t,o,h,m),T=Wq(p);T&&(E[no]=T);let R=E[it],C=E[Nt];dt({name:`${C} ${R}`,op:"gen_ai.chat",attributes:{...ET(m),...E,[oe]:"gen_ai.chat"}},P=>(r.set(u,P),P))},handleLLMEnd(a,c,u,d,p){let f=r.get(c);if(f?.isRecording()){let m=Yq(a,n);m&&f.setAttributes(m),i(c)}},handleLLMError(a,c){let u=r.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),he(a,{mechanism:{handled:!1,type:`${Ts}.llm_error_handler`}})},handleChainStart(a,c,u,d,p,f,m,_){if(f?.__sentry_langgraph__)return;let h=_||a.name||"unknown_chain",E={[ne]:"auto.ai.langchain","langchain.chain.name":h};t&&(E["langchain.chain.inputs"]=JSON.stringify(c)),dt({name:`chain ${h}`,op:"gen_ai.invoke_agent",attributes:{...E,[oe]:"gen_ai.invoke_agent"}},T=>(r.set(u,T),T))},handleChainEnd(a,c){let u=r.get(c);u?.isRecording()&&(n&&u.setAttributes({"langchain.chain.outputs":JSON.stringify(a)}),i(c))},handleChainError(a,c){let u=r.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),he(a,{mechanism:{handled:!1,type:`${Ts}.chain_error_handler`}})},handleToolStart(a,c,u,d,p,f,m){if(f?.__sentry_langgraph__)return;let _=m||a.name||"unknown_tool",h={...ET(f),[ne]:Ts,[Nt]:"execute_tool",[Ti]:_};t&&(h[ud]=c),dt({name:`execute_tool ${_}`,op:"gen_ai.execute_tool",attributes:{...h,[oe]:"gen_ai.execute_tool"}},E=>(r.set(u,E),E))},handleToolEnd(a,c){let u=r.get(c);if(u?.isRecording()){if(n){let d=a,p=d&&typeof d=="object"&&"content"in d?d.content:a;u.setAttributes({[ld]:typeof p=="string"?p:JSON.stringify(p)})}i(c)}},handleToolError(a,c){let u=r.get(c);u?.isRecording()&&(u.setStatus({code:2,message:"internal_error"}),i(c)),he(a,{mechanism:{handled:!1,type:`${Ts}.tool_error_handler`}})},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}l();l();var TT="LangGraph",n_="auto.ai.langgraph";l();function Kq(e){let t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;let n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function Zq(e){let t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function Jq(e,t,n){let o="__sentry_tool_wrapped__";for(let r of e){if(!r||typeof r!="object")continue;let i=r,s=i.invoke;if(typeof s!="function"||Object.prototype.hasOwnProperty.call(i,o))continue;let a=typeof i.name=="string"?i.name:"unknown_tool",c=typeof i.description=="string"?i.description:void 0,u=new Proxy(s,{apply(d,p,f){let m={[ne]:n_,[oe]:tP,[Nt]:"execute_tool",[Ti]:a,[Ym]:"function"},h=f[1]?.metadata?.lc_agent_name??n;typeof h=="string"&&(m[tu]=h),c&&(m[dd]=c);let E=f[0];if(typeof E=="object"&&E&&("id"in E&&typeof E.id=="string"&&(m[qm]=E.id),t.recordInputs)){let T="args"in E&&typeof E.args=="object"?E.args:E;try{m[ud]=JSON.stringify(T)}catch{}}return tn({op:tP,name:`execute_tool ${a}`,attributes:m},async T=>{try{let R=await Reflect.apply(d,p,f);if(t.recordOutputs)try{let C=R,P=C&&typeof C=="object"&&"content"in C?C.content:R;T.setAttribute(ld,typeof P=="string"?P:JSON.stringify(P))}catch{}return R}catch(R){throw T.setStatus({code:2,message:"internal_error"}),he(R,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),R}})}});i.invoke=u,Object.defineProperty(i,o,{value:!0,enumerable:!1})}return e}function NSe(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n=="object"){let o=n.tool_calls;o&&Array.isArray(o)&&t.push(...o)}return t.length>0?t:null}function OSe(e){let t=e,n=0,o=0,r=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){let i=t.usage_metadata;return typeof i.input_tokens=="number"&&(n=i.input_tokens),typeof i.output_tokens=="number"&&(o=i.output_tokens),typeof i.total_tokens=="number"&&(r=i.total_tokens),{inputTokens:n,outputTokens:o,totalTokens:r}}if(t.response_metadata&&typeof t.response_metadata=="object"){let i=t.response_metadata;if(i.tokenUsage&&typeof i.tokenUsage=="object"){let s=i.tokenUsage;typeof s.promptTokens=="number"&&(n=s.promptTokens),typeof s.completionTokens=="number"&&(o=s.completionTokens),typeof s.totalTokens=="number"&&(r=s.totalTokens)}}return{inputTokens:n,outputTokens:o,totalTokens:r}}function CSe(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){let o=n.response_metadata;o.model_name&&typeof o.model_name=="string"&&e.setAttribute(Wn,o.model_name),o.finish_reason&&typeof o.finish_reason=="string"&&e.setAttribute(Ei,[o.finish_reason])}}function Xq(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function Qq(e,t,n){let r=n?.messages;if(!r||!Array.isArray(r))return;let i=t?.length??0,s=r.length>i?r.slice(i):[];if(s.length===0)return;let a=NSe(s);a&&e.setAttribute(fr,JSON.stringify(a));let c=t_(s);e.setAttribute(xn,JSON.stringify(c));let u=0,d=0,p=0;for(let f of s){let m=OSe(f);u+=m.inputTokens,d+=m.outputTokens,p+=m.totalTokens,CSe(e,f)}u>0&&e.setAttribute(gt,u),d>0&&e.setAttribute(Bt,d),p>0&&e.setAttribute(Kn,p)}function eY(e,t){if(!e)return[t];if(Array.isArray(e))return e.includes(t)?e:[...e,t];let n=e;return typeof n.addHandler=="function"&&(Array.isArray(n.handlers)&&n.handlers.includes(t)||n.addHandler(t)),e}var hP=!1,ST="__sentry_patched__";function AT(e,t){if(Object.prototype.hasOwnProperty.call(e,ST))return e;let n=Ra(t),o=new Proxy(e,{apply(r,i,s){return hP?Reflect.apply(r,i,s):tn({op:"gen_ai.create_agent",name:"create_agent",attributes:{[ne]:n_,[oe]:"gen_ai.create_agent",[Nt]:"create_agent"}},a=>{try{let c=Reflect.apply(r,i,s),u=s.length>0?s[0]:{};u?.name&&typeof u.name=="string"&&(a.setAttribute(tu,u.name),a.updateName(`create_agent ${u.name}`));let d=c.invoke;return d&&typeof d=="function"&&(c.invoke=tY(d.bind(c),c,u,t,void 0,n)),c}catch(c){throw a.setStatus({code:2,message:"internal_error"}),he(c,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),c}})}});return Object.defineProperty(o,ST,{value:!0,enumerable:!1}),o}function tY(e,t,n,o,r,i){return new Proxy(e,{apply(s,a,c){let u=r?.modelName??r?.model;return tn({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[ne]:n_,[oe]:Hz,[Nt]:"invoke_agent"}},async d=>{try{let p=n?.name;p&&typeof p=="string"&&(d.setAttribute(jz,p),d.setAttribute(tu,p),d.updateName(`invoke_agent ${p}`)),u&&d.setAttribute(it,u);let _=(c.length>1?c[1]:void 0)?.configurable?.thread_id;if(_&&typeof _=="string"&&d.setAttribute(zm,_),i){let P=c[1]??{};c[1]=P;let M=P.metadata??{};P.metadata={...M,__sentry_langgraph__:!0,...typeof p=="string"?{lc_agent_name:p}:{}},P.callbacks=eY(P.callbacks,i)}let h=Xq(t);h&&d.setAttribute(no,JSON.stringify(h));let E=o.recordInputs,T=o.recordOutputs,R=c.length>0?c[0]?.messages??[]:[];if(R&&E){let P=t_(R),{systemInstructions:M,filteredMessages:O}=Ur(P);M&&d.setAttribute(Dr,M);let z=Mn(o.enableTruncation),ie=Array.isArray(O)?O.length:0;d.setAttributes({[_n]:z?_r(O):mr(O),[Zn]:ie})}let C=await Reflect.apply(s,a,c);return T&&Qq(d,R??null,C),C}catch(p){throw d.setStatus({code:2,message:"internal_error"}),he(p,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),p}})}})}function EP(e,t){if(Object.prototype.hasOwnProperty.call(e,ST))return e;let n=kr(t),o=Ra(n),r=new Proxy(e,{apply(i,s,a){let c=Kq(a),u=Zq(a),d=a[0];d&&Array.isArray(d.tools)&&d.tools.length>0&&Jq(d.tools,n,u??void 0),hP=!0;let p;try{p=Reflect.apply(i,s,a)}finally{hP=!1}let f=p.invoke;if(f&&typeof f=="function"){let m={};u&&(m.name=u),p.invoke=tY(f.bind(p),p,m,n,c,o)}return p}});return Object.defineProperty(r,ST,{value:!0,enumerable:!1}),r}function r_(e,t){return e.compile=AT(e.compile,kr(t)),e}l();l();function nY(e,t,n){let o=n.getOptions(),r=n.getDsn(),i=o.tunnel,s=Yl(o._metadata),a={sent_at:new Date().toISOString(),...vSe(t)&&{trace:t},...s&&{sdk:s},...!!i&&r&&{dsn:qn(r)}},c=o.sendDefaultPii?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Ql()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return mn(a,[u])}function vSe(e){return!!e.trace_id&&!!e.public_key}l();function rY(e){let t=156;if(t+=e.name.length*2,t+=BC(e.attributes),e.links&&e.links.length>0){let o=e.links[0]?.attributes,r=100+(o?BC(o):0);t+=r*e.links.length}return t}var oY=1e3,PSe=5e6,yT=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:o,flushInterval:r,maxTraceWeightInBytes:i}=n??{};this._maxSpanLimit=o&&o>0&&o<=oY?o:oY,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=i&&i>0?i:PSe,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(s=>{clearTimeout(s.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,o=this._traceBuckets.get(n);o||(o={spans:new Set,size:0,timeout:td(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,o)),o.spans.add(t),o.size+=rY(t),(o.spans.size>=this._maxSpanLimit||o.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(w&&b.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let o=Array.from(n.spans),r=o[0]?._segmentSpan;if(!r){w&&b.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let i=St(r),s=o.map(c=>{let{_segmentSpan:u,...d}=c;return d}),a=nY(s,i,this._client);w&&b.log(`Sending span envelope for trace ${t} with ${s.length} spans`),this._client.sendEnvelope(a).then(null,c=>{w&&b.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};l();var o_=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",o=e.getOptions();if(!Pn(e)){o.traceLifecycle="static",w&&b.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let r=o.beforeSendSpan;if(r&&!ua(r)){o.traceLifecycle="static",w&&b.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let i=new yT(e);e.on("afterSpanEnd",s=>{Lr(s)&&i.add(yv(s,e))})}});l();function i_(e,t,n){let o=e[t];if(typeof o=="function"){try{e[t]=n}catch{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(e.default===o)try{e.default=n}catch{Object.defineProperty(e,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}l();function aY(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function cY(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,o=/at (?:async )?(.+?) \(data:(.*?),/;return r=>{let i=r.match(o);if(i)return{filename:`<data:${i[2]}>`,function:i[1]};let s=r.match(n);if(s){let a,c,u,d,p;if(s[1]){u=s[1];let h=u.lastIndexOf(".");if(u[h-1]==="."&&h--,h>0){a=u.slice(0,h),c=u.slice(h+1);let E=a.indexOf(".Module");E>0&&(u=u.slice(E+1),a=a.slice(0,E))}d=void 0}c&&(d=a,p=c),c==="<anonymous>"&&(p=void 0,u=void 0),u===void 0&&(p=p||"?",u=d?`${d}.${p}`:p);let f=rF(s[2]),m=s[5]==="native";!f&&s[5]&&!m&&(f=s[5]);let _=f?xSe(f):void 0;return{filename:_??f,module:_&&e?.(_),function:u,lineno:iY(s[3]),colno:iY(s[4]),in_app:aY(f||"",m)}}if(r.match(t))return{filename:r}}}function TP(e){return[90,cY(e)]}function iY(e){return parseInt(e||"",10)||void 0}function xSe(e){try{return decodeURI(e)}catch{return}}l();function MSe(e){let t=e.constructor?.name??"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}function LSe(e){let t=e??{},n={[ne]:Ts,[oe]:eP,[Nt]:"embeddings",[it]:t.model??"unknown"};return n[hi]=MSe(t),"dimensions"in t&&(n[uT]=t.dimensions),"encodingFormat"in t&&(n[cT]=t.encodingFormat),n}function uY(e,t={}){let{recordInputs:n}=kr(t);return new Proxy(e,{apply(o,r,i){let s=LSe(r),a=s[it]||"unknown";if(n){let c=i[0];c!=null&&(s[Ea]=typeof c=="string"?c:JSON.stringify(c))}return tn({name:`embeddings ${a}`,op:eP,attributes:s},()=>Reflect.apply(o,r,i).then(void 0,c=>{throw he(c,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),c}))}})}function s_(e,t){let n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=uY(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=uY(n.embedDocuments,t)),e}l();l();l();var Hx=U(Pe(),1),O_={};function se(e,t,n){return n?cIe(e,t,n):aIe(e,t)}function aIe(e,t){return Object.assign(n=>{let o=O_[e];if(o)return n&&o.setConfig(n),o;let r=t(n);return O_[e]=r,(0,Hx.registerInstrumentations)({instrumentations:[r]}),r},{id:e})}function cIe(e,t,n){return Object.assign(o=>{let r=n(o),i=O_[e];if(i)return i.setConfig(r),i;let s=new t(r);return O_[e]=s,(0,Hx.registerInstrumentations)({instrumentations:[s]}),s},{id:e})}function C_(e){let t=!1,n=[];if(!uIe(e))t=!0;else{let r=e._wrap;e._wrap=(...i)=>(t=!0,n.forEach(s=>s()),n=[],r(...i))}return r=>{t?r():n.push(r)}}function uIe(e){return typeof e._wrap=="function"}l();var D4=require("node:diagnostics_channel"),Ca=U(K(),1);l();var je=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;l();function M4(e,t,n,o){let r=0,i=[];je&&b.log(o,"Patching request.on");let s=new WeakMap,a=Bv(n);try{e.on=new Proxy(e.on,{apply:(c,u,d)=>{let[p,f,...m]=d;if(p==="data"){je&&b.log(o,`Handling request.on("data") with maximum body size of ${a}b`);let _=new Proxy(f,{apply:(h,E,T)=>{try{let R=T[0],C=Buffer.from(R);r<a?(i.push(C),r+=C.byteLength):je&&b.log(o,`Dropping request body chunk because maximum body length of ${a}b is exceeded.`)}catch{je&&b.error(o,"Encountered error while storing body chunk.")}return Reflect.apply(h,E,T)}});return s.set(f,_),Reflect.apply(c,u,[p,_,...m])}return Reflect.apply(c,u,d)}}),e.off=new Proxy(e.off,{apply:(c,u,d)=>{let[,p]=d,f=s.get(p);if(f){s.delete(p);let m=d.slice();return m[1]=f,Reflect.apply(c,u,m)}return Reflect.apply(c,u,d)}}),e.on("end",()=>{try{let c=Buffer.concat(i).toString("utf-8");if(c){let d=Buffer.byteLength(c,"utf-8")>a?`${Buffer.from(c).subarray(0,a-3).toString("utf-8")}...`:c;t.setSDKProcessingMetadata({normalizedRequest:{data:d}})}}catch(c){je&&b.error(o,"Error building captured request body",c)}})}catch(c){je&&b.error(o,"Error patching request to capture body",c)}}var L4=(0,Ca.createContextKey)("sentry_http_server_instrumented"),qx="Http.Server",zx=new Map,w4=new WeakSet;function k4(e,t){kt(e,"_startSpanCallback",new WeakRef(t))}var lIe=((e={})=>{let t={sessions:e.sessions??!0,sessionFlushingDelayMS:e.sessionFlushingDelayMS??6e4,maxRequestBodySize:e.maxRequestBodySize??"medium",ignoreRequestBody:e.ignoreRequestBody};return{name:qx,setupOnce(){(0,D4.subscribe)("http.server.request.start",(o=>{dIe(o.server,t)}))},afterAllSetup(n){je&&n.getIntegrationByName("Http")&&b.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}}),pu=lIe;function dIe(e,{ignoreRequestBody:t,maxRequestBodySize:n,sessions:o,sessionFlushingDelayMS:r}){let i=e.emit;if(w4.has(i))return;let s=new Proxy(i,{apply(a,c,u){if(u[0]!=="request")return a.apply(c,u);let d=Q();if(Ca.context.active().getValue(L4)||!d)return a.apply(c,u);je&&b.log(qx,"Handling incoming request");let p=Ie().clone(),f=u[1],m=u[2],_=od(f),h=f.ip||f.socket?.remoteAddress,E=f.url||"/";n!=="none"&&!t?.(E,f)&&M4(f,p,n,qx),p.setSDKProcessingMetadata({normalizedRequest:_,ipAddress:h});let T=(f.method||"GET").toUpperCase(),R=to(E),C=`${T} ${R}`;return p.setTransactionName(C),o&&d&&pIe(d,{requestIsolationScope:p,response:m,sessionFlushingDelayMS:r??6e4}),ia(p,()=>{let P={traceId:en(),sampleRand:Ut(),propagationSpanId:On()};Le().setPropagationContext({...P}),p.setPropagationContext({...P});let M=Ca.propagation.extract(Ca.context.active(),_.headers).setValue(L4,!0);return Ca.context.with(M,()=>{d.emit("httpServerRequest",f,m,_);let O=f._startSpanCallback?.deref();return O?O(()=>a.apply(c,u)):a.apply(c,u)})})}});w4.add(s),e.emit=s}function pIe(e,{requestIsolationScope:t,response:n,sessionFlushingDelayMS:o}){t.setSDKProcessingMetadata({requestSession:{status:"ok"}}),n.once("close",()=>{let r=t.getScopeData().sdkProcessingMetadata.requestSession;if(e&&r){je&&b.log(`Recorded request session with status: ${r.status}`);let i=new Date;i.setSeconds(0,0);let s=i.toISOString(),a=zx.get(e),c=a?.[s]||{exited:0,crashed:0,errored:0};if(c[{ok:"exited",crashed:"crashed",errored:"errored"}[r.status]]++,a)a[s]=c;else{je&&b.log("Opened new request session aggregate.");let u={[s]:c};zx.set(e,u);let d=()=>{clearTimeout(f),p(),zx.delete(e);let m=Object.entries(u).map(([_,h])=>({started:_,exited:h.exited,errored:h.errored,crashed:h.crashed}));e.sendSession({aggregates:m})},p=e.on("flush",()=>{je&&b.log("Sending request session aggregate due to client flush"),d()}),f=setTimeout(()=>{je&&b.log("Sending request session aggregate due to flushing schedule"),d()},o).unref()}}})}l();var a9=require("node:events"),Br=U(K(),1),Rs=U(Xe(),1),Gr=U(We(),1);var s9="Http.ServerSpans",rNe=((e={})=>{let t=e.ignoreStaticAssets??!0,n=e.ignoreIncomingRequests,o=e.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:r}=e,{requestHook:i,responseHook:s,applyCustomAttributesOnSpan:a}=e.instrumentation??{};return{name:s9,setup(c){typeof __SENTRY_TRACING__<"u"&&!__SENTRY_TRACING__||c.on("httpServerRequest",(u,d,p)=>{let f=u,m=d;k4(f,h=>{if(sNe(f,{ignoreStaticAssets:t,ignoreIncomingRequests:n}))return je&&b.log(s9,"Skipping span creation for incoming request",f.url),h();let E=p.url||f.url||"/",T=Fc(E),R=f.headers,C=R["user-agent"],P=R["x-forwarded-for"],M=f.httpVersion,O=R.host,z=O?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",ie=c.tracer,$=E.startsWith("https")?"https":"http",q=p.method||f.method?.toUpperCase()||"GET",J=T?T.pathname:to(E),Z=`${q} ${J}`,k=ie.startSpan(Z,{kind:Br.SpanKind.SERVER,attributes:{[oe]:"http.server",[ne]:"auto.http.otel.http","sentry.http.prefetch":oNe(f)||void 0,"http.url":E,"http.method":p.method,"http.target":T?`${T.pathname}${T.search}`:J,"http.host":O,"net.host.name":z,"http.client_ip":typeof P=="string"?P.split(",")[0]:void 0,"http.user_agent":C,"http.scheme":$,"http.flavor":M,"net.transport":M?.toUpperCase()==="QUIC"?"ip_udp":"ip_tcp",...aNe(f),...$o(p.headers||{},c.getOptions().sendDefaultPii??!1)}});i?.(k,f),s?.(k,m),a?.(k,f,m),r?.(k,f,m);let ue={type:Rs.RPCType.HTTP,span:k};return Br.context.with((0,Rs.setRPCMetadata)(Br.trace.setSpan(Br.context.active(),k),ue),()=>{Br.context.bind(Br.context.active(),f),Br.context.bind(Br.context.active(),m);let le=!1;function Ae(ye){if(le)return;le=!0;let at=lNe(f,m);k.setAttributes(at),k.setStatus(ye),k.end();let Yt=at["http.route"];Yt&&Ie().setTransactionName(`${f.method?.toUpperCase()||"GET"} ${Yt}`)}return m.on("close",()=>{Ae(Lo(m.statusCode))}),m.on(a9.errorMonitor,()=>{let ye=Lo(m.statusCode);Ae(ye.code===2?ye:{code:2})}),h()})})})},processEvent(c){if(c.type==="transaction"){let u=c.contexts?.trace?.data?.["http.response.status_code"];if(typeof u=="number"&&dNe(u,o))return je&&b.log("Dropping transaction due to status code",u),null}return c},afterAllSetup(c){je&&(c.getIntegrationByName("Http")&&b.warn("It seems that you have manually added `httpServerSpansIntergation` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),c.getIntegrationByName("Http.Server")||b.error("It seems that you have manually added `httpServerSpansIntergation` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}}),Su=rNe;function oNe(e){return e.headers["next-router-prefetch"]==="1"}function iNe(e){let t=to(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function sNe(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){if((0,Rs.isTracingSuppressed)(Br.context.active()))return!0;let o=e.url,r=e.method?.toUpperCase();return!!(r==="OPTIONS"||r==="HEAD"||!o||t&&r==="GET"&&iNe(o)||n?.(o,e))}function aNe(e){let t=cNe(e.headers);return t==null?{}:uNe(e.headers)?{"http.request_content_length":t}:{"http.request_content_length_uncompressed":t}}function cNe(e){let t=e["content-length"];if(t===void 0)return null;let n=parseInt(t,10);return isNaN(n)?null:n}function uNe(e){let t=e["content-encoding"];return!!t&&t!=="identity"}function lNe(e,t){let{socket:n}=e,{statusCode:o,statusMessage:r}=t,i={[Gr.ATTR_HTTP_RESPONSE_STATUS_CODE]:o,[Gr.SEMATTRS_HTTP_STATUS_CODE]:o,"http.status_text":r?.toUpperCase()},s=(0,Rs.getRPCMetadata)(Br.context.active());if(n){let{localAddress:a,localPort:c,remoteAddress:u,remotePort:d}=n;i[Gr.SEMATTRS_NET_HOST_IP]=a,i[Gr.SEMATTRS_NET_HOST_PORT]=c,i[Gr.SEMATTRS_NET_PEER_IP]=u,i["net.peer.port"]=d}if(i[Gr.SEMATTRS_HTTP_STATUS_CODE]=o,i["http.status_text"]=(r||"").toUpperCase(),s?.type===Rs.RPCType.HTTP&&s.route!==void 0){let a=s.route;i[Gr.ATTR_HTTP_ROUTE]=a}return i}function dNe(e,t){return t.some(n=>{if(typeof n=="number")return n===e;let[o,r]=n;return e>=o&&e<=r})}l();var u9=require("node:diagnostics_channel"),xa=U(K(),1),l9=U(Xe(),1),D_=U(Pe(),1);l();var c9="@sentry/instrumentation-http";l();var Ho=DC(process.versions.node),Is=Ho.major,w_=Ho.minor;var d9=require("node:events"),pNe=U(require("node:http"),1),fNe=U(require("node:https"),1),mNe=Ho.major===22&&Ho.minor>=12||Ho.major===23&&Ho.minor>=2||Ho.major>=24,Au=class extends D_.InstrumentationBase{constructor(t={}){super(c9,ve,t)}init(){let{outgoingRequestApplyCustomAttributes:t,...n}=this.getConfig(),o={propagateTrace:n.propagateTraceInOutgoingRequests,applyCustomAttributesOnSpan:t,...n,spans:n.createSpansForOutgoingRequests&&(n.spans??!0),ignoreOutgoingRequests(u,d){return(0,l9.isTracingSuppressed)(xa.context.active())||!!n.ignoreOutgoingRequests?.(u,rT(d))},outgoingRequestHook(u,d){n.outgoingRequestHook?.(u,d);let p=d.once,f=new Proxy(p,{apply(m,_,h){let[E]=h;if(E!=="response")return m.apply(_,h);let T=xa.context.active(),R=xa.trace.setSpan(T,u);return xa.context.with(R,()=>m.apply(_,h))}});d.once=f},outgoingResponseHook(u,d){n.outgoingResponseHook?.(u,d),xa.context.bind(xa.context.active(),d)},errorMonitor:d9.errorMonitor,http:pNe,https:fNe},{[hs]:r}=mNe?Hm(o):{},i=!1,s=r?u=>(!i&&r&&(i=!0,(0,u9.subscribe)(hs,r)),u):void 0,a=s??(u=>iT(u,o)),c=s??(u=>iT(u,o));return[new D_.InstrumentationNodeModuleDefinition("http",["*"],a),new D_.InstrumentationNodeModuleDefinition("https",["*"],c)]}};var p9="Http",_Ne=se(`${p9}.sentry`,e=>new Au(e)),f9=(e={})=>{let t={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},n={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes},o={breadcrumbs:e.breadcrumbs,propagateTraceInOutgoingRequests:e.tracePropagation??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests},r=pu(t),i=Su(n),s=e.spans??!1,a=e.disableIncomingRequestSpans??!1,c=s&&!a;return{name:p9,setup(u){c&&i.setup(u)},setupOnce(){r.setupOnce(),_Ne(o)},processEvent(u){return i.processEvent(u)}}};l();l();var g9=U(K(),1),h9=U(Xe(),1),E9=U(Pe(),1);var jd=U(require("diagnostics_channel"),1);l();var mM="sentry-trace",aA="baggage",gNe="traceparent";function m9(e,t){let n=cA(e.origin,e.path),{tracePropagationTargets:o,propagateTraceparent:r}=Q()?.getOptions()||{},i=Wc(n,o,t)?Yc({propagateTraceparent:r}):void 0;if(!i)return;let{"sentry-trace":s,baggage:a,traceparent:c}=i,u=Array.isArray(e.headers)?hNe(e.headers):ENe(e.headers);if(_M(u,mM),_M(u,aA),r&&_M(u,gNe),!(gM(u,mM)!==-1)){s&&u.push(mM,s),c&&gM(u,"traceparent")===-1&&u.push("traceparent",c);let p=gM(u,aA);if(a&&p===-1)u.push(aA,a);else if(a){let f=u[p+1],m=Fl(f,a);m&&(u[p+1]=m)}}Array.isArray(e.headers)?e.headers.splice(0,e.headers.length,...u):e.headers=TNe(u)}function hNe(e){let t=[];for(let n=0;n<e.length;n++){let o=e[n];n%2===0?t.push(typeof o=="string"?o:String(o)):t.push(Array.isArray(o)?o.join(", "):o??"")}return t}function ENe(e){let t=e.split(`\r
985
+ `),n=[];for(let o of t)try{let r=o.indexOf(":");if(r===-1)continue;let i=o.slice(0,r).trim(),s=o.slice(r+1).trim();i&&n.push(i,s)}catch{b.warn(`Failed to convert string request header to array header: ${o}`)}return n}function TNe(e){let t=[];for(let n=0;n<e.length;n+=2){let o=e[n],r=e[n+1];!o||r==null||t.push(`${o}: ${r}`)}return t.length?t.join(`\r
986
+ `).concat(`\r
987
+ `):""}function _M(e,t){let n=-1;for(let o=0;o<e.length;o+=2){if(e[o]!==t)continue;if(n===-1){n=o;continue}let r=e[n+1];if(t===aA&&r){let i=Fl(e[o+1],r);i&&(e[n+1]=i)}e.splice(o,2),o-=2}}function gM(e,t){return e.findIndex((n,o)=>o%2===0&&n===t)}function _9(e,t){let n=SNe(e),o=t.statusCode,r=Fm(o);wr({category:"http",data:{status_code:o,...n},type:"http",level:r},{event:"response",request:e,response:t})}function SNe(e){try{let t=cA(e.origin,e.path),n=fi(t),o={url:mi(n),"http.method":e.method||"GET"};return n.search&&(o["http.query"]=n.search),n.hash&&(o["http.fragment"]=n.hash),o}catch{return{}}}function cA(e,t="/"){try{return new URL(t,e).toString()}catch{let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}}var yu=class extends E9.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-node-fetch",ve,t),this._channelSubs=[],this._propagationDecisionMap=new pr(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(t=>t.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel("undici:request:create",this._onRequestCreated.bind(this)),this._subscribeToChannel("undici:request:headers",this._onResponseHeaders.bind(this)))}_onRequestCreated({request:t}){let n=this.getConfig();if(!(n.enabled!==!1))return;let r=this._shouldIgnoreOutgoingRequest(t);this._ignoreOutgoingRequestsMap.set(t,r),!r&&n.tracePropagation!==!1&&m9(t,this._propagationDecisionMap)}_onResponseHeaders({request:t,response:n}){let o=this.getConfig();if(!(o.enabled!==!1))return;let i=o.breadcrumbs,s=typeof i>"u"?!0:i,a=this._ignoreOutgoingRequestsMap.get(t);s&&!a&&_9(t,n)}_subscribeToChannel(t,n){let o=Is>18||Is===18&&w_>=19,r;if(o)jd.subscribe?.(t,n),r=()=>jd.unsubscribe?.(t,n);else{let i=jd.channel(t);i.subscribe(n),r=()=>i.unsubscribe(n)}this._channelSubs.push({name:t,unsubscribe:r})}_shouldIgnoreOutgoingRequest(t){if((0,h9.isTracingSuppressed)(g9.context.active()))return!0;let n=cA(t.origin,t.path),o=this.getConfig().ignoreOutgoingRequests;return typeof o!="function"||!n?!1:o(n)}};var ANe="NodeFetch",yNe=se(`${ANe}.sentry`,yu,e=>e),RNe=((e={})=>({name:"NodeFetch",setupOnce(){yNe(e)}})),T9=RNe;l();l();l();var Tr=U(K(),1),te=U(K(),1);var pe=U(We(),1),Kt=U(Xe(),1);l();var zo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Li=U(tL(),1),pL="sentry.parentIsRemote",Ou="sentry.graphql.operation";function fL(e){if("parentSpanId"in e)return e.parentSpanId;if("parentSpanContext"in e)return e.parentSpanContext?.spanId}function ny(e){let t=e;return!!t.attributes&&typeof t.attributes=="object"}function RQ(e){return typeof e.kind=="number"}function IQ(e){return!!e.status}function mL(e){return!!e.name}function bQ(e){if(!ny(e))return{};let t=e.attributes[pe.ATTR_URL_FULL]||e.attributes[pe.SEMATTRS_HTTP_URL],n={url:t,"http.method":e.attributes[pe.ATTR_HTTP_REQUEST_METHOD]||e.attributes[pe.SEMATTRS_HTTP_METHOD]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof t=="string"){let o=fi(t);n.url=mi(o),o.search&&(n["http.query"]=o.search),o.hash&&(n["http.fragment"]=o.hash)}}catch{}return n}function NQ(e){return RQ(e)?e.kind:te.SpanKind.INTERNAL}var ty="sentry-trace",nL="baggage",_L="sentry.dsc",gL="sentry.sampled_not_recording",OQ="sentry.url",tCe="sentry.sample_rand",nCe="sentry.sample_rate",CQ="sentry.ignored",vQ="sentry.segment_ignored",ry=(0,te.createContextKey)("sentry_scopes"),rL=(0,te.createContextKey)("sentry_fork_isolation_scope"),oL=(0,te.createContextKey)("sentry_fork_set_scope"),iL=(0,te.createContextKey)("sentry_fork_set_isolation_scope"),PQ="_scopeContext";function Cu(e){return e.getValue(ry)}function xQ(e,t){return e.setValue(ry,t)}function rCe(e,t){kt(e,PQ,mm(t))}function H_(e){return _m(e[PQ])}function Jd(e){let{traceFlags:t,traceState:n}=e,o=n?n.get(gL)==="1":!1;if(t===te.TraceFlags.SAMPLED)return!0;if(o)return!1;let r=n?n.get(_L):void 0,i=r?wo(r):void 0;if(i?.sampled==="true")return!0;if(i?.sampled==="false")return!1}function sL(e,t,n){let o=t[pe.ATTR_HTTP_REQUEST_METHOD]||t[pe.SEMATTRS_HTTP_METHOD];if(o)return iCe({attributes:t,name:e,kind:n},o);let r=t[pe.ATTR_DB_SYSTEM_NAME]||t[pe.SEMATTRS_DB_SYSTEM],i=typeof t[oe]=="string"&&t[oe].startsWith("cache.");if(r&&!i)return oCe({attributes:t,name:e});let s=t[Ge]==="custom"?"custom":"route";if(t[pe.SEMATTRS_RPC_SERVICE])return{...F_(e,t,"route"),op:"rpc"};if(t[pe.SEMATTRS_MESSAGING_SYSTEM])return{...F_(e,t,s),op:"message"};let u=t[pe.SEMATTRS_FAAS_TRIGGER];return u?{...F_(e,t,s),op:u.toString()}:{op:void 0,description:e,source:"custom"}}function MQ(e){let t=ny(e)?e.attributes:{},n=mL(e)?e.name:"<unknown>",o=NQ(e);return sL(n,t,o)}function oCe({attributes:e,name:t}){let n=e[zn];if(typeof n=="string")return{op:"db",description:n,source:e[Ge]||"custom"};if(e[Ge]==="custom")return{op:"db",description:t,source:"custom"};let o=e[pe.SEMATTRS_DB_STATEMENT];return{op:"db",description:o?o.toString():t,source:"task"}}function iCe({name:e,kind:t,attributes:n},o){let r=["http"];switch(t){case te.SpanKind.CLIENT:r.push("client");break;case te.SpanKind.SERVER:r.push("server");break}n["sentry.http.prefetch"]&&r.push("prefetch");let{urlPath:i,url:s,query:a,fragment:c,hasRoute:u}=aCe(n,t);if(!i)return{...F_(e,n),op:r.join(".")};let d=n[Ou],p=`${o} ${i}`,f=d?`${p} (${sCe(d)})`:p,m=u||i==="/"?"route":"url",_={};s&&(_.url=s),a&&(_["http.query"]=a),c&&(_["http.fragment"]=c);let h=t===te.SpanKind.CLIENT||t===te.SpanKind.SERVER,T=!`${n[ne]||"manual"}`.startsWith("auto"),R=n[Ge]==="custom",C=n[zn],P=!R&&C==null&&(h||!T),{description:M,source:O}=P?{description:f,source:m}:F_(e,n);return{op:r.join("."),description:M,source:O,data:_}}function sCe(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}function aCe(e,t){let n=e[pe.SEMATTRS_HTTP_TARGET],o=e[pe.SEMATTRS_HTTP_URL]||e[pe.ATTR_URL_FULL],r=e[pe.ATTR_HTTP_ROUTE],i=typeof o=="string"?fi(o):void 0,s=i?mi(i):void 0,a=i?.search||void 0,c=i?.hash||void 0;return typeof r=="string"?{urlPath:r,url:s,query:a,fragment:c,hasRoute:!0}:t===te.SpanKind.SERVER&&typeof n=="string"?{urlPath:to(n),url:s,query:a,fragment:c,hasRoute:!1}:i?{urlPath:s,url:s,query:a,fragment:c,hasRoute:!1}:typeof n=="string"?{urlPath:to(n),url:s,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:s,query:a,fragment:c,hasRoute:!1}}function F_(e,t,n="custom"){let o=t[Ge]||n,r=t[zn];return r&&typeof r=="string"?{description:r,source:o}:{description:e,source:o}}function hL(e){e.on("createDsc",(t,n)=>{if(!n)return;let i=_e(n).data[Ge],{description:s}=mL(n)?MQ(n):{description:void 0};if(i!=="url"&&s&&(t.transaction=s),_t()){let a=Jd(n.spanContext());t.sampled=a==null?void 0:String(a)}})}function EL(){return te.trace.getActiveSpan()}function LQ({dsc:e,sampled:t}){let n=e?Uc(e):void 0,o=new Kt.TraceState,r=n?o.set(_L,n):o;return t===!1?r.set(gL,"1"):r}var wQ=new Set;function TL(){return Array.from(wQ)}function W_(e){wQ.add(e)}var z_=class extends Kt.W3CBaggagePropagator{constructor(){super(),W_("SentryPropagator"),this._urlMatchesTargetsMap=new pr(100)}inject(t,n,o){if((0,Kt.isTracingSuppressed)(t)){zo&&b.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let r=te.trace.getSpan(t),i=r&&dCe(r),{tracePropagationTargets:s,propagateTraceparent:a}=Q()?.getOptions()||{};if(!Wc(i,s,this._urlMatchesTargetsMap)){zo&&b.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",i);return}let c=uCe(n),u=lCe(n),d=te.propagation.getBaggage(t)||te.propagation.createBaggage({}),{dynamicSamplingContext:p,traceId:f,spanId:m,sampled:_}=DQ(t);if(c){let h=Vl(c);h&&Object.entries(h).forEach(([E,T])=>{!u&&E.startsWith(fs)||(d=d.setEntry(E,{value:T}))})}!u&&p&&(d=Object.entries(p).reduce((h,[E,T])=>T?h.setEntry(`${fs}${E}`,{value:T}):h,d)),!u&&f&&f!==te.INVALID_TRACEID&&(o.set(n,ty,sa(f,m,_)),a&&o.set(n,"traceparent",aa(f,m,_))),super.inject(te.propagation.setBaggage(t,d),n,o)}extract(t,n,o){let r=o.get(n,ty),i=o.get(n,nL),s=r?Array.isArray(r)?r[0]:r:void 0;return UQ(kQ(t,{sentryTrace:s,baggage:i}))}fields(){return[ty,nL,"traceparent"]}};function DQ(e,t={}){let n=te.trace.getSpan(e);if(n?.spanContext().isRemote){let a=n.spanContext();return{dynamicSamplingContext:St(n),traceId:a.traceId,spanId:void 0,sampled:Jd(a)}}if(n){let a=n.spanContext();return{dynamicSamplingContext:St(n),traceId:a.traceId,spanId:a.spanId,sampled:Jd(a)}}let o=t.scope||Cu(e)?.scope||Le(),r=t.client||Q(),i=o.getPropagationContext();return{dynamicSamplingContext:r?pi(r,o):void 0,traceId:i.traceId,spanId:i.propagationSpanId,sampled:i.sampled}}function kQ(e,{sentryTrace:t,baggage:n}){let o=$c(t,n),{traceId:r,parentSpanId:i,sampled:s,dsc:a}=o,c=Q(),u=wo(n);if(!i||c&&!hm(c,u?.org_id))return e;let d=pCe({traceId:r,spanId:i,sampled:s,dsc:a});return te.trace.setSpanContext(e,d)}function cCe(e,t,n){let o=UQ(kQ(e,t));return te.context.with(o,n)}function UQ(e){let t=Cu(e),n={scope:t?t.scope:Le().clone(),isolationScope:t?t.isolationScope:Ie()};return xQ(e,n)}function uCe(e){try{let t=e[nL];return Array.isArray(t)?t.join(","):t}catch{return}}function lCe(e){try{return e[ty]}catch{return}}function dCe(e){let t=_e(e).data,n=t[pe.SEMATTRS_HTTP_URL]||t[pe.ATTR_URL_FULL];if(typeof n=="string")return n;let o=e.spanContext().traceState?.get(OQ);if(o)return o}function pCe({spanId:e,traceId:t,sampled:n,dsc:o}){let r=LQ({dsc:o,sampled:n});return{traceId:t,spanId:e,isRemote:!0,traceFlags:n?te.TraceFlags.SAMPLED:te.TraceFlags.NONE,traceState:r}}function $Q(e,t,n){let o=VQ(),{name:r,parentSpan:i}=e;return YQ(i)(()=>{let a=zQ(e.scope,e.forceTransaction),c=e.onlyIfParent&&!te.trace.getSpan(a),u=c?(0,Kt.suppressTracing)(a):a;c&&Q()?.recordDroppedEvent("no_parent_span","span");let d=FQ(e);if(!_t()){let p=(0,Kt.isTracingSuppressed)(u)?u:(0,Kt.suppressTracing)(u);return te.context.with(p,()=>o.startActiveSpan(r,d,p,f=>(aL(f),te.context.with(a,()=>Uo(()=>t(f),()=>{_e(f).status===void 0&&f.setStatus({code:te.SpanStatusCode.ERROR})},n?()=>f.end():void 0)))))}return o.startActiveSpan(r,d,u,p=>(aL(p),Uo(()=>t(p),()=>{_e(p).status===void 0&&p.setStatus({code:te.SpanStatusCode.ERROR})},n?()=>p.end():void 0)))})}function BQ(e,t){return $Q(e,t,!0)}function GQ(e,t){return $Q(e,n=>t(n,()=>n.end()),!1)}function jQ(e){let t=VQ(),{name:n,parentSpan:o}=e;return YQ(o)(()=>{let i=zQ(e.scope,e.forceTransaction),s=e.onlyIfParent&&!te.trace.getSpan(i),a=s?(0,Kt.suppressTracing)(i):i;s&&Q()?.recordDroppedEvent("no_parent_span","span");let c=FQ(e);_t()||(a=(0,Kt.isTracingSuppressed)(a)?a:(0,Kt.suppressTracing)(a));let u=t.startSpan(n,c,a);return aL(u),u})}function SL(e,t){let n=e?te.trace.setSpan(te.context.active(),e):te.trace.deleteSpan(te.context.active());return te.context.with(n,()=>t(Le()))}function VQ(){return Q()?.tracer||te.trace.getTracer("@sentry/opentelemetry",ve)}function FQ(e){let{startTime:t,attributes:n,kind:o,op:r,links:i}=e,s=typeof t=="number"?HQ(t):t;return{attributes:r?{[oe]:r,...n}:n,kind:o,links:i,startTime:s}}function HQ(e){return e<9999999999?e*1e3:e}function aL(e){let t=e.end.bind(e);e.end=n=>t(typeof n=="number"?HQ(n):n)}function zQ(e,t){let n=fCe(e),o=te.trace.getSpan(n);if(!o||!t)return n;let r=te.trace.deleteSpan(n),{spanId:i,traceId:s}=o.spanContext(),a=Jd(o.spanContext()),c=mt(o),u=St(c),d=LQ({dsc:u,sampled:a}),p={traceId:s,spanId:i,isRemote:!0,traceFlags:a?te.TraceFlags.SAMPLED:te.TraceFlags.NONE,traceState:d};return te.trace.setSpanContext(r,p)}function fCe(e){if(e){let t=H_(e);if(t)return t}return te.context.active()}function qQ(e,t){return cCe(te.context.active(),e,t)}function mCe(e){let t=en(),n=On(),o={traceId:t,spanId:n,isRemote:!0,traceFlags:te.TraceFlags.NONE},r=te.trace.setSpanContext(te.context.active(),o);return te.context.with(r,()=>(Le().setPropagationContext({traceId:t,sampleRand:Ut()}),e()))}function AL(e,t){let n=H_(t),o=n&&te.trace.getSpan(n),r=o?ca(o):Dc(t);return[o?St(o):pi(e,t),r]}function YQ(e){return e!==void 0?t=>SL(e,t):t=>t()}function WQ(e){let t=(0,Kt.suppressTracing)(te.context.active());return te.context.with(t,e)}function yL(e){e.on("preprocessEvent",t=>{let n=EL();if(!n||t.type==="transaction")return;t.contexts={trace:ca(n),...t.contexts};let o=mt(n);return t.sdkProcessingMetadata={dynamicSamplingContext:St(o),...t.sdkProcessingMetadata},t})}function _Ce({span:e,scope:t,client:n,propagateTraceparent:o}={}){let r=(t&&H_(t))??Tr.context.active();if(e){let{scope:d}=xr(e);r=d&&H_(d)||Tr.trace.setSpan(Tr.context.active(),e)}let{traceId:i,spanId:s,sampled:a,dynamicSamplingContext:c}=DQ(r,{scope:t,client:n}),u={"sentry-trace":sa(i,s,a),baggage:Uc(c)};return o&&(u.traceparent=aa(i,s,a)),u}function RL(){function e(){let a=Tr.context.active(),c=Cu(a);return c||{scope:Ul(),isolationScope:Zr()}}function t(a){let c=Tr.context.active();return Tr.context.with(c,()=>a(i()))}function n(a,c){let u=H_(a)||Tr.context.active();return Tr.context.with(u.setValue(oL,a),()=>c(a))}function o(a){let c=Tr.context.active();return Tr.context.with(c.setValue(rL,!0),()=>a(s()))}function r(a,c){let u=Tr.context.active();return Tr.context.with(u.setValue(iL,a),()=>c(s()))}function i(){return e().scope}function s(){return e().isolationScope}$C({withScope:t,withSetScope:n,withSetIsolationScope:r,withIsolationScope:o,getCurrentScope:i,getIsolationScope:s,startSpan:BQ,startSpanManual:GQ,startInactiveSpan:jQ,getActiveSpan:EL,suppressTracing:WQ,getTraceData:_Ce,continueTrace:qQ,startNewTrace:mCe,withActiveSpan:SL})}function KQ(e,t){let n=te.trace.getSpan(e),o;if(n?.spanContext().traceState?.get(CQ)==="1"){let h=te.trace.deleteSpan(e),E=te.trace.getSpan(t);o=E?te.trace.setSpan(h,E):h}else o=e;let r=Cu(o),i=r?.scope||Le(),s=r?.isolationScope||Ie(),a=o.getValue(rL)===!0,c=o.getValue(oL),u=o.getValue(iL),d=c||i.clone(),p=u||(a?s.clone():s),_=xQ(o,{scope:d,isolationScope:p}).deleteValue(rL).deleteValue(oL).deleteValue(iL);return rCe(d,_),_}function gCe(e){let t=new Map;for(let n of e)hCe(t,n);return Array.from(t,function([n,o]){return o})}function ZQ(e){return e.attributes[pL]===!0?void 0:fL(e)}function hCe(e,t){let n=t.spanContext().spanId,o=ZQ(t);if(!o){cL(e,{id:n,span:t,children:[]});return}let r=ECe(e,o),i=cL(e,{id:n,span:t,parentNode:r,children:[]});r.children.push(i)}function ECe(e,t){let n=e.get(t);return n||cL(e,{id:t,children:[]})}function cL(e,t){let n=e.get(t.id);return n?.span?n:n&&!n.span?(n.span=t.span,n.parentNode=t.parentNode,n):(e.set(t.id,t),t)}var JQ={1:"cancelled",2:"unknown_error",3:"invalid_argument",4:"deadline_exceeded",5:"not_found",6:"already_exists",7:"permission_denied",8:"resource_exhausted",9:"failed_precondition",10:"aborted",11:"out_of_range",12:"unimplemented",13:"internal_error",14:"unavailable",15:"data_loss",16:"unauthenticated"},TCe=e=>Object.values(JQ).includes(e);function XQ(e){let t=ny(e)?e.attributes:{},n=IQ(e)?e.status:void 0;if(n){if(n.code===te.SpanStatusCode.OK)return{code:1};if(n.code===te.SpanStatusCode.ERROR){if(typeof n.message>"u"){let r=SQ(t);if(r)return r}return n.message&&TCe(n.message)?{code:2,message:n.message}:{code:2,message:"internal_error"}}}let o=SQ(t);return o||(n?.code===te.SpanStatusCode.UNSET?{code:1}:{code:2,message:"unknown_error"})}function SQ(e){let t=e[pe.ATTR_HTTP_RESPONSE_STATUS_CODE]||e[pe.SEMATTRS_HTTP_STATUS_CODE],n=e[pe.SEMATTRS_RPC_GRPC_STATUS_CODE],o=typeof t=="number"?t:typeof t=="string"?parseInt(t):void 0;if(typeof o=="number")return Lo(o);if(typeof n=="string")return{code:2,message:JQ[n]||"unknown_error"}}var AQ=1e3,yQ=300,uL=class{constructor(t){this._finishedSpanBucketSize=t?.timeout||yQ,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Kr()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=$v(this.flush.bind(this),1,{maxWait:100})}export(t){let n=Math.floor(Kr()/1e3);if(this._lastCleanupTimestampInS!==n){let s=0;this._finishedSpanBuckets.forEach((a,c)=>{a&&a.timestampInS<=n-this._finishedSpanBucketSize&&(s+=a.spans.size,this._finishedSpanBuckets[c]=void 0)}),s>0&&zo&&b.log(`SpanExporter dropped ${s} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let o=n%this._finishedSpanBucketSize,r=this._finishedSpanBuckets[o]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[o]=r,r.spans.add(t),this._spansToBucketEntry.set(t,r);let i=ZQ(t);(!i||this._sentSpans.has(i))&&this._debouncedFlush()}flush(){let t=this._finishedSpanBuckets.flatMap(s=>s?Array.from(s.spans):[]);this._flushSentSpanCache();let n=this._maybeSend(t),o=n.size,r=t.length-o;zo&&b.log(`SpanExporter exported ${o} spans, ${r} spans are waiting for their parent spans to finish`);let i=Kr()+yQ*1e3;for(let s of n){this._sentSpans.set(s.spanContext().spanId,i);let a=this._spansToBucketEntry.get(s);a&&a.spans.delete(s)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(t){let n=gCe(t),o=new Set,r=this._getCompletedRootNodes(n);for(let i of r){let s=i.span;o.add(s);let a=ACe(s);if(i.parentNode&&this._sentSpans.has(i.parentNode.id)){let d=a.contexts?.trace?.data;d&&(d["sentry.parent_span_already_sent"]=!0)}let c=a.spans||[];for(let d of i.children)lL(d,c,o);a.spans=c.length>AQ?c.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,AQ):c;let u=Vc(s.events);u&&(a.measurements=u),Lm(a)}return o}_flushSentSpanCache(){let t=Kr();for(let[n,o]of this._sentSpans.entries())o<=t&&this._sentSpans.delete(n)}_nodeIsCompletedRootNodeOrHasSentParent(t){return!!t.span&&(!t.parentNode||this._sentSpans.has(t.parentNode.id))}_getCompletedRootNodes(t){return t.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function SCe(e){let t=e.attributes,n=t[ne],o=t[oe],r=t[Ge];return{origin:n,op:o,source:r}}function ACe(e){let{op:t,description:n,data:o,origin:r="manual",source:i}=QQ(e),s=xr(e),a=e.attributes[Xr],c={[Ge]:i,[Xr]:a,[oe]:t,[ne]:r,...o,...e8(e.attributes)},{links:u}=e,{traceId:d,spanId:p}=e.spanContext(),f=fL(e),m=XQ(e),_={parent_span_id:f,span_id:p,trace_id:d,data:c,origin:r,op:t,status:Gc(m),links:Bc(u)},h=c[pe.ATTR_HTTP_RESPONSE_STATUS_CODE],E=typeof h=="number"?{response:{status_code:h}}:void 0;return{contexts:{trace:_,otel:{resource:e.resource.attributes},...E},spans:[],start_timestamp:vn(e.startTime),timestamp:vn(e.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:s.scope,capturedSpanIsolationScope:s.isolationScope,sampleRate:a,dynamicSamplingContext:St(e)},...i&&{transaction_info:{source:i}}}}function lL(e,t,n){let o=e.span;if(o&&n.add(o),!o){e.children.forEach(C=>{lL(C,t,n)});return}let i=o.spanContext().spanId,s=o.spanContext().traceId,a=fL(o),{attributes:c,startTime:u,endTime:d,links:p}=o,{op:f,description:m,data:_,origin:h="manual"}=QQ(o),E={[ne]:h,[oe]:f,...e8(c),..._},T=XQ(o),R={span_id:i,trace_id:s,data:E,description:m,parent_span_id:a,start_timestamp:vn(u),timestamp:vn(d)||void 0,status:Gc(T),op:f,origin:h,measurements:Vc(o.events),links:Bc(p)};t.push(R),e.children.forEach(C=>{lL(C,t,n)})}function QQ(e){let{op:t,source:n,origin:o}=SCe(e),{op:r,description:i,source:s,data:a}=MQ(e),c=t||r,u=n||s,d={...a,...yCe(e)};return{op:c,description:i,source:u,origin:o,data:d}}function e8(e){let t={...e};return delete t[Xr],delete t[pL],delete t[zn],t}function yCe(e){let t=e.attributes,n={};e.kind!==te.SpanKind.INTERNAL&&(n["otel.kind"]=te.SpanKind[e.kind]);let o=t[pe.SEMATTRS_HTTP_STATUS_CODE];o&&(n[pe.ATTR_HTTP_RESPONSE_STATUS_CODE]=o);let r=bQ(e);return r.url&&(n.url=r.url),r["http.query"]&&(n["http.query"]=r["http.query"].slice(1)),r["http.fragment"]&&(n["http.fragment"]=r["http.fragment"].slice(1)),n}var q_=class{constructor(t){W_("SentrySpanProcessor"),this._exporter=new uL(t)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(t,n){let o=te.trace.getSpan(n),r=Cu(n);o&&!o.spanContext().isRemote&&zl(o,t),o?.spanContext().isRemote&&t.setAttribute(pL,!0),n===te.ROOT_CONTEXT&&(r={scope:Ul(),isolationScope:Zr()}),r&&gm(t,r.scope,r.isolationScope),bm(t),Q()?.emit("spanStart",t)}onEnd(t){Nm(t);let n=Q();n?.emit("spanEnd",t),n&&Pn(n)?n.emit("afterSpanEnd",t):this._exporter.export(t)}},Y_=class{constructor(t){this._client=t,this._isSpanStreaming=Pn(t),W_("SentrySampler")}shouldSample(t,n,o,r,i,s){let a=this._client.getOptions(),{ignoreSpans:c}=a,u=bCe(t),d=u?.spanContext();if(!_t(a))return Os({decision:void 0,context:t,spanAttributes:i});let p=i[pe.SEMATTRS_HTTP_METHOD]||i[pe.ATTR_HTTP_REQUEST_METHOD];if(r===te.SpanKind.CLIENT&&p&&(!u||d?.isRemote)&&!this._isSpanStreaming)return this._client.recordDroppedEvent("no_parent_span","span"),Os({decision:void 0,context:t,spanAttributes:i});let f=u?RCe(u,n,o):void 0;if(!(!u||d?.isRemote)){if(this._isSpanStreaming){if(f&&c?.length){let{description:J,op:Z}=sL(o,i,r);if(Do({description:J,op:i[oe]??Z,attributes:i},c))return this._client.recordDroppedEvent("ignored","span"),Os({decision:Li.SamplingDecision.NOT_RECORD,context:t,spanAttributes:i,ignoredChildSpan:!0})}if(!f){let J=d?.traceState?.get(vQ)==="1";this._client.recordDroppedEvent(J?"ignored":"sample_rate","span")}}return Os({decision:f?Li.SamplingDecision.RECORD_AND_SAMPLED:Li.SamplingDecision.NOT_RECORD,context:t,spanAttributes:i})}let{description:_,data:h,op:E}=sL(o,i,r),T={...h,...i};if(E&&(T[oe]=E),this._isSpanStreaming&&c?.length&&Do({description:_,op:T[oe]??E,attributes:T},c))return this._client.recordDroppedEvent("ignored","span"),Os({decision:Li.SamplingDecision.NOT_RECORD,context:t,spanAttributes:i,ignoredSegmentSpan:!0});let R={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:T,spanName:_,parentSampled:f,parentContext:d},R),!R.decision)return Os({decision:void 0,context:t,spanAttributes:i});let{isolationScope:C}=Cu(t)??{},P=d?.traceState?d.traceState.get(_L):void 0,M=P?wo(P):void 0,O=Mr(M?.sample_rand)??Ut(),[z,ie,$]=Om(a,{name:_,attributes:T,normalizedRequest:C?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:f,parentSampleRate:Mr(M?.sample_rate)},O),q=`${p}`.toUpperCase();return q==="OPTIONS"||q==="HEAD"?(zo&&b.log(`[Tracing] Not sampling span because HTTP method is '${q}' for ${o}`),Os({decision:Li.SamplingDecision.NOT_RECORD,context:t,spanAttributes:i,sampleRand:O,downstreamTraceSampleRate:0})):(!z&&f===void 0&&(zo&&b.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate",this._isSpanStreaming?"span":"transaction")),{...Os({decision:z?Li.SamplingDecision.RECORD_AND_SAMPLED:Li.SamplingDecision.NOT_RECORD,context:t,spanAttributes:i,sampleRand:O,downstreamTraceSampleRate:$?ie:void 0}),attributes:{[Xr]:$?ie:void 0}})}toString(){return"SentrySampler"}};function RCe(e,t,n){let o=e.spanContext();if((0,te.isSpanContextValid)(o)&&o.traceId===t){if(o.isRemote){let i=Jd(e.spanContext());return zo&&b.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${i}`),i}let r=Jd(o);return zo&&b.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${r}`),r}}function Os({decision:e,context:t,spanAttributes:n,sampleRand:o,downstreamTraceSampleRate:r,ignoredChildSpan:i,ignoredSegmentSpan:s}){let a=ICe(t,n);return r!==void 0&&(a=a.set(nCe,`${r}`)),o!==void 0&&(a=a.set(tCe,`${o}`)),i&&(a=a.set(CQ,"1")),s&&(a=a.set(vQ,"1")),e==null?{decision:Li.SamplingDecision.NOT_RECORD,traceState:a}:e===Li.SamplingDecision.NOT_RECORD?{decision:e,traceState:a.set(gL,"1")}:{decision:e,traceState:a}}function ICe(e,t){let r=te.trace.getSpan(e)?.spanContext()?.traceState||new Kt.TraceState,i=t[pe.SEMATTRS_HTTP_URL]||t[pe.ATTR_URL_FULL];return i&&typeof i=="string"&&(r=r.set(OQ,i)),r}function bCe(e){let t=te.trace.getSpan(e);return t&&(0,te.isSpanContextValid)(t.spanContext())?t:void 0}var dL=class e{constructor(t){this._attributes=t}get attributes(){return this._attributes}merge(t){return t?new e({...this._attributes,...t.attributes}):this}getRawAttributes(){return Object.entries(this._attributes)}};function NCe(e){if(!e)return{};let t={};for(let n of e.split(",")){let o=n.indexOf("=");if(o===-1)continue;let r=n.substring(0,o).trim(),i=n.substring(o+1).trim();if(r)try{t[r]=decodeURIComponent(i)}catch{t[r]=i}}return t}function IL(e){let t=typeof process<"u"?process.env:{},n=t.OTEL_SERVICE_NAME,o=NCe(t.OTEL_RESOURCE_ATTRIBUTES);return new dL({[pe.SEMRESATTRS_SERVICE_NAMESPACE]:"sentry",[pe.ATTR_SERVICE_NAME]:e,...o,...n?{[pe.ATTR_SERVICE_NAME]:n}:{},[pe.ATTR_SERVICE_VERSION]:ve,[pe.ATTR_TELEMETRY_SDK_LANGUAGE]:Kt.SDK_INFO[pe.ATTR_TELEMETRY_SDK_LANGUAGE],[pe.ATTR_TELEMETRY_SDK_NAME]:Kt.SDK_INFO[pe.ATTR_TELEMETRY_SDK_NAME],[pe.ATTR_TELEMETRY_SDK_VERSION]:Kt.SDK_INFO[pe.ATTR_TELEMETRY_SDK_VERSION]})}var t8=U(K(),1),n8=require("node:async_hooks"),r8=require("node:events");var OCe=["addListener","on","once","prependListener","prependOnceListener"],oy=class e{__init(){this._asyncLocalStorage=new n8.AsyncLocalStorage}__init2(){this._kOtListeners=Symbol("OtListeners")}__init3(){this._wrapped=!1}constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),W_("SentryContextManager")}active(){return this._asyncLocalStorage.getStore()??t8.ROOT_CONTEXT}with(t,n,o,...r){let i=KQ(t,this.active()),s=o==null?n:n.bind(o);return this._asyncLocalStorage.run(i,s,...r)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}bind(t,n){return n instanceof r8.EventEmitter?this._bindEventEmitter(t,n):typeof n=="function"?this._bindFunction(t,n):n}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:ry}}_bindFunction(t,n){let o=this.with.bind(this),r=function(...i){return o(t,()=>n.apply(this,i))};return Object.defineProperty(r,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),r}_bindEventEmitter(t,n){if(this._getPatchMap(n)!==void 0)return n;this._createPatchMap(n);for(let o of OCe)n[o]!==void 0&&(n[o]=this._patchAddListener(n,n[o],t));return typeof n.removeListener=="function"&&(n.removeListener=this._patchRemoveListener(n,n.removeListener)),typeof n.off=="function"&&(n.off=this._patchRemoveListener(n,n.off)),typeof n.removeAllListeners=="function"&&(n.removeAllListeners=this._patchRemoveAllListeners(n,n.removeAllListeners)),n}_patchRemoveListener(t,n){let o=this;return function(r,i){let s=o._getPatchMap(t)?.[r];if(s===void 0)return n.call(this,r,i);let a=s.get(i);return n.call(this,r,a||i)}}_patchRemoveAllListeners(t,n){let o=this;return function(r){let i=o._getPatchMap(t);return i!==void 0&&(arguments.length===0?o._createPatchMap(t):r!==void 0&&i[r]!==void 0&&delete i[r]),n.apply(this,arguments)}}_patchAddListener(t,n,o){let r=this;return function(i,s){if(r._wrapped)return n.call(this,i,s);let a=r._getPatchMap(t);a===void 0&&(a=r._createPatchMap(t));let c=a[i];c===void 0&&(c=new WeakMap,a[i]=c);let u=r.bind(o,s);c.set(s,u),r._wrapped=!0;try{return n.call(this,i,u)}finally{r._wrapped=!1}}}_createPatchMap(t){let n=Object.create(null);return t[this._kOtListeners]=n,n}_getPatchMap(t){return t[this._kOtListeners]}};var iy=oy;l();var K_=U(K(),1);function bL(){K_.diag.disable(),K_.diag.setLogger({error:b.error,warn:b.warn,info:b.log,debug:b.log,verbose:b.log},K_.DiagLogLevel.DEBUG)}l();l();var NL=U(require("node:diagnostics_channel"),1);var CCe="ChildProcess",OL=(e={})=>({name:CCe,setup(){NL.channel("child_process").subscribe(t=>{t&&typeof t=="object"&&"process"in t&&vCe(t.process,e)}),NL.channel("worker_threads").subscribe(t=>{t&&typeof t=="object"&&"worker"in t&&PCe(t.worker,e)})}});function vCe(e,t){let n=!1,o;e.on("spawn",()=>{if(e.spawnfile==="/usr/bin/sw_vers"){n=!0;return}o={spawnfile:e.spawnfile},t.includeChildProcessArgs&&(o.spawnargs=e.spawnargs)}).on("exit",r=>{n||(n=!0,r!==null&&r!==0&&wr({category:"child_process",message:`Child process exited with code '${r}'`,level:r===0?"info":"warning",data:o}))}).on("error",r=>{n||(n=!0,wr({category:"child_process",message:`Child process errored with '${r.message}'`,level:"error",data:o}))})}function PCe(e,t){let n;e.on("online",()=>{n=e.threadId}).on("error",o=>{t.captureWorkerErrors!==!1?he(o,{mechanism:{type:"auto.child_process.worker_thread",handled:!1,data:{threadId:String(n)}}}):wr({category:"worker_thread",message:`Worker thread errored with '${o.message}'`,level:"error",data:{threadId:n}})})}l();var s8=require("node:child_process"),sy=require("node:fs"),Zt=U(require("node:os"),1),a8=require("node:path"),CL=require("node:util");var xCe=(0,CL.promisify)(sy.readFile),MCe=(0,CL.promisify)(sy.readdir),LCe="Context",wCe=((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},n=t.app?BCe():void 0,o=t.device?GCe(t.device):void 0,r=t.culture?$Ce():void 0,i=t.cloudResource?qCe():void 0,s=t.os?UCe():void 0,a={"process.runtime.engine.name":"v8","process.runtime.engine.version":process.versions.v8,...o8({app:n,device:o,culture:r,cloud_resource:i})};s&&s.then(d=>Object.assign(a,o8({os:d}))).catch(()=>{});let c=(async()=>{let d={};return s&&(d.os=await s),n&&(d.app=n),o&&(d.device=o),r&&(d.culture=r),i&&(d.cloud_resource=i),d})();async function u(d){let p=DCe(await c);return d.contexts={...d.contexts,app:{...p.app,...d.contexts?.app},os:{...p.os,...d.contexts?.os},device:{...p.device,...d.contexts?.device},culture:{...p.culture,...d.contexts?.culture},cloud_resource:{...p.cloud_resource,...d.contexts?.cloud_resource}},d}return{name:LCe,processEvent(d){return u(d)},processSegmentSpan(d){$t(d,a),$t(d,kCe(n,o))}}}),vu=wCe;function DCe(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory=="function"){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=Zt.freemem()),e}function o8(e){let t={},{app:n,device:o,os:r,culture:i,cloud_resource:s}=e;if(n&&n.app_start_time&&(t["app.start_time"]=n.app_start_time),o&&(o.arch&&(t["device.archs"]=[o.arch]),o.boot_time&&(t["device.boot_time"]=o.boot_time),o.memory_size!=null&&(t["device.memory_size"]=o.memory_size),o.processor_count!=null&&(t["device.processor_count"]=o.processor_count),o.cpu_description&&(t["device.cpu_description"]=o.cpu_description),o.processor_frequency!=null&&(t["device.processor_frequency"]=o.processor_frequency)),r&&(r.name&&(t["os.name"]=r.name),r.version&&(t["os.version"]=r.version),r.kernel_version&&(t["os.kernel_version"]=r.kernel_version),r.build&&(t["os.build"]=r.build)),i&&(i.locale&&(t["culture.locale"]=i.locale),i.timezone&&(t["culture.timezone"]=i.timezone)),s)for(let[a,c]of Object.entries(s))c!=null&&(t[a]=c);return t}function kCe(e,t){let n={};if(e&&(n["app.memory"]=process.memoryUsage().rss,typeof process.availableMemory=="function")){let o=process.availableMemory?.();o!=null&&(n["app.free_memory"]=o)}return t?.free_memory!=null&&(n["device.free_memory"]=Zt.freemem()),n}async function UCe(){let e=Zt.platform();switch(e){case"darwin":return HCe();case"linux":return zCe();default:return{name:jCe[e]||e,version:Zt.release()}}}function $Ce(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function BCe(){let e=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let o=process.availableMemory?.();o!=null&&(n.free_memory=o)}return n}function GCe(e){let t={},n;try{n=Zt.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=Zt.arch(),(e===!0||e.memory)&&(t.memory_size=Zt.totalmem(),t.free_memory=Zt.freemem()),e===!0||e.cpu){let o=Zt.cpus(),r=o?.[0];r&&(t.processor_count=o.length,t.cpu_description=r.model,t.processor_frequency=r.speed)}return t}var jCe={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},VCe=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],FCe={alpine:e=>e,arch:e=>wi(/distrib_release=(.*)/,e),centos:e=>wi(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>wi(/release (..)/,e),mint:e=>wi(/distrib_release=(.*)/,e),red:e=>wi(/release ([^ ]+)/,e),suse:e=>wi(/VERSION = (.*)\n/,e),ubuntu:e=>wi(/distrib_release=(.*)/,e)};function wi(e,t){let n=e.exec(t);return n?n[1]:void 0}async function HCe(){let e={kernel_version:Zt.release(),name:"Mac OS X",version:`10.${Number(Zt.release().split(".")[0])-4}`};try{let t=await new Promise((n,o)=>{(0,s8.execFile)("/usr/bin/sw_vers",(r,i)=>{if(r){o(r);return}n(i)})});e.name=wi(/^ProductName:\s+(.*)$/m,t),e.version=wi(/^ProductVersion:\s+(.*)$/m,t),e.build=wi(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function i8(e){return e.split(" ")[0].toLowerCase()}async function zCe(){let e={kernel_version:Zt.release(),name:"Linux"};try{let t=await MCe("/etc"),n=VCe.find(a=>t.includes(a.name));if(!n)return e;let o=(0,a8.join)("/etc",n.name),r=(await xCe(o,{encoding:"utf-8"})).toLowerCase(),{distros:i}=n;e.name=i.find(a=>r.indexOf(i8(a))>=0)||i[0];let s=i8(e.name);e.version=FCe[s]?.(r)}catch{}return e}function qCe(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}l();var l8=require("node:fs"),d8=require("node:readline");var vL=new pr(10),p8=new pr(20),YCe=7,WCe="ContextLines",KCe=1e3,ZCe=1e4;function JCe(e,t,n){let o=e.get(t);return o===void 0?(e.set(t,n),n):o}function XCe(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function QCe(e){return e.lineno!==void 0&&e.lineno>ZCe||e.colno!==void 0&&e.colno>KCe}function eve(e,t){let n=vL.get(e);if(n===void 0)return!1;for(let o=t[0];o<=t[1];o++)if(n[o]===void 0)return!1;return!0}function tve(e,t){if(!e.length)return[];let n=0,o=e[0];if(typeof o!="number")return[];let r=u8(o,t),i=[];for(;;){if(n===e.length-1){i.push(r);break}let s=e[n+1];if(typeof s!="number")break;s<=r[1]?r[1]=s+t:(i.push(r),r=u8(s,t)),n++}return i}function nve(e,t,n){return new Promise((o,r)=>{let i=(0,l8.createReadStream)(e),s=(0,d8.createInterface)({input:i});function a(){i.destroy(),o()}let c=0,u=0,d=t[u];if(d===void 0){a();return}let p=d[0],f=d[1];function m(_){p8.set(e,1),je&&b.error(`Failed to read file: ${e}. Error: ${_}`),s.close(),s.removeAllListeners(),a()}i.on("error",m),s.on("error",m),s.on("close",a),s.on("line",_=>{if(c++,!(c<p)&&(n[c]=PC(_,0),c>=f)){if(u===t.length-1){s.close(),s.removeAllListeners();return}u++;let h=t[u];if(h===void 0){s.close(),s.removeAllListeners();return}p=h[0],f=h[1]}})})}async function rve(e,t){let n={};if(t>0&&e.exception?.values){for(let i of e.exception.values)if(i.stacktrace?.frames?.length)for(let s=i.stacktrace.frames.length-1;s>=0;s--){let a=i.stacktrace.frames[s],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||XCe(c)||QCe(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let o=Object.keys(n);if(o.length==0)return e;let r=[];for(let i of o){if(p8.get(i))continue;let s=n[i];if(!s)continue;s.sort((u,d)=>u-d);let a=tve(s,t);if(a.every(u=>eve(i,u)))continue;let c=JCe(vL,i,{});r.push(nve(i,a,c))}if(await Promise.all(r).catch(()=>{je&&b.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let i of e.exception.values)i.stacktrace?.frames&&i.stacktrace.frames.length>0&&ove(i.stacktrace.frames,t,vL);return e}function ove(e,t,n){for(let o of e)if(o.filename&&o.context_line===void 0&&typeof o.lineno=="number"){let r=n.get(o.filename);if(r===void 0)continue;ive(o.lineno,o,t,r)}}function c8(e){delete e.pre_context,delete e.context_line,delete e.post_context}function ive(e,t,n,o){if(t.lineno===void 0||o===void 0){je&&b.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let i=f8(e,n);i<e;i++){let s=o[i];if(s===void 0){c8(t),je&&b.error(`Could not find line ${i} in file ${t.filename}`);return}t.pre_context.push(s)}if(o[e]===void 0){c8(t),je&&b.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=o[e];let r=m8(e,n);t.post_context=[];for(let i=e+1;i<=r;i++){let s=o[i];if(s===void 0)break;t.post_context.push(s)}}function f8(e,t){return Math.max(1,e-t)}function m8(e,t){return e+t}function u8(e,t){return[f8(e,t),m8(e,t)]}var sve=((e={})=>{let t=e.frameContextLines!==void 0?e.frameContextLines:YCe;return{name:WCe,processEvent(n){return rve(n,t)}}}),Pu=sve;l();l();var E8=require("node:worker_threads");l();var ay;async function cy(){if(ay===void 0)try{ay=!!(await import("node:inspector")).url()}catch{ay=!1}return ay}l();var Z_="__SENTRY_ERROR_LOCAL_VARIABLES__";function g8(e,t,n){let o=0,r=5,i=0;return setInterval(()=>{i===0?o>e&&(r*=2,n(r),r>86400&&(r=86400),i=r):(i-=1,i===0&&t()),o=0},1e3).unref(),()=>{o+=1}}function _8(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function uy(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||_8(e)&&_8(t)}var ave="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjUyLjAgKDRiOTExZTApIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function h8(...e){b.log("[LocalVariables]",...e)}var T8=((e={})=>{function t(i,s){let a=(i.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,d=s[c],p=a[u];if(!p||!d)break;d.vars===void 0||p.in_app===!1&&e.includeOutOfAppFrames!==!0||!uy(p.function,d.function)||(p.vars=d.vars)}}function n(i,s){if(s.originalException&&typeof s.originalException=="object"&&Z_ in s.originalException&&Array.isArray(s.originalException[Z_])){for(let a of i.exception?.values||[])t(a,s.originalException[Z_]);s.originalException[Z_]=void 0}return i}async function o(){let i=await import("node:inspector");i.url()||i.open(0)}function r(i){let s=new E8.Worker(new URL(`data:application/javascript;base64,${ave}`),{workerData:i,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{s.terminate()}),s.once("error",a=>{h8("Worker error",a)}),s.once("exit",a=>{h8("Worker exit",a)}),s.unref()}return{name:"LocalVariablesAsync",async setup(i){if(!i.getOptions().includeLocalVariables)return;if(await cy()){b.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:b.isEnabled()};o().then(()=>{try{r(a)}catch(c){b.error("Failed to start worker",c)}},c=>{b.error("Failed to start inspector",c)})},processEvent(i,s){return n(i,s)}}});l();function S8(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function cve(e,t){if(t!==void 0)return S8(e(t,1))}function A8(e){let t=[],n=!1;function o(s){t=[],!n&&(n=!0,e(s))}t.push(o);function r(s){t.push(s)}function i(s){let a=t.pop()||o;try{a(s)}catch{o(s)}}return{add:r,next:i}}var PL=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("node:inspector");return new e(new n.Session)}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",o=>{t(o,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,o=>{let{add:r,next:i}=A8(n);for(let s of o)if(s.value?.objectId&&s.value.className==="Array"){let a=s.value.objectId;r(c=>this._unrollArray(a,s.name,c,i))}else if(s.value?.objectId&&s.value.className==="Object"){let a=s.value.objectId;r(c=>this._unrollObject(a,s.name,c,i))}else s.value&&r(a=>this._unrollOther(s,a,i));i({})})}_getProperties(t,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(o,r)=>{n(o?[]:r.result)})}_unrollArray(t,n,o,r){this._getProperties(t,i=>{o[n]=i.filter(s=>s.name!=="length"&&!isNaN(parseInt(s.name,10))).sort((s,a)=>parseInt(s.name,10)-parseInt(a.name,10)).map(s=>s.value?.value),r(o)})}_unrollObject(t,n,o,r){this._getProperties(t,i=>{o[n]=i.map(s=>[s.name,s.value?.value]).reduce((s,[a,c])=>(s[a]=c,s),{}),r(o)})}_unrollOther(t,n,o){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?n[t.name]=`<${t.value.value}>`:n[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?n[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(n[t.name]="<undefined>")),o(n)}},uve="LocalVariables",lve=((e={},t)=>{let n=new pr(20),o,r=!1;function i(u){let d=S8(u.stacktrace?.frames);if(d===void 0)return;let p=n.remove(d);if(p===void 0)return;let f=(u.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<f.length;m++){let _=f.length-m-1,h=p[m],E=f[_];if(!E||!h)break;h.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!uy(E.function,h.function)||(E.vars=h.vars)}}function s(u){for(let d of u.exception?.values||[])i(d);return u}let a;async function c(){let d=Q()?.getOptions();if(!d?.includeLocalVariables)return;if(Is<18){b.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await cy()){b.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let f=await PL.create(t),m=(h,{params:{reason:E,data:T,callFrames:R}},C)=>{if(E!=="exception"&&E!=="promiseRejection"){C();return}o?.();let P=cve(h,T.description);if(P==null){C();return}let{add:M,next:O}=A8(z=>{n.set(P,z),C()});for(let z=0;z<Math.min(R.length,5);z++){let{scopeChain:ie,functionName:$,this:q}=R[z],J=ie.find(k=>k.type==="local"),Z=q.className==="global"||!q.className?$:`${q.className}.${$}`;if(J?.object.objectId===void 0)M(k=>{k[z]={function:Z},O(k)});else{let k=J.object.objectId;M(ue=>f.getLocalVariables(k,le=>{ue[z]={function:Z,vars:le},O(ue)}))}}O([])},_=e.captureAllExceptions!==!1;if(f.configureAndConnect((h,E)=>m(d.stackParser,h,E),_),_){let h=e.maxExceptionsPerSecond||50;o=g8(h,()=>{b.log("Local variables rate-limit lifted."),f.setPauseOnExceptions(!0)},E=>{b.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),f.setPauseOnExceptions(!1)})}r=!0}catch(f){b.log("The `LocalVariables` integration failed to start.",f)}}return{name:uve,setupOnce(){a=c()},async processEvent(u){return await a,r?s(u):u},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),y8=lve;var ly=(e={})=>Ho.major<19?y8(e):T8(e);l();var X_=require("node:fs"),Q_=require("node:path");l();function J_(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var R8;function I8(){return J_()?!1:Is>=21||Is===20&&w_>=6||Is===18&&w_>=19?!0:(R8||(R8=!0,Tt(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}var xL,dve="Modules",pve=typeof __SENTRY_SERVER_MODULES__>"u"?{}:__SENTRY_SERVER_MODULES__,fve=(()=>({name:dve,processEvent(e){return e.modules={...e.modules,...b8()},e},getModules:b8})),xu=fve;function mve(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function _ve(){return{...pve,...Eve(),...J_()?gve():{}}}function gve(){let e=require.main?.paths||[],t=mve(),n={},o=new Set;return t.forEach(r=>{let i=r,s=()=>{let a=i;if(i=(0,Q_.dirname)(a),!i||a===i||o.has(a))return;if(e.indexOf(i)<0)return s();let c=(0,Q_.join)(a,"package.json");if(o.add(a),!(0,X_.existsSync)(c))return s();try{let u=JSON.parse((0,X_.readFileSync)(c,"utf8"));n[u.name]=u.version}catch{}};s()}),n}function b8(){return xL||(xL=_ve()),xL}function hve(){try{let e=(0,Q_.join)(process.cwd(),"package.json");return JSON.parse((0,X_.readFileSync)(e,"utf8"))}catch{return{}}}function Eve(){let e=hve();return{...e.dependencies,...e.devDependencies}}l();var N8=require("worker_threads");l();var Tve=2e3;function eg(e){Tt(()=>{console.error(e)});let t=Q();if(t===void 0){je&&b.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=t.getOptions(),o=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:Tve;t.close(o).then(r=>{r||je&&b.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},r=>{je&&b.error(r)})}var Sve="OnUncaughtException",Mu=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:Sve,setup(n){N8.isMainThread&&global.process.on("uncaughtException",Ave(n,t))}}};function Ave(e,t){let o=!1,r=!1,i=!1,s,a=e.getOptions();return Object.assign(c=>{let u=eg;t.onFatalError?u=t.onFatalError:a.onFatalError&&(u=a.onFatalError);let p=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m.tag!=="sentry_tracingErrorCallback"&&m._errorHandler!==!0).length===0,f=t.exitEvenIfOtherHandlersAreRegistered||p;o?f&&(i?(je&&b.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),eg(c)):r||(r=!0,setTimeout(()=>{i||(i=!0,u(s,c))},2e3))):(s=c,o=!0,Q()===e&&he(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!i&&f&&(i=!0,u(c)))},{_errorHandler:!0})}l();var yve="OnUnhandledRejection",Rve=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],Ive=((e={})=>{let t={mode:e.mode??"warn",ignore:[...Rve,...e.ignore??[]]};return{name:yve,setup(n){global.process.on("unhandledRejection",Cve(n,t))}}}),Lu=Ive;function bve(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,n=typeof t.name=="string"?t.name:"",o=typeof t.message=="string"?t.message:String(e);return{name:n,message:o}}function Nve(e,t){let n=e.name===void 0||ui(t.name,e.name,!0),o=e.message===void 0||ui(t.message,e.message);return n&&o}function Ove(e,t){let n=bve(t);return e.some(o=>Nve(o,n))}function Cve(e,t){return function(o,r){if(Q()!==e||Ove(t.ignore??[],o))return;let i=t.mode==="strict"?"fatal":"error",s=o&&typeof o=="object"?o._sentry_active_span:void 0;(s?c=>eo(s,c):c=>c())(()=>{he(o,{originalException:o,captureContext:{extra:{unhandledPromiseRejection:!0},level:i},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),vve(o,t.mode)}}function vve(e,t){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";t==="warn"?Tt(()=>{console.warn(n),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(Tt(()=>{console.warn(n)}),eg(e))}l();var Pve="ProcessSession",wu=()=>({name:Pve,setupOnce(){Um(),process.on("beforeExit",()=>{Ie().getSession()?.status!=="ok"&&Xl()})}});l();var O8=U(require("node:http"),1);var ML="Spotlight",xve=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:ML,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&b.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}Mve(n,t)}}}),dy=xve;function Mve(e,t){let n=Lve(t.sidecarUrl);if(!n)return;let o=0;e.on("beforeEnvelope",r=>{if(o>3){b.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let i=Im(r);ms(()=>{let s=O8.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(o=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});s.on("error",()=>{o++,b.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),s.write(i),s.end()})})}function Lve(e){try{return new URL(`${e}`)}catch{b.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}l();var Du=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&as("console",wve),Zv(e).setup?.(t)}});function wve(){let e=ge?.console;e&&vc.forEach(t=>{t in e&&Dve(e,t)})}function Dve(e,t){let n=e[t];Mo[t]=n;let o=n,r,i=!1,s=function(...c){if(i){n.apply(e,c);return}i=!0;try{si("console",{args:c,level:t}),o.apply(e,c)}finally{i=!1}};Mc(s,n);let a=n.bind(e);Mo[t]=a;try{let c=s;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(u){u===s?(r!==void 0&&(o=r,r=void 0),c=s):u===a?(r=o,c=a):typeof u=="function"&&!u.__sentry_original__?(o=u,c=s):c=u}})}catch{um(e,t,function(c){return Mo[t]=c,function(...u){si("console",{args:u,level:t}),Mo[t]?.apply(this,u)}})}}l();var C8=U(require("node:util"),1);var kve="NodeSystemError";function Uve(e){return!(e instanceof Error)||!("errno"in e)||typeof e.errno!="number"?!1:C8.getSystemErrorMap().has(e.errno)}var LL=(e={})=>({name:kve,processEvent:(t,n,o)=>{if(!Uve(n.originalException))return t;let r=n.originalException,i={...r};!o.getOptions().sendDefaultPii&&e.includePaths!==!0&&(delete i.path,delete i.dest),t.contexts={...t.contexts,node_system_error:i};for(let s of t.exception?.values||[])s.value&&(r.path&&s.value.includes(r.path)&&(s.value=s.value.replace(`'${r.path}'`,"").trim()),r.dest&&s.value.includes(r.dest)&&(s.value=s.value.replace(`'${r.dest}'`,"").trim()));return t}});l();var Bve=U(require("node:http"),1),Gve=U(require("node:https"),1),x8=require("node:stream"),M8=require("node:zlib");l();var Cs=U(require("node:net"),1),DL=U(require("node:tls"),1);l();var wL=U(require("node:http"),1),clt=require("node:https"),Di=Symbol("AgentBaseInternalState"),py=class extends wL.Agent{constructor(t){super(t),this[Di]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
988
+ `).some(o=>o.indexOf("(https.js:")!==-1||o.indexOf("node:https:")!==-1)}createSocket(t,n,o){let r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,r)).then(i=>{if(i instanceof wL.Agent)return i.addRequest(t,r);this[Di].currentSocket=i,super.createSocket(t,n,o)},o)}createConnection(){let t=this[Di].currentSocket;if(this[Di].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[Di].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[Di]&&(this[Di].defaultPort=t)}get protocol(){return this[Di].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[Di]&&(this[Di].protocol=t)}};l();function fy(...e){b.log("[https-proxy-agent:parse-proxy-response]",...e)}function v8(e){return new Promise((t,n)=>{let o=0,r=[];function i(){let d=e.read();d?u(d):e.once("readable",i)}function s(){e.removeListener("end",a),e.removeListener("error",c),e.removeListener("readable",i)}function a(){s(),fy("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(d){s(),fy("onerror %o",d),n(d)}function u(d){r.push(d),o+=d.length;let p=Buffer.concat(r,o),f=p.indexOf(`\r
989
+ \r
990
+ `);if(f===-1){fy("have not received end of HTTP headers yet..."),i();return}let m=p.subarray(0,f).toString("ascii").split(`\r
991
+ `),_=m.shift();if(!_)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let h=_.split(" "),E=+(h[1]||0),T=h.slice(2).join(" "),R={};for(let C of m){if(!C)continue;let P=C.indexOf(":");if(P===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${C}"`));let M=C.slice(0,P).toLowerCase(),O=C.slice(P+1).trimStart(),z=R[M];typeof z=="string"?R[M]=[z,O]:Array.isArray(z)?z.push(O):R[M]=O}fy("got proxy server response: %o %o",_,R),s(),t({connect:{statusCode:E,statusText:T,headers:R},buffered:p})}e.on("error",c),e.on("end",a),i()})}function tg(...e){b.log("[https-proxy-agent]",...e)}var ng=class extends py{static __initStatic(){this.protocols=["http","https"]}constructor(t,n){super(n),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=n?.headers??{},tg("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let o=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?P8(n,"headers"):null,host:o,port:r}}async connect(t,n){let{proxy:o}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if(o.protocol==="https:"){tg("Creating `tls.Socket`: %o",this.connectOpts);let f=this.connectOpts.servername||this.connectOpts.host;r=DL.connect({...this.connectOpts,servername:f&&Cs.isIP(f)?void 0:f})}else tg("Creating `net.Socket`: %o",this.connectOpts),r=Cs.connect(this.connectOpts);let i=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},s=Cs.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${s}:${n.port} HTTP/1.1\r
992
+ `;if(o.username||o.password){let f=`${decodeURIComponent(o.username)}:${decodeURIComponent(o.password)}`;i["Proxy-Authorization"]=`Basic ${Buffer.from(f).toString("base64")}`}i.Host=`${s}:${n.port}`,i["Proxy-Connection"]||(i["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let f of Object.keys(i))a+=`${f}: ${i[f]}\r
993
+ `;let c=v8(r);r.write(`${a}\r
994
+ `);let{connect:u,buffered:d}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),u.statusCode===200){if(t.once("socket",$ve),n.secureEndpoint){tg("Upgrading socket connection to TLS");let f=n.servername||n.host;return DL.connect({...P8(n,"host","path","port"),socket:r,servername:Cs.isIP(f)?void 0:f})}return r}r.destroy();let p=new Cs.Socket({writable:!1});return p.readable=!0,t.once("socket",f=>{tg("Replaying proxy buffer for failed request"),f.push(d),f.push(null)}),p}};ng.__initStatic();function $ve(e){e.resume()}function P8(e,...t){let n={},o;for(o in e)t.includes(o)||(n[o]=e[o]);return n}var jve=1024*32;function Vve(e){return new x8.Readable({read(){this.push(e),this.push(null)}})}function my(e){let t;try{t=new URL(e.url)}catch{return Tt(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),pa(e,()=>Promise.resolve({}))}let n=t.protocol==="https:",o=Fve(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),r=n?Gve:Bve,i=e.keepAlive===void 0?!1:e.keepAlive,s=o?new ng(o):new r.Agent({keepAlive:i,maxSockets:30,timeout:2e3}),a=Hve(e,e.httpModule??r,s);return pa(e,a)}function Fve(e,t){let{no_proxy:n}=process.env;if(!n?.split(",").some(r=>e.host.endsWith(r)||e.hostname.endsWith(r)))return t}function Hve(e,t,n){let{hostname:o,pathname:r,port:i,protocol:s,search:a}=new URL(e.url);return function(u){return new Promise((d,p)=>{ms(()=>{let f=Vve(u.body),m={...e.headers};u.body.length>jve&&(m["content-encoding"]="gzip",f=f.pipe((0,M8.createGzip)()));let _=o.startsWith("["),h=t.request({method:"POST",agent:n,headers:m,hostname:_?o.slice(1,-1):o,path:`${r}${a}`,port:i,protocol:s,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let T=E.headers["retry-after"]??null,R=E.headers["x-sentry-rate-limits"]??null;d({statusCode:E.statusCode,headers:{"retry-after":T,"x-sentry-rate-limits":Array.isArray(R)?R[0]||null:R}})});h.on("error",p),f.pipe(h)})})}}l();function L8(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=rd(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}l();l();var _y=require("node:path");function w8(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function gy(e=process.argv[1]?zv(process.argv[1]):process.cwd(),t=_y.sep==="\\"){let n=t?w8(e):e;return o=>{if(!o)return;let r=t?w8(o):o,{dir:i,base:s,ext:a}=_y.posix.parse(r);(a===".js"||a===".mjs"||a===".cjs")&&(s=s.slice(0,a.length*-1));let c=decodeURIComponent(s);i||(i=".");let u=i.lastIndexOf("/node_modules");if(u>-1)return`${i.slice(u+14).replace(/\//g,".")}:${c}`;if(i.startsWith(n)){let d=i.slice(n.length+1).replace(/\//g,".");return d?`${d}:${c}`:c}return c}}function hy(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(ge.SENTRY_RELEASE?.id)return ge.SENTRY_RELEASE.id;let t=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,o=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 t||n||o||e}var Ey=CE(TP(gy()));l();var D8=U(require("node:os"),1),k8=U(K(),1),U8=U(Pe(),1);var Ty=require("worker_threads");var zve=6e4,Xd=class extends Gm{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||D8.hostname(),o={...t,platform:"node",runtime:t.runtime||{name:"node",version:global.process.version},serverName:n};t.openTelemetryInstrumentations&&(0,U8.registerInstrumentations)({instrumentations:t.openTelemetryInstrumentations}),gs(o,"node"),b.log(`Initializing Sentry: process: ${process.pid}, thread: ${Ty.isMainThread?"main":`worker-${Ty.threadId}`}.`),super(o),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{zc(this)},n&&this.on("beforeCaptureLog",r=>{r.attributes={...r.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let t="@sentry/node",n=ve,o=k8.trace.getTracer(t,n);return this._tracer=o,o}async flush(t){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(t);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{je&&b.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??zve).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){Uv(),super._setupIntegrations()}_getTraceInfoFromScope(t){return t?AL(this,t):[void 0,void 0]}};l();var $8=U(kx(),1),B8=U(require("module"),1);var qve={};function kL(){if(I8()&&!ge._sentryEsmLoaderHookRegistered){ge._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:e}=(0,$8.createAddHookMessageChannel)();B8.register("import-in-the-middle/hook.mjs",qve.url,{data:{addHookMessagePort:e,include:[]},transferList:[e]})}catch(e){b.warn("Failed to register 'import-in-the-middle' hook",e)}}}function Sy(){return[Zc(),Kc(),Jc(),Xc(),LL(),Jv(),Du(),f9(),T9(),Mu(),Lu(),Pu(),ly(),vu(),OL(),wu(),xu()]}function UL(e={}){return Yve(e,Sy)}function Yve(e={},t){let n=Wve(e,t);n.debug===!0&&(je?b.enable():Tt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&kL(),RL(),Le().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:i})=>i===ML)&&n.integrations.push(dy({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),gs(n,"node-core");let r=new Xd(n);return Le().setClient(r),r.init(),b.log(`SDK initialized from ${J_()?"CommonJS":"ESM"}`),r.startClientReportTracking(),Jve(),hL(r),yL(r),process.env.VERCEL&&process.on("SIGTERM",async()=>{await r.flush(200)}),r}function Ay(){if(!je)return;let e=TL(),t=["SentryContextManager","SentryPropagator"];_t()&&t.push("SentrySpanProcessor");for(let n of t)e.includes(n)||b.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);e.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 Wve(e,t){let n=Kve(e.release),o=L8(e.spotlight),r=Zve(e.tracesSampleRate),i={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??my,stackParser:AC(e.stackParser||Ey),release:n,tracesSampleRate:r,spotlight:o,debug:rd(e.debug??process.env.SENTRY_DEBUG)},s=e.integrations,a=e.defaultIntegrations??t(i),c=Nv({defaultIntegrations:a,integrations:s});return i.traceLifecycle==="stream"&&!c.some(u=>u.name==="SpanStreaming")&&c.push(o_()),{...i,integrations:c}}function Kve(e){if(e!==void 0)return e;let t=hy();if(t!==void 0)return t}function Zve(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function Jve(){if(rd(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=$c(e,t);Le().setPropagationContext(n)}}var Ma={};ft(Ma,{debug:()=>Qve,error:()=>nPe,fatal:()=>rPe,fmt:()=>jm,info:()=>ePe,trace:()=>Xve,warn:()=>tPe});l();l();var G8=require("node:util");function ku(e,...t){let[n,o,r,i]=t;if(Array.isArray(o)){let s={...r};s["sentry.message.template"]=n,o.forEach((c,u)=>{s[`sentry.message.parameter.${u}`]=c});let a=(0,G8.format)(n,...o);ed({level:e,message:a,attributes:s},i?.scope)}else ed({level:e,message:n,attributes:o},r?.scope??i?.scope)}function Xve(...e){ku("trace",...e)}function Qve(...e){ku("debug",...e)}function ePe(...e){ku("info",...e)}function tPe(...e){ku("warn",...e)}function nPe(...e){ku("error",...e)}function rPe(...e){ku("fatal",...e)}l();function ht(e,t){e.setAttribute(ne,t)}var j8="Http",oPe=se(`${j8}.sentry`,e=>new Au(e)),Qd=(e={})=>{let t=e.spans??!0,n=e.disableIncomingRequestSpans,o=t&&!n,r={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},i={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes,instrumentation:e.instrumentation,onSpanCreated:e.incomingRequestSpanHook},s=pu(r),a=Su(i);return{name:j8,setup(c){let u=c.getOptions();o&&_t(u)&&a.setup(c)},setupOnce(){s.setupOnce();let c={breadcrumbs:e.breadcrumbs,spans:t,propagateTraceInOutgoingRequests:e.tracePropagation??!0,createSpansForOutgoingRequests:t,ignoreOutgoingRequests:e.ignoreOutgoingRequests,outgoingRequestHook:(u,d)=>{let p=Bo(d);if(p.startsWith("data:")){let f=Mm(p);u.setAttribute("http.url",f),u.setAttribute(kc,f),u.updateName(`${d.method||"GET"} ${f}`)}e.instrumentation?.requestHook?.(u,d)},outgoingResponseHook:e.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:e.instrumentation?.applyCustomAttributesOnSpan};oPe(c)},processEvent(c){return a.processEvent(c)}}};l();l();var ep=U(require("diagnostics_channel"),1),V8=require("url"),Uu=U(Pe(),1),jt=U(K(),1),$u=U(Xe(),1),Ve=U(We(),1);var iPe="@sentry/instrumentation-undici",yy=class e extends Uu.InstrumentationBase{__init(){this._recordFromReq=new WeakMap}constructor(t={}){super(iPe,ve,t),e.prototype.__init.call(this)}init(){}disable(){super.disable(),this._channelSubs.forEach(t=>t.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel("undici:request:create",this.onRequestCreated.bind(this)),this.subscribeToChannel("undici:client:sendHeaders",this.onRequestHeaders.bind(this)),this.subscribeToChannel("undici:request:headers",this.onResponseHeaders.bind(this)),this.subscribeToChannel("undici:request:trailers",this.onDone.bind(this)),this.subscribeToChannel("undici:request:error",this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram(Ve.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Measures the duration of outbound HTTP requests.",unit:"s",valueType:jt.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(t,n){let[o=0,r=0]=process.version.replace("v","").split(".").map(a=>Number(a)),i=o>18||o===18&&r>=19,s;if(i)ep.subscribe?.(t,n),s=()=>ep.unsubscribe?.(t,n);else{let a=ep.channel(t);a.subscribe(n),s=()=>a.unsubscribe(n)}this._channelSubs.push({name:t,unsubscribe:s})}parseRequestHeaders(t){let n=new Map;if(Array.isArray(t.headers))for(let o=0;o<t.headers.length;o+=2){let r=t.headers[o],i=t.headers[o+1];typeof r=="string"&&i!==void 0&&n.set(r.toLowerCase(),i)}else if(typeof t.headers=="string"){let o=t.headers.split(`\r
995
+ `);for(let r of o){if(!r)continue;let i=r.indexOf(":");if(i===-1)continue;let s=r.substring(0,i).toLowerCase(),a=r.substring(i+1).trim(),c=n.get(s);c&&Array.isArray(c)?c.push(a):c?n.set(s,[c,a]):n.set(s,a)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),o=n.enabled!==!1;if((0,Uu.safeExecuteInTheMiddle)(()=>!o||t.method==="CONNECT"||n.ignoreRequestHook?.(t),O=>O&&this._diag.error("caught ignoreRequestHook error: ",O),!0))return;let i=(0,$u.hrTime)(),s;try{s=new V8.URL(t.path,t.origin)}catch(O){this._diag.warn("could not determine url.full:",O);return}let a=s.protocol.replace(":",""),c=this.getRequestMethod(t.method),u={[Ve.ATTR_HTTP_REQUEST_METHOD]:c,[Ve.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[Ve.ATTR_URL_FULL]:s.toString(),[Ve.ATTR_URL_PATH]:s.pathname,[Ve.ATTR_URL_QUERY]:s.search,[Ve.ATTR_URL_SCHEME]:a},d={https:"443",http:"80"},p=s.hostname,f=s.port||d[a];u[Ve.ATTR_SERVER_ADDRESS]=p,f&&!isNaN(Number(f))&&(u[Ve.ATTR_SERVER_PORT]=Number(f));let _=this.parseRequestHeaders(t).get("user-agent");if(_){let O=Array.isArray(_)?_[_.length-1]:_;u[Ve.ATTR_USER_AGENT_ORIGINAL]=O}let h=(0,Uu.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),O=>O&&this._diag.error("caught startSpanHook error: ",O),!0);h&&Object.entries(h).forEach(([O,z])=>{u[O]=z});let E=jt.context.active(),T=jt.trace.getSpan(E),R;n.requireParentforSpans&&(!T||!jt.trace.isSpanContextValid(T.spanContext()))?R=jt.trace.wrapSpanContext(jt.INVALID_SPAN_CONTEXT):R=this.tracer.startSpan(c==="_OTHER"?"HTTP":c,{kind:jt.SpanKind.CLIENT,attributes:u},E),(0,Uu.safeExecuteInTheMiddle)(()=>n.requestHook?.(R,t),O=>O&&this._diag.error("caught requestHook error: ",O),!0);let C=jt.trace.setSpan(jt.context.active(),R),P={};jt.propagation.inject(C,P);let M=Object.entries(P);for(let O=0;O<M.length;O++){let z=M[O];if(!z)continue;let[ie,$]=z;typeof t.addHeader=="function"?t.addHeader(ie,$):typeof t.headers=="string"?t.headers+=`${ie}: ${$}\r
996
+ `:Array.isArray(t.headers)&&t.headers.push(ie,$)}this._recordFromReq.set(t,{span:R,attributes:u,startTime:i})}onRequestHeaders({request:t,socket:n}){let o=this._recordFromReq.get(t);if(!o)return;let r=this.getConfig(),{span:i}=o,{remoteAddress:s,remotePort:a}=n,c={[Ve.ATTR_NETWORK_PEER_ADDRESS]:s,[Ve.ATTR_NETWORK_PEER_PORT]:a};if(r.headersToSpanAttributes?.requestHeaders){let u=new Set(r.headersToSpanAttributes.requestHeaders.map(p=>p.toLowerCase())),d=this.parseRequestHeaders(t);for(let[p,f]of d.entries())if(u.has(p)){let m=Array.isArray(f)?f:[f];c[`http.request.header.${p}`]=m}}i.setAttributes(c)}onResponseHeaders({request:t,response:n}){let o=this._recordFromReq.get(t);if(!o)return;let{span:r,attributes:i}=o,s={[Ve.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},a=this.getConfig();if((0,Uu.safeExecuteInTheMiddle)(()=>a.responseHook?.(r,{request:t,response:n}),c=>c&&this._diag.error("caught responseHook error: ",c),!0),a.headersToSpanAttributes?.responseHeaders){let c=new Set;a.headersToSpanAttributes?.responseHeaders.forEach(u=>c.add(u.toLowerCase()));for(let u=0;u<n.headers.length;u=u+2){let d=n.headers[u],p=n.headers[u+1];if(d===void 0||p===void 0)continue;let f=d.toString().toLowerCase(),m=p;if(c.has(f)){let _=`http.response.header.${f}`;Object.prototype.hasOwnProperty.call(s,_)?s[_].push(m.toString()):s[_]=[m.toString()]}}}r.setAttributes(s),r.setStatus({code:n.statusCode>=400?jt.SpanStatusCode.ERROR:jt.SpanStatusCode.UNSET}),o.attributes=Object.assign(i,s)}onDone({request:t}){let n=this._recordFromReq.get(t);if(!n)return;let{span:o,attributes:r,startTime:i}=n;o.end(),this._recordFromReq.delete(t),this.recordRequestDuration(r,i)}onError({request:t,error:n}){let o=this._recordFromReq.get(t);if(!o)return;let{span:r,attributes:i,startTime:s}=o;r.recordException(n),r.setStatus({code:jt.SpanStatusCode.ERROR,message:n.message}),r.end(),this._recordFromReq.delete(t),i[Ve.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,s)}recordRequestDuration(t,n){let o={};[Ve.ATTR_HTTP_RESPONSE_STATUS_CODE,Ve.ATTR_HTTP_REQUEST_METHOD,Ve.ATTR_SERVER_ADDRESS,Ve.ATTR_SERVER_PORT,Ve.ATTR_URL_SCHEME,Ve.ATTR_ERROR_TYPE].forEach(s=>{s in t&&(o[s]=t[s])});let i=(0,$u.hrTimeToMilliseconds)((0,$u.hrTimeDuration)(n,(0,$u.hrTime)()))/1e3;this._httpClientDurationHistogram.record(i,o)}getRequestMethod(t){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return t.toUpperCase()in n?t.toUpperCase():"_OTHER"}};var H8="NodeFetch",sPe=se(H8,yy,e=>lPe(e)),aPe=se(`${H8}.sentry`,yu,e=>e),cPe=((e={})=>({name:"NodeFetch",setupOnce(){uPe(e,Q()?.getOptions())&&sPe(e),aPe(e)}})),tp=cPe;function F8(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function uPe(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&_t(t)}function lPe(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let o=F8(n.origin,n.path),r=e.ignoreOutgoingRequests;return!!(r&&o&&r(o))},startSpanHook:n=>{let o=F8(n.origin,n.path);if(o.startsWith("data:")){let r=Mm(o);return{[ne]:"auto.http.otel.node_fetch","http.url":r,[kc]:r,[zn]:`${n.method||"GET"} ${r}`}}return{[ne]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}l();var Iy=U(Pe(),1),z8=U(K(),1),by=U(Xe(),1);l();var Jt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var q8="Express",dPe=[">=4.0.0 <6"];var Y8=se(q8,e=>new $L(e)),$L=class extends Iy.InstrumentationBase{constructor(t={}){super("sentry-express",ve,t)}init(){return new Iy.InstrumentationNodeModuleDefinition("express",dPe,n=>{try{Hv(n,()=>({...this.getConfig(),onRouteResolved(o){let r=(0,by.getRPCMetadata)(z8.context.active());o&&r?.type===by.RPCType.HTTP&&(r.route=o)}}))}catch(o){Jt&&b.error("Failed to patch express module:",o)}return n},n=>n)}},pPe=(e=>({name:q8,setupOnce(){Y8(e)}})),BL=pPe;l();var Rw=U(require("node:diagnostics_channel"),1),Aee=U(fee(),1);l();var qo=U(K(),1),iR=U(Xe(),1),Vu=U(Pe(),1),Eee=U(We(),1);l();var Ps;(function(e){let t="fastify.name";e.FASTIFY_NAME=t;let n="fastify.type";e.FASTIFY_TYPE=n;let o="hook.name";e.HOOK_NAME=o;let r="plugin.name";e.PLUGIN_NAME=r})(Ps||(Ps={}));var gg;(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(gg||(gg={}));var hg;(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(hg||(hg={}));l();var _ee=U(K(),1);l();var Eg=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function yw(e,t,n,o={}){let r=t.startSpan(n,{attributes:o}),i=e[Eg]||[];return i.push(r),Object.defineProperty(e,Eg,{enumerable:!1,configurable:!0,value:i}),r}function rR(e,t){let n=e[Eg]||[];n.length&&(n.forEach(o=>{t&&(o.setStatus({code:_ee.SpanStatusCode.ERROR,message:t.message}),o.recordException(t)),o.end()}),delete e[Eg])}function gee(e,t,n){let o,r;try{r=e(),mee(r)&&r.then(i=>t(void 0,i),i=>t(i))}catch(i){o=i}finally{if(!mee(r)&&(t(o,r),o))throw o;return r}}function mee(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var uLe="0.1.0",lLe="@sentry/instrumentation-fastify-v3",hee="anonymous",dLe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),oR=class extends Vu.InstrumentationBase{constructor(t={}){super(lLe,uLe,t)}init(){return[new Vu.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_hookOnRequest(){let t=this;return function(o,r,i){if(!t.isEnabled())return i();t._wrap(r,"send",t._patchSend());let s=o,a=(0,iR.getRPCMetadata)(qo.context.active()),c=s.routeOptions?s.routeOptions.url:o.routerPath;c&&a?.type===iR.RPCType.HTTP&&(a.route=c);let u=o.method||"GET";Ie().setTransactionName(`${u} ${c}`),i()}}_wrapHandler(t,n,o,r){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...s){if(!i.isEnabled())return o.apply(this,s);let a=o.name||t||hee,c=`${hg.MIDDLEWARE} - ${a}`,u=s[1],d=yw(u,i.tracer,c,{[Ps.FASTIFY_TYPE]:gg.MIDDLEWARE,[Ps.PLUGIN_NAME]:t,[Ps.HOOK_NAME]:n}),p=r&&s[s.length-1];return p&&(s[s.length-1]=function(...f){rR(u),p.apply(this,f)}),qo.context.with(qo.trace.setSpan(qo.context.active(),d),()=>gee(()=>o.apply(this,s),f=>{f instanceof Error&&(d.setStatus({code:qo.SpanStatusCode.ERROR,message:f.message}),d.recordException(f)),r||rR(u)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...r){let i=r[0],s=r[1],a=this.pluginName;if(!dLe.has(i))return n.apply(this,r);let c=typeof r[r.length-1]=="function"&&s.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(a,i,s,c)])}}}_patchConstructor(t){let n=this;function o(...r){let i=t.fastify.apply(this,r);return i.addHook("onRequest",n._hookOnRequest()),i.addHook("preHandler",n._hookPreHandler()),pLe(),n._wrap(i,"addHook",n._wrapAddHook()),i}return t.errorCodes!==void 0&&(o.errorCodes=t.errorCodes),o.fastify=o,o.default=o,o}_patchSend(){let t=this;return this._diag.debug("Patching fastify reply.send function"),function(o){return function(...i){let s=i[0];return t.isEnabled()?(0,Vu.safeExecuteInTheMiddle)(()=>o.apply(this,i),a=>{!a&&s instanceof Error&&(a=s),rR(this,a)}):o.apply(this,i)}}}_hookPreHandler(){let t=this;return this._diag.debug("Patching fastify preHandler function"),function(o,r,i){if(!t.isEnabled())return i();let s=o,a=s.routeOptions?.handler||s.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,u=`${hg.REQUEST_HANDLER} - ${c||this.pluginName||hee}`,d={[Ps.PLUGIN_NAME]:this.pluginName,[Ps.FASTIFY_TYPE]:gg.REQUEST_HANDLER,[Eee.SEMATTRS_HTTP_ROUTE]:s.routeOptions?s.routeOptions.url:o.routerPath};c&&(d[Ps.FASTIFY_NAME]=c);let p=yw(r,t.tracer,u,d);Tee(p);let{requestHook:f}=t.getConfig();return f&&(0,Vu.safeExecuteInTheMiddle)(()=>f(p,{request:o}),m=>{m&&t._diag.error("request hook failed",m)},!0),qo.context.with(qo.trace.setSpan(qo.context.active(),p),()=>{i()})}}};function pLe(){let e=Q();e&&e.on("spanStart",t=>{Tee(t)})}function Tee(e){let t=_e(e).data,n=t["fastify.type"];if(t[oe]||!n)return;e.setAttributes({[ne]:"auto.http.otel.fastify",[oe]:`${n}.fastify`});let o=t["fastify.name"]||t["plugin.name"]||t["hook.name"];if(typeof o=="string"){let r=o.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(r)}}var sR="Fastify",yee=se(`${sR}.v3`,()=>new oR);function fLe(){let e=Q();if(e)return e.getIntegrationByName(sR)}function See(e,t,n,o){let r=fLe()?.getShouldHandleError()||Iee;if(o==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&o==="onError-hook"){Jt&&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}r(e,t,n)&&he(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var Ree=se(`${sR}.v5`,()=>{let e=new Aee.FastifyOtelInstrumentation,t=e.plugin();return Rw.subscribe("fastify.initialization",n=>{let o=n.fastify;o?.register(t).after(r=>{r?Jt&&b.error("Failed to setup Fastify instrumentation",r):(_Le(),o&&gLe(o))})}),Rw.subscribe("tracing:fastify.request.handler:error",n=>{let{error:o,request:r,reply:i}=n;See.call(See,o,r,i,"diagnostics-channel")}),e}),mLe=(({shouldHandleError:e})=>{let t;return{name:sR,setupOnce(){t=e||Iee,yee(),Ree()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),Iw=(e={})=>mLe(e);function Iee(e,t,n){let o=n.statusCode;return o>=500||o<=299}function bee(e){let t=_e(e),n=t.description,o=t.data,r=o["fastify.type"],i=r==="hook",s=r===n?.startsWith("handler -"),a=n==="request"||r==="request-handler";if(o[oe]||!s&&!a&&!i)return;let c=i?"hook":s?"middleware":a?"request_handler":"<unknown>";e.setAttributes({[ne]:"auto.http.otel.fastify",[oe]:`${c}.fastify`});let u=o["fastify.name"]||o["plugin.name"]||o["hook.name"];if(typeof u=="string"){let d=u.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(d)}}function _Le(){let e=Q();e&&e.on("spanStart",t=>{bee(t)})}function gLe(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&bee(i)}let o=t.routeOptions?.url,r=t.method||"GET";Ie().setTransactionName(`${r} ${o}`)})}l();var qee=U(K(),1),Yee=U(zee(),1);var Wee="Graphql",Kee=se(Wee,Yee.GraphQLInstrumentation,e=>{let t=Zee(e);return{...t,responseHook(n,o){ht(n,"auto.graphql.otel.graphql"),o.errors?.length&&!_e(n).status&&n.setStatus({code:qee.SpanStatusCode.ERROR});let i=_e(n).data,s=i["graphql.operation.type"],a=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&s){let c=mt(n),d=_e(c).data[Ou]||[],p=a?`${s} ${a}`:`${s}`;Array.isArray(d)?(d.push(p),c.setAttribute(Ou,d)):typeof d=="string"?c.setAttribute(Ou,[d,p]):c.setAttribute(Ou,p),_e(c).data["original-description"]||c.setAttribute("original-description",_e(c).description),c.updateName(`${_e(c).data["original-description"]} (${ULe(d)})`)}}}}),kLe=((e={})=>({name:Wee,setupOnce(){Kee(Zee(e))}})),Pw=kLe;function Zee(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function ULe(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}l();var cte=U(ate(),1);var ute="Kafka",lte=se(ute,()=>new cte.KafkaJsInstrumentation({consumerHook(e){ht(e,"auto.kafkajs.otel.consumer")},producerHook(e){ht(e,"auto.kafkajs.otel.producer")}})),BLe=(()=>({name:ute,setupOnce(){lte()}})),Mw=BLe;l();var hte=U(gte(),1);var Ete="LruMemoizer",Tte=se(Ete,()=>new hte.LruMemoizerInstrumentation),jLe=(()=>({name:Ete,setupOnce(){Tte()}})),ww=jLe;l();var Cte=U(Ote(),1);var vte="Mongo",Pte=se(vte,()=>new Cte.MongoDBInstrumentation({dbStatementSerializer:qLe,responseHook(e){ht(e,"auto.db.otel.mongo")}}));function qLe(e){let t=kw(e);return JSON.stringify(t)}function kw(e){if(Array.isArray(e))return e.map(t=>kw(t));if(YLe(e)){let t={};return Object.entries(e).map(([n,o])=>[n,kw(o)]).reduce((n,o)=>(KLe(o)&&(n[o[0]]=o[1]),n),t)}return"?"}function YLe(e){return typeof e=="object"&&e!==null&&!WLe(e)}function WLe(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function KLe(e){return Array.isArray(e)}var ZLe=(()=>({name:vte,setupOnce(){Pte()}})),Uw=ZLe;l();var jte=U(Gte(),1);var Vte="Mongoose",Fte=se(Vte,()=>new jte.MongooseInstrumentation({responseHook(e){ht(e,"auto.db.otel.mongoose")}})),iwe=(()=>({name:Vte,setupOnce(){Fte()}})),Vw=iwe;l();var Jte=U(Zte(),1);var Xte="Mysql",Qte=se(Xte,()=>new Jte.MySQLInstrumentation({})),_we=(()=>({name:Xte,setupOnce(){Qte()}})),zw=_we;l();var ane=U(sne(),1);var cne="Mysql2",une=se(cne,()=>new ane.MySQL2Instrumentation({responseHook(e){ht(e,"auto.db.otel.mysql2")}})),Pwe=(()=>({name:cne,setupOnce(){une()}})),eD=Pwe;l();l();var xwe=["get","set","setex"],tD=["get","mget"],Mwe=["set","setex"];function Og(e,t){return e.includes(t.toLowerCase())}function nD(e){return Og(tD,e)?"cache.get":Og(Mwe,e)?"cache.put":void 0}function Lwe(e,t){return t.some(n=>e.startsWith(n))}function dne(e,t){try{if(t.length===0)return;let n=r=>typeof r=="string"||typeof r=="number"||Buffer.isBuffer(r)?[r.toString()]:Array.isArray(r)?lne(r.map(i=>n(i))):["<unknown>"],o=t[0];return Og(xwe,e)&&o!=null?n(o):lne(t.map(r=>n(r)))}catch{return}}function pne(e,t,n){if(!nD(e))return!1;for(let o of t)if(Lwe(o,n))return!0;return!1}function fne(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,o)=>{let r=t(o);return typeof r=="number"?n!==void 0?n+r:r:n},0):t(e)}function lne(e){let t=[],n=o=>{o.forEach(r=>{Array.isArray(r)?n(r):t.push(r)})};return n(e),t}l();var Rr=U(K(),1);var Ct=U(Pe(),1),go=U(We(),1);l();var wwe=[{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}],Yu=(e,t)=>{if(Array.isArray(t)&&t.length){let n=wwe.find(({regex:r})=>r.test(e))?.args??0,o=n>=0?t.slice(0,n):t.slice();return t.length>o.length&&o.push(`[${t.length-n} other arguments]`),`${e} ${o.join(" ")}`}return e};l();var Rp="db.connection_string",ja="db.statement",$i="db.system",Bi="net.peer.name",Gi="net.peer.port",Ip="redis",ji="redis";var Dwe="@opentelemetry/instrumentation-ioredis",kwe="0.62.0";function Wu(e,t){t&&(e.recordException(t),e.setStatus({code:Rr.SpanStatusCode.ERROR,message:t.message})),e.end()}var mne={requireParentSpan:!0},PR=class extends Ct.InstrumentationBase{constructor(t={}){super(Dwe,kwe,{...mne,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ct.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ct.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...mne,...t})}init(){return[new Ct.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let o=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Ct.isWrapped)(o.prototype.sendCommand)&&this._unwrap(o.prototype,"sendCommand"),this._wrap(o.prototype,"sendCommand",this._patchSendCommand(n)),(0,Ct.isWrapped)(o.prototype.connect)&&this._unwrap(o.prototype,"connect"),this._wrap(o.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let o=this;return function(r){if(arguments.length<1||typeof r!="object")return t.apply(this,arguments);let i=o.getConfig(),s=i.dbStatementSerializer||Yu,a=Rr.trace.getSpan(Rr.context.active())===void 0;if(i.requireParentSpan===!0&&a)return t.apply(this,arguments);let c={},{host:u,port:d}=this.options,p=s(r.name,r.args);o._dbSemconvStability&Ct.SemconvStability.OLD&&(c[$i]=ji,c[ja]=p,c[Rp]=`redis://${u}:${d}`),o._dbSemconvStability&Ct.SemconvStability.STABLE&&(c[go.ATTR_DB_SYSTEM_NAME]=Ip,c[go.ATTR_DB_QUERY_TEXT]=p),o._netSemconvStability&Ct.SemconvStability.OLD&&(c[Bi]=u,c[Gi]=d),o._netSemconvStability&Ct.SemconvStability.STABLE&&(c[go.ATTR_SERVER_ADDRESS]=u,c[go.ATTR_SERVER_PORT]=d),c[ne]="auto.db.otel.redis";let f=o.tracer.startSpan(r.name,{kind:Rr.SpanKind.CLIENT,attributes:c}),{requestHook:m}=i;m&&(0,Ct.safeExecuteInTheMiddle)(()=>m(f,{moduleVersion:n,cmdName:r.name,cmdArgs:r.args}),_=>{_&&Rr.diag.error("ioredis instrumentation: request hook failed",_)},!0);try{let _=t.apply(this,arguments),h=r.resolve;r.resolve=function(T){(0,Ct.safeExecuteInTheMiddle)(()=>i.responseHook?.(f,r.name,r.args,T),R=>{R&&Rr.diag.error("ioredis instrumentation: response hook failed",R)},!0),Wu(f,null),h(T)};let E=r.reject;return r.reject=function(T){Wu(f,T),E(T)},_}catch(_){throw Wu(f,_),_}}}_traceConnection(t){let n=this;return function(){let o=Rr.trace.getSpan(Rr.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&o)return t.apply(this,arguments);let r={},{host:i,port:s}=this.options;n._dbSemconvStability&Ct.SemconvStability.OLD&&(r[$i]=ji,r[ja]="connect",r[Rp]=`redis://${i}:${s}`),n._dbSemconvStability&Ct.SemconvStability.STABLE&&(r[go.ATTR_DB_SYSTEM_NAME]=Ip,r[go.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Ct.SemconvStability.OLD&&(r[Bi]=i,r[Gi]=s),n._netSemconvStability&Ct.SemconvStability.STABLE&&(r[go.ATTR_SERVER_ADDRESS]=i,r[go.ATTR_SERVER_PORT]=s),r[ne]="auto.db.otel.redis";let a=n.tracer.startSpan("connect",{kind:Rr.SpanKind.CLIENT,attributes:r});try{let c=t.apply(this,arguments);return typeof c?.then=="function"?c.then(u=>(Wu(a,null),u),u=>(Wu(a,u),Promise.reject(u))):(Wu(a,null),c)}catch(c){throw Wu(a,c),c}}}};l();var lt=U(K(),1);var Ee=U(Pe(),1),Bn=U(We(),1);var rD="@opentelemetry/instrumentation-redis",oD="0.62.0",Cg=Symbol("opentelemetry.instrumentation.redis.open_spans"),_ne=Symbol("opentelemetry.instrumentation.redis.multi_command_options");function Uwe(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}function gne(e,t,n){let o={};return n&Ee.SemconvStability.OLD&&Object.assign(o,{[$i]:ji,[Bi]:t?.socket?.host,[Gi]:t?.socket?.port,[Rp]:Uwe(e,t?.url)}),n&Ee.SemconvStability.STABLE&&Object.assign(o,{[Bn.ATTR_DB_SYSTEM_NAME]:Ip,[Bn.ATTR_SERVER_ADDRESS]:t?.socket?.host,[Bn.ATTR_SERVER_PORT]:t?.socket?.port}),o}function hne(e,t){t&&e.setStatus({code:lt.SpanStatusCode.ERROR,message:t.message}),e.end()}function $we(e){return function(){let n=e.apply(this,arguments);return lt.context.bind(lt.context.active(),n)}}function Bwe(e){return function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){lt.context.bind(lt.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)}}var xR=class e extends Ee.InstrumentationBase{static __initStatic(){this.COMPONENT="redis"}constructor(t={}){super(rD,oD,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ee.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ee.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Ee.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Ee.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Ee.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Ee.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(o){return function(i){if(arguments.length!==1||typeof i!="object")return o.apply(this,arguments);let s=t.getConfig(),a=lt.trace.getSpan(lt.context.active())===void 0;if(s.requireParentSpan===!0&&a)return o.apply(this,arguments);let c=s?.dbStatementSerializer||Yu,u={};t._semconvStability&Ee.SemconvStability.OLD&&Object.assign(u,{[$i]:ji,[ja]:c(i.command,i.args)}),t._semconvStability&Ee.SemconvStability.STABLE&&Object.assign(u,{[Bn.ATTR_DB_SYSTEM_NAME]:Ip,[Bn.ATTR_DB_OPERATION_NAME]:i.command,[Bn.ATTR_DB_QUERY_TEXT]:c(i.command,i.args)}),u[ne]="auto.db.otel.redis";let d=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:lt.SpanKind.CLIENT,attributes:u});if(this.connection_options){let f={};t._semconvStability&Ee.SemconvStability.OLD&&Object.assign(f,{[Bi]:this.connection_options.host,[Gi]:this.connection_options.port}),t._semconvStability&Ee.SemconvStability.STABLE&&Object.assign(f,{[Bn.ATTR_SERVER_ADDRESS]:this.connection_options.host,[Bn.ATTR_SERVER_PORT]:this.connection_options.port}),d.setAttributes(f)}this.address&&t._semconvStability&Ee.SemconvStability.OLD&&d.setAttribute(Rp,`redis://${this.address}`);let p=arguments[0].callback;if(p){let f=lt.context.active();arguments[0].callback=function(_,h){if(s?.responseHook){let E=s.responseHook;(0,Ee.safeExecuteInTheMiddle)(()=>{E(d,i.command,i.args,h)},T=>{T&&t._diag.error("Error executing responseHook",T)},!0)}return hne(d,_),lt.context.with(f,p,this,...arguments)}}try{return o.apply(this,arguments)}catch(f){throw hne(d,f),f}}}}_getPatchCreateClient(){return function(n){return $we(n)}}_getPatchCreateStream(){return function(n){return Bwe(n)}}};xR.__initStatic();var MR=class e extends Ee.InstrumentationBase{static __initStatic2(){this.COMPONENT="redis"}constructor(t={}){super(rD,oD,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ee.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ee.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Ee.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,s)=>{let a=i.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let c=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Ee.isWrapped)(i?.[c])&&this._unwrap(i,c),this._wrap(i,c,this._getPatchExtendWithCommands(a)),i},i=>{(0,Ee.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,Ee.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),o=new Ee.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0",">=5.0.0 <5.12.0"],i=>{let s=i?.default?.prototype;return(0,Ee.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec(!1)),(0,Ee.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,Ee.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let s=i?.default?.prototype;(0,Ee.isWrapped)(s?.exec)&&this._unwrap(s,"exec"),(0,Ee.isWrapped)(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),(0,Ee.isWrapped)(s?.addCommand)&&this._unwrap(s,"addCommand")}),r=new Ee.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0",">=5.0.0 <5.12.0"],i=>{let s=i?.default?.prototype;return s?.multi&&((0,Ee.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&((0,Ee.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),(0,Ee.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),(0,Ee.isWrapped)(s?.connect)&&this._unwrap(s,"connect"),this._wrap(s,"connect",this._getPatchedClientConnect()),i},i=>{let s=i?.default?.prototype;(0,Ee.isWrapped)(s?.multi)&&this._unwrap(s,"multi"),(0,Ee.isWrapped)(s?.MULTI)&&this._unwrap(s,"MULTI"),(0,Ee.isWrapped)(s?.sendCommand)&&this._unwrap(s,"sendCommand"),(0,Ee.isWrapped)(s?.connect)&&this._unwrap(s,"connect")});return new Ee.InstrumentationNodeModuleDefinition(t,["^1.0.0",">=5.0.0 <5.12.0"],i=>i,()=>{},[n,o,r])}_getPatchExtendWithCommands(t){let n=this;return function(r){return function(s){if(s?.BaseClass?.name!=="RedisClient")return r.apply(this,arguments);let a=s.executor;return s.executor=function(c,u){let d=t(c,u).args;return n._traceClientCommand(a,this,arguments,d)},r.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(r){return function(){let s=r.apply(this,arguments);return typeof s?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),s):s.then(a=>{let c=this[Cg];return n._endSpansWithRedisReplies(c,a,t),a}).catch(a=>{let c=this[Cg];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let u=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,u,t)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(o){return function(i){return t._traceClientCommand(o,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let r=n.apply(this,arguments);return r[_ne]=this.options,r}}}_getPatchRedisClientSendCommand(){let t=this;return function(o){return function(i){return t._traceClientCommand(o,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(o){return function(){let i=this.options,s=gne(t._diag,i,t._semconvStability);s[ne]="auto.db.otel.redis";let a=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:lt.SpanKind.CLIENT,attributes:s});return lt.context.with(lt.trace.setSpan(lt.context.active(),a),()=>o.apply(this)).then(u=>(a.end(),u)).catch(u=>(a.recordException(u),a.setStatus({code:lt.SpanStatusCode.ERROR,message:u.message}),a.end(),Promise.reject(u)))}}}_traceClientCommand(t,n,o,r){if(lt.trace.getSpan(lt.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,o);let s=n.options||n[_ne],a=r[0],c=r.slice(1),u=this.getConfig().dbStatementSerializer||Yu,d=gne(this._diag,s,this._semconvStability);this._semconvStability&Ee.SemconvStability.STABLE&&(d[Bn.ATTR_DB_OPERATION_NAME]=a);try{let m=u(a,c);m!=null&&(this._semconvStability&Ee.SemconvStability.OLD&&(d[ja]=m),this._semconvStability&Ee.SemconvStability.STABLE&&(d[Bn.ATTR_DB_QUERY_TEXT]=m))}catch(m){this._diag.error("dbStatementSerializer throw an exception",m,{commandName:a})}d[ne]="auto.db.otel.redis";let p=this.tracer.startSpan(`${e.COMPONENT}-${a}`,{kind:lt.SpanKind.CLIENT,attributes:d}),f=lt.context.with(lt.trace.setSpan(lt.context.active(),p),()=>t.apply(n,o));if(typeof f?.then=="function")f.then(m=>{this._endSpanWithResponse(p,a,c,m,void 0)},m=>{this._endSpanWithResponse(p,a,c,null,m)});else{let m=f;m[Cg]=m[Cg]||[],m[Cg].push({span:p,commandName:a,commandArgs:c})}return f}_endSpansWithRedisReplies(t,n,o=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let r=t.map(a=>a.commandName),s=r.every(a=>a===r[0])?(o?"PIPELINE ":"MULTI ")+r[0]:o?"PIPELINE":"MULTI";for(let a=0;a<t.length;a++){let{span:c,commandArgs:u}=t[a],d=n[a],[p,f]=d instanceof Error?[null,d]:[d,void 0];this._semconvStability&Ee.SemconvStability.STABLE&&c.setAttribute(Bn.ATTR_DB_OPERATION_NAME,s),this._endSpanWithResponse(c,r[a],u,p,f)}}_endSpanWithResponse(t,n,o,r,i){let{responseHook:s}=this.getConfig();if(!i&&s)try{s(t,n,o,r)}catch(a){this._diag.error("responseHook throw an exception",a)}i&&(t.recordException(i),t.setStatus({code:lt.SpanStatusCode.ERROR,message:i?.message})),t.end()}};MR.__initStatic2();var Ene={requireParentSpan:!1},LR=class e extends Ee.InstrumentationBase{__init(){this.initialized=!1}constructor(t={}){let n={...Ene,...t};super(rD,oD,n),e.prototype.__init.call(this),this.instrumentationV2_V3=new xR(this.getConfig()),this.instrumentationV4_V5=new MR(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...Ene,...t};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};l();l();var Tne=require("node:diagnostics_channel"),vg=U(K(),1);function wR(e,t){let n=(0,Tne.tracingChannel)(e),o;try{o=vg.context._getContextManager().getAsyncLocalStorageLookup()}catch{}if(!o)return zo&&sT.warn("[TracingChannel] Could not access OpenTelemetry AsyncLocalStorage, context propagation will not work."),n;let r=o.asyncLocalStorage;return n.start.bindStore(r,i=>{let s=t(i);return i._sentrySpan=s,vg.trace.setSpan(vg.context.active(),s)}),n}var Gwe="node-redis:command",jwe="node-redis:batch",Vwe="node-redis:connect",iD="auto.db.redis.diagnostic_channel",Ds=()=>{},Sne=!1,Ane;function yne(e){if(Ane=e,!Sne)try{Fwe(),Hwe(),zwe(),Sne=!0}catch{}}function Fwe(){wR(Gwe,t=>{let n=t.args.slice(1),o=Ywe(t.command,n);return dt({name:`redis-${t.command}`,attributes:{[ne]:iD,[oe]:"db.redis",[$i]:ji,...o!=null?{[ja]:o}:{},...t.serverAddress!=null?{[Bi]:t.serverAddress}:{},...t.serverPort!=null?{[Gi]:t.serverPort}:{}}},r=>r)}).subscribe({start:Ds,asyncStart:Ds,end:Ds,asyncEnd:t=>{let n=t._sentrySpan;!n||t.error||(qwe(n,t.command,t.args.slice(1),t.result),n.end())},error:t=>{let n=t._sentrySpan;n&&(t.error&&n.setStatus({code:2,message:t.error.message}),n.end())}})}function Hwe(){wR(jwe,t=>{let n=t.batchMode==="PIPELINE"?"PIPELINE":"MULTI";return dt({name:n,attributes:{[ne]:iD,[oe]:"db.redis",[$i]:ji,...t.batchSize!=null?{"db.redis.batch_size":t.batchSize}:{},...t.serverAddress!=null?{[Bi]:t.serverAddress}:{},...t.serverPort!=null?{[Gi]:t.serverPort}:{}}},o=>o)}).subscribe({start:Ds,asyncStart:Ds,end:Ds,asyncEnd:t=>{t.error||t._sentrySpan?.end()},error:t=>{let n=t._sentrySpan;n&&(t.error&&n.setStatus({code:2,message:t.error.message}),n.end())}})}function zwe(){wR(Vwe,t=>dt({name:"redis-connect",attributes:{[ne]:iD,[oe]:"db.redis.connect",[$i]:ji,...t.serverAddress!=null?{[Bi]:t.serverAddress}:{},...t.serverPort!=null?{[Gi]:t.serverPort}:{}}},n=>n)).subscribe({start:Ds,asyncStart:Ds,end:Ds,asyncEnd:t=>{t.error||t._sentrySpan?.end()},error:t=>{let n=t._sentrySpan;n&&(t.error&&n.setStatus({code:2,message:t.error.message}),n.end())}})}function qwe(e,t,n,o){let r=Ane;if(r)try{r(e,t,n,o)}catch{}}function Ywe(e,t){try{return Yu(e,t)}catch{return}}var DR="Redis",Pg={},sD=(e,t,n,o)=>{let r=dne(t,n),i=nD(t);if(!r||!i||!Pg.cachePrefixes||!pne(t,r,Pg.cachePrefixes))return;let s=_e(e).data,a=s["net.peer.name"]??s["server.address"],c=s["net.peer.port"]??s["server.port"];c&&a&&e.setAttributes({"network.peer.address":a,"network.peer.port":c});let u=fne(o);u&&e.setAttribute(tv,u),Og(tD,t)&&u!==void 0&&e.setAttribute(QC,u>0),e.setAttributes({[oe]:i,[ev]:r});let d=r.join(", ");e.updateName(Pg.maxCacheKeyLength?ta(d,Pg.maxCacheKeyLength):d)},Wwe=se(`${DR}.IORedis`,()=>new PR({responseHook:sD})),Kwe=se(`${DR}.Redis`,()=>new LR({responseHook:sD})),Rne=Object.assign(()=>{Wwe(),Kwe(),Promise.resolve().then(()=>yne(sD))},{id:DR}),Zwe=((e={})=>({name:DR,setupOnce(){Pg=e,Rne()}})),aD=Zwe;l();var Gne=U(Bne(),1);var jne="Postgres",Vne=se(jne,Gne.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){ht(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),dDe=(e=>({name:jne,setupOnce(){Vne(e)}})),fD=dDe;l();var VR=U(K(),1),Fa=U(Pe(),1),Zo=U(We(),1);var _D="PostgresJs",Fne=[">=3.0.0 <4"],pDe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,fDe=Symbol.for("sentry.query.from.instrumented.sql"),Hne=se(_D,e=>new mD({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),mD=class extends Fa.InstrumentationBase{constructor(t){super("sentry-postgres-js",ve,t)}init(){let t=new Fa.InstrumentationNodeModuleDefinition("postgres",Fne,n=>{try{return this._patchPostgres(n)}catch(o){return Jt&&b.error("Failed to patch postgres module:",o),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new Fa.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,Fne,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",o=n?t:t.default;if(typeof o!="function")return Jt&&b.warn("postgres module does not export a function. Skipping instrumentation."),t;let r=this,i=function(...s){let a=Reflect.construct(o,s);if(!a||typeof a!="function")return Jt&&b.warn("postgres() did not return a valid instance"),a;let c=r.getConfig();return Kv(a,{requireParentSpan:c.requireParentSpan,requestHook:c.requestHook})};Object.setPrototypeOf(i,o),Object.setPrototypeOf(i.prototype,o.prototype);for(let s of Object.getOwnPropertyNames(o))if(!["length","name","prototype"].includes(s)){let a=Object.getOwnPropertyDescriptor(o,s);a&&Object.defineProperty(i,s,a)}return n?i:(i_(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return VR.trace.getSpan(VR.context.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,o){if(o){t.setAttribute(Zo.ATTR_DB_OPERATION_NAME,o);return}let r=n?.match(pDe);r?.[1]&&t.setAttribute(Zo.ATTR_DB_OPERATION_NAME,r[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,o,r)=>r===0?o:`${n}$${r}${o}`,"")}_sanitizeSqlQuery(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(t){let n=this,o=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...r){if(this[fDe])return o.apply(this,r);if(!n._shouldCreateSpans())return o.apply(this,r);let i=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(i);return dt({name:s||"postgresjs.query",op:"db"},a=>{ht(a,"auto.db.postgresjs"),a.setAttributes({[Zo.ATTR_DB_SYSTEM_NAME]:"postgres",[Zo.ATTR_DB_QUERY_TEXT]:s});let c=n.getConfig(),{requestHook:u}=c;u&&(0,Fa.safeExecuteInTheMiddle)(()=>u(a,s,void 0),f=>{f&&(a.setAttribute("sentry.hook.error","requestHook failed"),Jt&&b.error(`Error in requestHook for ${_D} integration:`,f))},!0);let d=this.resolve;this.resolve=new Proxy(d,{apply:(f,m,_)=>{try{n._setOperationName(a,s,_?.[0]?.command),a.end()}catch(h){Jt&&b.error("Error ending span in resolve callback:",h)}return Reflect.apply(f,m,_)}});let p=this.reject;this.reject=new Proxy(p,{apply:(f,m,_)=>{try{a.setStatus({code:2,message:_?.[0]?.message||"unknown_error"}),a.setAttribute(Zo.ATTR_DB_RESPONSE_STATUS_CODE,_?.[0]?.code||"unknown"),a.setAttribute(Zo.ATTR_ERROR_TYPE,_?.[0]?.name||"unknown"),n._setOperationName(a,s),a.end()}catch(h){Jt&&b.error("Error ending span in reject callback:",h)}return Reflect.apply(f,m,_)}});try{return o.apply(this,r)}catch(f){throw a.setStatus({code:2,message:f instanceof Error?f.message:"unknown_error"}),a.end(),f}})},t.Query.prototype.handle.__sentry_original__=o,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},mDe=(e=>({name:_D,setupOnce(){Hne(e)}})),gD=mDe;l();var To=U(K(),1);l();var Pre=U(K(),1),lI=U(Ore(),1),qa=U(K(),1);var Dke={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"}},kke=Dke.version.split(".")[0],GD="PRISMA_INSTRUMENTATION",jD=`V${kke}_PRISMA_INSTRUMENTATION`,Lp=globalThis;function Uke(){let e=Lp[jD];return e?.helper?e.helper:Lp[GD]?.helper}function $ke(e){let t={helper:e};Lp[jD]=t,Lp[GD]=t}function Bke(){delete Lp[jD],delete Lp[GD]}var Gke=process.env.PRISMA_SHOW_ALL_TRACES==="true",jke="00-10-10-00";function Vke(e){switch(e){case"client":return qa.SpanKind.CLIENT;case"internal":default:return qa.SpanKind.INTERNAL}}var Fke=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=qa.trace.getSpanContext(e??qa.context.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:jke}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,o=e.filter(r=>r.parentId===null);for(let r of o)xre(t,r,e,n,this.ignoreSpanTypes)}getActiveContext(){return qa.context.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!Gke)return t();let n=this.tracerProvider.getTracer("prisma"),o=e.context??this.getActiveContext(),r=`prisma:client:${e.name}`;if(Mre(r,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(r,e,o);return Cre(i,t(i,o))}return n.startActiveSpan(r,e,i=>Cre(i,t(i,o)))}};function xre(e,t,n,o,r){if(Mre(t.name,r))return;let i={attributes:t.attributes,kind:Vke(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,s=>{o.set(t.id,s.spanContext().spanId),t.links&&s.addLinks(t.links.flatMap(c=>{let u=o.get(c);return u?{context:{spanId:u,traceId:s.spanContext().traceId,traceFlags:s.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===t.id);for(let c of a)xre(e,c,n,o,r);s.end(t.endTime)})}function Cre(e,t){return Hke(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function Hke(e){return e!=null&&typeof e.then=="function"}function Mre(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var Lre={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},vre=Lre.version,zke=Lre.name,qke="@prisma/client",wre=class extends lI.InstrumentationBase{tracerProvider;constructor(e={}){super(zke,vre,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new lI.InstrumentationNodeModuleDefinition(qke,[vre])]}enable(){let e=this._config;$ke(new Fke({tracerProvider:this.tracerProvider??Pre.trace.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){Bke()}isEnabled(){return Uke()!==void 0}};var Dre="Prisma";function Yke(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function kre(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}var VD=class extends wre{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=kre();Yke(t)&&(t.createEngineSpan=n=>{let o=To.trace.getTracer("prismaV5Compatibility"),r=o._idGenerator;if(!r){Tt(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let s=Wke(i.kind),a=i.parent_span_id,c=i.span_id,u=i.trace_id,d=i.links?.map(f=>({context:{traceId:f.trace_id,spanId:f.span_id,traceFlags:To.TraceFlags.SAMPLED}})),p=To.trace.setSpanContext(To.context.active(),{traceId:u,spanId:a,traceFlags:To.TraceFlags.SAMPLED});To.context.with(p,()=>{let f={generateTraceId:()=>u,generateSpanId:()=>c};o._idGenerator=f,o.startSpan(i.name,{kind:s,links:d,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),o._idGenerator=r})})}finally{o._idGenerator=r}})}};function Wke(e){switch(e){case"client":return To.SpanKind.CLIENT;case"internal":default:return To.SpanKind.INTERNAL}}var Kke=se(Dre,e=>new VD(e)),FD=e=>({name:Dre,setupOnce(){Kke(e)},setup(t){kre()&&t.on("spanStart",n=>{let o=_e(n);o.description?.startsWith("prisma:")&&n.setAttribute(ne,"auto.db.otel.prisma"),(o.description==="prisma:engine:db_query"||o.description==="prisma:client:db_query")&&o.data["db.query.text"]&&n.updateName(o.data["db.query.text"]),o.description==="prisma:engine:db_query"&&!o.data["db.system"]&&n.setAttribute("db.system","prisma")})}});l();var qre=U(zre(),1);var Yre="Hapi",Wre=se(Yre,()=>new qre.HapiInstrumentation),c0e=(()=>({name:Yre,setupOnce(){Wre()}})),YD=c0e;l();var _I=U(We(),1);l();var Wa={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Hg={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};l();var Ju=U(K(),1),mI=U(Pe(),1);var u0e="@sentry/instrumentation-hono",l0e="0.0.1",fI=class extends mI.InstrumentationBase{constructor(t={}){super(u0e,l0e,t)}init(){return[new mI.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class o extends t.Hono{constructor(...i){super(...i),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=o}catch{return{...t,Hono:o}}return t}_patchHandler(){let t=this;return function(n){return function(...r){if(typeof r[0]=="string"){let i=r[0];if(r.length===1)return n.apply(this,[i]);let s=r.slice(1);return n.apply(this,[i,...s.map(a=>t._wrapHandler(a))])}return n.apply(this,r.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...r){let i=r.slice(2);return n.apply(this,[...r.slice(0,2),...i.map(s=>t._wrapHandler(s))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...r){if(typeof r[0]=="string"){let i=r[0];if(r.length===1)return n.apply(this,[i]);let s=r.slice(1);return n.apply(this,[i,...s.map(a=>t._wrapHandler(a))])}return n.apply(this,r.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(o,r){if(!n.isEnabled())return t.apply(this,[o,r]);let i=o.req.path,s=n.tracer.startSpan(i);return Ju.context.with(Ju.trace.setSpan(Ju.context.active(),s),()=>n._safeExecute(()=>{let a=t.apply(this,[o,r]);if(fn(a))return a.then(c=>{let u=n._determineHandlerType(c);return s.setAttributes({[Wa.HONO_TYPE]:u,[Wa.HONO_NAME]:u===Hg.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),c});{let c=n._determineHandlerType(a);return s.setAttributes({[Wa.HONO_TYPE]:c,[Wa.HONO_NAME]:c===Hg.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(s),a}},()=>s.end(),a=>{n._handleError(s,a),s.end()}))}}_safeExecute(t,n,o){try{let r=t();return fn(r)?r.then(()=>n(),i=>o(i)):n(),r}catch(r){throw o(r),r}}_determineHandlerType(t){return t===void 0?Hg.MIDDLEWARE:Hg.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Ju.SpanStatusCode.ERROR,message:n.message}),t.recordException(n))}};var Kre="Hono";function d0e(e){let t=_e(e).data,n=t[Wa.HONO_TYPE];if(t[oe]||!n)return;e.setAttributes({[ne]:"auto.http.otel.hono",[oe]:`${n}.hono`});let o=t[Wa.HONO_NAME];if(typeof o=="string"&&e.updateName(o),Ie()===Zr()){Jt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let r=t[_I.ATTR_HTTP_ROUTE],i=t[_I.ATTR_HTTP_REQUEST_METHOD];typeof r=="string"&&typeof i=="string"&&Ie().setTransactionName(`${i} ${r}`)}var Zre=se(Kre,()=>new fI({responseHook:e=>{d0e(e)}})),p0e=(()=>({name:Kre,setupOnce(){Zre()}})),WD=p0e;l();var coe=U(aoe(),1),uoe=U(We(),1);var loe="Koa",doe=se(loe,coe.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){ht(t,"auto.http.otel.koa");let o=_e(t).data,r=o["koa.type"];r&&t.setAttribute(oe,`${r}.koa`);let i=o["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),Ie()===Zr()){Jt&&b.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let s=o[uoe.ATTR_HTTP_ROUTE],a=n.context?.request?.method?.toUpperCase()||"GET";s&&Ie().setTransactionName(`${a} ${s}`)}})),A0e=((e={})=>({name:loe,setupOnce(){doe(e)}})),JD=A0e;l();var Soe=U(Toe(),1);var Aoe="Connect",yoe=se(Aoe,()=>new Soe.ConnectInstrumentation),x0e=(()=>({name:Aoe,setupOnce(){yoe()}})),nk=x0e;l();var Moe=U(xoe(),1);var k0e=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),Loe="Tedious",woe=se(Loe,()=>new Moe.TediousInstrumentation({})),U0e=(()=>{let e;return{name:Loe,setupOnce(){let t=woe();e=C_(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:o,data:r}=_e(n);if(!o||r["db.system"]!=="mssql")return;let i=o.split(" ")[0]||"";k0e.has(i)&&n.setAttribute(ne,"auto.db.otel.tedious")}))}}}),ok=U0e;l();var Boe=U($oe(),1);var Goe="GenericPool",joe=se(Goe,()=>new Boe.GenericPoolInstrumentation({})),B0e=(()=>{let e;return{name:Goe,setupOnce(){let t=joe();e=C_(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let r=_e(n).description;(r==="generic-pool.aquire"||r==="generic-pool.acquire")&&n.setAttribute(ne,"auto.db.otel.generic_pool")}))}}}),ak=B0e;l();var Joe=U(Zoe(),1);var Xoe="Amqplib",Z0e={consumeEndHook:e=>{ht(e,"auto.amqplib.otel.consumer")},publishHook:e=>{ht(e,"auto.amqplib.otel.publisher")}},Qoe=se(Xoe,()=>new Joe.AmqplibInstrumentation(Z0e)),J0e=(()=>({name:Xoe,setupOnce(){Qoe()}})),mk=J0e;l();l();var Kg="VercelAI";l();var MI=U(Pe(),1);var X0e=[">=3.0.0 <7"],eie=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function Q0e(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function eUe(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(tUe(t.content),nUe(t.content))}function tUe(e){for(let t of e){if(!Q0e(t))continue;let n=dP(t.toolCallId);n?Cn(o=>{o.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),o.setTag("vercel.ai.tool.name",t.toolName),o.setTag("vercel.ai.tool.callId",t.toolCallId),o.setLevel("error"),he(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Cn(o=>{o.setTag("vercel.ai.tool.name",t.toolName),o.setTag("vercel.ai.tool.callId",t.toolCallId),o.setLevel("error"),he(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function nUe(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&pP(t.toolCallId)}function rUe(e,t,n,o){let r=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:o,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:o;return{recordInputs:r,recordOutputs:i}}var xI=class e extends MI.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",ve,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new MI.InstrumentationNodeModuleDefinition("ai",X0e,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(o=>o()),this._callbacks=[];let n=o=>new Proxy(o,{apply:(r,i,s)=>{let a=s[0].experimental_telemetry||{},c=a.isEnabled,u=Q(),d=u?.getIntegrationByName(Kg),p=d?.options,f=d?!!u?.getOptions().sendDefaultPii:!1,{recordInputs:m,recordOutputs:_}=rUe(p,a,c,f);return s[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:m,recordOutputs:_},Uo(()=>Reflect.apply(r,i,s),h=>{h&&typeof h=="object"&&kt(h,"_sentry_active_span",Yn())},()=>{},h=>{eUe(h)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let o of eie)t[o]!=null&&(t[o]=n(t[o]));return t}else{let o=eie.reduce((r,i)=>(t[i]!=null&&(r[i]=n(t[i])),r),{});return{...t,...o}}}};var tie=se(Kg,()=>new xI({}));function oUe(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var iUe=((e={})=>{let t;return{name:Kg,options:e,setupOnce(){t=tie()},afterAllSetup(n){e.force??oUe(n)?gT(n):t?.callWhenPatched(()=>gT(n))}}}),_k=iUe;l();l();var wI=U(Pe(),1);var sUe=[">=4.0.0 <7"],LI=class extends wI.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",ve,t)}init(){return new wI.InstrumentationNodeModuleDefinition("openai",sUe,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let o=t[n];if(!o)return t;let r=this.getConfig(),i=function(...s){if(qc(Sa))return Reflect.construct(o,s);let a=Reflect.construct(o,s);return Jm(a,r)};Object.setPrototypeOf(i,o),Object.setPrototypeOf(i.prototype,o.prototype);for(let s of Object.getOwnPropertyNames(o))if(!["length","name","prototype"].includes(s)){let a=Object.getOwnPropertyDescriptor(o,s);a&&Object.defineProperty(i,s,a)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===o)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}};var nie=se(Sa,e=>new LI(e)),aUe=((e={})=>({name:Sa,setupOnce(){nie(e)}})),gk=aUe;l();l();var kI=U(Pe(),1);var cUe=[">=0.19.2 <1.0.0"],DI=class extends kI.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",ve,t)}init(){return new kI.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",cUe,this._patch.bind(this))}_patch(t){let n=t.Anthropic,o=this.getConfig(),r=function(...i){if(qc(Aa))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return Xm(s,o)};Object.setPrototypeOf(r,n),Object.setPrototypeOf(r.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s)}try{t.Anthropic=r}catch{Object.defineProperty(t,"Anthropic",{value:r,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=r}catch{Object.defineProperty(t,"default",{value:r,writable:!0,configurable:!0,enumerable:!0})}return t}};var rie=se(Aa,e=>new DI(e)),uUe=((e={})=>({name:Aa,options:e,setupOnce(){rie(e)}})),hk=uUe;l();l();var qp=U(Pe(),1);var oie=[">=0.10.0 <2"],UI=class extends qp.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",ve,t)}init(){return new qp.InstrumentationNodeModuleDefinition("@google/genai",oie,n=>this._patch(n),n=>n,[new qp.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",oie,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,o=this.getConfig();if(typeof n!="function")return t;let r=function(...i){if(qc(ya))return Reflect.construct(n,i);let s=Reflect.construct(n,i);return Qm(s,o)};Object.setPrototypeOf(r,n),Object.setPrototypeOf(r.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(r,i,s)}return i_(t,"GoogleGenAI",r),t}};var iie=se(ya,e=>new UI(e)),lUe=((e={})=>({name:ya,setupOnce(){iie(e)}})),Ek=lUe;l();l();var rc=U(Pe(),1);var $I=[">=0.1.0 <2.0.0"];function dUe(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function pUe(e,t,n){return new Proxy(e,{apply(o,r,i){let a=i[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},i[1]=a);let c=a.callbacks,u=dUe(c,t);return a.callbacks=u,Reflect.apply(o,r,i)}})}var BI=class extends rc.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",ve,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let o of n)t.push(new rc.InstrumentationNodeModuleDefinition(o,$I,this._patch.bind(this),r=>r,[new rc.InstrumentationNodeModuleFile(`${o}/dist/index.cjs`,$I,this._patch.bind(this),r=>r)]));return t.push(new rc.InstrumentationNodeModuleDefinition("langchain",$I,this._patch.bind(this),o=>o,[new rc.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",$I,this._patch.bind(this),o=>o)])),t}_patch(t){kv([Sa,Aa,ya]);let n=this.getConfig(),o=Ra(n);return this._patchRunnableMethods(t,o),this._patchEmbeddingsMethods(t,n),t}_patchRunnableMethods(t,n){let o=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],r=t.universal_exports??t,i=Object.values(r).find(c=>typeof c=="function"&&o.includes(c.name));if(!i)return;let s=i.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let a=["invoke","stream","batch"];for(let c of a){let u=s[c];typeof u=="function"&&(s[c]=pUe(u,n))}}_patchEmbeddingsMethods(t,n){let o=t.universal_exports??t;for(let r of Object.values(o)){if(typeof r!="function"||!r.prototype)continue;let i=r.prototype;typeof i.embedQuery!="function"||typeof i.embedDocuments!="function"||i.__sentry_patched__||(i.__sentry_patched__=!0,s_(i,n))}}};var sie=se(hT,e=>new BI(e)),fUe=((e={})=>({name:hT,setupOnce(){sie(e)}})),Tk=fUe;l();l();var Us=U(Pe(),1);var Zg=[">=0.0.0 <2.0.0"],GI=class extends Us.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",ve,t)}init(){return[new Us.InstrumentationNodeModuleDefinition("@langchain/langgraph",Zg,this._patch.bind(this),t=>t,[new Us.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",Zg,this._patch.bind(this),t=>t),new Us.InstrumentationNodeModuleFile("@langchain/langgraph/dist/prebuilt/index.cjs",Zg,this._patch.bind(this),t=>t)]),new Us.InstrumentationNodeModuleDefinition("@langchain/langgraph/prebuilt",Zg,this._patch.bind(this),t=>t,[new Us.InstrumentationNodeModuleFile("@langchain/langgraph/dist/prebuilt/index.cjs",Zg,this._patch.bind(this),t=>t)])]}_patch(t){let n=Q(),o={...this.getConfig(),recordInputs:this.getConfig().recordInputs??n?.getOptions().sendDefaultPii,recordOutputs:this.getConfig().recordOutputs??n?.getOptions().sendDefaultPii};if(t.StateGraph&&typeof t.StateGraph=="function"&&r_(t.StateGraph.prototype,o),t.createReactAgent&&typeof t.createReactAgent=="function"){let r=t.createReactAgent;Object.defineProperty(t,"createReactAgent",{value:EP(r,o),writable:!0,enumerable:!0,configurable:!0})}return t}};var aie=se(TT,e=>new GI(e)),mUe=((e={})=>({name:TT,setupOnce(){aie(e)}})),Sk=mUe;l();l();var _ie=U(Pe(),1);l();var uie=U(require("node:net"),1),$s=U(K(),1),Bs=U(Pe(),1),Ao=U(We(),1);function lie(e,t,n,o,r){let s=()=>{},a=r.firestoreSpanCreationHook;typeof a=="function"&&(s=d=>{(0,Bs.safeExecuteInTheMiddle)(()=>a(d),p=>{p&&$s.diag.error(p?.message)},!0)});let c=new Bs.InstrumentationNodeModuleDefinition("@firebase/firestore",t,d=>cie(d,n,o,e,s)),u=["@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 d of u)c.files.push(new Bs.InstrumentationNodeModuleFile(d,t,p=>cie(p,n,o,e,s),p=>die(p,o)));return c}function cie(e,t,n,o,r){return die(e,n),t(e,"addDoc",_Ue(o,r)),t(e,"getDocs",hUe(o,r)),t(e,"setDoc",EUe(o,r)),t(e,"deleteDoc",gUe(o,r)),e}function die(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Bs.isWrapped)(e[n])&&t(e,n);return e}function _Ue(e,t){return function(o){return function(r,i){let s=VI(e,"addDoc",r);return t(s),jI(s,()=>o(r,i))}}}function gUe(e,t){return function(o){return function(r){let i=VI(e,"deleteDoc",r.parent||r);return t(i),jI(i,()=>o(r))}}}function hUe(e,t){return function(o){return function(r){let i=VI(e,"getDocs",r);return t(i),jI(i,()=>o(r))}}}function EUe(e,t){return function(o){return function(r,i,s){let a=VI(e,"setDoc",r.parent||r);return t(a),jI(a,()=>typeof s<"u"?o(r,i,s):o(r,i))}}}function jI(e,t){return $s.context.with($s.trace.setSpan($s.context.active(),e),()=>(0,Bs.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function VI(e,t,n){let o=e.startSpan(`${t} ${n.path}`,{kind:$s.SpanKind.CLIENT});return SUe(o,n),o.setAttribute(Ao.ATTR_DB_OPERATION_NAME,t),o}function TUe(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let o=e.host.lastIndexOf(":");o!==-1&&(t=e.host.slice(1,o).replace(/^\[|\]$/g,""),n=e.host.slice(o+1))}}else if(uie.isIPv6(e.host))t=e.host;else{let o=e.host.lastIndexOf(":");o!==-1?(t=e.host.slice(0,o),n=e.host.slice(o+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function SUe(e,t){let n=t.firestore.app,o=n.options,i=(t.firestore.toJSON()||{}).settings||{},s={[Ao.ATTR_DB_COLLECTION_NAME]:t.path,[Ao.ATTR_DB_NAMESPACE]:n.name,[Ao.ATTR_DB_SYSTEM_NAME]:"firebase.firestore","firebase.firestore.type":t.type,"firebase.firestore.options.projectId":o.projectId,"firebase.firestore.options.appId":o.appId,"firebase.firestore.options.messagingSenderId":o.messagingSenderId,"firebase.firestore.options.storageBucket":o.storageBucket},{address:a,port:c}=TUe(i);a&&(s[Ao.ATTR_SERVER_ADDRESS]=a),c&&(s[Ao.ATTR_SERVER_PORT]=c),e.setAttributes(s)}l();var Wi=U(K(),1),Gs=U(Pe(),1);function pie(e,t,n,o,r){let i=()=>{},s=()=>{},a=r.functions?.errorHook,c=r.functions?.requestHook,u=r.functions?.responseHook;typeof u=="function"&&(s=(f,m)=>{(0,Gs.safeExecuteInTheMiddle)(()=>u(f,m),_=>{_&&Wi.diag.error(_?.message)},!0)}),typeof c=="function"&&(i=f=>{(0,Gs.safeExecuteInTheMiddle)(()=>c(f),m=>{m&&Wi.diag.error(m?.message)},!0)});let d=new Gs.InstrumentationNodeModuleDefinition("firebase-functions",t);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:f,triggerType:m})=>{d.files.push(new Gs.InstrumentationNodeModuleFile(f,t,_=>AUe(_,n,o,e,{requestHook:i,responseHook:s,errorHook:a},m),_=>fie(_,o)))}),d}function ir(e,t,n){return function(r){return function(...i){let s=typeof i[0]=="function"?i[0]:i[1],a=typeof i[0]=="function"?void 0:i[0];if(!s)return r.call(this,...i);let c=async function(...u){let d=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",p=e.startSpan(`firebase.function.${n}`,{kind:Wi.SpanKind.SERVER}),f={"faas.name":d,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(f["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(f["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),p.setAttributes(f),t?.requestHook?.(p),Wi.context.with(Wi.trace.setSpan(Wi.context.active(),p),async()=>{let m,_;try{_=await s.apply(this,u)}catch(h){m=h}if(t?.responseHook?.(p,m),m&&p.recordException(m),p.end(),m)throw await t?.errorHook?.(p,m),m;return _})};return a?r.call(this,a,c):r.call(this,c)}}}function AUe(e,t,n,o,r,i){switch(fie(e,n),i){case"function":t(e,"onRequest",ir(o,r,"http.request")),t(e,"onCall",ir(o,r,"http.call"));break;case"firestore":t(e,"onDocumentCreated",ir(o,r,"firestore.document.created")),t(e,"onDocumentUpdated",ir(o,r,"firestore.document.updated")),t(e,"onDocumentDeleted",ir(o,r,"firestore.document.deleted")),t(e,"onDocumentWritten",ir(o,r,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",ir(o,r,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",ir(o,r,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",ir(o,r,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",ir(o,r,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",ir(o,r,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",ir(o,r,"storage.object.finalized")),t(e,"onObjectArchived",ir(o,r,"storage.object.archived")),t(e,"onObjectDeleted",ir(o,r,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",ir(o,r,"storage.object.metadataUpdated"));break}return e}function fie(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let o of n)(0,Gs.isWrapped)(e[o])&&t(e,o);return e}var mie={},yUe=[">=3.0.0 <5"],RUe=[">=6.0.0 <7"],FI=class extends _ie.InstrumentationBase{constructor(t=mie){super("@sentry/instrumentation-firebase",ve,t)}setConfig(t={}){super.setConfig({...mie,...t})}init(){let t=[];return t.push(lie(this.tracer,yUe,this._wrap,this._unwrap,this.getConfig())),t.push(pie(this.tracer,RUe,this._wrap,this._unwrap,this.getConfig())),t}};var gie="Firebase",IUe={firestoreSpanCreationHook:e=>{ht(e,"auto.firebase.otel.firestore"),e.setAttribute(oe,"db.query")},functions:{requestHook:e=>{ht(e,"auto.firebase.otel.functions"),e.setAttribute(oe,"http.request")},errorHook:async(e,t)=>{t&&(he(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await wm(2e3))}}},hie=se(gie,()=>new FI(IUe)),bUe=(()=>({name:gie,setupOnce(){hie()}})),Ak=bUe;l();l();function Yp(){return[BL(),Iw(),Pw(),WD(),Uw(),Vw(),zw(),eD(),aD(),fD(),FD(),YD(),JD(),nk(),ok(),ak(),Mw(),mk(),ww(),Tk(),Sk(),_k(),gk(),hk(),Ek(),gD(),Ak()]}l();var Wp=U(K(),1),Eie=U(tL(),1);var yk=1e6;function Rk(e,t={}){e.getOptions().debug&&bL();let[n,o]=NUe(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=o}function NUe(e,t={}){let n=new Eie.BasicTracerProvider({sampler:new Y_(e),resource:IL("node"),forceFlushTimeoutMillis:500,spanProcessors:[new q_({timeout:OUe(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Wp.trace.setGlobalTracerProvider(n),Wp.propagation.setGlobalPropagator(new z_);let o=new iy;return Wp.context.setGlobalContextManager(o),[n,o.getAsyncLocalStorageLookup()]}function OUe(e){if(e!=null){if(e>yk)return Jt&&b.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${yk}`),yk;if(e<=0||Number.isNaN(e)){Jt&&b.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}function Tie(){return Sy().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(Qd(),tp())}function Sie(e){return[...Tie(),..._t(e)?Yp():[]]}function Ik(e={}){return CUe(e,Sie)}function CUe(e={},t){gs(e,"node");let n=UL({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(Rk(n,{spanProcessors:e.openTelemetrySpanProcessors}),Ay()),n}l();var bie=U(require("node:os"),1);l();var WUe="BunServer",KUe=(()=>({name:WUe,setupOnce(){ZUe()}})),Rie=KUe,Aie=!1;function ZUe(){Aie||(Bun.serve=new Proxy(Bun.serve,{apply(e,t,n){yie(n[0]);let o=e.apply(t,n),r=o.reload.bind(o);return o.reload=i=>(yie(i),r(i)),o}}),Aie=!0)}function yie(e){JUe(e),XUe(e)}function JUe(e){typeof e.fetch=="function"&&(e.fetch=new Proxy(e.fetch,{apply(t,n,o){return bk(t,n,o)}}))}function XUe(e){e.routes&&typeof e.routes=="object"&&Object.keys(e.routes).forEach(t=>{let n=e.routes[t];typeof n=="function"&&(e.routes[t]=new Proxy(n,{apply:(o,r,i)=>bk(o,r,i,t)})),!(n instanceof Response)&&typeof n=="object"&&Object.entries(n).forEach(([o,r])=>{typeof r=="function"&&(e.routes[t][o]=new Proxy(r,{apply:(i,s,a)=>bk(i,s,a,t)}))})})}function bk(e,t,n,o){return ia(r=>{let i=n[0],s=i.method.toUpperCase();if(s==="OPTIONS"||s==="HEAD")return e.apply(t,n);let a=Fc(i.url),c=QUe(a,i),u=a?.pathname||"/";i.params&&(Object.keys(i.params).forEach(p=>{c[`url.path.parameter.${p}`]=i.params[p]}),o&&(c[Ge]="route",c["url.template"]=o,u=o)),o?.endsWith("/*")&&(c[Ge]="route",c["url.template"]=o,u=o);let d=Q()?.getOptions().sendDefaultPii??!1;return Object.assign(c,$o(i.headers.toJSON(),d)),r.setSDKProcessingMetadata({normalizedRequest:{url:i.url,method:i.method,headers:i.headers.toJSON(),query_string:a?.search}}),vm({sentryTrace:i.headers.get("sentry-trace")??"",baggage:i.headers.get("baggage")},()=>tn({attributes:c,op:"http.server",name:`${i.method} ${u}`},async p=>{try{let f=await e.apply(t,n);return f?.status&&(fm(p,f.status),r.setContext("response",{status_code:f.status}),p.setAttributes($o(f.headers.toJSON(),d,"response"))),f}catch(f){throw he(f,{mechanism:{type:"auto.http.bun.serve",handled:!1}}),f}}))})}function QUe(e,t){let n={[ne]:"auto.http.bun.serve",[pm]:t.method||"GET",[Ge]:"url"};return e&&(e.search&&(n["url.query"]=e.search),e.hash&&(n["url.fragment"]=e.hash),e.pathname&&(n["url.path"]=e.pathname),xm(e)||(n["url.full"]=e.href,e.port&&(n["url.port"]=e.port),e.protocol&&(n["url.scheme"]=e.protocol),e.hostname&&(n["url.domain"]=e.hostname))),n}l();function Iie(e){function t(n){let o={body:n.body,method:"POST",headers:e.headers};try{return ms(()=>fetch(e.url,o).then(r=>({statusCode:r.status,headers:{"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")}})))}catch(r){return Promise.reject(r)}}return pa(e,t)}function Nie(e){return[Zc(),Kc(),Jc(),Xc(),Du(),Qd(),tp(),Mu(),Lu(),Pu(),vu(),xu(),wu(),Rie(),..._t(e)?Yp():[]]}function Nk(e={}){gs(e,"bun");let t={...e,platform:"javascript",runtime:{name:"bun",version:typeof Bun<"u"?Bun.version:"unknown"},serverName:e.serverName||global.process.env.SENTRY_NAME||bie.hostname()};return t.transport=t.transport||Iie,t.defaultIntegrations===void 0&&(t.defaultIntegrations=Nie(t)),Ik(t)}ns();Ol();try{let e=new Error().stack;if(e){let t=globalThis;t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="9a509e63-fdb8-4670-b66e-a8e6754ef984"}}catch{}qe!=="dev"&&!Dm()&&(Nk({dsn:"https://0282201d6a3df3bc46423e61012ae62b@o275100.ingest.us.sentry.io/4511355222622208",release:qe,sendDefaultPii:!0,tracesSampleRate:1,enableLogs:!0}),F.registerSink({info:(e,t)=>Ma.info(e,t),warn:(e,t)=>Ma.warn(e,t),error:(e,t)=>Ma.error(e,t),captureException:e=>he(e)}));HO();yV();QO();l();var sge=require("node:util");l();Ol();var JHe=`
997
+ lore v${qe} \u2014 context management proxy for AI coding agents
998
+
999
+ Usage:
1000
+ lore [command] [options]
1001
+
1002
+ Commands:
1003
+ run [command...] Start gateway and launch an AI agent (default)
1004
+ start Start the gateway server only
1005
+ upgrade [version] Update lore to the latest (or specified) version
1006
+ Flags: --check, --force, --offline, --channel <ch>
1007
+ help Show this help text
1008
+
1009
+ Options:
1010
+ -p, --port <port> Gateway port (default: 6969, env: LORE_LISTEN_PORT)
1011
+ -H, --host <host> Gateway host (default: 127.0.0.1, env: LORE_LISTEN_HOST)
1012
+ -d, --debug Enable debug logging (env: LORE_DEBUG=1)
1013
+ -v, --version Print version and exit
1014
+ -h, --help Show this help text
1015
+
1016
+ Examples:
1017
+ lore # Auto-detect agent and launch with gateway
1018
+ lore run claude # Launch Claude Code through the gateway
1019
+ lore run opencode # Launch OpenCode through the gateway
1020
+ lore start # Start gateway only (set ANTHROPIC_BASE_URL yourself)
1021
+ lore start -p 8080 # Start gateway on a custom port
1022
+ lore upgrade # Upgrade to latest version
1023
+ lore upgrade --check # Check for updates without installing
1024
+ lore upgrade --force # Force re-download even if up to date
1025
+ lore upgrade nightly # Switch to nightly channel and update
1026
+ lore upgrade stable # Switch back to stable channel
1027
+ lore upgrade 0.14.0 # Install a specific version
1028
+ lore upgrade --offline # Upgrade from cached patches (no network)
1029
+
1030
+ Environment variables:
1031
+ LORE_LISTEN_PORT Gateway port (overridden by --port)
1032
+ LORE_LISTEN_HOST Gateway host (overridden by --host)
1033
+ LORE_UPSTREAM_ANTHROPIC Upstream Anthropic API URL
1034
+ LORE_UPSTREAM_OPENAI Upstream OpenAI API URL
1035
+ LORE_DEBUG Enable debug logging (1 or true)
1036
+ LORE_NO_UPDATE_CHECK Disable background update checks (set to 1)
1037
+ `.trimStart();function tC(){console.log(JHe)}function Kme(){console.log(qe)}rC();l();var Nc=require("node:fs"),j_e=require("node:path");Js();Ol();UV();pC();VV();var Hze=1440*60*1e3,zze=1440*60*1e3,qze=.2,Yze=new Set(["upgrade","--version","-v","--json","help"]),V_e=process.env.FORCE_COLOR!=="0"&&process.env.NO_COLOR===void 0&&(process.stderr.isTTY??!1);function FV(e){return V_e?`\x1B[36m${e}\x1B[39m`:e}function Wze(e){return V_e?`\x1B[2m${e}\x1B[22m`:e}var Kze="version-check.json";function F_e(){return(0,j_e.join)(Zs(),Kze)}function mC(){try{let e=(0,Nc.readFileSync)(F_e(),"utf-8"),t=JSON.parse(e);return{lastChecked:typeof t.lastChecked=="number"?t.lastChecked:null,latestVersion:typeof t.latestVersion=="string"?t.latestVersion:null,lastNotified:typeof t.lastNotified=="number"?t.lastNotified:null}}catch{return{lastChecked:null,latestVersion:null,lastNotified:null}}}function H_e(e){try{let t=Zs();(0,Nc.existsSync)(t)||(0,Nc.mkdirSync)(t,{recursive:!0}),(0,Nc.writeFileSync)(F_e(),JSON.stringify(e),"utf-8")}catch{}}function Zze(e){let t=mC();H_e({...t,lastChecked:Date.now(),latestVersion:e})}function Jze(){let e=mC();H_e({...e,lastNotified:Date.now()})}function Xze(){let{lastChecked:e}=mC();if(e===null)return!0;let t=Date.now()-e,n=(Math.random()-.5)*2*qze,o=Hze*(1+n),r=1-Math.exp(-t/o);return Math.random()<r}var G_e=!1;function Qze(e){return e===null?!0:Date.now()-e>=zze}var IE=null;async function eqe(e,t,n){if(Bun.semver.order(t,qe)===1){try{e==="nightly"?await P_e(t,n):await x_e(t,n)}catch{}try{await E_e()}catch{}}}function tqe(){try{if(!Xze())return}catch{return}IE=new AbortController;let{signal:e}=IE,t=tm();(async()=>{try{let n=t==="nightly"?await jV(e):await GV(e);Zze(n),await eqe(t,n,e)}catch{}finally{IE=null}})()}function nqe(){return!!process.stderr.isTTY}function rqe(){if(!nqe()||G_e)return null;try{let{latestVersion:e,lastNotified:t}=mC();if(!e||Bun.semver.order(e,qe)!==1||!Qze(t))return null;let o=tm()==="nightly"?"New nightly available:":"Update available:";try{Jze()}catch{}return G_e=!0,`
1038
+ ${Wze(o)} ${FV(qe)} -> ${FV(e)} Run ${FV('"lore upgrade"')} to update.
1039
+ `}catch{return null}}function z_e(e){return e.some(t=>Yze.has(t))}function q_e(){return process.env.LORE_NO_UPDATE_CHECK==="1"}function Y_e(){q_e()||tqe()}function W_e(){return q_e()?null:rqe()}function K_e(){IE?.abort(),IE=null}var mqe={port:{type:"string",short:"p"},host:{type:"string",short:"H"},debug:{type:"boolean",short:"d"},version:{type:"boolean",short:"v"},help:{type:"boolean",short:"h"}};function _qe(e){let t=Number.parseInt(e,10);return(Number.isNaN(t)||t<0||t>65535)&&(console.error(`Error: Invalid port "${e}". Must be 0\u201365535.`),process.exit(1)),t}function gqe(e){return{port:e.port?_qe(e.port):void 0,host:e.host??void 0,debug:e.debug??void 0}}async function age(){let e,t;try{let s=(0,sge.parseArgs)({args:process.argv.slice(2),options:mqe,allowPositionals:!0,strict:!1});e=s.values,t=s.positionals}catch(s){console.error(`Error: ${s instanceof Error?s.message:s}`),tC(),process.exit(1)}if(e.version){Kme();return}if(e.help&&t.length===0){tC();return}let n=t[0]??"run",o=t.slice(1),r=gqe(e),i=z_e(t);i||Y_e();try{switch(n){case"start":await RV(r);break;case"run":{let{commandRun:s}=await Promise.resolve().then(()=>(qV(),zV));await s(r,o);break}case"upgrade":{let{commandUpgrade:s}=await Promise.resolve().then(()=>(ige(),oge));await s(o);break}case"help":tC();break;default:{let{commandRun:s}=await Promise.resolve().then(()=>(qV(),zV));await s(r,[n,...o])}break}}finally{K_e()}if(!i){let s=W_e();s&&process.stderr.write(s)}}var Eqe={};typeof Bun<"u"&&Bun.main===Eqe.path&&Promise.resolve().then(()=>(rC(),Zme)).then(({commandStart:e})=>e({}));0&&(module.exports={_cli,handleRequest,loadConfig,resetPipelineState,startServer});
1040
+ //# sourceMappingURL=index.cjs.map
1041
+
1042
+ //# debugId=9a509e63-fdb8-4670-b66e-a8e6754ef984