sentry 0.10.1 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/bin.cjs +4 -4
  2. package/package.json +1 -1
package/dist/bin.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  {let e=process.emit;process.emit=function(n,...a){return n==="warning"?!1:e.apply(this,[n,...a])}}
3
- var xue=Object.create;var Rg=Object.defineProperty;var vue=Object.getOwnPropertyDescriptor;var Mue=Object.getOwnPropertyNames;var Lue=Object.getPrototypeOf,wue=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Mn=(t,e)=>{for(var n in e)Rg(t,n,{get:e[n],enumerable:!0})},L0=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Mue(e))!wue.call(t,o)&&o!==n&&Rg(t,o,{get:()=>e[o],enumerable:!(r=vue(e,o))||r.enumerable});return t};var B=(t,e,n)=>(n=t!=null?xue(Lue(t)):{},L0(e||!t||!t.__esModule?Rg(n,"default",{value:t,enumerable:!0}):n,t)),D=t=>L0(Rg({},"__esModule",{value:!0}),t);var h,u=S(()=>{"use strict";h=require("node:url").pathToFileURL(__filename).href});var Due,l=S(()=>{Due=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};Due.SENTRY_RELEASE={id:"0.10.1"}});var If=y((qze,w0)=>{"use strict";p();u();l();var Uue="2.0.0",kue=Number.MAX_SAFE_INTEGER||9007199254740991,jue=16,Bue=250,Gue=["major","premajor","minor","preminor","patch","prepatch","prerelease"];w0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:jue,MAX_SAFE_BUILD_LENGTH:Bue,MAX_SAFE_INTEGER:kue,RELEASE_TYPES:Gue,SEMVER_SPEC_VERSION:Uue,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nf=y((zze,D0)=>{"use strict";p();u();l();var $ue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};D0.exports=$ue});var bl=y((Is,U0)=>{"use strict";p();u();l();var{MAX_SAFE_COMPONENT_LENGTH:IN,MAX_SAFE_BUILD_LENGTH:Fue,MAX_LENGTH:Hue}=If(),Vue=Nf();Is=U0.exports={};var que=Is.re=[],Yue=Is.safeRe=[],X=Is.src=[],Wue=Is.safeSrc=[],Q=Is.t={},Kue=0,NN="[a-zA-Z0-9-]",zue=[["\\s",1],["\\d",Hue],[NN,Fue]],Xue=t=>{for(let[e,n]of zue)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},Ae=(t,e,n)=>{let r=Xue(e),o=Kue++;Vue(t,o,e),Q[t]=o,X[o]=e,Wue[o]=r,que[o]=new RegExp(e,n?"g":void 0),Yue[o]=new RegExp(r,n?"g":void 0)};Ae("NUMERICIDENTIFIER","0|[1-9]\\d*");Ae("NUMERICIDENTIFIERLOOSE","\\d+");Ae("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${NN}*`);Ae("MAINVERSION",`(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})`);Ae("MAINVERSIONLOOSE",`(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})`);Ae("PRERELEASEIDENTIFIER",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIER]})`);Ae("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIERLOOSE]})`);Ae("PRERELEASE",`(?:-(${X[Q.PRERELEASEIDENTIFIER]}(?:\\.${X[Q.PRERELEASEIDENTIFIER]})*))`);Ae("PRERELEASELOOSE",`(?:-?(${X[Q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Q.PRERELEASEIDENTIFIERLOOSE]})*))`);Ae("BUILDIDENTIFIER",`${NN}+`);Ae("BUILD",`(?:\\+(${X[Q.BUILDIDENTIFIER]}(?:\\.${X[Q.BUILDIDENTIFIER]})*))`);Ae("FULLPLAIN",`v?${X[Q.MAINVERSION]}${X[Q.PRERELEASE]}?${X[Q.BUILD]}?`);Ae("FULL",`^${X[Q.FULLPLAIN]}$`);Ae("LOOSEPLAIN",`[v=\\s]*${X[Q.MAINVERSIONLOOSE]}${X[Q.PRERELEASELOOSE]}?${X[Q.BUILD]}?`);Ae("LOOSE",`^${X[Q.LOOSEPLAIN]}$`);Ae("GTLT","((?:<|>)?=?)");Ae("XRANGEIDENTIFIERLOOSE",`${X[Q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ae("XRANGEIDENTIFIER",`${X[Q.NUMERICIDENTIFIER]}|x|X|\\*`);Ae("XRANGEPLAIN",`[v=\\s]*(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:${X[Q.PRERELEASE]})?${X[Q.BUILD]}?)?)?`);Ae("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:${X[Q.PRERELEASELOOSE]})?${X[Q.BUILD]}?)?)?`);Ae("XRANGE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAIN]}$`);Ae("XRANGELOOSE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAINLOOSE]}$`);Ae("COERCEPLAIN",`(^|[^\\d])(\\d{1,${IN}})(?:\\.(\\d{1,${IN}}))?(?:\\.(\\d{1,${IN}}))?`);Ae("COERCE",`${X[Q.COERCEPLAIN]}(?:$|[^\\d])`);Ae("COERCEFULL",X[Q.COERCEPLAIN]+`(?:${X[Q.PRERELEASE]})?(?:${X[Q.BUILD]})?(?:$|[^\\d])`);Ae("COERCERTL",X[Q.COERCE],!0);Ae("COERCERTLFULL",X[Q.COERCEFULL],!0);Ae("LONETILDE","(?:~>?)");Ae("TILDETRIM",`(\\s*)${X[Q.LONETILDE]}\\s+`,!0);Is.tildeTrimReplace="$1~";Ae("TILDE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAIN]}$`);Ae("TILDELOOSE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAINLOOSE]}$`);Ae("LONECARET","(?:\\^)");Ae("CARETTRIM",`(\\s*)${X[Q.LONECARET]}\\s+`,!0);Is.caretTrimReplace="$1^";Ae("CARET",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAIN]}$`);Ae("CARETLOOSE",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAINLOOSE]}$`);Ae("COMPARATORLOOSE",`^${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]})$|^$`);Ae("COMPARATOR",`^${X[Q.GTLT]}\\s*(${X[Q.FULLPLAIN]})$|^$`);Ae("COMPARATORTRIM",`(\\s*)${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]}|${X[Q.XRANGEPLAIN]})`,!0);Is.comparatorTrimReplace="$1$2$3";Ae("HYPHENRANGE",`^\\s*(${X[Q.XRANGEPLAIN]})\\s+-\\s+(${X[Q.XRANGEPLAIN]})\\s*$`);Ae("HYPHENRANGELOOSE",`^\\s*(${X[Q.XRANGEPLAINLOOSE]})\\s+-\\s+(${X[Q.XRANGEPLAINLOOSE]})\\s*$`);Ae("STAR","(<|>)?=?\\s*\\*");Ae("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ae("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ig=y((n3e,k0)=>{"use strict";p();u();l();var Que=Object.freeze({loose:!0}),Jue=Object.freeze({}),Zue=t=>t?typeof t!="object"?Que:t:Jue;k0.exports=Zue});var bN=y((i3e,G0)=>{"use strict";p();u();l();var j0=/^[0-9]+$/,B0=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=j0.test(t),r=j0.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},ele=(t,e)=>B0(e,t);G0.exports={compareIdentifiers:B0,rcompareIdentifiers:ele}});var Ln=y((l3e,F0)=>{"use strict";p();u();l();var Ng=Nf(),{MAX_LENGTH:$0,MAX_SAFE_INTEGER:bg}=If(),{safeRe:Og,t:Cg}=bl(),tle=Ig(),{compareIdentifiers:ON}=bN(),CN=class t{constructor(e,n){if(n=tle(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$0)throw new TypeError(`version is longer than ${$0} characters`);Ng("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Og[Cg.LOOSE]:Og[Cg.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>bg||this.major<0)throw new TypeError("Invalid major version");if(this.minor>bg||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>bg||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<bg)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ng("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(Ng("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return ON(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(Ng("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return ON(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Og[Cg.PRERELEASELOOSE]:Og[Cg.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),ON(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};F0.exports=CN});var Vc=y((m3e,V0)=>{"use strict";p();u();l();var H0=Ln(),nle=(t,e,n=!1)=>{if(t instanceof H0)return t;try{return new H0(t,e)}catch(r){if(!n)return null;throw r}};V0.exports=nle});var Y0=y((E3e,q0)=>{"use strict";p();u();l();var rle=Vc(),ole=(t,e)=>{let n=rle(t,e);return n?n.version:null};q0.exports=ole});var K0=y((y3e,W0)=>{"use strict";p();u();l();var sle=Vc(),ile=(t,e)=>{let n=sle(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};W0.exports=ile});var Q0=y((b3e,X0)=>{"use strict";p();u();l();var z0=Ln(),ale=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new z0(t instanceof z0?t.version:t,n).inc(e,r,o).version}catch{return null}};X0.exports=ale});var eU=y((x3e,Z0)=>{"use strict";p();u();l();var J0=Vc(),cle=(t,e)=>{let n=J0(t,null,!0),r=J0(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let f=c?"pre":"";return n.major!==r.major?f+"major":n.minor!==r.minor?f+"minor":n.patch!==r.patch?f+"patch":"prerelease"};Z0.exports=cle});var nU=y((w3e,tU)=>{"use strict";p();u();l();var ule=Ln(),lle=(t,e)=>new ule(t,e).major;tU.exports=lle});var oU=y((j3e,rU)=>{"use strict";p();u();l();var ple=Ln(),dle=(t,e)=>new ple(t,e).minor;rU.exports=dle});var iU=y((F3e,sU)=>{"use strict";p();u();l();var fle=Ln(),mle=(t,e)=>new fle(t,e).patch;sU.exports=mle});var cU=y((Y3e,aU)=>{"use strict";p();u();l();var _le=Vc(),hle=(t,e)=>{let n=_le(t,e);return n&&n.prerelease.length?n.prerelease:null};aU.exports=hle});var go=y((X3e,lU)=>{"use strict";p();u();l();var uU=Ln(),gle=(t,e,n)=>new uU(t,n).compare(new uU(e,n));lU.exports=gle});var dU=y((e5e,pU)=>{"use strict";p();u();l();var Ele=go(),Tle=(t,e,n)=>Ele(e,t,n);pU.exports=Tle});var mU=y((o5e,fU)=>{"use strict";p();u();l();var Sle=go(),Ale=(t,e)=>Sle(t,e,!0);fU.exports=Ale});var Pg=y((c5e,hU)=>{"use strict";p();u();l();var _U=Ln(),yle=(t,e,n)=>{let r=new _U(t,n),o=new _U(e,n);return r.compare(o)||r.compareBuild(o)};hU.exports=yle});var EU=y((d5e,gU)=>{"use strict";p();u();l();var Rle=Pg(),Ile=(t,e)=>t.sort((n,r)=>Rle(n,r,e));gU.exports=Ile});var SU=y((h5e,TU)=>{"use strict";p();u();l();var Nle=Pg(),ble=(t,e)=>t.sort((n,r)=>Nle(r,n,e));TU.exports=ble});var bf=y((S5e,AU)=>{"use strict";p();u();l();var Ole=go(),Cle=(t,e,n)=>Ole(t,e,n)>0;AU.exports=Cle});var xg=y((I5e,yU)=>{"use strict";p();u();l();var Ple=go(),xle=(t,e,n)=>Ple(t,e,n)<0;yU.exports=xle});var PN=y((C5e,RU)=>{"use strict";p();u();l();var vle=go(),Mle=(t,e,n)=>vle(t,e,n)===0;RU.exports=Mle});var xN=y((M5e,IU)=>{"use strict";p();u();l();var Lle=go(),wle=(t,e,n)=>Lle(t,e,n)!==0;IU.exports=wle});var vg=y((U5e,NU)=>{"use strict";p();u();l();var Dle=go(),Ule=(t,e,n)=>Dle(t,e,n)>=0;NU.exports=Ule});var Mg=y((G5e,bU)=>{"use strict";p();u();l();var kle=go(),jle=(t,e,n)=>kle(t,e,n)<=0;bU.exports=jle});var vN=y((V5e,OU)=>{"use strict";p();u();l();var Ble=PN(),Gle=xN(),$le=bf(),Fle=vg(),Hle=xg(),Vle=Mg(),qle=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Ble(t,n,r);case"!=":return Gle(t,n,r);case">":return $le(t,n,r);case">=":return Fle(t,n,r);case"<":return Hle(t,n,r);case"<=":return Vle(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};OU.exports=qle});var PU=y((K5e,CU)=>{"use strict";p();u();l();var Yle=Ln(),Wle=Vc(),{safeRe:Lg,t:wg}=bl(),Kle=(t,e)=>{if(t instanceof Yle)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Lg[wg.COERCEFULL]:Lg[wg.COERCE]);else{let c=e.includePrerelease?Lg[wg.COERCERTLFULL]:Lg[wg.COERCERTL],d;for(;(d=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||d.index+d[0].length!==n.index+n[0].length)&&(n=d),c.lastIndex=d.index+d[1].length+d[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Wle(`${r}.${o}.${s}${i}${a}`,e)};CU.exports=Kle});var vU=y((J5e,xU)=>{"use strict";p();u();l();var MN=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};xU.exports=MN});var Eo=y((n9e,DU)=>{"use strict";p();u();l();var zle=/\s+/g,LN=class t{constructor(e,n){if(n=Qle(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof wN)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(zle," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!LU(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&ope(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&npe)|(this.options.loose&&rpe))+":"+e,o=MU.get(r);if(o)return o;let s=this.options.loose,i=s?Zn[wn.HYPHENRANGELOOSE]:Zn[wn.HYPHENRANGE];e=e.replace(i,mpe(this.options.includePrerelease)),rt("hyphen replace",e),e=e.replace(Zn[wn.COMPARATORTRIM],Zle),rt("comparator trim",e),e=e.replace(Zn[wn.TILDETRIM],epe),rt("tilde trim",e),e=e.replace(Zn[wn.CARETTRIM],tpe),rt("caret trim",e);let a=e.split(" ").map(m=>spe(m,this.options)).join(" ").split(/\s+/).map(m=>fpe(m,this.options));s&&(a=a.filter(m=>(rt("loose invalid filter",m,this.options),!!m.match(Zn[wn.COMPARATORLOOSE])))),rt("range list",a);let c=new Map,d=a.map(m=>new wN(m,this.options));for(let m of d){if(LU(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return MU.set(r,f),f}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>wU(r,n)&&e.set.some(o=>wU(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Jle(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_pe(this.set[n],e,this.options))return!0;return!1}};DU.exports=LN;var Xle=vU(),MU=new Xle,Qle=Ig(),wN=Of(),rt=Nf(),Jle=Ln(),{safeRe:Zn,t:wn,comparatorTrimReplace:Zle,tildeTrimReplace:epe,caretTrimReplace:tpe}=bl(),{FLAG_INCLUDE_PRERELEASE:npe,FLAG_LOOSE:rpe}=If(),LU=t=>t.value==="<0.0.0-0",ope=t=>t.value==="",wU=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},spe=(t,e)=>(t=t.replace(Zn[wn.BUILD],""),rt("comp",t,e),t=cpe(t,e),rt("caret",t),t=ipe(t,e),rt("tildes",t),t=lpe(t,e),rt("xrange",t),t=dpe(t,e),rt("stars",t),t),er=t=>!t||t.toLowerCase()==="x"||t==="*",ipe=(t,e)=>t.trim().split(/\s+/).map(n=>ape(n,e)).join(" "),ape=(t,e)=>{let n=e.loose?Zn[wn.TILDELOOSE]:Zn[wn.TILDE];return t.replace(n,(r,o,s,i,a)=>{rt("tilde",t,r,o,s,i,a);let c;return er(o)?c="":er(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:er(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(rt("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,rt("tilde return",c),c})},cpe=(t,e)=>t.trim().split(/\s+/).map(n=>upe(n,e)).join(" "),upe=(t,e)=>{rt("caret",t,e);let n=e.loose?Zn[wn.CARETLOOSE]:Zn[wn.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{rt("caret",t,o,s,i,a,c);let d;return er(s)?d="":er(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:er(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(rt("replaceCaret pr",c),s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(rt("no pr"),s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),rt("caret return",d),d})},lpe=(t,e)=>(rt("replaceXRanges",t,e),t.split(/\s+/).map(n=>ppe(n,e)).join(" ")),ppe=(t,e)=>{t=t.trim();let n=e.loose?Zn[wn.XRANGELOOSE]:Zn[wn.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{rt("xRange",t,r,o,s,i,a,c);let d=er(s),f=d||er(i),m=f||er(a),_=m;return o==="="&&_&&(o=""),c=e.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),rt("xRange return",r),r})},dpe=(t,e)=>(rt("replaceStars",t,e),t.trim().replace(Zn[wn.STAR],"")),fpe=(t,e)=>(rt("replaceGTE0",t,e),t.trim().replace(Zn[e.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),mpe=t=>(e,n,r,o,s,i,a,c,d,f,m,_)=>(er(r)?n="":er(o)?n=`>=${r}.0.0${t?"-0":""}`:er(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,er(d)?c="":er(f)?c=`<${+d+1}.0.0-0`:er(m)?c=`<${d}.${+f+1}.0-0`:_?c=`<=${d}.${f}.${m}-${_}`:t?c=`<${d}.${f}.${+m+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),_pe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(rt(t[r].semver),t[r].semver!==wN.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var Of=y((i9e,$U)=>{"use strict";p();u();l();var Cf=Symbol("SemVer ANY"),kN=class t{static get ANY(){return Cf}constructor(e,n){if(n=UU(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),UN("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Cf?this.value="":this.value=this.operator+this.semver.version,UN("comp",this)}parse(e){let n=this.options.loose?kU[jU.COMPARATORLOOSE]:kU[jU.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new BU(r[2],this.options.loose):this.semver=Cf}toString(){return this.value}test(e){if(UN("Comparator.test",e,this.options.loose),this.semver===Cf||e===Cf)return!0;if(typeof e=="string")try{e=new BU(e,this.options)}catch{return!1}return DN(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new GU(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new GU(this.value,n).test(e.semver):(n=UU(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||DN(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||DN(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};$U.exports=kN;var UU=Ig(),{safeRe:kU,t:jU}=bl(),DN=vN(),UN=Nf(),BU=Ln(),GU=Eo()});var Pf=y((l9e,FU)=>{"use strict";p();u();l();var hpe=Eo(),gpe=(t,e,n)=>{try{e=new hpe(e,n)}catch{return!1}return e.test(t)};FU.exports=gpe});var VU=y((m9e,HU)=>{"use strict";p();u();l();var Epe=Eo(),Tpe=(t,e)=>new Epe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));HU.exports=Tpe});var YU=y((E9e,qU)=>{"use strict";p();u();l();var Spe=Ln(),Ape=Eo(),ype=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Ape(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new Spe(r,n))}),r};qU.exports=ype});var KU=y((y9e,WU)=>{"use strict";p();u();l();var Rpe=Ln(),Ipe=Eo(),Npe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Ipe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new Rpe(r,n))}),r};WU.exports=Npe});var QU=y((b9e,XU)=>{"use strict";p();u();l();var jN=Ln(),bpe=Eo(),zU=bf(),Ope=(t,e)=>{t=new bpe(t,e);let n=new jN("0.0.0");if(t.test(n)||(n=new jN("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new jN(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||zU(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||zU(n,s))&&(n=s)}return n&&t.test(n)?n:null};XU.exports=Ope});var ZU=y((x9e,JU)=>{"use strict";p();u();l();var Cpe=Eo(),Ppe=(t,e)=>{try{return new Cpe(t,e).range||"*"}catch{return null}};JU.exports=Ppe});var Dg=y((w9e,rk)=>{"use strict";p();u();l();var xpe=Ln(),nk=Of(),{ANY:vpe}=nk,Mpe=Eo(),Lpe=Pf(),ek=bf(),tk=xg(),wpe=Mg(),Dpe=vg(),Upe=(t,e,n,r)=>{t=new xpe(t,r),e=new Mpe(e,r);let o,s,i,a,c;switch(n){case">":o=ek,s=wpe,i=tk,a=">",c=">=";break;case"<":o=tk,s=Dpe,i=ek,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Lpe(t,e,r))return!1;for(let d=0;d<e.set.length;++d){let f=e.set[d],m=null,_=null;if(f.forEach(g=>{g.semver===vpe&&(g=new nk(">=0.0.0")),m=m||g,_=_||g,o(g.semver,m.semver,r)?m=g:i(g.semver,_.semver,r)&&(_=g)}),m.operator===a||m.operator===c||(!_.operator||_.operator===a)&&s(t,_.semver))return!1;if(_.operator===c&&i(t,_.semver))return!1}return!0};rk.exports=Upe});var sk=y((j9e,ok)=>{"use strict";p();u();l();var kpe=Dg(),jpe=(t,e,n)=>kpe(t,e,">",n);ok.exports=jpe});var ak=y((F9e,ik)=>{"use strict";p();u();l();var Bpe=Dg(),Gpe=(t,e,n)=>Bpe(t,e,"<",n);ik.exports=Gpe});var lk=y((Y9e,uk)=>{"use strict";p();u();l();var ck=Eo(),$pe=(t,e,n)=>(t=new ck(t,n),e=new ck(e,n),t.intersects(e,n));uk.exports=$pe});var dk=y((X9e,pk)=>{"use strict";p();u();l();var Fpe=Pf(),Hpe=go();pk.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((f,m)=>Hpe(f,m,n));for(let f of i)Fpe(f,e,n)?(s=f,o||(o=f)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[f,m]of r)f===m?a.push(f):!m&&f===i[0]?a.push("*"):m?f===i[0]?a.push(`<=${m}`):a.push(`${f} - ${m}`):a.push(`>=${f}`);let c=a.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return c.length<d.length?c:e}});var Ek=y((e6e,gk)=>{"use strict";p();u();l();var fk=Eo(),GN=Of(),{ANY:BN}=GN,xf=Pf(),$N=go(),Vpe=(t,e,n={})=>{if(t===e)return!0;t=new fk(t,n),e=new fk(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=Ype(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},qpe=[new GN(">=0.0.0-0")],mk=[new GN(">=0.0.0")],Ype=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===BN){if(e.length===1&&e[0].semver===BN)return!0;n.includePrerelease?t=qpe:t=mk}if(e.length===1&&e[0].semver===BN){if(n.includePrerelease)return!0;e=mk}let r=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=_k(o,g,n):g.operator==="<"||g.operator==="<="?s=hk(s,g,n):r.add(g.semver);if(r.size>1)return null;let i;if(o&&s){if(i=$N(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of r){if(o&&!xf(g,String(o),n)||s&&!xf(g,String(s),n))return null;for(let T of e)if(!xf(g,String(T),n))return!1;return!0}let a,c,d,f,m=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;m&&m.prerelease.length===1&&s.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(_&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===_.major&&g.semver.minor===_.minor&&g.semver.patch===_.patch&&(_=!1),g.operator===">"||g.operator===">="){if(a=_k(o,g,n),a===g&&a!==o)return!1}else if(o.operator===">="&&!xf(o.semver,String(g),n))return!1}if(s){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator==="<"||g.operator==="<="){if(c=hk(s,g,n),c===g&&c!==s)return!1}else if(s.operator==="<="&&!xf(s.semver,String(g),n))return!1}if(!g.operator&&(s||o)&&i!==0)return!1}return!(o&&d&&!s&&i!==0||s&&f&&!o&&i!==0||_||m)},_k=(t,e,n)=>{if(!t)return e;let r=$N(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},hk=(t,e,n)=>{if(!t)return e;let r=$N(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};gk.exports=Vpe});var yk=y((o6e,Ak)=>{"use strict";p();u();l();var FN=bl(),Tk=If(),Wpe=Ln(),Sk=bN(),Kpe=Vc(),zpe=Y0(),Xpe=K0(),Qpe=Q0(),Jpe=eU(),Zpe=nU(),ede=oU(),tde=iU(),nde=cU(),rde=go(),ode=dU(),sde=mU(),ide=Pg(),ade=EU(),cde=SU(),ude=bf(),lde=xg(),pde=PN(),dde=xN(),fde=vg(),mde=Mg(),_de=vN(),hde=PU(),gde=Of(),Ede=Eo(),Tde=Pf(),Sde=VU(),Ade=YU(),yde=KU(),Rde=QU(),Ide=ZU(),Nde=Dg(),bde=sk(),Ode=ak(),Cde=lk(),Pde=dk(),xde=Ek();Ak.exports={parse:Kpe,valid:zpe,clean:Xpe,inc:Qpe,diff:Jpe,major:Zpe,minor:ede,patch:tde,prerelease:nde,compare:rde,rcompare:ode,compareLoose:sde,compareBuild:ide,sort:ade,rsort:cde,gt:ude,lt:lde,eq:pde,neq:dde,gte:fde,lte:mde,cmp:_de,coerce:hde,Comparator:gde,Range:Ede,satisfies:Tde,toComparators:Sde,maxSatisfying:Ade,minSatisfying:yde,minVersion:Rde,validRange:Ide,outside:Nde,gtr:bde,ltr:Ode,intersects:Cde,simplifyRange:Pde,subset:xde,SemVer:Wpe,re:FN.re,src:FN.src,tokens:FN.t,SEMVER_SPEC_VERSION:Tk.SEMVER_SPEC_VERSION,RELEASE_TYPES:Tk.RELEASE_TYPES,compareIdentifiers:Sk.compareIdentifiers,rcompareIdentifiers:Sk.rcompareIdentifiers}});function Mde(t){let e=(0,tr.normalize)(t);return e.length>1&&e[e.length-1]===tr.sep&&(e=e.substring(0,e.length-1)),e}function bk(t,e){return t.replace(Lde,e)}function Dde(t){return t==="/"||wde.test(t)}function HN(t,e){let{resolvePaths:n,normalizePath:r,pathSeparator:o}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=(0,tr.resolve)(t)),(r||s)&&(t=Mde(t)),t===".")return"";let i=t[t.length-1]!==o;return bk(i?t+o:t,o)}function Ok(t,e){return e+t}function Ude(t,e){return function(n,r){return r.startsWith(t)?r.slice(t.length)+n:bk((0,tr.relative)(t,r),e.pathSeparator)+e.pathSeparator+n}}function kde(t){return t}function jde(t,e,n){return e+t+n}function Bde(t,e){let{relativePaths:n,includeBasePath:r}=e;return n&&t?Ude(t,e):r?Ok:kde}function Gde(t){return function(e,n){n.push(e.substring(t.length)||".")}}function $de(t){return function(e,n,r){let o=e.substring(t.length)||".";r.every(s=>s(o,!0))&&n.push(o)}}function qde(t,e){let{includeDirs:n,filters:r,relativePaths:o}=e;return n?o?r&&r.length?$de(t):Gde(t):r&&r.length?Hde:Fde:Vde}function Qde(t){let{excludeFiles:e,filters:n,onlyCounts:r}=t;return e?Xde:n&&n.length?r?Yde:Wde:r?Kde:zde}function efe(t){return t.group?Zde:Jde}function rfe(t){return t.group?tfe:nfe}function ife(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?sfe:ofe}function Ck(t,e,n){if(n.options.useRealPaths)return afe(e,n);let r=(0,tr.dirname)(t),o=1;for(;r!==n.root&&o<2;){let s=n.symlinks.get(r);!!s&&(s===e||s.startsWith(e)||e.startsWith(s))?o++:r=(0,tr.dirname)(r)}return n.symlinks.set(t,e),o>1}function afe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Ug(t,e,n,r){e(t&&!r?t:null,n)}function hfe(t,e){let{onlyCounts:n,group:r,maxFiles:o}=t;return n?e?cfe:dfe:r?e?ufe:_fe:o?e?pfe:mfe:e?lfe:ffe}function Tfe(t){return t?Efe:gfe}function Rfe(t,e){return new Promise((n,r)=>{vk(t,e,(o,s)=>{if(o)return r(o);n(s)})})}function vk(t,e,n){new xk(t,e,n).start()}function Ife(t,e){return new xk(t,e).start()}var Nk,tr,vde,Rk,Lde,wde,Fde,Hde,Vde,Yde,Wde,Kde,zde,Xde,Jde,Zde,tfe,nfe,ofe,sfe,cfe,ufe,lfe,pfe,dfe,ffe,mfe,_fe,Pk,gfe,Efe,Sfe,Afe,yfe,xk,Ik,Mk,Lk,wk=S(()=>{p();u();l();Nk=require("module"),tr=require("path"),vde=B(require("fs"),1),Rk=(0,Nk.createRequire)(h);Lde=/[\\/]/g;wde=/^[a-z]:[\\/]$/i;Fde=(t,e)=>{e.push(t||".")},Hde=(t,e,n)=>{let r=t||".";n.every(o=>o(r,!0))&&e.push(r)},Vde=()=>{};Yde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&n.files++},Wde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&e.push(t)},Kde=(t,e,n,r)=>{n.files++},zde=(t,e)=>{e.push(t)},Xde=()=>{};Jde=t=>t,Zde=()=>[""].slice(0,0);tfe=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},nfe=()=>{};ofe=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue(),o.realpath(t,(i,a)=>{if(i)return r.dequeue(s?null:i,e);o.stat(a,(c,d)=>{if(c)return r.dequeue(s?null:c,e);if(d.isDirectory()&&Ck(t,a,e))return r.dequeue(null,e);n(d,a),r.dequeue(null,e)})})},sfe=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue();try{let i=o.realpathSync(t),a=o.statSync(i);if(a.isDirectory()&&Ck(t,i,e))return;n(a,i)}catch(i){if(!s)throw i}};cfe=t=>t.counts,ufe=t=>t.groups,lfe=t=>t.paths,pfe=t=>t.paths.slice(0,t.options.maxFiles),dfe=(t,e,n)=>(Ug(e,n,t.counts,t.options.suppressErrors),null),ffe=(t,e,n)=>(Ug(e,n,t.paths,t.options.suppressErrors),null),mfe=(t,e,n)=>(Ug(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),_fe=(t,e,n)=>(Ug(e,n,t.groups,t.options.suppressErrors),null);Pk={withFileTypes:!0},gfe=(t,e,n,r,o)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",Pk,(i,a=[])=>{o(a,n,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Efe=(t,e,n,r,o)=>{let{fs:s}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",Pk)}catch(a){if(!t.options.suppressErrors)throw a}o(i,n,r)};Sfe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},Afe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},yfe=class{aborted=!1;abort(){this.aborted=!0}},xk=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=hfe(e,this.isSynchronous),this.root=HN(t,e),this.state={root:Dde(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Afe,options:e,queue:new Sfe((r,o)=>this.callbackInvoker(o,r,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new yfe,fs:e.fs||vde},this.joinPath=Bde(this.root,e),this.pushDirectory=qde(this.root,e),this.pushFile=Qde(e),this.getArray=efe(e),this.groupFiles=rfe(e),this.resolveSymlink=ife(e,this.isSynchronous),this.walkDirectory=Tfe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{let{paths:r,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:a,maxFiles:c,signal:d,useRealPaths:f,pathSeparator:m},controller:_}=this.state;if(_.aborted||d&&d.aborted||c&&r.length>c)return;let g=this.getArray(this.state.paths);for(let T=0;T<t.length;++T){let A=t[T];if(A.isFile()||A.isSymbolicLink()&&!s&&!i){let R=this.joinPath(A.name,e);this.pushFile(R,g,this.state.counts,o)}else if(A.isDirectory()){let R=jde(A.name,e,this.state.options.pathSeparator);if(a&&a(A.name,R))continue;this.pushDirectory(R,r,o),this.walkDirectory(this.state,R,R,n-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let R=Ok(A.name,e);this.resolveSymlink(R,this.state,(b,I)=>{if(b.isDirectory()){if(I=HN(I,this.state.options),a&&a(A.name,f?I:R+m))return;this.walkDirectory(this.state,I,f?I:R+m,n-1,this.walk)}else{I=f?I:R;let C=(0,tr.basename)(I),O=HN((0,tr.dirname)(I),this.state.options);I=this.joinPath(C,O),this.pushFile(I,g,this.state.counts,o)}})}}this.groupFiles(this.state.groups,e,g)}};Ik=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return Rfe(this.root,this.options)}withCallback(t){vk(this.root,this.options,t)}sync(){return Ife(this.root,this.options)}},Mk=null;try{Rk.resolve("picomatch"),Mk=Rk("picomatch")}catch{}Lk=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:tr.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ik(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ik(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let n=this.globFunction||Mk;if(!n)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=n(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(o=>r(o)),this}}});var vf=y((E6e,Bk)=>{"use strict";p();u();l();var Dk="[^\\\\/]",Nfe="(?=.)",Uk="[^/]",VN="(?:\\/|$)",kk="(?:^|\\/)",qN=`\\.{1,2}${VN}`,bfe="(?!\\.)",Ofe=`(?!${kk}${qN})`,Cfe=`(?!\\.{0,1}${VN})`,Pfe=`(?!${qN})`,xfe="[^.\\/]",vfe=`${Uk}*?`,Mfe="/",jk={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:Nfe,QMARK:Uk,END_ANCHOR:VN,DOTS_SLASH:qN,NO_DOT:bfe,NO_DOTS:Ofe,NO_DOT_SLASH:Cfe,NO_DOTS_SLASH:Pfe,QMARK_NO_DOT:xfe,STAR:vfe,START_ANCHOR:kk,SEP:Mfe},Lfe={...jk,SLASH_LITERAL:"[\\\\/]",QMARK:Dk,STAR:`${Dk}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},wfe={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Bk.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wfe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Lfe:jk}}});var Mf=y(Nr=>{"use strict";p();u();l();var{REGEX_BACKSLASH:Dfe,REGEX_REMOVE_BACKSLASH:Ufe,REGEX_SPECIAL_CHARS:kfe,REGEX_SPECIAL_CHARS_GLOBAL:jfe}=vf();Nr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Nr.hasRegexChars=t=>kfe.test(t);Nr.isRegexChar=t=>t.length===1&&Nr.hasRegexChars(t);Nr.escapeRegex=t=>t.replace(jfe,"\\$1");Nr.toPosixSlashes=t=>t.replace(Dfe,"/");Nr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Nr.removeBackslashes=t=>t.replace(Ufe,e=>e==="\\"?"":e);Nr.escapeLast=(t,e,n)=>{let r=t.lastIndexOf(e,n);return r===-1?t:t[r-1]==="\\"?Nr.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Nr.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n};Nr.wrapOutput=(t,e={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",s=`${r}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Nr.basename=(t,{windows:e}={})=>{let n=t.split(e?/[\\/]/:"/"),r=n[n.length-1];return r===""?n[n.length-2]:r}});var Wk=y((b6e,Yk)=>{"use strict";p();u();l();var Gk=Mf(),{CHAR_ASTERISK:YN,CHAR_AT:Bfe,CHAR_BACKWARD_SLASH:Lf,CHAR_COMMA:Gfe,CHAR_DOT:WN,CHAR_EXCLAMATION_MARK:KN,CHAR_FORWARD_SLASH:qk,CHAR_LEFT_CURLY_BRACE:zN,CHAR_LEFT_PARENTHESES:XN,CHAR_LEFT_SQUARE_BRACKET:$fe,CHAR_PLUS:Ffe,CHAR_QUESTION_MARK:$k,CHAR_RIGHT_CURLY_BRACE:Hfe,CHAR_RIGHT_PARENTHESES:Fk,CHAR_RIGHT_SQUARE_BRACKET:Vfe}=vf(),Hk=t=>t===qk||t===Lf,Vk=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qfe=(t,e)=>{let n=e||{},r=t.length-1,o=n.parts===!0||n.scanToEnd===!0,s=[],i=[],a=[],c=t,d=-1,f=0,m=0,_=!1,g=!1,T=!1,A=!1,R=!1,b=!1,I=!1,C=!1,O=!1,k=!1,L=0,K,j,ee={value:"",depth:0,isGlob:!1},P=()=>d>=r,Tt=()=>c.charCodeAt(d+1),ze=()=>(K=j,c.charCodeAt(++d));for(;d<r;){j=ze();let je;if(j===Lf){I=ee.backslashes=!0,j=ze(),j===zN&&(b=!0);continue}if(b===!0||j===zN){for(L++;P()!==!0&&(j=ze());){if(j===Lf){I=ee.backslashes=!0,ze();continue}if(j===zN){L++;continue}if(b!==!0&&j===WN&&(j=ze())===WN){if(_=ee.isBrace=!0,T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(b!==!0&&j===Gfe){if(_=ee.isBrace=!0,T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===Hfe&&(L--,L===0)){b=!1,_=ee.isBrace=!0,k=!0;break}}if(o===!0)continue;break}if(j===qk){if(s.push(d),i.push(ee),ee={value:"",depth:0,isGlob:!1},k===!0)continue;if(K===WN&&d===f+1){f+=2;continue}m=d+1;continue}if(n.noext!==!0&&(j===Ffe||j===Bfe||j===YN||j===$k||j===KN)===!0&&Tt()===XN){if(T=ee.isGlob=!0,A=ee.isExtglob=!0,k=!0,j===KN&&d===f&&(O=!0),o===!0){for(;P()!==!0&&(j=ze());){if(j===Lf){I=ee.backslashes=!0,j=ze();continue}if(j===Fk){T=ee.isGlob=!0,k=!0;break}}continue}break}if(j===YN){if(K===YN&&(R=ee.isGlobstar=!0),T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===$k){if(T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===$fe){for(;P()!==!0&&(je=ze());){if(je===Lf){I=ee.backslashes=!0,ze();continue}if(je===Vfe){g=ee.isBracket=!0,T=ee.isGlob=!0,k=!0;break}}if(o===!0)continue;break}if(n.nonegate!==!0&&j===KN&&d===f){C=ee.negated=!0,f++;continue}if(n.noparen!==!0&&j===XN){if(T=ee.isGlob=!0,o===!0){for(;P()!==!0&&(j=ze());){if(j===XN){I=ee.backslashes=!0,j=ze();continue}if(j===Fk){k=!0;break}}continue}break}if(T===!0){if(k=!0,o===!0)continue;break}}n.noext===!0&&(A=!1,T=!1);let Ce=c,x="",v="";f>0&&(x=c.slice(0,f),c=c.slice(f),m-=f),Ce&&T===!0&&m>0?(Ce=c.slice(0,m),v=c.slice(m)):T===!0?(Ce="",v=c):Ce=c,Ce&&Ce!==""&&Ce!=="/"&&Ce!==c&&Hk(Ce.charCodeAt(Ce.length-1))&&(Ce=Ce.slice(0,-1)),n.unescape===!0&&(v&&(v=Gk.removeBackslashes(v)),Ce&&I===!0&&(Ce=Gk.removeBackslashes(Ce)));let Qn={prefix:x,input:t,start:f,base:Ce,glob:v,isBrace:_,isBracket:g,isGlob:T,isExtglob:A,isGlobstar:R,negated:C,negatedExtglob:O};if(n.tokens===!0&&(Qn.maxDepth=0,Hk(j)||i.push(ee),Qn.tokens=i),n.parts===!0||n.tokens===!0){let je;for(let Je=0;Je<s.length;Je++){let _o=je?je+1:f,ho=s[Je],la=t.slice(_o,ho);n.tokens&&(Je===0&&f!==0?(i[Je].isPrefix=!0,i[Je].value=x):i[Je].value=la,Vk(i[Je]),Qn.maxDepth+=i[Je].depth),(Je!==0||la!=="")&&a.push(la),je=ho}if(je&&je+1<t.length){let Je=t.slice(je+1);a.push(Je),n.tokens&&(i[i.length-1].value=Je,Vk(i[i.length-1]),Qn.maxDepth+=i[i.length-1].depth)}Qn.slashes=s,Qn.parts=a}return Qn};Yk.exports=qfe});var Xk=y((x6e,zk)=>{"use strict";p();u();l();var kg=vf(),Ns=Mf(),{MAX_LENGTH:jg,POSIX_REGEX_SOURCE:Yfe,REGEX_NON_SPECIAL_CHARS:Wfe,REGEX_SPECIAL_CHARS_BACKREF:Kfe,REPLACEMENTS:Kk}=kg,zfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let n=`[${t.join("-")}]`;try{new RegExp(n)}catch{return t.map(o=>Ns.escapeRegex(o)).join("..")}return n},Ol=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,QN=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Kk[t]||t;let n={...e},r=typeof n.maxLength=="number"?Math.min(jg,n.maxLength):jg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);let s={type:"bos",value:"",output:n.prepend||""},i=[s],a=n.capture?"":"?:",c=kg.globChars(n.windows),d=kg.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:_,ONE_CHAR:g,DOTS_SLASH:T,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:b,QMARK:I,QMARK_NO_DOT:C,STAR:O,START_ANCHOR:k}=c,L=z=>`(${a}(?:(?!${k}${z.dot?T:f}).)*?)`,K=n.dot?"":A,j=n.dot?I:C,ee=n.bash===!0?L(n):O;n.capture&&(ee=`(${ee})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);let P={input:t,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Ns.removePrefix(t,P),o=t.length;let Tt=[],ze=[],Ce=[],x=s,v,Qn=()=>P.index===o-1,je=P.peek=(z=1)=>t[P.index+z],Je=P.advance=()=>t[++P.index]||"",_o=()=>t.slice(P.index+1),ho=(z="",nt=0)=>{P.consumed+=z,P.index+=nt},la=z=>{P.output+=z.output!=null?z.output:z.value,ho(z.value)},Cue=()=>{let z=1;for(;je()==="!"&&(je(2)!=="("||je(3)==="?");)Je(),P.start++,z++;return z%2===0?!1:(P.negated=!0,P.start++,!0)},Sg=z=>{P[z]++,Ce.push(z)},Hc=z=>{P[z]--,Ce.pop()},Me=z=>{if(x.type==="globstar"){let nt=P.braces>0&&(z.type==="comma"||z.type==="brace"),$=z.extglob===!0||Tt.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!nt&&!$&&(P.output=P.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=ee,P.output+=x.output)}if(Tt.length&&z.type!=="paren"&&(Tt[Tt.length-1].inner+=z.value),(z.value||z.output)&&la(z),x&&x.type==="text"&&z.type==="text"){x.output=(x.output||x.value)+z.value,x.value+=z.value;return}z.prev=x,i.push(z),x=z},Ag=(z,nt)=>{let $={...d[nt],conditions:1,inner:""};$.prev=x,$.parens=P.parens,$.output=P.output;let xe=(n.capture?"(":"")+$.open;Sg("parens"),Me({type:z,value:nt,output:P.output?"":g}),Me({type:"paren",extglob:!0,value:Je(),output:xe}),Tt.push($)},Pue=z=>{let nt=z.close+(n.capture?")":""),$;if(z.type==="negate"){let xe=ee;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(xe=L(n)),(xe!==ee||Qn()||/^\)+$/.test(_o()))&&(nt=z.close=`)$))${xe}`),z.inner.includes("*")&&($=_o())&&/^\.[^\\/.]+$/.test($)){let dt=QN($,{...e,fastpaths:!1}).output;nt=z.close=`)${dt})${xe})`}z.prev.type==="bos"&&(P.negatedExtglob=!0)}Me({type:"paren",extglob:!0,value:v,output:nt}),Hc("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,nt=t.replace(Kfe,($,xe,dt,Jn,Zt,RN)=>Jn==="\\"?(z=!0,$):Jn==="?"?xe?xe+Jn+(Zt?I.repeat(Zt.length):""):RN===0?j+(Zt?I.repeat(Zt.length):""):I.repeat(dt.length):Jn==="."?f.repeat(dt.length):Jn==="*"?xe?xe+Jn+(Zt?ee:""):ee:xe?$:`\\${$}`);return z===!0&&(n.unescape===!0?nt=nt.replace(/\\/g,""):nt=nt.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),nt===t&&n.contains===!0?(P.output=t,P):(P.output=Ns.wrapOutput(nt,P,e),P)}for(;!Qn();){if(v=Je(),v==="\0")continue;if(v==="\\"){let $=je();if($==="/"&&n.bash!==!0||$==="."||$===";")continue;if(!$){v+="\\",Me({type:"text",value:v});continue}let xe=/^\\+/.exec(_o()),dt=0;if(xe&&xe[0].length>2&&(dt=xe[0].length,P.index+=dt,dt%2!==0&&(v+="\\")),n.unescape===!0?v=Je():v+=Je(),P.brackets===0){Me({type:"text",value:v});continue}}if(P.brackets>0&&(v!=="]"||x.value==="["||x.value==="[^")){if(n.posix!==!1&&v===":"){let $=x.value.slice(1);if($.includes("[")&&(x.posix=!0,$.includes(":"))){let xe=x.value.lastIndexOf("["),dt=x.value.slice(0,xe),Jn=x.value.slice(xe+2),Zt=Yfe[Jn];if(Zt){x.value=dt+Zt,P.backtrack=!0,Je(),!s.output&&i.indexOf(x)===1&&(s.output=g);continue}}}(v==="["&&je()!==":"||v==="-"&&je()==="]")&&(v=`\\${v}`),v==="]"&&(x.value==="["||x.value==="[^")&&(v=`\\${v}`),n.posix===!0&&v==="!"&&x.value==="["&&(v="^"),x.value+=v,la({value:v});continue}if(P.quotes===1&&v!=='"'){v=Ns.escapeRegex(v),x.value+=v,la({value:v});continue}if(v==='"'){P.quotes=P.quotes===1?0:1,n.keepQuotes===!0&&Me({type:"text",value:v});continue}if(v==="("){Sg("parens"),Me({type:"paren",value:v});continue}if(v===")"){if(P.parens===0&&n.strictBrackets===!0)throw new SyntaxError(Ol("opening","("));let $=Tt[Tt.length-1];if($&&P.parens===$.parens+1){Pue(Tt.pop());continue}Me({type:"paren",value:v,output:P.parens?")":"\\)"}),Hc("parens");continue}if(v==="["){if(n.nobracket===!0||!_o().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(Ol("closing","]"));v=`\\${v}`}else Sg("brackets");Me({type:"bracket",value:v});continue}if(v==="]"){if(n.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){Me({type:"text",value:v,output:`\\${v}`});continue}if(P.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(Ol("opening","["));Me({type:"text",value:v,output:`\\${v}`});continue}Hc("brackets");let $=x.value.slice(1);if(x.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(v=`/${v}`),x.value+=v,la({value:v}),n.literalBrackets===!1||Ns.hasRegexChars($))continue;let xe=Ns.escapeRegex(x.value);if(P.output=P.output.slice(0,-x.value.length),n.literalBrackets===!0){P.output+=xe,x.value=xe;continue}x.value=`(${a}${xe}|${x.value})`,P.output+=x.value;continue}if(v==="{"&&n.nobrace!==!0){Sg("braces");let $={type:"brace",value:v,output:"(",outputIndex:P.output.length,tokensIndex:P.tokens.length};ze.push($),Me($);continue}if(v==="}"){let $=ze[ze.length-1];if(n.nobrace===!0||!$){Me({type:"text",value:v,output:v});continue}let xe=")";if($.dots===!0){let dt=i.slice(),Jn=[];for(let Zt=dt.length-1;Zt>=0&&(i.pop(),dt[Zt].type!=="brace");Zt--)dt[Zt].type!=="dots"&&Jn.unshift(dt[Zt].value);xe=zfe(Jn,n),P.backtrack=!0}if($.comma!==!0&&$.dots!==!0){let dt=P.output.slice(0,$.outputIndex),Jn=P.tokens.slice($.tokensIndex);$.value=$.output="\\{",v=xe="\\}",P.output=dt;for(let Zt of Jn)P.output+=Zt.output||Zt.value}Me({type:"brace",value:v,output:xe}),Hc("braces"),ze.pop();continue}if(v==="|"){Tt.length>0&&Tt[Tt.length-1].conditions++,Me({type:"text",value:v});continue}if(v===","){let $=v,xe=ze[ze.length-1];xe&&Ce[Ce.length-1]==="braces"&&(xe.comma=!0,$="|"),Me({type:"comma",value:v,output:$});continue}if(v==="/"){if(x.type==="dot"&&P.index===P.start+1){P.start=P.index+1,P.consumed="",P.output="",i.pop(),x=s;continue}Me({type:"slash",value:v,output:_});continue}if(v==="."){if(P.braces>0&&x.type==="dot"){x.value==="."&&(x.output=f);let $=ze[ze.length-1];x.type="dots",x.output+=v,x.value+=v,$.dots=!0;continue}if(P.braces+P.parens===0&&x.type!=="bos"&&x.type!=="slash"){Me({type:"text",value:v,output:f});continue}Me({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(x&&x.value==="(")&&n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ag("qmark",v);continue}if(x&&x.type==="paren"){let xe=je(),dt=v;(x.value==="("&&!/[!=<:]/.test(xe)||xe==="<"&&!/<([!=]|\w+>)/.test(_o()))&&(dt=`\\${v}`),Me({type:"text",value:v,output:dt});continue}if(n.dot!==!0&&(x.type==="slash"||x.type==="bos")){Me({type:"qmark",value:v,output:C});continue}Me({type:"qmark",value:v,output:I});continue}if(v==="!"){if(n.noextglob!==!0&&je()==="("&&(je(2)!=="?"||!/[!=<:]/.test(je(3)))){Ag("negate",v);continue}if(n.nonegate!==!0&&P.index===0){Cue();continue}}if(v==="+"){if(n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ag("plus",v);continue}if(x&&x.value==="("||n.regex===!1){Me({type:"plus",value:v,output:m});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||P.parens>0){Me({type:"plus",value:v});continue}Me({type:"plus",value:m});continue}if(v==="@"){if(n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Me({type:"at",extglob:!0,value:v,output:""});continue}Me({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let $=Wfe.exec(_o());$&&(v+=$[0],P.index+=$[0].length),Me({type:"text",value:v});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=v,x.output=ee,P.backtrack=!0,P.globstar=!0,ho(v);continue}let z=_o();if(n.noextglob!==!0&&/^\([^?]/.test(z)){Ag("star",v);continue}if(x.type==="star"){if(n.noglobstar===!0){ho(v);continue}let $=x.prev,xe=$.prev,dt=$.type==="slash"||$.type==="bos",Jn=xe&&(xe.type==="star"||xe.type==="globstar");if(n.bash===!0&&(!dt||z[0]&&z[0]!=="/")){Me({type:"star",value:v,output:""});continue}let Zt=P.braces>0&&($.type==="comma"||$.type==="brace"),RN=Tt.length&&($.type==="pipe"||$.type==="paren");if(!dt&&$.type!=="paren"&&!Zt&&!RN){Me({type:"star",value:v,output:""});continue}for(;z.slice(0,3)==="/**";){let yg=t[P.index+4];if(yg&&yg!=="/")break;z=z.slice(3),ho("/**",3)}if($.type==="bos"&&Qn()){x.type="globstar",x.value+=v,x.output=L(n),P.output=x.output,P.globstar=!0,ho(v);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!Jn&&Qn()){P.output=P.output.slice(0,-($.output+x.output).length),$.output=`(?:${$.output}`,x.type="globstar",x.output=L(n)+(n.strictSlashes?")":"|$)"),x.value+=v,P.globstar=!0,P.output+=$.output+x.output,ho(v);continue}if($.type==="slash"&&$.prev.type!=="bos"&&z[0]==="/"){let yg=z[1]!==void 0?"|$":"";P.output=P.output.slice(0,-($.output+x.output).length),$.output=`(?:${$.output}`,x.type="globstar",x.output=`${L(n)}${_}|${_}${yg})`,x.value+=v,P.output+=$.output+x.output,P.globstar=!0,ho(v+Je()),Me({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&z[0]==="/"){x.type="globstar",x.value+=v,x.output=`(?:^|${_}|${L(n)}${_})`,P.output=x.output,P.globstar=!0,ho(v+Je()),Me({type:"slash",value:"/",output:""});continue}P.output=P.output.slice(0,-x.output.length),x.type="globstar",x.output=L(n),x.value+=v,P.output+=x.output,P.globstar=!0,ho(v);continue}let nt={type:"star",value:v,output:ee};if(n.bash===!0){nt.output=".*?",(x.type==="bos"||x.type==="slash")&&(nt.output=K+nt.output),Me(nt);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&n.regex===!0){nt.output=v,Me(nt);continue}(P.index===P.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(P.output+=R,x.output+=R):n.dot===!0?(P.output+=b,x.output+=b):(P.output+=K,x.output+=K),je()!=="*"&&(P.output+=g,x.output+=g)),Me(nt)}for(;P.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing","]"));P.output=Ns.escapeLast(P.output,"["),Hc("brackets")}for(;P.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing",")"));P.output=Ns.escapeLast(P.output,"("),Hc("parens")}for(;P.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing","}"));P.output=Ns.escapeLast(P.output,"{"),Hc("braces")}if(n.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&Me({type:"maybe_slash",value:"",output:`${_}?`}),P.backtrack===!0){P.output="";for(let z of P.tokens)P.output+=z.output!=null?z.output:z.value,z.suffix&&(P.output+=z.suffix)}return P};QN.fastpaths=(t,e)=>{let n={...e},r=typeof n.maxLength=="number"?Math.min(jg,n.maxLength):jg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);t=Kk[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:_,START_ANCHOR:g}=kg.globChars(n.windows),T=n.dot?f:d,A=n.dot?m:d,R=n.capture?"":"?:",b={negated:!1,prefix:""},I=n.bash===!0?".*?":_;n.capture&&(I=`(${I})`);let C=K=>K.noglobstar===!0?I:`(${R}(?:(?!${g}${K.dot?c:s}).)*?)`,O=K=>{switch(K){case"*":return`${T}${a}${I}`;case".*":return`${s}${a}${I}`;case"*.*":return`${T}${I}${s}${a}${I}`;case"*/*":return`${T}${I}${i}${a}${A}${I}`;case"**":return T+C(n);case"**/*":return`(?:${T}${C(n)}${i})?${A}${a}${I}`;case"**/*.*":return`(?:${T}${C(n)}${i})?${A}${I}${s}${a}${I}`;case"**/.*":return`(?:${T}${C(n)}${i})?${s}${a}${I}`;default:{let j=/^(.*?)\.(\w+)$/.exec(K);if(!j)return;let ee=O(j[1]);return ee?ee+s+j[2]:void 0}}},k=Ns.removePrefix(t,b),L=O(k);return L&&n.strictSlashes!==!0&&(L+=`${i}?`),L};zk.exports=QN});var Zk=y((w6e,Jk)=>{"use strict";p();u();l();var Xfe=Wk(),JN=Xk(),Qk=Mf(),Qfe=vf(),Jfe=t=>t&&typeof t=="object"&&!Array.isArray(t),Mt=(t,e,n=!1)=>{if(Array.isArray(t)){let f=t.map(_=>Mt(_,e,n));return _=>{for(let g of f){let T=g(_);if(T)return T}return!1}}let r=Jfe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,i=r?Mt.compileRe(t,e):Mt.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=Mt(o.ignore,f,n)}let d=(f,m=!1)=>{let{isMatch:_,match:g,output:T}=Mt.test(f,i,e,{glob:t,posix:s}),A={glob:t,state:a,regex:i,posix:s,input:f,output:T,match:g,isMatch:_};return typeof o.onResult=="function"&&o.onResult(A),_===!1?(A.isMatch=!1,m?A:!1):c(f)?(typeof o.onIgnore=="function"&&o.onIgnore(A),A.isMatch=!1,m?A:!1):(typeof o.onMatch=="function"&&o.onMatch(A),m?A:!0)};return n&&(d.state=a),d};Mt.test=(t,e,n,{glob:r,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=n||{},i=s.format||(o?Qk.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Mt.matchBase(t,e,n,o):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Mt.matchBase=(t,e,n)=>(e instanceof RegExp?e:Mt.makeRe(e,n)).test(Qk.basename(t));Mt.isMatch=(t,e,n)=>Mt(e,n)(t);Mt.parse=(t,e)=>Array.isArray(t)?t.map(n=>Mt.parse(n,e)):JN(t,{...e,fastpaths:!1});Mt.scan=(t,e)=>Xfe(t,e);Mt.compileRe=(t,e,n=!1,r=!1)=>{if(n===!0)return t.output;let o=e||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Mt.toRegex(a,e);return r===!0&&(c.state=t),c};Mt.makeRe=(t,e={},n=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=JN.fastpaths(t,e)),o.output||(o=JN(t,e)),Mt.compileRe(o,e,n,r)};Mt.toRegex=(t,e)=>{try{let n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(n){if(e&&e.debug===!0)throw n;return/$^/}};Mt.constants=Qfe;Jk.exports=Mt});var r1=y((j6e,n1)=>{"use strict";p();u();l();var e1=Zk(),Zfe=Mf();function t1(t,e,n=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Zfe.isWindows()}),e1(t,e,n)}Object.assign(t1,e1);n1.exports=t1});function nme(t,e={}){let n=t.length,r=Array(n),o=Array(n),s=!e.noglobstar;for(let i=0;i<n;i++){let a=a1(t[i]);r[i]=a;let c=a.length,d=Array(c);for(let f=0;f<c;f++)d[f]=(0,Pl.default)(a[f],e);o[i]=d}return i=>{let a=i.split("/");if(a[0]===".."&&tme.test(i))return!0;for(let c=0;c<t.length;c++){let d=r[c],f=o[c],m=a.length,_=Math.min(m,d.length),g=0;for(;g<_;){let T=d[g];if(T.includes("/"))return!0;if(!f[g](a[g]))break;if(s&&T==="**")return!0;g++}if(g===m)return!0}return!1}}function o1(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){let o=ome(t)?t.length:t.length+1;return(s,i)=>s.slice(o,i?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(o,s)=>{if(o===".")return r;let i=`${r}/${o}`;return s?i.slice(0,-1):i}:(o,s)=>s&&o!=="."?o.slice(0,-1):o}return n?r=>Zo.posix.relative(t,r)||".":r=>Zo.posix.relative(t,`${e}/${r}`)||"."}function sme(t,e){if(e.startsWith(`${t}/`)){let n=e.slice(t.length+1);return r=>`${n}/${r}`}return n=>{let r=Zo.posix.relative(t,`${e}/${n}`);return n.endsWith("/")&&r!==""?`${r}/`:r||"."}}function a1(t){var e;let n=Pl.default.scan(t,ime);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}function dme(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=Pl.default.scan(t);return n.isGlob||n.negated}function Cl(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function ZN(t,e,n,r,o){let s=t;t.endsWith("/")&&(s=t.slice(0,-1)),!s.endsWith("*")&&e&&(s+="/**");let i=pme(n);Zo.default.isAbsolute(s.replace(mme,""))?s=Zo.posix.relative(i,s):s=Zo.posix.normalize(s);let a=fme.exec(s),c=a1(s);if(a?.[0]){let f=(a[0].length+1)/3,m=0,_=i.split("/");for(;m<f&&c[m+f]===_[_.length+m-f];)s=s.slice(0,(f-m-1)*3)+s.slice((f-m)*3+c[m+f].length+1)||".",m++;let g=Zo.posix.join(n,a[0].slice(m*3));!g.startsWith(".")&&r.root.length>g.length&&(r.root=g,r.depthOffset=-f+m)}if(!o&&r.depthOffset>=0){var d;(d=r.commonPath)!==null&&d!==void 0||(r.commonPath=c);let f=[],m=Math.min(r.commonPath.length,c.length);for(let _=0;_<m;_++){let g=c[_];if(g==="**"&&!c[_+1]){f.pop();break}if(g!==r.commonPath[_]||dme(g)||_===c.length-1)break;f.push(g)}r.depthOffset=f.length,r.commonPath=f,r.root=f.length>0?Zo.posix.join(n,...f):n}return s}function _me({patterns:t=["**/*"],ignore:e=[],expandDirectories:n=!0},r,o){typeof t=="string"&&(t=[t]),typeof e=="string"&&(e=[e]);let s=[],i=[];for(let a of e)a&&(a[0]!=="!"||a[1]==="(")&&i.push(ZN(a,n,r,o,!0));for(let a of t)a&&(a[0]!=="!"||a[1]==="("?s.push(ZN(a,n,r,o,!1)):(a[1]!=="!"||a[2]==="(")&&i.push(ZN(a.slice(1),n,r,o,!0)));return{match:s,ignore:i}}function hme(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];t[n]=e(r)}return t}function gme(t){return t?t instanceof URL?(0,s1.fileURLToPath)(t).replace(Bg,"/"):Zo.default.resolve(t).replace(Bg,"/"):process.cwd().replace(Bg,"/")}function Eme(t,e={}){let n=process.env.TINYGLOBBY_DEBUG?{...e,debug:!0}:e,r=gme(n.cwd);if(n.debug&&Cl("globbing with:",{patterns:t,options:n,cwd:r}),Array.isArray(t)&&t.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let o={root:r,commonPath:null,depthOffset:0},s=_me({...n,patterns:t},r,o);n.debug&&Cl("internal processing patterns:",s);let i={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},a=(0,Pl.default)(s.match,{...i,ignore:s.ignore}),c=(0,Pl.default)(s.ignore,i),d=nme(s.match,i),f=o1(r,o.root,n.absolute),m=n.absolute?f:o1(r,o.root,!0),_={filters:[n.debug?(A,R)=>{let b=f(A,R),I=a(b);return I&&Cl(`matched ${b}`),I}:(A,R)=>a(f(A,R))],exclude:n.debug?(A,R)=>{let b=m(R,!0),I=b!=="."&&!d(b)||c(b);return Cl(I?`skipped ${R}`:`crawling ${R}`),I}:(A,R)=>{let b=m(R,!0);return b!=="."&&!d(b)||c(b)},fs:n.fs?{readdir:n.fs.readdir||qc.default.readdir,readdirSync:n.fs.readdirSync||qc.default.readdirSync,realpath:n.fs.realpath||qc.default.realpath,realpathSync:n.fs.realpathSync||qc.default.realpathSync,stat:n.fs.stat||qc.default.stat,statSync:n.fs.statSync||qc.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(_.maxDepth=Math.round(n.deep-o.depthOffset)),n.absolute&&(_.relativePaths=!1,_.resolvePaths=!0,_.includeBasePath=!0),n.followSymbolicLinks===!1&&(_.resolveSymlinks=!1,_.excludeSymlinks=!0),n.onlyDirectories?(_.excludeFiles=!0,_.includeDirs=!0):n.onlyFiles===!1&&(_.includeDirs=!0),o.root=o.root.replace(Bg,"");let g=o.root;n.debug&&Cl("internal properties:",o);let T=r!==g&&!n.absolute&&sme(r,o.root);return[new Lk(_).crawl(g),T]}async function c1(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=eme(t)||typeof t=="string",r=n?e:t,o=n?t:t.patterns,[s,i]=Eme(o,r);return i?hme(await s.withPromise(),i):s.withPromise()}var qc,Zo,s1,Pl,eme,i1,tme,rme,ome,ime,ame,cme,ume,lme,pme,fme,mme,Bg,u1=S(()=>{p();u();l();qc=B(require("fs"),1),Zo=B(require("path"),1),s1=require("url");wk();Pl=B(r1(),1),eme=Array.isArray,i1=process.platform==="win32",tme=/^(\/?\.\.)+$/;rme=/^[A-Z]:\/$/i,ome=i1?t=>rme.test(t):t=>t==="/";ime={parts:!0};ame=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,cme=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,ume=t=>t.replace(ame,"\\$&"),lme=t=>t.replace(cme,"\\$&"),pme=i1?lme:ume;fme=/^(\/?\.\.)+/,mme=/\\(?=[()[\]{}!*+?@|])/g,Bg=/\\/g});var Gg,$g,eb,Tme,tb,l1,p1,Sme,d1=S(()=>{p();u();l();Gg="0123456789abcdef",$g=class t{constructor(e){this.bytes=e}static ofInner(e){if(e.length!==16)throw new TypeError("not 128-bit length");return new t(e)}static fromFieldsV7(e,n,r,o){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||e<0||n<0||r<0||o<0||e>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=e/2**40,s[1]=e/2**32,s[2]=e/2**24,s[3]=e/2**16,s[4]=e/2**8,s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new t(s)}static parse(e){var n,r,o,s;let i;switch(e.length){case 32:i=(n=/^[0-9a-f]{32}$/i.exec(e))===null||n===void 0?void 0:n[0];break;case 36:i=(r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 38:i=(o=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 45:i=(s=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||s===void 0?void 0:s.slice(1,6).join("");break;default:break}if(i){let a=new Uint8Array(16);for(let c=0;c<16;c+=4){let d=parseInt(i.substring(2*c,2*c+8),16);a[c+0]=d>>>24,a[c+1]=d>>>16,a[c+2]=d>>>8,a[c+3]=d}return new t(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let e="";for(let n=0;n<this.bytes.length;n++)e+=Gg.charAt(this.bytes[n]>>>4),e+=Gg.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(e+="-");return e}toHex(){let e="";for(let n=0;n<this.bytes.length;n++)e+=Gg.charAt(this.bytes[n]>>>4),e+=Gg.charAt(this.bytes[n]&15);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=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 t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;n<16;n++){let r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},eb=class{constructor(e){this.timestamp_biased=0,this.counter=0,this.random=e??Tme()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,n){let r=this.generateOrAbortCore(e,n);return r===void 0&&(this.timestamp_biased=0,r=this.generateOrAbortCore(e,n)),r}generateOrAbortCore(e,n){if(!Number.isInteger(e)||e<0||e>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(e++,e>this.timestamp_biased)this.timestamp_biased=e,this.resetCounter();else if(e+n>=this.timestamp_biased)this.counter++,this.counter>4398046511103&&(this.timestamp_biased++,this.resetCounter());else return;return $g.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 e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,$g.ofInner(e)}},Tme=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new tb;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)}},tb=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++]}},p1=()=>Sme().toString(),Sme=()=>(l1||(l1=new eb)).generate()});var Fg,bs,f1,m1,nb,rb,Ame,yme,p=S(()=>{"use strict";Fg=require("node:child_process"),bs=require("node:fs/promises"),f1=require("node:sqlite"),m1=B(yk(),1);u1();d1();nb=class{stmt;constructor(e){this.stmt=e}get(...e){return this.stmt.get(...e)}all(...e){return this.stmt.all(...e)}run(...e){this.stmt.run(...e)}},rb=class{db;constructor(e){this.db=new f1.DatabaseSync(e)}exec(e){this.db.exec(e)}query(e){return new nb(this.db.prepare(e))}close(){this.db.close()}transaction(e){return()=>{this.db.exec("BEGIN");try{let n=e();return this.db.exec("COMMIT"),n}catch(n){throw this.db.exec("ROLLBACK"),n}}}},Ame={Database:rb};globalThis.__bun_sqlite_polyfill=Ame;yme={file(t){return{async exists(){try{return await(0,bs.access)(t),!0}catch{return!1}},text(){return(0,bs.readFile)(t,"utf-8")},async json(){let e=await(0,bs.readFile)(t,"utf-8");return JSON.parse(e)}}},async write(t,e){if(e instanceof Response){let n=await e.arrayBuffer();await(0,bs.writeFile)(t,Buffer.from(n))}else e instanceof ArrayBuffer?await(0,bs.writeFile)(t,Buffer.from(e)):e instanceof Uint8Array?await(0,bs.writeFile)(t,e):await(0,bs.writeFile)(t,e,"utf-8")},which(t){try{let n=process.platform==="win32"?`where ${t}`:`which ${t}`;return(0,Fg.execSync)(n,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
3
+ var xue=Object.create;var Rg=Object.defineProperty;var vue=Object.getOwnPropertyDescriptor;var Mue=Object.getOwnPropertyNames;var Lue=Object.getPrototypeOf,wue=Object.prototype.hasOwnProperty;var S=(t,e)=>()=>(t&&(e=t(t=0)),e);var y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Mn=(t,e)=>{for(var n in e)Rg(t,n,{get:e[n],enumerable:!0})},L0=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Mue(e))!wue.call(t,o)&&o!==n&&Rg(t,o,{get:()=>e[o],enumerable:!(r=vue(e,o))||r.enumerable});return t};var B=(t,e,n)=>(n=t!=null?xue(Lue(t)):{},L0(e||!t||!t.__esModule?Rg(n,"default",{value:t,enumerable:!0}):n,t)),D=t=>L0(Rg({},"__esModule",{value:!0}),t);var h,u=S(()=>{"use strict";h=require("node:url").pathToFileURL(__filename).href});var Due,l=S(()=>{Due=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};Due.SENTRY_RELEASE={id:"0.10.2"}});var If=y((qze,w0)=>{"use strict";p();u();l();var Uue="2.0.0",kue=Number.MAX_SAFE_INTEGER||9007199254740991,jue=16,Bue=250,Gue=["major","premajor","minor","preminor","patch","prepatch","prerelease"];w0.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:jue,MAX_SAFE_BUILD_LENGTH:Bue,MAX_SAFE_INTEGER:kue,RELEASE_TYPES:Gue,SEMVER_SPEC_VERSION:Uue,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Nf=y((zze,D0)=>{"use strict";p();u();l();var $ue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};D0.exports=$ue});var bl=y((Is,U0)=>{"use strict";p();u();l();var{MAX_SAFE_COMPONENT_LENGTH:IN,MAX_SAFE_BUILD_LENGTH:Fue,MAX_LENGTH:Hue}=If(),Vue=Nf();Is=U0.exports={};var que=Is.re=[],Yue=Is.safeRe=[],X=Is.src=[],Wue=Is.safeSrc=[],Q=Is.t={},Kue=0,NN="[a-zA-Z0-9-]",zue=[["\\s",1],["\\d",Hue],[NN,Fue]],Xue=t=>{for(let[e,n]of zue)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},Ae=(t,e,n)=>{let r=Xue(e),o=Kue++;Vue(t,o,e),Q[t]=o,X[o]=e,Wue[o]=r,que[o]=new RegExp(e,n?"g":void 0),Yue[o]=new RegExp(r,n?"g":void 0)};Ae("NUMERICIDENTIFIER","0|[1-9]\\d*");Ae("NUMERICIDENTIFIERLOOSE","\\d+");Ae("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${NN}*`);Ae("MAINVERSION",`(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})\\.(${X[Q.NUMERICIDENTIFIER]})`);Ae("MAINVERSIONLOOSE",`(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})\\.(${X[Q.NUMERICIDENTIFIERLOOSE]})`);Ae("PRERELEASEIDENTIFIER",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIER]})`);Ae("PRERELEASEIDENTIFIERLOOSE",`(?:${X[Q.NONNUMERICIDENTIFIER]}|${X[Q.NUMERICIDENTIFIERLOOSE]})`);Ae("PRERELEASE",`(?:-(${X[Q.PRERELEASEIDENTIFIER]}(?:\\.${X[Q.PRERELEASEIDENTIFIER]})*))`);Ae("PRERELEASELOOSE",`(?:-?(${X[Q.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${X[Q.PRERELEASEIDENTIFIERLOOSE]})*))`);Ae("BUILDIDENTIFIER",`${NN}+`);Ae("BUILD",`(?:\\+(${X[Q.BUILDIDENTIFIER]}(?:\\.${X[Q.BUILDIDENTIFIER]})*))`);Ae("FULLPLAIN",`v?${X[Q.MAINVERSION]}${X[Q.PRERELEASE]}?${X[Q.BUILD]}?`);Ae("FULL",`^${X[Q.FULLPLAIN]}$`);Ae("LOOSEPLAIN",`[v=\\s]*${X[Q.MAINVERSIONLOOSE]}${X[Q.PRERELEASELOOSE]}?${X[Q.BUILD]}?`);Ae("LOOSE",`^${X[Q.LOOSEPLAIN]}$`);Ae("GTLT","((?:<|>)?=?)");Ae("XRANGEIDENTIFIERLOOSE",`${X[Q.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ae("XRANGEIDENTIFIER",`${X[Q.NUMERICIDENTIFIER]}|x|X|\\*`);Ae("XRANGEPLAIN",`[v=\\s]*(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:\\.(${X[Q.XRANGEIDENTIFIER]})(?:${X[Q.PRERELEASE]})?${X[Q.BUILD]}?)?)?`);Ae("XRANGEPLAINLOOSE",`[v=\\s]*(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:\\.(${X[Q.XRANGEIDENTIFIERLOOSE]})(?:${X[Q.PRERELEASELOOSE]})?${X[Q.BUILD]}?)?)?`);Ae("XRANGE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAIN]}$`);Ae("XRANGELOOSE",`^${X[Q.GTLT]}\\s*${X[Q.XRANGEPLAINLOOSE]}$`);Ae("COERCEPLAIN",`(^|[^\\d])(\\d{1,${IN}})(?:\\.(\\d{1,${IN}}))?(?:\\.(\\d{1,${IN}}))?`);Ae("COERCE",`${X[Q.COERCEPLAIN]}(?:$|[^\\d])`);Ae("COERCEFULL",X[Q.COERCEPLAIN]+`(?:${X[Q.PRERELEASE]})?(?:${X[Q.BUILD]})?(?:$|[^\\d])`);Ae("COERCERTL",X[Q.COERCE],!0);Ae("COERCERTLFULL",X[Q.COERCEFULL],!0);Ae("LONETILDE","(?:~>?)");Ae("TILDETRIM",`(\\s*)${X[Q.LONETILDE]}\\s+`,!0);Is.tildeTrimReplace="$1~";Ae("TILDE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAIN]}$`);Ae("TILDELOOSE",`^${X[Q.LONETILDE]}${X[Q.XRANGEPLAINLOOSE]}$`);Ae("LONECARET","(?:\\^)");Ae("CARETTRIM",`(\\s*)${X[Q.LONECARET]}\\s+`,!0);Is.caretTrimReplace="$1^";Ae("CARET",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAIN]}$`);Ae("CARETLOOSE",`^${X[Q.LONECARET]}${X[Q.XRANGEPLAINLOOSE]}$`);Ae("COMPARATORLOOSE",`^${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]})$|^$`);Ae("COMPARATOR",`^${X[Q.GTLT]}\\s*(${X[Q.FULLPLAIN]})$|^$`);Ae("COMPARATORTRIM",`(\\s*)${X[Q.GTLT]}\\s*(${X[Q.LOOSEPLAIN]}|${X[Q.XRANGEPLAIN]})`,!0);Is.comparatorTrimReplace="$1$2$3";Ae("HYPHENRANGE",`^\\s*(${X[Q.XRANGEPLAIN]})\\s+-\\s+(${X[Q.XRANGEPLAIN]})\\s*$`);Ae("HYPHENRANGELOOSE",`^\\s*(${X[Q.XRANGEPLAINLOOSE]})\\s+-\\s+(${X[Q.XRANGEPLAINLOOSE]})\\s*$`);Ae("STAR","(<|>)?=?\\s*\\*");Ae("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ae("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ig=y((n3e,k0)=>{"use strict";p();u();l();var Que=Object.freeze({loose:!0}),Jue=Object.freeze({}),Zue=t=>t?typeof t!="object"?Que:t:Jue;k0.exports=Zue});var bN=y((i3e,G0)=>{"use strict";p();u();l();var j0=/^[0-9]+$/,B0=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=j0.test(t),r=j0.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},ele=(t,e)=>B0(e,t);G0.exports={compareIdentifiers:B0,rcompareIdentifiers:ele}});var Ln=y((l3e,F0)=>{"use strict";p();u();l();var Ng=Nf(),{MAX_LENGTH:$0,MAX_SAFE_INTEGER:bg}=If(),{safeRe:Og,t:Cg}=bl(),tle=Ig(),{compareIdentifiers:ON}=bN(),CN=class t{constructor(e,n){if(n=tle(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>$0)throw new TypeError(`version is longer than ${$0} characters`);Ng("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?Og[Cg.LOOSE]:Og[Cg.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>bg||this.major<0)throw new TypeError("Invalid major version");if(this.minor>bg||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>bg||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<bg)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(Ng("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(Ng("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return ON(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(Ng("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return ON(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Og[Cg.PRERELEASELOOSE]:Og[Cg.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),ON(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};F0.exports=CN});var Vc=y((m3e,V0)=>{"use strict";p();u();l();var H0=Ln(),nle=(t,e,n=!1)=>{if(t instanceof H0)return t;try{return new H0(t,e)}catch(r){if(!n)return null;throw r}};V0.exports=nle});var Y0=y((E3e,q0)=>{"use strict";p();u();l();var rle=Vc(),ole=(t,e)=>{let n=rle(t,e);return n?n.version:null};q0.exports=ole});var K0=y((y3e,W0)=>{"use strict";p();u();l();var sle=Vc(),ile=(t,e)=>{let n=sle(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};W0.exports=ile});var Q0=y((b3e,X0)=>{"use strict";p();u();l();var z0=Ln(),ale=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new z0(t instanceof z0?t.version:t,n).inc(e,r,o).version}catch{return null}};X0.exports=ale});var eU=y((x3e,Z0)=>{"use strict";p();u();l();var J0=Vc(),cle=(t,e)=>{let n=J0(t,null,!0),r=J0(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let f=c?"pre":"";return n.major!==r.major?f+"major":n.minor!==r.minor?f+"minor":n.patch!==r.patch?f+"patch":"prerelease"};Z0.exports=cle});var nU=y((w3e,tU)=>{"use strict";p();u();l();var ule=Ln(),lle=(t,e)=>new ule(t,e).major;tU.exports=lle});var oU=y((j3e,rU)=>{"use strict";p();u();l();var ple=Ln(),dle=(t,e)=>new ple(t,e).minor;rU.exports=dle});var iU=y((F3e,sU)=>{"use strict";p();u();l();var fle=Ln(),mle=(t,e)=>new fle(t,e).patch;sU.exports=mle});var cU=y((Y3e,aU)=>{"use strict";p();u();l();var _le=Vc(),hle=(t,e)=>{let n=_le(t,e);return n&&n.prerelease.length?n.prerelease:null};aU.exports=hle});var go=y((X3e,lU)=>{"use strict";p();u();l();var uU=Ln(),gle=(t,e,n)=>new uU(t,n).compare(new uU(e,n));lU.exports=gle});var dU=y((e5e,pU)=>{"use strict";p();u();l();var Ele=go(),Tle=(t,e,n)=>Ele(e,t,n);pU.exports=Tle});var mU=y((o5e,fU)=>{"use strict";p();u();l();var Sle=go(),Ale=(t,e)=>Sle(t,e,!0);fU.exports=Ale});var Pg=y((c5e,hU)=>{"use strict";p();u();l();var _U=Ln(),yle=(t,e,n)=>{let r=new _U(t,n),o=new _U(e,n);return r.compare(o)||r.compareBuild(o)};hU.exports=yle});var EU=y((d5e,gU)=>{"use strict";p();u();l();var Rle=Pg(),Ile=(t,e)=>t.sort((n,r)=>Rle(n,r,e));gU.exports=Ile});var SU=y((h5e,TU)=>{"use strict";p();u();l();var Nle=Pg(),ble=(t,e)=>t.sort((n,r)=>Nle(r,n,e));TU.exports=ble});var bf=y((S5e,AU)=>{"use strict";p();u();l();var Ole=go(),Cle=(t,e,n)=>Ole(t,e,n)>0;AU.exports=Cle});var xg=y((I5e,yU)=>{"use strict";p();u();l();var Ple=go(),xle=(t,e,n)=>Ple(t,e,n)<0;yU.exports=xle});var PN=y((C5e,RU)=>{"use strict";p();u();l();var vle=go(),Mle=(t,e,n)=>vle(t,e,n)===0;RU.exports=Mle});var xN=y((M5e,IU)=>{"use strict";p();u();l();var Lle=go(),wle=(t,e,n)=>Lle(t,e,n)!==0;IU.exports=wle});var vg=y((U5e,NU)=>{"use strict";p();u();l();var Dle=go(),Ule=(t,e,n)=>Dle(t,e,n)>=0;NU.exports=Ule});var Mg=y((G5e,bU)=>{"use strict";p();u();l();var kle=go(),jle=(t,e,n)=>kle(t,e,n)<=0;bU.exports=jle});var vN=y((V5e,OU)=>{"use strict";p();u();l();var Ble=PN(),Gle=xN(),$le=bf(),Fle=vg(),Hle=xg(),Vle=Mg(),qle=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return Ble(t,n,r);case"!=":return Gle(t,n,r);case">":return $le(t,n,r);case">=":return Fle(t,n,r);case"<":return Hle(t,n,r);case"<=":return Vle(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};OU.exports=qle});var PU=y((K5e,CU)=>{"use strict";p();u();l();var Yle=Ln(),Wle=Vc(),{safeRe:Lg,t:wg}=bl(),Kle=(t,e)=>{if(t instanceof Yle)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?Lg[wg.COERCEFULL]:Lg[wg.COERCE]);else{let c=e.includePrerelease?Lg[wg.COERCERTLFULL]:Lg[wg.COERCERTL],d;for(;(d=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||d.index+d[0].length!==n.index+n[0].length)&&(n=d),c.lastIndex=d.index+d[1].length+d[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return Wle(`${r}.${o}.${s}${i}${a}`,e)};CU.exports=Kle});var vU=y((J5e,xU)=>{"use strict";p();u();l();var MN=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};xU.exports=MN});var Eo=y((n9e,DU)=>{"use strict";p();u();l();var zle=/\s+/g,LN=class t{constructor(e,n){if(n=Qle(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof wN)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(zle," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!LU(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&ope(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&npe)|(this.options.loose&&rpe))+":"+e,o=MU.get(r);if(o)return o;let s=this.options.loose,i=s?Zn[wn.HYPHENRANGELOOSE]:Zn[wn.HYPHENRANGE];e=e.replace(i,mpe(this.options.includePrerelease)),rt("hyphen replace",e),e=e.replace(Zn[wn.COMPARATORTRIM],Zle),rt("comparator trim",e),e=e.replace(Zn[wn.TILDETRIM],epe),rt("tilde trim",e),e=e.replace(Zn[wn.CARETTRIM],tpe),rt("caret trim",e);let a=e.split(" ").map(m=>spe(m,this.options)).join(" ").split(/\s+/).map(m=>fpe(m,this.options));s&&(a=a.filter(m=>(rt("loose invalid filter",m,this.options),!!m.match(Zn[wn.COMPARATORLOOSE])))),rt("range list",a);let c=new Map,d=a.map(m=>new wN(m,this.options));for(let m of d){if(LU(m))return[m];c.set(m.value,m)}c.size>1&&c.has("")&&c.delete("");let f=[...c.values()];return MU.set(r,f),f}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>wU(r,n)&&e.set.some(o=>wU(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new Jle(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_pe(this.set[n],e,this.options))return!0;return!1}};DU.exports=LN;var Xle=vU(),MU=new Xle,Qle=Ig(),wN=Of(),rt=Nf(),Jle=Ln(),{safeRe:Zn,t:wn,comparatorTrimReplace:Zle,tildeTrimReplace:epe,caretTrimReplace:tpe}=bl(),{FLAG_INCLUDE_PRERELEASE:npe,FLAG_LOOSE:rpe}=If(),LU=t=>t.value==="<0.0.0-0",ope=t=>t.value==="",wU=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},spe=(t,e)=>(t=t.replace(Zn[wn.BUILD],""),rt("comp",t,e),t=cpe(t,e),rt("caret",t),t=ipe(t,e),rt("tildes",t),t=lpe(t,e),rt("xrange",t),t=dpe(t,e),rt("stars",t),t),er=t=>!t||t.toLowerCase()==="x"||t==="*",ipe=(t,e)=>t.trim().split(/\s+/).map(n=>ape(n,e)).join(" "),ape=(t,e)=>{let n=e.loose?Zn[wn.TILDELOOSE]:Zn[wn.TILDE];return t.replace(n,(r,o,s,i,a)=>{rt("tilde",t,r,o,s,i,a);let c;return er(o)?c="":er(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:er(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(rt("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,rt("tilde return",c),c})},cpe=(t,e)=>t.trim().split(/\s+/).map(n=>upe(n,e)).join(" "),upe=(t,e)=>{rt("caret",t,e);let n=e.loose?Zn[wn.CARETLOOSE]:Zn[wn.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{rt("caret",t,o,s,i,a,c);let d;return er(s)?d="":er(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:er(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(rt("replaceCaret pr",c),s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(rt("no pr"),s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),rt("caret return",d),d})},lpe=(t,e)=>(rt("replaceXRanges",t,e),t.split(/\s+/).map(n=>ppe(n,e)).join(" ")),ppe=(t,e)=>{t=t.trim();let n=e.loose?Zn[wn.XRANGELOOSE]:Zn[wn.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{rt("xRange",t,r,o,s,i,a,c);let d=er(s),f=d||er(i),m=f||er(a),_=m;return o==="="&&_&&(o=""),c=e.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),rt("xRange return",r),r})},dpe=(t,e)=>(rt("replaceStars",t,e),t.trim().replace(Zn[wn.STAR],"")),fpe=(t,e)=>(rt("replaceGTE0",t,e),t.trim().replace(Zn[e.includePrerelease?wn.GTE0PRE:wn.GTE0],"")),mpe=t=>(e,n,r,o,s,i,a,c,d,f,m,_)=>(er(r)?n="":er(o)?n=`>=${r}.0.0${t?"-0":""}`:er(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,er(d)?c="":er(f)?c=`<${+d+1}.0.0-0`:er(m)?c=`<${d}.${+f+1}.0-0`:_?c=`<=${d}.${f}.${m}-${_}`:t?c=`<${d}.${f}.${+m+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),_pe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(rt(t[r].semver),t[r].semver!==wN.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var Of=y((i9e,$U)=>{"use strict";p();u();l();var Cf=Symbol("SemVer ANY"),kN=class t{static get ANY(){return Cf}constructor(e,n){if(n=UU(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),UN("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===Cf?this.value="":this.value=this.operator+this.semver.version,UN("comp",this)}parse(e){let n=this.options.loose?kU[jU.COMPARATORLOOSE]:kU[jU.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new BU(r[2],this.options.loose):this.semver=Cf}toString(){return this.value}test(e){if(UN("Comparator.test",e,this.options.loose),this.semver===Cf||e===Cf)return!0;if(typeof e=="string")try{e=new BU(e,this.options)}catch{return!1}return DN(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new GU(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new GU(this.value,n).test(e.semver):(n=UU(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||DN(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||DN(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};$U.exports=kN;var UU=Ig(),{safeRe:kU,t:jU}=bl(),DN=vN(),UN=Nf(),BU=Ln(),GU=Eo()});var Pf=y((l9e,FU)=>{"use strict";p();u();l();var hpe=Eo(),gpe=(t,e,n)=>{try{e=new hpe(e,n)}catch{return!1}return e.test(t)};FU.exports=gpe});var VU=y((m9e,HU)=>{"use strict";p();u();l();var Epe=Eo(),Tpe=(t,e)=>new Epe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));HU.exports=Tpe});var YU=y((E9e,qU)=>{"use strict";p();u();l();var Spe=Ln(),Ape=Eo(),ype=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Ape(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new Spe(r,n))}),r};qU.exports=ype});var KU=y((y9e,WU)=>{"use strict";p();u();l();var Rpe=Ln(),Ipe=Eo(),Npe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Ipe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new Rpe(r,n))}),r};WU.exports=Npe});var QU=y((b9e,XU)=>{"use strict";p();u();l();var jN=Ln(),bpe=Eo(),zU=bf(),Ope=(t,e)=>{t=new bpe(t,e);let n=new jN("0.0.0");if(t.test(n)||(n=new jN("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new jN(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||zU(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||zU(n,s))&&(n=s)}return n&&t.test(n)?n:null};XU.exports=Ope});var ZU=y((x9e,JU)=>{"use strict";p();u();l();var Cpe=Eo(),Ppe=(t,e)=>{try{return new Cpe(t,e).range||"*"}catch{return null}};JU.exports=Ppe});var Dg=y((w9e,rk)=>{"use strict";p();u();l();var xpe=Ln(),nk=Of(),{ANY:vpe}=nk,Mpe=Eo(),Lpe=Pf(),ek=bf(),tk=xg(),wpe=Mg(),Dpe=vg(),Upe=(t,e,n,r)=>{t=new xpe(t,r),e=new Mpe(e,r);let o,s,i,a,c;switch(n){case">":o=ek,s=wpe,i=tk,a=">",c=">=";break;case"<":o=tk,s=Dpe,i=ek,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Lpe(t,e,r))return!1;for(let d=0;d<e.set.length;++d){let f=e.set[d],m=null,_=null;if(f.forEach(g=>{g.semver===vpe&&(g=new nk(">=0.0.0")),m=m||g,_=_||g,o(g.semver,m.semver,r)?m=g:i(g.semver,_.semver,r)&&(_=g)}),m.operator===a||m.operator===c||(!_.operator||_.operator===a)&&s(t,_.semver))return!1;if(_.operator===c&&i(t,_.semver))return!1}return!0};rk.exports=Upe});var sk=y((j9e,ok)=>{"use strict";p();u();l();var kpe=Dg(),jpe=(t,e,n)=>kpe(t,e,">",n);ok.exports=jpe});var ak=y((F9e,ik)=>{"use strict";p();u();l();var Bpe=Dg(),Gpe=(t,e,n)=>Bpe(t,e,"<",n);ik.exports=Gpe});var lk=y((Y9e,uk)=>{"use strict";p();u();l();var ck=Eo(),$pe=(t,e,n)=>(t=new ck(t,n),e=new ck(e,n),t.intersects(e,n));uk.exports=$pe});var dk=y((X9e,pk)=>{"use strict";p();u();l();var Fpe=Pf(),Hpe=go();pk.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((f,m)=>Hpe(f,m,n));for(let f of i)Fpe(f,e,n)?(s=f,o||(o=f)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[f,m]of r)f===m?a.push(f):!m&&f===i[0]?a.push("*"):m?f===i[0]?a.push(`<=${m}`):a.push(`${f} - ${m}`):a.push(`>=${f}`);let c=a.join(" || "),d=typeof e.raw=="string"?e.raw:String(e);return c.length<d.length?c:e}});var Ek=y((e6e,gk)=>{"use strict";p();u();l();var fk=Eo(),GN=Of(),{ANY:BN}=GN,xf=Pf(),$N=go(),Vpe=(t,e,n={})=>{if(t===e)return!0;t=new fk(t,n),e=new fk(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=Ype(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},qpe=[new GN(">=0.0.0-0")],mk=[new GN(">=0.0.0")],Ype=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===BN){if(e.length===1&&e[0].semver===BN)return!0;n.includePrerelease?t=qpe:t=mk}if(e.length===1&&e[0].semver===BN){if(n.includePrerelease)return!0;e=mk}let r=new Set,o,s;for(let g of t)g.operator===">"||g.operator===">="?o=_k(o,g,n):g.operator==="<"||g.operator==="<="?s=hk(s,g,n):r.add(g.semver);if(r.size>1)return null;let i;if(o&&s){if(i=$N(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let g of r){if(o&&!xf(g,String(o),n)||s&&!xf(g,String(s),n))return null;for(let T of e)if(!xf(g,String(T),n))return!1;return!0}let a,c,d,f,m=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,_=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;m&&m.prerelease.length===1&&s.operator==="<"&&m.prerelease[0]===0&&(m=!1);for(let g of e){if(f=f||g.operator===">"||g.operator===">=",d=d||g.operator==="<"||g.operator==="<=",o){if(_&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===_.major&&g.semver.minor===_.minor&&g.semver.patch===_.patch&&(_=!1),g.operator===">"||g.operator===">="){if(a=_k(o,g,n),a===g&&a!==o)return!1}else if(o.operator===">="&&!xf(o.semver,String(g),n))return!1}if(s){if(m&&g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===m.major&&g.semver.minor===m.minor&&g.semver.patch===m.patch&&(m=!1),g.operator==="<"||g.operator==="<="){if(c=hk(s,g,n),c===g&&c!==s)return!1}else if(s.operator==="<="&&!xf(s.semver,String(g),n))return!1}if(!g.operator&&(s||o)&&i!==0)return!1}return!(o&&d&&!s&&i!==0||s&&f&&!o&&i!==0||_||m)},_k=(t,e,n)=>{if(!t)return e;let r=$N(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},hk=(t,e,n)=>{if(!t)return e;let r=$N(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};gk.exports=Vpe});var yk=y((o6e,Ak)=>{"use strict";p();u();l();var FN=bl(),Tk=If(),Wpe=Ln(),Sk=bN(),Kpe=Vc(),zpe=Y0(),Xpe=K0(),Qpe=Q0(),Jpe=eU(),Zpe=nU(),ede=oU(),tde=iU(),nde=cU(),rde=go(),ode=dU(),sde=mU(),ide=Pg(),ade=EU(),cde=SU(),ude=bf(),lde=xg(),pde=PN(),dde=xN(),fde=vg(),mde=Mg(),_de=vN(),hde=PU(),gde=Of(),Ede=Eo(),Tde=Pf(),Sde=VU(),Ade=YU(),yde=KU(),Rde=QU(),Ide=ZU(),Nde=Dg(),bde=sk(),Ode=ak(),Cde=lk(),Pde=dk(),xde=Ek();Ak.exports={parse:Kpe,valid:zpe,clean:Xpe,inc:Qpe,diff:Jpe,major:Zpe,minor:ede,patch:tde,prerelease:nde,compare:rde,rcompare:ode,compareLoose:sde,compareBuild:ide,sort:ade,rsort:cde,gt:ude,lt:lde,eq:pde,neq:dde,gte:fde,lte:mde,cmp:_de,coerce:hde,Comparator:gde,Range:Ede,satisfies:Tde,toComparators:Sde,maxSatisfying:Ade,minSatisfying:yde,minVersion:Rde,validRange:Ide,outside:Nde,gtr:bde,ltr:Ode,intersects:Cde,simplifyRange:Pde,subset:xde,SemVer:Wpe,re:FN.re,src:FN.src,tokens:FN.t,SEMVER_SPEC_VERSION:Tk.SEMVER_SPEC_VERSION,RELEASE_TYPES:Tk.RELEASE_TYPES,compareIdentifiers:Sk.compareIdentifiers,rcompareIdentifiers:Sk.rcompareIdentifiers}});function Mde(t){let e=(0,tr.normalize)(t);return e.length>1&&e[e.length-1]===tr.sep&&(e=e.substring(0,e.length-1)),e}function bk(t,e){return t.replace(Lde,e)}function Dde(t){return t==="/"||wde.test(t)}function HN(t,e){let{resolvePaths:n,normalizePath:r,pathSeparator:o}=e,s=process.platform==="win32"&&t.includes("/")||t.startsWith(".");if(n&&(t=(0,tr.resolve)(t)),(r||s)&&(t=Mde(t)),t===".")return"";let i=t[t.length-1]!==o;return bk(i?t+o:t,o)}function Ok(t,e){return e+t}function Ude(t,e){return function(n,r){return r.startsWith(t)?r.slice(t.length)+n:bk((0,tr.relative)(t,r),e.pathSeparator)+e.pathSeparator+n}}function kde(t){return t}function jde(t,e,n){return e+t+n}function Bde(t,e){let{relativePaths:n,includeBasePath:r}=e;return n&&t?Ude(t,e):r?Ok:kde}function Gde(t){return function(e,n){n.push(e.substring(t.length)||".")}}function $de(t){return function(e,n,r){let o=e.substring(t.length)||".";r.every(s=>s(o,!0))&&n.push(o)}}function qde(t,e){let{includeDirs:n,filters:r,relativePaths:o}=e;return n?o?r&&r.length?$de(t):Gde(t):r&&r.length?Hde:Fde:Vde}function Qde(t){let{excludeFiles:e,filters:n,onlyCounts:r}=t;return e?Xde:n&&n.length?r?Yde:Wde:r?Kde:zde}function efe(t){return t.group?Zde:Jde}function rfe(t){return t.group?tfe:nfe}function ife(t,e){return!t.resolveSymlinks||t.excludeSymlinks?null:e?sfe:ofe}function Ck(t,e,n){if(n.options.useRealPaths)return afe(e,n);let r=(0,tr.dirname)(t),o=1;for(;r!==n.root&&o<2;){let s=n.symlinks.get(r);!!s&&(s===e||s.startsWith(e)||e.startsWith(s))?o++:r=(0,tr.dirname)(r)}return n.symlinks.set(t,e),o>1}function afe(t,e){return e.visited.includes(t+e.options.pathSeparator)}function Ug(t,e,n,r){e(t&&!r?t:null,n)}function hfe(t,e){let{onlyCounts:n,group:r,maxFiles:o}=t;return n?e?cfe:dfe:r?e?ufe:_fe:o?e?pfe:mfe:e?lfe:ffe}function Tfe(t){return t?Efe:gfe}function Rfe(t,e){return new Promise((n,r)=>{vk(t,e,(o,s)=>{if(o)return r(o);n(s)})})}function vk(t,e,n){new xk(t,e,n).start()}function Ife(t,e){return new xk(t,e).start()}var Nk,tr,vde,Rk,Lde,wde,Fde,Hde,Vde,Yde,Wde,Kde,zde,Xde,Jde,Zde,tfe,nfe,ofe,sfe,cfe,ufe,lfe,pfe,dfe,ffe,mfe,_fe,Pk,gfe,Efe,Sfe,Afe,yfe,xk,Ik,Mk,Lk,wk=S(()=>{p();u();l();Nk=require("module"),tr=require("path"),vde=B(require("fs"),1),Rk=(0,Nk.createRequire)(h);Lde=/[\\/]/g;wde=/^[a-z]:[\\/]$/i;Fde=(t,e)=>{e.push(t||".")},Hde=(t,e,n)=>{let r=t||".";n.every(o=>o(r,!0))&&e.push(r)},Vde=()=>{};Yde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&n.files++},Wde=(t,e,n,r)=>{r.every(o=>o(t,!1))&&e.push(t)},Kde=(t,e,n,r)=>{n.files++},zde=(t,e)=>{e.push(t)},Xde=()=>{};Jde=t=>t,Zde=()=>[""].slice(0,0);tfe=(t,e,n)=>{t.push({directory:e,files:n,dir:e})},nfe=()=>{};ofe=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue(),o.realpath(t,(i,a)=>{if(i)return r.dequeue(s?null:i,e);o.stat(a,(c,d)=>{if(c)return r.dequeue(s?null:c,e);if(d.isDirectory()&&Ck(t,a,e))return r.dequeue(null,e);n(d,a),r.dequeue(null,e)})})},sfe=function(t,e,n){let{queue:r,fs:o,options:{suppressErrors:s}}=e;r.enqueue();try{let i=o.realpathSync(t),a=o.statSync(i);if(a.isDirectory()&&Ck(t,i,e))return;n(a,i)}catch(i){if(!s)throw i}};cfe=t=>t.counts,ufe=t=>t.groups,lfe=t=>t.paths,pfe=t=>t.paths.slice(0,t.options.maxFiles),dfe=(t,e,n)=>(Ug(e,n,t.counts,t.options.suppressErrors),null),ffe=(t,e,n)=>(Ug(e,n,t.paths,t.options.suppressErrors),null),mfe=(t,e,n)=>(Ug(e,n,t.paths.slice(0,t.options.maxFiles),t.options.suppressErrors),null),_fe=(t,e,n)=>(Ug(e,n,t.groups,t.options.suppressErrors),null);Pk={withFileTypes:!0},gfe=(t,e,n,r,o)=>{if(t.queue.enqueue(),r<0)return t.queue.dequeue(null,t);let{fs:s}=t;t.visited.push(e),t.counts.directories++,s.readdir(e||".",Pk,(i,a=[])=>{o(a,n,r),t.queue.dequeue(t.options.suppressErrors?null:i,t)})},Efe=(t,e,n,r,o)=>{let{fs:s}=t;if(r<0)return;t.visited.push(e),t.counts.directories++;let i=[];try{i=s.readdirSync(e||".",Pk)}catch(a){if(!t.options.suppressErrors)throw a}o(i,n,r)};Sfe=class{count=0;constructor(t){this.onQueueEmpty=t}enqueue(){return this.count++,this.count}dequeue(t,e){this.onQueueEmpty&&(--this.count<=0||t)&&(this.onQueueEmpty(t,e),t&&(e.controller.abort(),this.onQueueEmpty=void 0))}},Afe=class{_files=0;_directories=0;set files(t){this._files=t}get files(){return this._files}set directories(t){this._directories=t}get directories(){return this._directories}get dirs(){return this._directories}},yfe=class{aborted=!1;abort(){this.aborted=!0}},xk=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(t,e,n){this.isSynchronous=!n,this.callbackInvoker=hfe(e,this.isSynchronous),this.root=HN(t,e),this.state={root:Dde(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new Afe,options:e,queue:new Sfe((r,o)=>this.callbackInvoker(o,r,n)),symlinks:new Map,visited:[""].slice(0,0),controller:new yfe,fs:e.fs||vde},this.joinPath=Bde(this.root,e),this.pushDirectory=qde(this.root,e),this.pushFile=Qde(e),this.getArray=efe(e),this.groupFiles=rfe(e),this.resolveSymlink=ife(e,this.isSynchronous),this.walkDirectory=Tfe(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(t,e,n)=>{let{paths:r,options:{filters:o,resolveSymlinks:s,excludeSymlinks:i,exclude:a,maxFiles:c,signal:d,useRealPaths:f,pathSeparator:m},controller:_}=this.state;if(_.aborted||d&&d.aborted||c&&r.length>c)return;let g=this.getArray(this.state.paths);for(let T=0;T<t.length;++T){let A=t[T];if(A.isFile()||A.isSymbolicLink()&&!s&&!i){let R=this.joinPath(A.name,e);this.pushFile(R,g,this.state.counts,o)}else if(A.isDirectory()){let R=jde(A.name,e,this.state.options.pathSeparator);if(a&&a(A.name,R))continue;this.pushDirectory(R,r,o),this.walkDirectory(this.state,R,R,n-1,this.walk)}else if(this.resolveSymlink&&A.isSymbolicLink()){let R=Ok(A.name,e);this.resolveSymlink(R,this.state,(b,I)=>{if(b.isDirectory()){if(I=HN(I,this.state.options),a&&a(A.name,f?I:R+m))return;this.walkDirectory(this.state,I,f?I:R+m,n-1,this.walk)}else{I=f?I:R;let C=(0,tr.basename)(I),O=HN((0,tr.dirname)(I),this.state.options);I=this.joinPath(C,O),this.pushFile(I,g,this.state.counts,o)}})}}this.groupFiles(this.state.groups,e,g)}};Ik=class{constructor(t,e){this.root=t,this.options=e}withPromise(){return Rfe(this.root,this.options)}withCallback(t){vk(this.root,this.options,t)}sync(){return Ife(this.root,this.options)}},Mk=null;try{Rk.resolve("picomatch"),Mk=Rk("picomatch")}catch{}Lk=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:tr.sep,filters:[]};globFunction;constructor(t){this.options={...this.options,...t},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(t){return this.options.pathSeparator=t,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(t){return this.options.maxDepth=t,this}withMaxFiles(t){return this.options.maxFiles=t,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:t=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=t,this.withFullPaths()}withAbortSignal(t){return this.options.signal=t,this}normalize(){return this.options.normalizePath=!0,this}filter(t){return this.options.filters.push(t),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(t){return this.options.exclude=t,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(t){return new Ik(t||".",this.options)}withGlobFunction(t){return this.globFunction=t,this}crawlWithOptions(t,e){return this.options={...this.options,...e},new Ik(t||".",this.options)}glob(...t){return this.globFunction?this.globWithOptions(t):this.globWithOptions(t,{dot:!0})}globWithOptions(t,...e){let n=this.globFunction||Mk;if(!n)throw new Error("Please specify a glob function to use glob matching.");var r=this.globCache[t.join("\0")];return r||(r=n(t,...e),this.globCache[t.join("\0")]=r),this.options.filters.push(o=>r(o)),this}}});var vf=y((E6e,Bk)=>{"use strict";p();u();l();var Dk="[^\\\\/]",Nfe="(?=.)",Uk="[^/]",VN="(?:\\/|$)",kk="(?:^|\\/)",qN=`\\.{1,2}${VN}`,bfe="(?!\\.)",Ofe=`(?!${kk}${qN})`,Cfe=`(?!\\.{0,1}${VN})`,Pfe=`(?!${qN})`,xfe="[^.\\/]",vfe=`${Uk}*?`,Mfe="/",jk={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:Nfe,QMARK:Uk,END_ANCHOR:VN,DOTS_SLASH:qN,NO_DOT:bfe,NO_DOTS:Ofe,NO_DOT_SLASH:Cfe,NO_DOTS_SLASH:Pfe,QMARK_NO_DOT:xfe,STAR:vfe,START_ANCHOR:kk,SEP:Mfe},Lfe={...jk,SLASH_LITERAL:"[\\\\/]",QMARK:Dk,STAR:`${Dk}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},wfe={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};Bk.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:wfe,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Lfe:jk}}});var Mf=y(Nr=>{"use strict";p();u();l();var{REGEX_BACKSLASH:Dfe,REGEX_REMOVE_BACKSLASH:Ufe,REGEX_SPECIAL_CHARS:kfe,REGEX_SPECIAL_CHARS_GLOBAL:jfe}=vf();Nr.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Nr.hasRegexChars=t=>kfe.test(t);Nr.isRegexChar=t=>t.length===1&&Nr.hasRegexChars(t);Nr.escapeRegex=t=>t.replace(jfe,"\\$1");Nr.toPosixSlashes=t=>t.replace(Dfe,"/");Nr.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let t=navigator.platform.toLowerCase();return t==="win32"||t==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Nr.removeBackslashes=t=>t.replace(Ufe,e=>e==="\\"?"":e);Nr.escapeLast=(t,e,n)=>{let r=t.lastIndexOf(e,n);return r===-1?t:t[r-1]==="\\"?Nr.escapeLast(t,e,r-1):`${t.slice(0,r)}\\${t.slice(r)}`};Nr.removePrefix=(t,e={})=>{let n=t;return n.startsWith("./")&&(n=n.slice(2),e.prefix="./"),n};Nr.wrapOutput=(t,e={},n={})=>{let r=n.contains?"":"^",o=n.contains?"":"$",s=`${r}(?:${t})${o}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};Nr.basename=(t,{windows:e}={})=>{let n=t.split(e?/[\\/]/:"/"),r=n[n.length-1];return r===""?n[n.length-2]:r}});var Wk=y((b6e,Yk)=>{"use strict";p();u();l();var Gk=Mf(),{CHAR_ASTERISK:YN,CHAR_AT:Bfe,CHAR_BACKWARD_SLASH:Lf,CHAR_COMMA:Gfe,CHAR_DOT:WN,CHAR_EXCLAMATION_MARK:KN,CHAR_FORWARD_SLASH:qk,CHAR_LEFT_CURLY_BRACE:zN,CHAR_LEFT_PARENTHESES:XN,CHAR_LEFT_SQUARE_BRACKET:$fe,CHAR_PLUS:Ffe,CHAR_QUESTION_MARK:$k,CHAR_RIGHT_CURLY_BRACE:Hfe,CHAR_RIGHT_PARENTHESES:Fk,CHAR_RIGHT_SQUARE_BRACKET:Vfe}=vf(),Hk=t=>t===qk||t===Lf,Vk=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},qfe=(t,e)=>{let n=e||{},r=t.length-1,o=n.parts===!0||n.scanToEnd===!0,s=[],i=[],a=[],c=t,d=-1,f=0,m=0,_=!1,g=!1,T=!1,A=!1,R=!1,b=!1,I=!1,C=!1,O=!1,k=!1,L=0,K,j,ee={value:"",depth:0,isGlob:!1},P=()=>d>=r,Tt=()=>c.charCodeAt(d+1),ze=()=>(K=j,c.charCodeAt(++d));for(;d<r;){j=ze();let je;if(j===Lf){I=ee.backslashes=!0,j=ze(),j===zN&&(b=!0);continue}if(b===!0||j===zN){for(L++;P()!==!0&&(j=ze());){if(j===Lf){I=ee.backslashes=!0,ze();continue}if(j===zN){L++;continue}if(b!==!0&&j===WN&&(j=ze())===WN){if(_=ee.isBrace=!0,T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(b!==!0&&j===Gfe){if(_=ee.isBrace=!0,T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===Hfe&&(L--,L===0)){b=!1,_=ee.isBrace=!0,k=!0;break}}if(o===!0)continue;break}if(j===qk){if(s.push(d),i.push(ee),ee={value:"",depth:0,isGlob:!1},k===!0)continue;if(K===WN&&d===f+1){f+=2;continue}m=d+1;continue}if(n.noext!==!0&&(j===Ffe||j===Bfe||j===YN||j===$k||j===KN)===!0&&Tt()===XN){if(T=ee.isGlob=!0,A=ee.isExtglob=!0,k=!0,j===KN&&d===f&&(O=!0),o===!0){for(;P()!==!0&&(j=ze());){if(j===Lf){I=ee.backslashes=!0,j=ze();continue}if(j===Fk){T=ee.isGlob=!0,k=!0;break}}continue}break}if(j===YN){if(K===YN&&(R=ee.isGlobstar=!0),T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===$k){if(T=ee.isGlob=!0,k=!0,o===!0)continue;break}if(j===$fe){for(;P()!==!0&&(je=ze());){if(je===Lf){I=ee.backslashes=!0,ze();continue}if(je===Vfe){g=ee.isBracket=!0,T=ee.isGlob=!0,k=!0;break}}if(o===!0)continue;break}if(n.nonegate!==!0&&j===KN&&d===f){C=ee.negated=!0,f++;continue}if(n.noparen!==!0&&j===XN){if(T=ee.isGlob=!0,o===!0){for(;P()!==!0&&(j=ze());){if(j===XN){I=ee.backslashes=!0,j=ze();continue}if(j===Fk){k=!0;break}}continue}break}if(T===!0){if(k=!0,o===!0)continue;break}}n.noext===!0&&(A=!1,T=!1);let Ce=c,x="",v="";f>0&&(x=c.slice(0,f),c=c.slice(f),m-=f),Ce&&T===!0&&m>0?(Ce=c.slice(0,m),v=c.slice(m)):T===!0?(Ce="",v=c):Ce=c,Ce&&Ce!==""&&Ce!=="/"&&Ce!==c&&Hk(Ce.charCodeAt(Ce.length-1))&&(Ce=Ce.slice(0,-1)),n.unescape===!0&&(v&&(v=Gk.removeBackslashes(v)),Ce&&I===!0&&(Ce=Gk.removeBackslashes(Ce)));let Qn={prefix:x,input:t,start:f,base:Ce,glob:v,isBrace:_,isBracket:g,isGlob:T,isExtglob:A,isGlobstar:R,negated:C,negatedExtglob:O};if(n.tokens===!0&&(Qn.maxDepth=0,Hk(j)||i.push(ee),Qn.tokens=i),n.parts===!0||n.tokens===!0){let je;for(let Je=0;Je<s.length;Je++){let _o=je?je+1:f,ho=s[Je],la=t.slice(_o,ho);n.tokens&&(Je===0&&f!==0?(i[Je].isPrefix=!0,i[Je].value=x):i[Je].value=la,Vk(i[Je]),Qn.maxDepth+=i[Je].depth),(Je!==0||la!=="")&&a.push(la),je=ho}if(je&&je+1<t.length){let Je=t.slice(je+1);a.push(Je),n.tokens&&(i[i.length-1].value=Je,Vk(i[i.length-1]),Qn.maxDepth+=i[i.length-1].depth)}Qn.slashes=s,Qn.parts=a}return Qn};Yk.exports=qfe});var Xk=y((x6e,zk)=>{"use strict";p();u();l();var kg=vf(),Ns=Mf(),{MAX_LENGTH:jg,POSIX_REGEX_SOURCE:Yfe,REGEX_NON_SPECIAL_CHARS:Wfe,REGEX_SPECIAL_CHARS_BACKREF:Kfe,REPLACEMENTS:Kk}=kg,zfe=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let n=`[${t.join("-")}]`;try{new RegExp(n)}catch{return t.map(o=>Ns.escapeRegex(o)).join("..")}return n},Ol=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,QN=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=Kk[t]||t;let n={...e},r=typeof n.maxLength=="number"?Math.min(jg,n.maxLength):jg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);let s={type:"bos",value:"",output:n.prepend||""},i=[s],a=n.capture?"":"?:",c=kg.globChars(n.windows),d=kg.extglobChars(c),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:_,ONE_CHAR:g,DOTS_SLASH:T,NO_DOT:A,NO_DOT_SLASH:R,NO_DOTS_SLASH:b,QMARK:I,QMARK_NO_DOT:C,STAR:O,START_ANCHOR:k}=c,L=z=>`(${a}(?:(?!${k}${z.dot?T:f}).)*?)`,K=n.dot?"":A,j=n.dot?I:C,ee=n.bash===!0?L(n):O;n.capture&&(ee=`(${ee})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);let P={input:t,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Ns.removePrefix(t,P),o=t.length;let Tt=[],ze=[],Ce=[],x=s,v,Qn=()=>P.index===o-1,je=P.peek=(z=1)=>t[P.index+z],Je=P.advance=()=>t[++P.index]||"",_o=()=>t.slice(P.index+1),ho=(z="",nt=0)=>{P.consumed+=z,P.index+=nt},la=z=>{P.output+=z.output!=null?z.output:z.value,ho(z.value)},Cue=()=>{let z=1;for(;je()==="!"&&(je(2)!=="("||je(3)==="?");)Je(),P.start++,z++;return z%2===0?!1:(P.negated=!0,P.start++,!0)},Sg=z=>{P[z]++,Ce.push(z)},Hc=z=>{P[z]--,Ce.pop()},Me=z=>{if(x.type==="globstar"){let nt=P.braces>0&&(z.type==="comma"||z.type==="brace"),$=z.extglob===!0||Tt.length&&(z.type==="pipe"||z.type==="paren");z.type!=="slash"&&z.type!=="paren"&&!nt&&!$&&(P.output=P.output.slice(0,-x.output.length),x.type="star",x.value="*",x.output=ee,P.output+=x.output)}if(Tt.length&&z.type!=="paren"&&(Tt[Tt.length-1].inner+=z.value),(z.value||z.output)&&la(z),x&&x.type==="text"&&z.type==="text"){x.output=(x.output||x.value)+z.value,x.value+=z.value;return}z.prev=x,i.push(z),x=z},Ag=(z,nt)=>{let $={...d[nt],conditions:1,inner:""};$.prev=x,$.parens=P.parens,$.output=P.output;let xe=(n.capture?"(":"")+$.open;Sg("parens"),Me({type:z,value:nt,output:P.output?"":g}),Me({type:"paren",extglob:!0,value:Je(),output:xe}),Tt.push($)},Pue=z=>{let nt=z.close+(n.capture?")":""),$;if(z.type==="negate"){let xe=ee;if(z.inner&&z.inner.length>1&&z.inner.includes("/")&&(xe=L(n)),(xe!==ee||Qn()||/^\)+$/.test(_o()))&&(nt=z.close=`)$))${xe}`),z.inner.includes("*")&&($=_o())&&/^\.[^\\/.]+$/.test($)){let dt=QN($,{...e,fastpaths:!1}).output;nt=z.close=`)${dt})${xe})`}z.prev.type==="bos"&&(P.negatedExtglob=!0)}Me({type:"paren",extglob:!0,value:v,output:nt}),Hc("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let z=!1,nt=t.replace(Kfe,($,xe,dt,Jn,Zt,RN)=>Jn==="\\"?(z=!0,$):Jn==="?"?xe?xe+Jn+(Zt?I.repeat(Zt.length):""):RN===0?j+(Zt?I.repeat(Zt.length):""):I.repeat(dt.length):Jn==="."?f.repeat(dt.length):Jn==="*"?xe?xe+Jn+(Zt?ee:""):ee:xe?$:`\\${$}`);return z===!0&&(n.unescape===!0?nt=nt.replace(/\\/g,""):nt=nt.replace(/\\+/g,$=>$.length%2===0?"\\\\":$?"\\":"")),nt===t&&n.contains===!0?(P.output=t,P):(P.output=Ns.wrapOutput(nt,P,e),P)}for(;!Qn();){if(v=Je(),v==="\0")continue;if(v==="\\"){let $=je();if($==="/"&&n.bash!==!0||$==="."||$===";")continue;if(!$){v+="\\",Me({type:"text",value:v});continue}let xe=/^\\+/.exec(_o()),dt=0;if(xe&&xe[0].length>2&&(dt=xe[0].length,P.index+=dt,dt%2!==0&&(v+="\\")),n.unescape===!0?v=Je():v+=Je(),P.brackets===0){Me({type:"text",value:v});continue}}if(P.brackets>0&&(v!=="]"||x.value==="["||x.value==="[^")){if(n.posix!==!1&&v===":"){let $=x.value.slice(1);if($.includes("[")&&(x.posix=!0,$.includes(":"))){let xe=x.value.lastIndexOf("["),dt=x.value.slice(0,xe),Jn=x.value.slice(xe+2),Zt=Yfe[Jn];if(Zt){x.value=dt+Zt,P.backtrack=!0,Je(),!s.output&&i.indexOf(x)===1&&(s.output=g);continue}}}(v==="["&&je()!==":"||v==="-"&&je()==="]")&&(v=`\\${v}`),v==="]"&&(x.value==="["||x.value==="[^")&&(v=`\\${v}`),n.posix===!0&&v==="!"&&x.value==="["&&(v="^"),x.value+=v,la({value:v});continue}if(P.quotes===1&&v!=='"'){v=Ns.escapeRegex(v),x.value+=v,la({value:v});continue}if(v==='"'){P.quotes=P.quotes===1?0:1,n.keepQuotes===!0&&Me({type:"text",value:v});continue}if(v==="("){Sg("parens"),Me({type:"paren",value:v});continue}if(v===")"){if(P.parens===0&&n.strictBrackets===!0)throw new SyntaxError(Ol("opening","("));let $=Tt[Tt.length-1];if($&&P.parens===$.parens+1){Pue(Tt.pop());continue}Me({type:"paren",value:v,output:P.parens?")":"\\)"}),Hc("parens");continue}if(v==="["){if(n.nobracket===!0||!_o().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(Ol("closing","]"));v=`\\${v}`}else Sg("brackets");Me({type:"bracket",value:v});continue}if(v==="]"){if(n.nobracket===!0||x&&x.type==="bracket"&&x.value.length===1){Me({type:"text",value:v,output:`\\${v}`});continue}if(P.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(Ol("opening","["));Me({type:"text",value:v,output:`\\${v}`});continue}Hc("brackets");let $=x.value.slice(1);if(x.posix!==!0&&$[0]==="^"&&!$.includes("/")&&(v=`/${v}`),x.value+=v,la({value:v}),n.literalBrackets===!1||Ns.hasRegexChars($))continue;let xe=Ns.escapeRegex(x.value);if(P.output=P.output.slice(0,-x.value.length),n.literalBrackets===!0){P.output+=xe,x.value=xe;continue}x.value=`(${a}${xe}|${x.value})`,P.output+=x.value;continue}if(v==="{"&&n.nobrace!==!0){Sg("braces");let $={type:"brace",value:v,output:"(",outputIndex:P.output.length,tokensIndex:P.tokens.length};ze.push($),Me($);continue}if(v==="}"){let $=ze[ze.length-1];if(n.nobrace===!0||!$){Me({type:"text",value:v,output:v});continue}let xe=")";if($.dots===!0){let dt=i.slice(),Jn=[];for(let Zt=dt.length-1;Zt>=0&&(i.pop(),dt[Zt].type!=="brace");Zt--)dt[Zt].type!=="dots"&&Jn.unshift(dt[Zt].value);xe=zfe(Jn,n),P.backtrack=!0}if($.comma!==!0&&$.dots!==!0){let dt=P.output.slice(0,$.outputIndex),Jn=P.tokens.slice($.tokensIndex);$.value=$.output="\\{",v=xe="\\}",P.output=dt;for(let Zt of Jn)P.output+=Zt.output||Zt.value}Me({type:"brace",value:v,output:xe}),Hc("braces"),ze.pop();continue}if(v==="|"){Tt.length>0&&Tt[Tt.length-1].conditions++,Me({type:"text",value:v});continue}if(v===","){let $=v,xe=ze[ze.length-1];xe&&Ce[Ce.length-1]==="braces"&&(xe.comma=!0,$="|"),Me({type:"comma",value:v,output:$});continue}if(v==="/"){if(x.type==="dot"&&P.index===P.start+1){P.start=P.index+1,P.consumed="",P.output="",i.pop(),x=s;continue}Me({type:"slash",value:v,output:_});continue}if(v==="."){if(P.braces>0&&x.type==="dot"){x.value==="."&&(x.output=f);let $=ze[ze.length-1];x.type="dots",x.output+=v,x.value+=v,$.dots=!0;continue}if(P.braces+P.parens===0&&x.type!=="bos"&&x.type!=="slash"){Me({type:"text",value:v,output:f});continue}Me({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(x&&x.value==="(")&&n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ag("qmark",v);continue}if(x&&x.type==="paren"){let xe=je(),dt=v;(x.value==="("&&!/[!=<:]/.test(xe)||xe==="<"&&!/<([!=]|\w+>)/.test(_o()))&&(dt=`\\${v}`),Me({type:"text",value:v,output:dt});continue}if(n.dot!==!0&&(x.type==="slash"||x.type==="bos")){Me({type:"qmark",value:v,output:C});continue}Me({type:"qmark",value:v,output:I});continue}if(v==="!"){if(n.noextglob!==!0&&je()==="("&&(je(2)!=="?"||!/[!=<:]/.test(je(3)))){Ag("negate",v);continue}if(n.nonegate!==!0&&P.index===0){Cue();continue}}if(v==="+"){if(n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Ag("plus",v);continue}if(x&&x.value==="("||n.regex===!1){Me({type:"plus",value:v,output:m});continue}if(x&&(x.type==="bracket"||x.type==="paren"||x.type==="brace")||P.parens>0){Me({type:"plus",value:v});continue}Me({type:"plus",value:m});continue}if(v==="@"){if(n.noextglob!==!0&&je()==="("&&je(2)!=="?"){Me({type:"at",extglob:!0,value:v,output:""});continue}Me({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let $=Wfe.exec(_o());$&&(v+=$[0],P.index+=$[0].length),Me({type:"text",value:v});continue}if(x&&(x.type==="globstar"||x.star===!0)){x.type="star",x.star=!0,x.value+=v,x.output=ee,P.backtrack=!0,P.globstar=!0,ho(v);continue}let z=_o();if(n.noextglob!==!0&&/^\([^?]/.test(z)){Ag("star",v);continue}if(x.type==="star"){if(n.noglobstar===!0){ho(v);continue}let $=x.prev,xe=$.prev,dt=$.type==="slash"||$.type==="bos",Jn=xe&&(xe.type==="star"||xe.type==="globstar");if(n.bash===!0&&(!dt||z[0]&&z[0]!=="/")){Me({type:"star",value:v,output:""});continue}let Zt=P.braces>0&&($.type==="comma"||$.type==="brace"),RN=Tt.length&&($.type==="pipe"||$.type==="paren");if(!dt&&$.type!=="paren"&&!Zt&&!RN){Me({type:"star",value:v,output:""});continue}for(;z.slice(0,3)==="/**";){let yg=t[P.index+4];if(yg&&yg!=="/")break;z=z.slice(3),ho("/**",3)}if($.type==="bos"&&Qn()){x.type="globstar",x.value+=v,x.output=L(n),P.output=x.output,P.globstar=!0,ho(v);continue}if($.type==="slash"&&$.prev.type!=="bos"&&!Jn&&Qn()){P.output=P.output.slice(0,-($.output+x.output).length),$.output=`(?:${$.output}`,x.type="globstar",x.output=L(n)+(n.strictSlashes?")":"|$)"),x.value+=v,P.globstar=!0,P.output+=$.output+x.output,ho(v);continue}if($.type==="slash"&&$.prev.type!=="bos"&&z[0]==="/"){let yg=z[1]!==void 0?"|$":"";P.output=P.output.slice(0,-($.output+x.output).length),$.output=`(?:${$.output}`,x.type="globstar",x.output=`${L(n)}${_}|${_}${yg})`,x.value+=v,P.output+=$.output+x.output,P.globstar=!0,ho(v+Je()),Me({type:"slash",value:"/",output:""});continue}if($.type==="bos"&&z[0]==="/"){x.type="globstar",x.value+=v,x.output=`(?:^|${_}|${L(n)}${_})`,P.output=x.output,P.globstar=!0,ho(v+Je()),Me({type:"slash",value:"/",output:""});continue}P.output=P.output.slice(0,-x.output.length),x.type="globstar",x.output=L(n),x.value+=v,P.output+=x.output,P.globstar=!0,ho(v);continue}let nt={type:"star",value:v,output:ee};if(n.bash===!0){nt.output=".*?",(x.type==="bos"||x.type==="slash")&&(nt.output=K+nt.output),Me(nt);continue}if(x&&(x.type==="bracket"||x.type==="paren")&&n.regex===!0){nt.output=v,Me(nt);continue}(P.index===P.start||x.type==="slash"||x.type==="dot")&&(x.type==="dot"?(P.output+=R,x.output+=R):n.dot===!0?(P.output+=b,x.output+=b):(P.output+=K,x.output+=K),je()!=="*"&&(P.output+=g,x.output+=g)),Me(nt)}for(;P.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing","]"));P.output=Ns.escapeLast(P.output,"["),Hc("brackets")}for(;P.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing",")"));P.output=Ns.escapeLast(P.output,"("),Hc("parens")}for(;P.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(Ol("closing","}"));P.output=Ns.escapeLast(P.output,"{"),Hc("braces")}if(n.strictSlashes!==!0&&(x.type==="star"||x.type==="bracket")&&Me({type:"maybe_slash",value:"",output:`${_}?`}),P.backtrack===!0){P.output="";for(let z of P.tokens)P.output+=z.output!=null?z.output:z.value,z.suffix&&(P.output+=z.suffix)}return P};QN.fastpaths=(t,e)=>{let n={...e},r=typeof n.maxLength=="number"?Math.min(jg,n.maxLength):jg,o=t.length;if(o>r)throw new SyntaxError(`Input length: ${o}, exceeds maximum allowed length: ${r}`);t=Kk[t]||t;let{DOT_LITERAL:s,SLASH_LITERAL:i,ONE_CHAR:a,DOTS_SLASH:c,NO_DOT:d,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:_,START_ANCHOR:g}=kg.globChars(n.windows),T=n.dot?f:d,A=n.dot?m:d,R=n.capture?"":"?:",b={negated:!1,prefix:""},I=n.bash===!0?".*?":_;n.capture&&(I=`(${I})`);let C=K=>K.noglobstar===!0?I:`(${R}(?:(?!${g}${K.dot?c:s}).)*?)`,O=K=>{switch(K){case"*":return`${T}${a}${I}`;case".*":return`${s}${a}${I}`;case"*.*":return`${T}${I}${s}${a}${I}`;case"*/*":return`${T}${I}${i}${a}${A}${I}`;case"**":return T+C(n);case"**/*":return`(?:${T}${C(n)}${i})?${A}${a}${I}`;case"**/*.*":return`(?:${T}${C(n)}${i})?${A}${I}${s}${a}${I}`;case"**/.*":return`(?:${T}${C(n)}${i})?${s}${a}${I}`;default:{let j=/^(.*?)\.(\w+)$/.exec(K);if(!j)return;let ee=O(j[1]);return ee?ee+s+j[2]:void 0}}},k=Ns.removePrefix(t,b),L=O(k);return L&&n.strictSlashes!==!0&&(L+=`${i}?`),L};zk.exports=QN});var Zk=y((w6e,Jk)=>{"use strict";p();u();l();var Xfe=Wk(),JN=Xk(),Qk=Mf(),Qfe=vf(),Jfe=t=>t&&typeof t=="object"&&!Array.isArray(t),Mt=(t,e,n=!1)=>{if(Array.isArray(t)){let f=t.map(_=>Mt(_,e,n));return _=>{for(let g of f){let T=g(_);if(T)return T}return!1}}let r=Jfe(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");let o=e||{},s=o.windows,i=r?Mt.compileRe(t,e):Mt.makeRe(t,e,!1,!0),a=i.state;delete i.state;let c=()=>!1;if(o.ignore){let f={...e,ignore:null,onMatch:null,onResult:null};c=Mt(o.ignore,f,n)}let d=(f,m=!1)=>{let{isMatch:_,match:g,output:T}=Mt.test(f,i,e,{glob:t,posix:s}),A={glob:t,state:a,regex:i,posix:s,input:f,output:T,match:g,isMatch:_};return typeof o.onResult=="function"&&o.onResult(A),_===!1?(A.isMatch=!1,m?A:!1):c(f)?(typeof o.onIgnore=="function"&&o.onIgnore(A),A.isMatch=!1,m?A:!1):(typeof o.onMatch=="function"&&o.onMatch(A),m?A:!0)};return n&&(d.state=a),d};Mt.test=(t,e,n,{glob:r,posix:o}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};let s=n||{},i=s.format||(o?Qk.toPosixSlashes:null),a=t===r,c=a&&i?i(t):t;return a===!1&&(c=i?i(t):t,a=c===r),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Mt.matchBase(t,e,n,o):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Mt.matchBase=(t,e,n)=>(e instanceof RegExp?e:Mt.makeRe(e,n)).test(Qk.basename(t));Mt.isMatch=(t,e,n)=>Mt(e,n)(t);Mt.parse=(t,e)=>Array.isArray(t)?t.map(n=>Mt.parse(n,e)):JN(t,{...e,fastpaths:!1});Mt.scan=(t,e)=>Xfe(t,e);Mt.compileRe=(t,e,n=!1,r=!1)=>{if(n===!0)return t.output;let o=e||{},s=o.contains?"":"^",i=o.contains?"":"$",a=`${s}(?:${t.output})${i}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let c=Mt.toRegex(a,e);return r===!0&&(c.state=t),c};Mt.makeRe=(t,e={},n=!1,r=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let o={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(o.output=JN.fastpaths(t,e)),o.output||(o=JN(t,e)),Mt.compileRe(o,e,n,r)};Mt.toRegex=(t,e)=>{try{let n=e||{};return new RegExp(t,n.flags||(n.nocase?"i":""))}catch(n){if(e&&e.debug===!0)throw n;return/$^/}};Mt.constants=Qfe;Jk.exports=Mt});var r1=y((j6e,n1)=>{"use strict";p();u();l();var e1=Zk(),Zfe=Mf();function t1(t,e,n=!1){return e&&(e.windows===null||e.windows===void 0)&&(e={...e,windows:Zfe.isWindows()}),e1(t,e,n)}Object.assign(t1,e1);n1.exports=t1});function nme(t,e={}){let n=t.length,r=Array(n),o=Array(n),s=!e.noglobstar;for(let i=0;i<n;i++){let a=a1(t[i]);r[i]=a;let c=a.length,d=Array(c);for(let f=0;f<c;f++)d[f]=(0,Pl.default)(a[f],e);o[i]=d}return i=>{let a=i.split("/");if(a[0]===".."&&tme.test(i))return!0;for(let c=0;c<t.length;c++){let d=r[c],f=o[c],m=a.length,_=Math.min(m,d.length),g=0;for(;g<_;){let T=d[g];if(T.includes("/"))return!0;if(!f[g](a[g]))break;if(s&&T==="**")return!0;g++}if(g===m)return!0}return!1}}function o1(t,e,n){if(t===e||e.startsWith(`${t}/`)){if(n){let o=ome(t)?t.length:t.length+1;return(s,i)=>s.slice(o,i?-1:void 0)||"."}let r=e.slice(t.length+1);return r?(o,s)=>{if(o===".")return r;let i=`${r}/${o}`;return s?i.slice(0,-1):i}:(o,s)=>s&&o!=="."?o.slice(0,-1):o}return n?r=>Zo.posix.relative(t,r)||".":r=>Zo.posix.relative(t,`${e}/${r}`)||"."}function sme(t,e){if(e.startsWith(`${t}/`)){let n=e.slice(t.length+1);return r=>`${n}/${r}`}return n=>{let r=Zo.posix.relative(t,`${e}/${n}`);return n.endsWith("/")&&r!==""?`${r}/`:r||"."}}function a1(t){var e;let n=Pl.default.scan(t,ime);return!((e=n.parts)===null||e===void 0)&&e.length?n.parts:[t]}function dme(t,e){if(e?.caseSensitiveMatch===!1)return!0;let n=Pl.default.scan(t);return n.isGlob||n.negated}function Cl(...t){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...t)}function ZN(t,e,n,r,o){let s=t;t.endsWith("/")&&(s=t.slice(0,-1)),!s.endsWith("*")&&e&&(s+="/**");let i=pme(n);Zo.default.isAbsolute(s.replace(mme,""))?s=Zo.posix.relative(i,s):s=Zo.posix.normalize(s);let a=fme.exec(s),c=a1(s);if(a?.[0]){let f=(a[0].length+1)/3,m=0,_=i.split("/");for(;m<f&&c[m+f]===_[_.length+m-f];)s=s.slice(0,(f-m-1)*3)+s.slice((f-m)*3+c[m+f].length+1)||".",m++;let g=Zo.posix.join(n,a[0].slice(m*3));!g.startsWith(".")&&r.root.length>g.length&&(r.root=g,r.depthOffset=-f+m)}if(!o&&r.depthOffset>=0){var d;(d=r.commonPath)!==null&&d!==void 0||(r.commonPath=c);let f=[],m=Math.min(r.commonPath.length,c.length);for(let _=0;_<m;_++){let g=c[_];if(g==="**"&&!c[_+1]){f.pop();break}if(g!==r.commonPath[_]||dme(g)||_===c.length-1)break;f.push(g)}r.depthOffset=f.length,r.commonPath=f,r.root=f.length>0?Zo.posix.join(n,...f):n}return s}function _me({patterns:t=["**/*"],ignore:e=[],expandDirectories:n=!0},r,o){typeof t=="string"&&(t=[t]),typeof e=="string"&&(e=[e]);let s=[],i=[];for(let a of e)a&&(a[0]!=="!"||a[1]==="(")&&i.push(ZN(a,n,r,o,!0));for(let a of t)a&&(a[0]!=="!"||a[1]==="("?s.push(ZN(a,n,r,o,!1)):(a[1]!=="!"||a[2]==="(")&&i.push(ZN(a.slice(1),n,r,o,!0)));return{match:s,ignore:i}}function hme(t,e){for(let n=t.length-1;n>=0;n--){let r=t[n];t[n]=e(r)}return t}function gme(t){return t?t instanceof URL?(0,s1.fileURLToPath)(t).replace(Bg,"/"):Zo.default.resolve(t).replace(Bg,"/"):process.cwd().replace(Bg,"/")}function Eme(t,e={}){let n=process.env.TINYGLOBBY_DEBUG?{...e,debug:!0}:e,r=gme(n.cwd);if(n.debug&&Cl("globbing with:",{patterns:t,options:n,cwd:r}),Array.isArray(t)&&t.length===0)return[{sync:()=>[],withPromise:async()=>[]},!1];let o={root:r,commonPath:null,depthOffset:0},s=_me({...n,patterns:t},r,o);n.debug&&Cl("internal processing patterns:",s);let i={dot:n.dot,nobrace:n.braceExpansion===!1,nocase:n.caseSensitiveMatch===!1,noextglob:n.extglob===!1,noglobstar:n.globstar===!1,posix:!0},a=(0,Pl.default)(s.match,{...i,ignore:s.ignore}),c=(0,Pl.default)(s.ignore,i),d=nme(s.match,i),f=o1(r,o.root,n.absolute),m=n.absolute?f:o1(r,o.root,!0),_={filters:[n.debug?(A,R)=>{let b=f(A,R),I=a(b);return I&&Cl(`matched ${b}`),I}:(A,R)=>a(f(A,R))],exclude:n.debug?(A,R)=>{let b=m(R,!0),I=b!=="."&&!d(b)||c(b);return Cl(I?`skipped ${R}`:`crawling ${R}`),I}:(A,R)=>{let b=m(R,!0);return b!=="."&&!d(b)||c(b)},fs:n.fs?{readdir:n.fs.readdir||qc.default.readdir,readdirSync:n.fs.readdirSync||qc.default.readdirSync,realpath:n.fs.realpath||qc.default.realpath,realpathSync:n.fs.realpathSync||qc.default.realpathSync,stat:n.fs.stat||qc.default.stat,statSync:n.fs.statSync||qc.default.statSync}:void 0,pathSeparator:"/",relativePaths:!0,resolveSymlinks:!0,signal:n.signal};n.deep!==void 0&&(_.maxDepth=Math.round(n.deep-o.depthOffset)),n.absolute&&(_.relativePaths=!1,_.resolvePaths=!0,_.includeBasePath=!0),n.followSymbolicLinks===!1&&(_.resolveSymlinks=!1,_.excludeSymlinks=!0),n.onlyDirectories?(_.excludeFiles=!0,_.includeDirs=!0):n.onlyFiles===!1&&(_.includeDirs=!0),o.root=o.root.replace(Bg,"");let g=o.root;n.debug&&Cl("internal properties:",o);let T=r!==g&&!n.absolute&&sme(r,o.root);return[new Lk(_).crawl(g),T]}async function c1(t,e){if(t&&e?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let n=eme(t)||typeof t=="string",r=n?e:t,o=n?t:t.patterns,[s,i]=Eme(o,r);return i?hme(await s.withPromise(),i):s.withPromise()}var qc,Zo,s1,Pl,eme,i1,tme,rme,ome,ime,ame,cme,ume,lme,pme,fme,mme,Bg,u1=S(()=>{p();u();l();qc=B(require("fs"),1),Zo=B(require("path"),1),s1=require("url");wk();Pl=B(r1(),1),eme=Array.isArray,i1=process.platform==="win32",tme=/^(\/?\.\.)+$/;rme=/^[A-Z]:\/$/i,ome=i1?t=>rme.test(t):t=>t==="/";ime={parts:!0};ame=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,cme=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,ume=t=>t.replace(ame,"\\$&"),lme=t=>t.replace(cme,"\\$&"),pme=i1?lme:ume;fme=/^(\/?\.\.)+/,mme=/\\(?=[()[\]{}!*+?@|])/g,Bg=/\\/g});var Gg,$g,eb,Tme,tb,l1,p1,Sme,d1=S(()=>{p();u();l();Gg="0123456789abcdef",$g=class t{constructor(e){this.bytes=e}static ofInner(e){if(e.length!==16)throw new TypeError("not 128-bit length");return new t(e)}static fromFieldsV7(e,n,r,o){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(o)||e<0||n<0||r<0||o<0||e>0xffffffffffff||n>4095||r>1073741823||o>4294967295)throw new RangeError("invalid field value");let s=new Uint8Array(16);return s[0]=e/2**40,s[1]=e/2**32,s[2]=e/2**24,s[3]=e/2**16,s[4]=e/2**8,s[5]=e,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=o>>>24,s[13]=o>>>16,s[14]=o>>>8,s[15]=o,new t(s)}static parse(e){var n,r,o,s;let i;switch(e.length){case 32:i=(n=/^[0-9a-f]{32}$/i.exec(e))===null||n===void 0?void 0:n[0];break;case 36:i=(r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 38:i=(o=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e))===null||o===void 0?void 0:o.slice(1,6).join("");break;case 45:i=(s=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e))===null||s===void 0?void 0:s.slice(1,6).join("");break;default:break}if(i){let a=new Uint8Array(16);for(let c=0;c<16;c+=4){let d=parseInt(i.substring(2*c,2*c+8),16);a[c+0]=d>>>24,a[c+1]=d>>>16,a[c+2]=d>>>8,a[c+3]=d}return new t(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let e="";for(let n=0;n<this.bytes.length;n++)e+=Gg.charAt(this.bytes[n]>>>4),e+=Gg.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(e+="-");return e}toHex(){let e="";for(let n=0;n<this.bytes.length;n++)e+=Gg.charAt(this.bytes[n]>>>4),e+=Gg.charAt(this.bytes[n]&15);return e}toJSON(){return this.toString()}getVariant(){let e=this.bytes[8]>>>4;if(e<0)throw new Error("unreachable");if(e<=7)return this.bytes.every(n=>n===0)?"NIL":"VAR_0";if(e<=11)return"VAR_10";if(e<=13)return"VAR_110";if(e<=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 t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(let n=0;n<16;n++){let r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},eb=class{constructor(e){this.timestamp_biased=0,this.counter=0,this.random=e??Tme()}generate(){return this.generateOrResetCore(Date.now(),1e4)}generateOrAbort(){return this.generateOrAbortCore(Date.now(),1e4)}generateOrResetCore(e,n){let r=this.generateOrAbortCore(e,n);return r===void 0&&(this.timestamp_biased=0,r=this.generateOrAbortCore(e,n)),r}generateOrAbortCore(e,n){if(!Number.isInteger(e)||e<0||e>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(e++,e>this.timestamp_biased)this.timestamp_biased=e,this.resetCounter();else if(e+n>=this.timestamp_biased)this.counter++,this.counter>4398046511103&&(this.timestamp_biased++,this.resetCounter());else return;return $g.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 e=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return e[6]=64|e[6]>>>4,e[8]=128|e[8]>>>2,$g.ofInner(e)}},Tme=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new tb;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)}},tb=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++]}},p1=()=>Sme().toString(),Sme=()=>(l1||(l1=new eb)).generate()});var Fg,bs,f1,m1,nb,rb,Ame,yme,p=S(()=>{"use strict";Fg=require("node:child_process"),bs=require("node:fs/promises"),f1=require("node:sqlite"),m1=B(yk(),1);u1();d1();nb=class{stmt;constructor(e){this.stmt=e}get(...e){return this.stmt.get(...e)}all(...e){return this.stmt.all(...e)}run(...e){this.stmt.run(...e)}},rb=class{db;constructor(e){this.db=new f1.DatabaseSync(e)}exec(e){this.db.exec(e)}query(e){return new nb(this.db.prepare(e))}close(){this.db.close()}transaction(e){return()=>{this.db.exec("BEGIN");try{let n=e();return this.db.exec("COMMIT"),n}catch(n){throw this.db.exec("ROLLBACK"),n}}}},Ame={Database:rb};globalThis.__bun_sqlite_polyfill=Ame;yme={file(t){return{async exists(){try{return await(0,bs.access)(t),!0}catch{return!1}},text(){return(0,bs.readFile)(t,"utf-8")},async json(){let e=await(0,bs.readFile)(t,"utf-8");return JSON.parse(e)}}},async write(t,e){if(e instanceof Response){let n=await e.arrayBuffer();await(0,bs.writeFile)(t,Buffer.from(n))}else e instanceof ArrayBuffer?await(0,bs.writeFile)(t,Buffer.from(e)):e instanceof Uint8Array?await(0,bs.writeFile)(t,e):await(0,bs.writeFile)(t,e,"utf-8")},which(t){try{let n=process.platform==="win32"?`where ${t}`:`which ${t}`;return(0,Fg.execSync)(n,{encoding:"utf-8",stdio:["pipe","pipe","ignore"]}).trim().split(`
4
4
  `)[0]||null}catch{return null}},spawn(t,e){let[n,...r]=t,o=["ignore",e?.stdout??"ignore",e?.stderr??"ignore"],s=(0,Fg.spawn)(n,r,{detached:!0,stdio:o});return{unref(){s.unref()}}},sleep(t){return new Promise(e=>setTimeout(e,t))},Glob:class{pattern;constructor(e){this.pattern=e}async*scan(e){let n=await c1(this.pattern,{cwd:e?.cwd||process.cwd()});for(let r of n)yield r}},randomUUIDv7(){return p1()},semver:{order:m1.compare}};globalThis.Bun=yme});function y1(t,e){let n=t.env?.[e];return typeof n=="string"&&n!=="0"}function ub(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function es(t){return Array.from(t).map((e,n)=>{let r=e.toUpperCase(),o=e.toLowerCase();return n===0||r!==e||r===o?e:`-${o}`}).join("")}function Rme(t){let e=new Map;return{get:(...n)=>e.get(n.join(","))??t,set:(n,...r)=>{e.set(r.join(","),n)}}}function Ime(t,e,n){let{threshold:r,weights:o}=n;if(t===e)return 0;let s=Math.abs(t.length-e.length);if(typeof r=="number"&&s>r)return 1/0;let i=Rme(1/0);i.set(0,-1,-1);for(let d=0;d<e.length;++d)i.set((d+1)*o.insertion,-1,d);for(let d=0;d<t.length;++d)i.set((d+1)*o.deletion,d,-1);let a=-1/0;for(let d=0;d<t.length;++d){let f=1/0;for(let m=0;m<=e.length-1;++m){let _=t[d]===e[m]?0:1,g=[i.get(d-1,m)+o.deletion,i.get(d,m-1)+o.insertion,i.get(d-1,m-1)+_*o.substitution];t[d]===e[m-1]&&t[d-1]===e[m]&&g.push(i.get(d-2,m-2)+_*o.transposition);let T=Math.min(...g);i.set(T,d,m),T<f&&(f=T)}if(f>r){if(a>r)return 1/0;a=f}else a=-1/0}let c=i.get(t.length-1,e.length-1);return c>r?1/0:c}function Nme(t,e,n){let r=t[1]-e[1];if(r!==0)return r;let o=t[0].startsWith(n),s=e[0].startsWith(n);return o&&!s?-1:!o&&s?1:t[0].localeCompare(e[0])}function Df(t,e,n){let r=e.map(s=>[s,Ime(t,s,n)]).filter(([,s])=>s<=n.threshold),o=Math.min(...r.map(([,s])=>s));return r.filter(([,s])=>s===o).sort((s,i)=>Nme(s,i,t)).map(([s])=>s)}function Hg(t){return t instanceof Error?t.stack??String(t):String(t)}function bme(t,e){let n=[],r=Math.max(t.length,e.length);for(let o=0;o<r;++o)n[o]=Math.max(t[o],e[o]);return n}function Vg(t,e){if(t.length===0)return[];let n=Array(Math.max(...t.map(o=>o.length))).fill(0,0),r=t.reduce((o,s)=>{let i=s.map(a=>a.length);return bme(o,i)},n);return t.map(o=>{let s=(o[0]??"").padEnd(r[0]);return o.slice(1).reduce((i,a,c,d)=>{let f=d.length===c+1?a:a.padEnd(r[c+1]);return[...i,e?.[c]??" ",f]},[s]).join("").trimEnd()})}function lb(t,e){if(t.length<=1)return t[0]??"";if(t.length===2)return t.join(` ${e.conjunction} `);let n=t.slice(0,t.length-1).join(", ");return e.serialComma&&(n+=","),[n,e.conjunction,t[t.length-1]].join(" ")}function Ome(t,e){return t.reduce((n,r)=>{let o=e(r),s=n[o]??[];return s.push(r),n[o]=s,n},{})}function Cme(t,e){return Ome(t,n=>n[e])}async function ob(t){let e=await Promise.allSettled(t),n=Cme(e,"status");return n.rejected&&n.rejected.length>0?{status:"rejected",reasons:n.rejected.map(r=>r.reason)}:{status:"fulfilled",value:n.fulfilled?.map(r=>r.value)??[]}}function Mme(t,e){let n=t.constructor.name,r=e[n];return r?r(t):t.message}function Lme(t,e,n){return Object.fromEntries(Object.entries(e).map(([r,o])=>{let s=o,i=t[s];if(!i){let a=Si(s,n);throw new wf(a,[],r)}return[r,[s,i]]}))}function sb(t,e){return t.placeholder?t.placeholder:typeof e=="number"?`arg${e}`:"args"}function Si(t,e){return e==="allow-kebab-for-camel"?es(t):t}function Yc(t,e,n,r){try{return e.parse.call(r,n)}catch(o){throw new cb(t,n,o)}}function g1(t){if(t.startsWith("no")&&t.length>2){if(t[2]==="-")return t.slice(4);let e=t[2],n=e.toUpperCase();return e!==n?void 0:e.toLowerCase()+t.slice(3)}}function R1(t,e,n){let r=t,o=e[r],s,i=!1;if(!o){let c=g1(r);if(c&&(o=e[c],o&&o.kind=="boolean")){if(o.withNegated!==!1)return{namedFlag:[c,o],negated:!0};s=c,o=void 0}}let a=ub(t);if(n.caseStyle==="allow-kebab-for-camel"&&!o){if(o=e[a],o)return{namedFlag:[a,o]};let c=g1(a);if(c&&(o=e[c],o&&o.kind=="boolean")){if(o.withNegated!==!1)return{namedFlag:[c,o],negated:!0};s=c,i=!0,o=void 0}}if(!o){if(s){let f=s;throw i&&t.includes("-")&&(f=es(s)),new wf(t,[f])}if(a in e)throw new wf(t,[a]);let c=es(t);if(c in e)throw new wf(t,[c]);let d=Df(r,Object.keys(e),n.distanceOptions);throw new wf(t,d)}return{namedFlag:[r,o]}}function E1(t){return t.namedFlag[1].kind==="boolean"||t.namedFlag[1].kind==="counter"}function Dme(t,e,n,r){let o=I1.exec(t);if(o){let i=o[1];return Array.from(i).map(a=>{let c=a,d=n[c];if(!d)throw new db(c);return{namedFlag:d}})}let s=wme.exec(t);if(s){let i=s[1];return[R1(i,e,r)]}return[]}function Bme(t,e,n,r){let o=Ume.exec(t);if(o){let i=o[1],{namedFlag:a,negated:c}=R1(i,e,r),d=o[2];if(c)throw new jme(i,d);return[a,d]}let s=kme.exec(t);if(s){let i=s[1],a=n[i];if(!a)throw new db(i);let c=s[2];return[a,c]}}async function Gme(t,e,n,r,o){if(!n){if("default"in e&&typeof e.default<"u"){if(e.kind==="boolean")return e.default;if(e.kind==="enum"){if("variadic"in e&&e.variadic&&Array.isArray(e.default)){let i=e.default;for(let a of i)if(!e.values.includes(a)){let c=Df(a,e.values,r.distanceOptions);throw new ib(t,a,e.values,c)}return e.default}return e.default}if("variadic"in e&&e.variadic&&Array.isArray(e.default)){let i=e.default;return Promise.all(i.map(a=>Yc(t,e,a,o)))}return Yc(t,e,e.default,o)}if(e.optional)return;if(e.kind==="boolean")return!1;if(e.kind==="counter")return 0;throw new xl(t)}if(e.kind==="counter")return n.reduce((i,a)=>{try{return i+pb.call(o,a)}catch(c){throw new cb(t,a,c)}},0);if("variadic"in e&&e.variadic){if(e.kind==="enum"){for(let i of n)if(!e.values.includes(i)){let a=Df(i,e.values,r.distanceOptions);throw new ib(t,i,e.values,a)}return n}return Promise.all(n.map(i=>Yc(t,e,i,o)))}let s=n[0];if(e.kind==="boolean")try{return vme.call(o,s)}catch(i){throw new cb(t,s,i)}if(e.kind==="enum"){if(!e.values.includes(s)){let i=Df(s,e.values,r.distanceOptions);throw new ib(t,s,e.values,i)}return s}return Yc(t,e,s,o)}function N1(t){return t.kind==="counter"?!0:"variadic"in t?!!t.variadic:!1}function Ti(t,e,[n,r],o){let s=t.get(n)??[];if(s.length>0&&!N1(r)){let i=Si(n,e);throw new $me(i,s[0],o)}if("variadic"in r&&typeof r.variadic=="string"){let i=o.split(r.variadic);t.set(n,[...s,...i])}else t.set(n,[...s,o])}function ab(t,e,n){if(e.get(n)){let o=t[n];return!N1(o)}return!1}function Fme(t,e){let{flags:n={},aliases:r={},positional:o={kind:"tuple",parameters:[]}}=t,s=Lme(n,r,e.caseStyle),i=[],a=new Map,c=0,d,f=!1;return{next:m=>{if(!f&&e.allowArgumentEscapeSequence&&m==="--"){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)Ti(a,e.caseStyle,d,""),d=void 0;else{let _=Si(d[0],e.caseStyle);throw new xl(_)}f=!0;return}if(!f){let _=Bme(m,n,s,e);if(_){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)Ti(a,e.caseStyle,d,""),d=void 0;else{let T=Si(d[0],e.caseStyle),A=Si(_[0][0],e.caseStyle);throw new xl(T,A)}Ti(a,e.caseStyle,..._);return}let g=Dme(m,n,s,e);if(g.length>0){if(d)if(d[1].kind==="parsed"&&d[1].inferEmpty)Ti(a,e.caseStyle,d,""),d=void 0;else{let T=Si(d[0],e.caseStyle),A=Si(g[0].namedFlag[0],e.caseStyle);throw new xl(T,A)}if(g.every(E1))for(let T of g)T.namedFlag[1].kind==="boolean"?Ti(a,e.caseStyle,T.namedFlag,T.negated?"false":"true"):Ti(a,e.caseStyle,T.namedFlag,"1");else if(g.length>1){let T=g.find(R=>!E1(R)),A=Si(T.namedFlag[0],e.caseStyle);throw new xl(A)}else d=g[0].namedFlag;return}}if(d)Ti(a,e.caseStyle,d,m),d=void 0;else{if(o.kind==="tuple"){if(c>=o.parameters.length)throw new _1(o.parameters.length,m)}else if(typeof o.maximum=="number"&&c>=o.maximum)throw new _1(o.maximum,m);i[c]=m,++c}},parseArguments:async m=>{let _=[],g;o.kind==="array"?(typeof o.minimum=="number"&&c<o.minimum&&_.push(new h1(sb(o.parameter),[o.minimum,c])),g=ob(i.map(async(I,C)=>{let O=sb(o.parameter,C+1);return Yc(O,o.parameter,I,m)}))):g=ob(o.parameters.map(async(I,C)=>{let O=sb(I,C+1),k=i[C];if(typeof k!="string"){if(typeof I.default=="string")return Yc(O,I,I.default,m);if(I.optional)return;throw new h1(O)}return Yc(O,I,k,m)})),d&&d[1].kind==="parsed"&&d[1].inferEmpty&&(Ti(a,e.caseStyle,d,""),d=void 0);let T=ob(Object.entries(n).map(async I=>{let[C,O]=I,k=Si(C,e.caseStyle);if(d&&d[0]===C)throw new xl(k);let L=a.get(C),K=await Gme(k,O,L,e,m);return[C,K]})),[A,R]=await Promise.all([g,T]);if(A.status==="rejected")for(let I of A.reasons)_.push(I);if(R.status==="rejected")for(let I of R.reasons)_.push(I);if(_.length>0)return{success:!1,errors:_};if(A.status==="rejected")throw new nr("Unknown failure while scanning positional arguments");if(R.status==="rejected")throw new nr("Unknown failure while scanning flag arguments");return{success:!0,arguments:[Object.fromEntries(R.value),...A.value]}},proposeCompletions:async({partial:m,completionConfig:_,text:g,context:T,includeVersionFlag:A})=>{if(d)return b1(d[1],T,m);let R=[];if(!f){let b=I1.exec(m);if(_.includeAliases){if(m===""||m==="-"){let I=Object.entries(r).filter(C=>!ab(n,a,C[1]));for(let[C]of I){let O=s[C];O&&R.push({kind:"argument:flag",completion:`-${C}`,brief:O[1].brief})}}else if(b){let I=Array.from(b[1]);if(I.includes("h"))return[];if(A&&I.includes("v"))return[];let C=new Map(a);for(let L of I){let K=s[L];if(!K)throw new db(L);Ti(C,e.caseStyle,K,K[1].kind==="boolean"?"true":"1")}let O=I[I.length-1];if(O){let L=s[O];L&&R.push({kind:"argument:flag",completion:m,brief:L[1].brief})}let k=Object.entries(r).filter(L=>!ab(n,C,L[1]));for(let[L]of k){let K=s[L];K&&R.push({kind:"argument:flag",completion:`${m}${L}`,brief:K[1].brief})}}}if(m===""||m==="-"||m.startsWith("--")){e.allowArgumentEscapeSequence&&R.push({kind:"argument:flag",completion:"--",brief:g.briefs.argumentEscapeSequence});let I=Object.entries(n).filter(([O])=>!ab(n,a,O));e.caseStyle==="allow-kebab-for-camel"&&(I=I.map(([O,k])=>[es(O),k]));let C=I.map(([O,k])=>[`--${O}`,k]).filter(([O])=>O.startsWith(m));R.push(...C.map(([O,k])=>({kind:"argument:flag",completion:O,brief:k.brief})))}}if(o.kind==="array"){if(o.parameter.proposeCompletions&&(typeof o.maximum!="number"||c<o.maximum)){let b=await o.parameter.proposeCompletions.call(T,m);R.push(...b.map(I=>({kind:"argument:value",completion:I,brief:o.parameter.brief})))}}else{let b=o.parameters[c];if(b?.proposeCompletions){let I=await b.proposeCompletions.call(T,m);R.push(...I.map(C=>({kind:"argument:value",completion:C,brief:b.brief})))}}return R.filter(({completion:b})=>b.startsWith(m))}}}async function b1(t,e,n){if(typeof t.variadic=="string"&&n.endsWith(t.variadic))return b1(t,e,"");let r;return t.kind==="enum"?r=t.values:t.proposeCompletions?r=await t.proposeCompletions.call(e,n):r=[],r.map(o=>({kind:"argument:value",completion:o,brief:t.brief})).filter(({completion:o})=>o.startsWith(n))}function Hme(t,e,n){let r=e==="allow-kebab-for-camel"?"convert-camel-to-kebab":e,o=t.getAllEntries();return n.includeHiddenRoutes||(o=o.filter(s=>!s.hidden)),o.flatMap(s=>{let i=s.name[r];return n.includeAliases?[i,...s.aliases]:[i]})}function Vme(t){if(t.startsWith("en"))return fb}function Cs(t,e,n){return!n.disableAnsiColor&&!y1(t,"STRICLI_NO_COLOR")&&(e.getColorDepth?.(t.env)??1)>=4}async function qme({loader:t,parameters:e},{context:n,inputs:r,scannerConfig:o,errorFormatting:s,documentationConfig:i,determineExitCode:a}){let c;try{let f=Fme(e,o);for(let _ of r)f.next(_);let m=await f.parseArguments(n);if(m.success)c=m.arguments;else{let _=Cs(n.process,n.process.stderr,i);for(let g of m.errors){let T=s.exceptionWhileParsingArguments(g,_);n.process.stderr.write(_?`\x1B[1m\x1B[31m${T}\x1B[39m\x1B[22m
5
5
  `:`${T}
6
6
  `)}return Os.InvalidArgument}}catch(f){let m=Cs(n.process,n.process.stderr,i),_=s.exceptionWhileParsingArguments(f,m);return n.process.stderr.write(m?`\x1B[1m\x1B[31m${_}\x1B[39m\x1B[22m
@@ -61,7 +61,7 @@ Url: ${YT(t)}`),!0}return!1}function NMe(t,e){return e?.length?FT(t).some(n=>Ia(
61
61
  globstar while`,e,_,n,g,T),this.matchOne(e.slice(_),n.slice(g),r))return this.debug("globstar found match!",_,c,T),!0;if(T==="."||T===".."||!o.dot&&T.charAt(0)==="."){this.debug("dot detected!",e,_,n,g);break}this.debug("globstar swallow a segment, and continue"),_++}return!!(r&&(this.debug(`
62
62
  >>> no match, partial?`,e,_,n,g),_===c))}let A;if(typeof f=="string"?(A=m===f,this.debug("string match",f,m,A)):(A=f.test(m),this.debug("pattern match",f,m,A)),!A)return!1}if(i===c&&a===d)return!0;if(i===c)return r;if(a===d)return i===c-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return CQ(this.pattern,this.options)}parse(e){B_(e);let n=this.options;if(e==="**")return wo;if(e==="")return"";let r,o=null;(r=e.match(N1e))?o=n.dot?O1e:b1e:(r=e.match(_1e))?o=(n.nocase?n.dot?T1e:E1e:n.dot?g1e:h1e)(r[1]):(r=e.match(C1e))?o=(n.nocase?n.dot?x1e:P1e:n.dot?v1e:M1e)(r):(r=e.match(S1e))?o=n.dot?y1e:A1e:(r=e.match(R1e))&&(o=I1e);let s=zp.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?D1e:n.dot?U1e:k1e,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let d=c.map(f=>{if(f instanceof RegExp)for(let m of f.flags.split(""))o.add(m);return typeof f=="string"?F1e(f):f===wo?wo:f._src});return d.forEach((f,m)=>{let _=d[m+1],g=d[m-1];f!==wo||g===wo||(g===void 0?_!==void 0&&_!==wo?d[m+1]="(?:\\/|"+r+"\\/)?"+_:d[m]=r:_===void 0?d[m-1]=g+"(?:\\/|"+r+")?":_!==wo&&(d[m-1]=g+"(?:\\/|\\/"+r+"\\/)"+_,d[m+1]=wo))}),d.filter(f=>f!==wo).join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],d=o;if(r.matchBase&&c.length===1&&(d=[i]),this.matchOne(d,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return In.defaults(e).Minimatch}};In.AST=zp;In.Minimatch=Xp;In.escape=nM;In.unescape=ec});var oM,FA,wQ,xQ,V1e,q1e,vQ,ot,tc,Hi,Er,nc,$_,MQ,LQ,GA,$A,DQ=S(()=>{p();u();l();oM=B(require("node:diagnostics_channel"),1);U();FA=B(Ge(),1),wQ=B(he(),1);Le();PQ();xQ="@fastify/otel",V1e="0.8.0",q1e=">=4.0.0 <6",vQ=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],ot={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},tc={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Hi="anonymous",Er=Symbol("fastify otel instance"),nc=Symbol("fastify otel request spans"),$_=Symbol("fastify otel request context"),MQ=Symbol("fastify otel addhook original"),LQ=Symbol("fastify otel setnotfound original"),GA=Symbol("fastify otel ignore path"),$A=class extends wQ.InstrumentationBase{constructor(e){if(super(xQ,V1e,e),this.servername=e?.servername??process.env.OTEL_SERVICE_NAME??"fastify",this[GA]=null,this._logger=or.createComponentLogger({namespace:xQ}),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=In;this[GA]=o=>typeof n=="function"?n(o):r(o.url,n)}}enable(){if(this._handleInitialization===void 0&&this.getConfig().registerOnInitialization){let e=this.plugin();this._handleInitialization=n=>{n.fastify.register(e)},oM.default.subscribe("fastify.initialization",this._handleInitialization)}return super.enable()}disable(){return this._handleInitialization&&(oM.default.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:q1e,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(Er,e),r.decorate(MQ,r.addHook),r.decorate(LQ,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let _=this[$_];return{span:this[nc],tracer:e.tracer,context:_,inject:(T,A)=>sr.inject(_,T,A),extract:(T,A)=>sr.extract(_,T,A)}}),r.decorateRequest(nc,null),r.decorateRequest($_,null),r.addHook("onRoute",function(m){if(e[GA]?.(m)===!0){e._logger.debug(`Ignoring route instrumentation ${m.method} ${m.url} because it matches the ignore path`);return}for(let _ of vQ)if(m[_]!=null){let g=m[_];if(typeof g=="function")m[_]=f(g,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[ot.FASTIFY_TYPE]:tc.ROUTE,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:g.name?.length>0?g.name:Hi});else if(Array.isArray(g)){let T=[];for(let A of g)T.push(f(A,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route -> ${_}`,[ot.FASTIFY_TYPE]:tc.ROUTE,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:A.name?.length>0?A.name:Hi}));m[_]=T}}m.onSend!=null?m.onSend=Array.isArray(m.onSend)?[...m.onSend,i]:[m.onSend,i]:m.onSend=i,m.onError!=null?m.onError=Array.isArray(m.onError)?[...m.onError,a]:[m.onError,a]:m.onError=a,m.handler=f(m.handler,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - route-handler`,[ot.FASTIFY_TYPE]:tc.HANDLER,[br]:m.url,[ot.HOOK_CALLBACK_NAME]:m.handler.name.length>0?m.handler.name:Hi})}),r.addHook("onRequest",function(m,_,g){if(this[Er].isEnabled()===!1)return g();if(this[Er][GA]?.({url:m.url,method:m.method})===!0)return this[Er]._logger.debug(`Ignoring request ${m.method} ${m.url} because it matches the ignore path`),g();let T=V.active();de.getSpan(T)==null&&(T=sr.extract(T,m.headers));let A=(0,FA.getRPCMetadata)(T);m.routeOptions.url!=null&&A?.type===FA.RPCType.HTTP&&(A.route=m.routeOptions.url);let R=this[Er].tracer.startSpan("request",{attributes:{[zr]:r[Er].servername,[ot.ROOT]:"@fastify/otel",[br]:m.url,[Ri]:m.method}},T);m[$_]=de.setSpan(T,R),m[nc]=R,V.with(m[$_],()=>{g()})}),r.addHook("onResponse",function(m,_,g){let T=m[nc];T!=null&&(T.setStatus({code:it.OK,message:"OK"}),T.setAttributes({[ws]:404}),T.end()),m[nc]=null,g()}),r.addHook=c,r.setNotFoundHandler=d,s();function i(m,_,g,T){let A=m[nc];A!=null&&(_.statusCode<500&&A.setStatus({code:it.OK,message:"OK"}),A.setAttributes({[ws]:_.statusCode}),A.end()),m[nc]=null,T(null,g)}function a(m,_,g,T){let A=m[nc];A!=null&&(A.setStatus({code:it.ERROR,message:g.message}),A.recordException(g)),T()}function c(m,_){let g=this[MQ];return vQ.includes(m)?g.call(this,m,f(_,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - ${m}`,[ot.FASTIFY_TYPE]:tc.INSTANCE,[ot.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Hi})):g.call(this,m,_)}function d(m,_){let g=this[LQ];typeof m=="function"?(_=f(m,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[ot.FASTIFY_TYPE]:tc.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.name?.length>0?m.name:Hi}),g.call(this,_)):(m.preValidation!=null&&(m.preValidation=f(m.preValidation,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[ot.FASTIFY_TYPE]:tc.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.preValidation.name?.length>0?m.preValidation.name:Hi})),m.preHandler!=null&&(m.preHandler=f(m.preHandler,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[ot.FASTIFY_TYPE]:tc.INSTANCE,[ot.HOOK_CALLBACK_NAME]:m.preHandler.name?.length>0?m.preHandler.name:Hi})),_=f(_,{[zr]:r[Er].servername,[ot.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[ot.FASTIFY_TYPE]:tc.INSTANCE,[ot.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:Hi}),g.call(this,m,_))}function f(m,_={}){return function(...T){let A=this[Er],[R]=T;if(A.isEnabled()===!1)return m.call(this,...T);let b=R[$_]??V.active(),I=A.tracer.startSpan(`handler - ${m.name?.length>0?m.name:this.pluginName??Hi}`,{attributes:_},b);return V.with(de.setSpan(b,I),function(){try{let C=m.call(this,...T);return typeof C?.then=="function"?C.then(O=>(I.end(),O),O=>(I.setStatus({code:it.ERROR,message:O.message}),I.recordException(O),I.end(),Promise.reject(O))):(I.end(),C)}catch(C){throw I.setStatus({code:it.ERROR,message:C.message}),I.recordException(C),I.end(),C}},this)}}}}}});var Vi,F_,H_,UQ=S(()=>{p();u();l();(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Vi||(Vi={}));(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(F_||(F_={}));(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(H_||(H_={}))});var V_,kQ=S(()=>{p();u();l();V_=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function sM(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[V_]||[];return s.push(o),Object.defineProperty(t,V_,{enumerable:!1,configurable:!0,value:s}),o}function HA(t,e){let n=t[V_]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:it.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[V_])}function BQ(t,e,n){let r,o;try{o=t(),jQ(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!jQ(o)&&(e(r,o),r))throw r;return o}}function jQ(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var GQ=S(()=>{p();u();l();U();kQ()});function z1e(){let t=F();t&&t.on("spanStart",e=>{FQ(e)})}function FQ(t){let e=ae(t).data,n=e["fastify.type"];if(e[Ee]||!n)return;t.setAttributes({[fe]:"auto.http.otel.fastify",[Ee]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var qA,Uu,Y1e,W1e,$Q,K1e,VA,HQ=S(()=>{p();u();l();U();qA=B(Ge(),1),Uu=B(he(),1);Le();ne();UQ();GQ();Y1e="0.1.0",W1e="@sentry/instrumentation-fastify-v3",$Q="anonymous",K1e=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),VA=class extends Uu.InstrumentationBase{constructor(e={}){super(W1e,Y1e,e)}init(){return[new Uu.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,qA.getRPCMetadata)(V.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===qA.RPCType.HTTP&&(a.route=c);let d=r.method||"GET";ge().setTransactionName(`${d} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||$Q,c=`${H_.MIDDLEWARE} - ${a}`,d=i[1],f=sM(d,s.tracer,c,{[Vi.FASTIFY_TYPE]:F_.MIDDLEWARE,[Vi.PLUGIN_NAME]:e,[Vi.HOOK_NAME]:n}),m=o&&i[i.length-1];return m&&(i[i.length-1]=function(..._){HA(d),m.apply(this,_)}),V.with(de.setSpan(V.active(),f),()=>BQ(()=>r.apply(this,i),_=>{_ instanceof Error&&(f.setStatus({code:it.ERROR,message:_.message}),f.recordException(_)),o||HA(d)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!K1e.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),z1e(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,Uu.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),HA(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,d=`${H_.REQUEST_HANDLER} - ${c||this.pluginName||$Q}`,f={[Vi.PLUGIN_NAME]:this.pluginName,[Vi.FASTIFY_TYPE]:F_.REQUEST_HANDLER,[tO]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(f[Vi.FASTIFY_NAME]=c);let m=sM(o,e.tracer,d,f);FQ(m);let{requestHook:_}=e.getConfig();return _&&(0,Uu.safeExecuteInTheMiddle)(()=>_(m,{request:r}),g=>{g&&e._diag.error("request hook failed",g)},!0),V.with(de.setSpan(V.active(),m),()=>{s()})}}}});function X1e(){let t=F();if(t)return t.getIntegrationByName(YA)}function VQ(t,e,n,r){let o=X1e()?.getShouldHandleError()||KQ;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){bt&&N.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&oe(t,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function KQ(t,e,n){let r=n.statusCode;return r>=500||r<=299}function zQ(t){let e=ae(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[Ee]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request-handler":"<unknown>";t.setAttributes({[fe]:"auto.http.otel.fastify",[Ee]:`${c}.fastify`});let d=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof d=="string"){let f=d.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(f)}}function J1e(){let t=F();t&&t.on("spanStart",e=>{zQ(e)})}function Z1e(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&zQ(s)}let r=e.routeOptions?.url,o=e.method||"GET";ge().setTransactionName(`${o} ${r}`)})}var iM,YA,qQ,YQ,Q1e,WQ,XQ=S(()=>{p();u();l();iM=B(require("node:diagnostics_channel"),1);ne();Be();Du();DQ();HQ();YA="Fastify",qQ=Z(`${YA}.v3`,()=>new VA);YQ=Z(`${YA}.v5`,()=>{let t=new $A,e=t.plugin();return iM.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?bt&&N.error("Failed to setup Fastify instrumentation",o):(J1e(),r&&Z1e(r))})}),iM.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;VQ.call(VQ,r,o,s,"diagnostics-channel")}),t}),Q1e=(({shouldHandleError:t})=>{let e;return{name:YA,setupOnce(){e=t||KQ,qQ(),YQ()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}}),WQ=(t={})=>Q1e(t)});var aM=y(fs=>{"use strict";p();u();l();Object.defineProperty(fs,"__esModule",{value:!0});fs.SpanNames=fs.TokenKind=fs.AllowedOperationTypes=void 0;var eje;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(eje=fs.AllowedOperationTypes||(fs.AllowedOperationTypes={}));var tje;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(tje=fs.TokenKind||(fs.TokenKind={}));var nje;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(nje=fs.SpanNames||(fs.SpanNames={}))});var cM=y(q_=>{"use strict";p();u();l();Object.defineProperty(q_,"__esModule",{value:!0});q_.AttributeNames=void 0;var rje;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(rje=q_.AttributeNames||(q_.AttributeNames={}))});var WA=y(Qp=>{"use strict";p();u();l();Object.defineProperty(Qp,"__esModule",{value:!0});Qp.OTEL_GRAPHQL_DATA_SYMBOL=Qp.OTEL_PATCHED_SYMBOL=void 0;Qp.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");Qp.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var QQ=y(KA=>{"use strict";p();u();l();Object.defineProperty(KA,"__esModule",{value:!0});KA.OPERATION_NOT_SUPPORTED=void 0;var EDt=WA();KA.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var p8=y(on=>{"use strict";p();u();l();Object.defineProperty(on,"__esModule",{value:!0});on.wrapFieldResolver=on.wrapFields=on.getSourceFromLocation=on.getOperation=on.endSpan=on.addSpanSource=on.addInputVariableAttributes=on.isPromise=void 0;var Zp=(U(),D(J)),rc=aM(),Jp=cM(),qi=WA(),JQ=Object.values(rc.AllowedOperationTypes),oje=t=>typeof t?.then=="function";on.isPromise=oje;var sje=t=>typeof t=="object"&&t!==null;function uM(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{uM(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{uM(t,`${e}.${r}`,o)}):t.setAttribute(`${Jp.AttributeNames.VARIABLES}${String(e)}`,n)}function ije(t,e){Object.entries(e).forEach(([n,r])=>{uM(t,n,r)})}on.addInputVariableAttributes=ije;function n8(t,e,n,r,o){let s=a8(e,n,r,o);t.setAttribute(Jp.AttributeNames.SOURCE,s)}on.addSpanSource=n8;function aje(t,e,n,r,o){let s=r8(n,o);if(s)return{field:s,spanAdded:!1};let a=e().flatResolveSpans?s8(n):o8(n,o);return s={span:cje(t,e,n,r,o,a)},pje(n,o,s),{field:s,spanAdded:!0}}function cje(t,e,n,r,o,s){let i={[Jp.AttributeNames.FIELD_NAME]:r.fieldName,[Jp.AttributeNames.FIELD_PATH]:o.join("."),[Jp.AttributeNames.FIELD_TYPE]:r.returnType.toString()},a=t.startSpan(`${rc.SpanNames.RESOLVE} ${i[Jp.AttributeNames.FIELD_PATH]}`,{attributes:i},s?Zp.trace.setSpan(Zp.context.active(),s):void 0),c=n[qi.OTEL_GRAPHQL_DATA_SYMBOL].source,d=r.fieldNodes.find(f=>f.kind==="Field");return d&&n8(a,c.loc,e().allowValues,d.loc?.start,d.loc?.end),a}function uje(t,e){e&&t.recordException(e),t.end()}on.endSpan=uje;function lje(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>JQ.indexOf(n?.operation)!==-1).find(n=>e===n?.name?.value):t.definitions.find(n=>JQ.indexOf(n?.operation)!==-1)}on.getOperation=lje;function pje(t,e,n){return t[qi.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function r8(t,e){return t[qi.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function o8(t,e){for(let n=e.length-1;n>0;n--){let r=r8(t,e.slice(0,n));if(r)return r.span}return s8(t)}function s8(t){return t[qi.OTEL_GRAPHQL_DATA_SYMBOL].span}function dje(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function fje(t){return i8(`
63
63
  `,t)}function ZQ(t){return i8(" ",t)}function i8(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var mje=[rc.TokenKind.FLOAT,rc.TokenKind.STRING,rc.TokenKind.INT,rc.TokenKind.BLOCK_STRING];function a8(t,e=!1,n,r){let o="";if(t?.startToken){let s=typeof n=="number"?n:t.start,i=typeof r=="number"?r:t.end,a=t.startToken.next,c=1;for(;a;){if(a.start<s){a=a.next,c=a?.line;continue}if(a.end>i){a=a.next,c=a?.line;continue}let d=a.value||a.kind,f="";!e&&mje.indexOf(a.kind)>=0&&(d="*"),a.kind===rc.TokenKind.STRING&&(d=`"${d}"`),a.kind===rc.TokenKind.EOF&&(d=""),a.line>c?(o+=fje(a.line-c),c=a.line,f=ZQ(a.column-1)):a.line===a.prev?.line&&(f=ZQ(a.start-(a.prev?.end||0))),o+=f+d,a&&(a=a.next)}}return o}on.getSourceFromLocation=a8;function c8(t,e,n){if(!t||t[qi.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[qi.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=l8(e,n,s.resolve)),s.type)){let i=u8(s.type);for(let a of i)c8(a,e,n)}})}on.wrapFields=c8;function u8(t){return"ofType"in t?u8(t.ofType):_je(t)?t.getTypes():hje(t)?[t]:[]}function _je(t){return"getTypes"in t&&typeof t.getTypes=="function"}function hje(t){return"getFields"in t&&typeof t.getFields=="function"}var e8=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:Zp.SpanStatusCode.ERROR,message:e.message}),t.end())},t8=(t,e)=>{e&&t.end()};function l8(t,e,n,r=!1){if(o[qi.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let d=e();if(d.ignoreTrivialResolveSpans&&r&&(sje(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[qi.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let f=dje(d.mergeItems,c&&c.path),m=f.filter(T=>typeof T=="string").length,_,g=!1;if(d.depth>=0&&d.depth<m)_=o8(a,f);else{let{field:T,spanAdded:A}=aje(t,e,a,c,f);_=T.span,g=A}return Zp.context.with(Zp.trace.setSpan(Zp.context.active(),_),()=>{try{let T=n.call(this,s,i,a,c);return(0,on.isPromise)(T)?T.then(A=>(t8(_,g),A),A=>{throw e8(_,A,g),A}):(t8(_,g),T)}catch(T){throw e8(_,T,g),T}})}return o[qi.OTEL_PATCHED_SYMBOL]=!0,o}on.wrapFieldResolver=l8});var d8=y(ed=>{"use strict";p();u();l();Object.defineProperty(ed,"__esModule",{value:!0});ed.PACKAGE_NAME=ed.PACKAGE_VERSION=void 0;ed.PACKAGE_VERSION="0.58.0";ed.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var _8=y(QA=>{"use strict";p();u();l();Object.defineProperty(QA,"__esModule",{value:!0});QA.GraphQLInstrumentation=void 0;var Yi=(U(),D(J)),Do=he(),Y_=aM(),zA=cM(),lM=WA(),gje=QQ(),Vn=p8(),f8=d8(),m8={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},XA=[">=14.0.0 <17"],pM=class extends Do.InstrumentationBase{constructor(e={}){super(f8.PACKAGE_NAME,f8.PACKAGE_VERSION,{...m8,...e})}setConfig(e={}){super.setConfig({...m8,...e})}init(){let e=new Do.InstrumentationNodeModuleDefinition("graphql",XA);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new Do.InstrumentationNodeModuleFile("graphql/execution/execute.js",XA,e=>((0,Do.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new Do.InstrumentationNodeModuleFile("graphql/language/parser.js",XA,e=>((0,Do.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new Do.InstrumentationNodeModuleFile("graphql/validation/validate.js",XA,e=>((0,Do.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let d=arguments;i=n._wrapExecuteArgs(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],e)}else{let d=arguments[0];i=n._wrapExecuteArgs(d.schema,d.document,d.rootValue,d.contextValue,d.variableValues,d.operationName,d.fieldResolver,d.typeResolver,e)}let a=(0,Vn.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[lM.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[lM.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},Yi.context.with(Yi.trace.setSpan(Yi.context.active(),c),()=>(0,Do.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(d,f)=>{n._handleExecutionResult(c,d,f)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,Vn.endSpan)(e,n);return}if((0,Vn.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,Vn.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,Vn.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,Vn.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,Do.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,Vn.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,d){return e._validate(this,r,s,i,a,d,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(Y_.SpanNames.PARSE);return Yi.context.with(Yi.trace.setSpan(Yi.context.active(),i),()=>(0,Do.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,Vn.getOperation)(c)?c.loc&&(0,Vn.addSpanSource)(i,c.loc,s.allowValues):i.updateName(Y_.SpanNames.SCHEMA_PARSE)),(0,Vn.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(Y_.SpanNames.VALIDATE,{});return Yi.context.with(Yi.trace.setSpan(Yi.context.active(),c),()=>(0,Do.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(d,f)=>{o.loc||c.updateName(Y_.SpanNames.SCHEMA_VALIDATE),f&&f.length&&c.recordException({name:zA.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(f)}),(0,Vn.endSpan)(c,d)}))}_createExecuteSpan(e,n){let r=this.getConfig(),o=this.tracer.startSpan(Y_.SpanNames.EXECUTE,{});if(e){let{operation:s,name:i}=e;o.setAttribute(zA.AttributeNames.OPERATION_TYPE,s);let a=i?.value;a?(o.setAttribute(zA.AttributeNames.OPERATION_NAME,a),o.updateName(`${s} ${a}`)):o.updateName(s)}else{let s=" ";n.operationName&&(s=` "${n.operationName}" `),s=gje.OPERATION_NOT_SUPPORTED.replace("$operationName$",s),o.setAttribute(zA.AttributeNames.OPERATION_NAME,s)}return n.document?.loc&&(0,Vn.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,Vn.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(e,n,r,o,s,i,a,c,d){if(o||(o={}),o[lM.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let f=a==null,m=a??d;return a=(0,Vn.wrapFieldResolver)(this.tracer,()=>this.getConfig(),m,f),e&&((0,Vn.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,Vn.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};QA.GraphQLInstrumentation=pM});var h8=y(JA=>{"use strict";p();u();l();Object.defineProperty(JA,"__esModule",{value:!0});JA.GraphQLInstrumentation=void 0;var Eje=_8();Object.defineProperty(JA,"GraphQLInstrumentation",{enumerable:!0,get:function(){return Eje.GraphQLInstrumentation}})});function A8(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function Sje(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var g8,E8,T8,Tje,S8,y8=S(()=>{p();u();l();U();g8=B(h8(),1);ne();Be();Xa();E8="Graphql",T8=Z(E8,g8.GraphQLInstrumentation,t=>{let e=A8(t);return{...e,responseHook(n,r){qe(n,"auto.graphql.otel.graphql"),r.errors?.length&&!ae(n).status&&n.setStatus({code:it.ERROR});let s=ae(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=ft(n),f=ae(c).data[Bp]||[],m=a?`${i} ${a}`:`${i}`;Array.isArray(f)?(f.push(m),c.setAttribute(Bp,f)):typeof f=="string"?c.setAttribute(Bp,[f,m]):c.setAttribute(Bp,m),ae(c).data["original-description"]||c.setAttribute("original-description",ae(c).description),c.updateName(`${ae(c).data["original-description"]} (${Sje(f)})`)}}}}),Tje=((t={})=>({name:E8,setupOnce(){T8(A8(t))}})),S8=Tje});var R8=y(ZA=>{"use strict";p();u();l();Object.defineProperty(ZA,"__esModule",{value:!0});ZA.EVENT_LISTENERS_SET=void 0;ZA.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var I8=y(ey=>{"use strict";p();u();l();Object.defineProperty(ey,"__esModule",{value:!0});ey.bufferTextMapGetter=void 0;ey.bufferTextMapGetter={get(t,e){if(!t)return;let n=Object.keys(t);for(let r of n)if(r===e||r.toLowerCase()===e)return t[r]?.toString()},keys(t){return t?Object.keys(t):[]}}});var N8=y(we=>{"use strict";p();u();l();Object.defineProperty(we,"__esModule",{value:!0});we.METRIC_MESSAGING_PROCESS_DURATION=we.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=we.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=we.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=we.MESSAGING_SYSTEM_VALUE_KAFKA=we.MESSAGING_OPERATION_TYPE_VALUE_SEND=we.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=we.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=we.ATTR_MESSAGING_SYSTEM=we.ATTR_MESSAGING_OPERATION_TYPE=we.ATTR_MESSAGING_OPERATION_NAME=we.ATTR_MESSAGING_KAFKA_OFFSET=we.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=we.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=we.ATTR_MESSAGING_DESTINATION_PARTITION_ID=we.ATTR_MESSAGING_DESTINATION_NAME=we.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;we.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";we.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";we.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";we.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";we.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";we.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";we.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";we.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";we.ATTR_MESSAGING_SYSTEM="messaging.system";we.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";we.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";we.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";we.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";we.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";we.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";we.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";we.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var b8=y(td=>{"use strict";p();u();l();Object.defineProperty(td,"__esModule",{value:!0});td.PACKAGE_NAME=td.PACKAGE_VERSION=void 0;td.PACKAGE_VERSION="0.20.0";td.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var M8=y(ny=>{"use strict";p();u();l();Object.defineProperty(ny,"__esModule",{value:!0});ny.KafkaJsInstrumentation=void 0;var We=(U(),D(J)),Uo=he(),nd=(Le(),D(Xe)),O8=R8(),C8=I8(),te=N8(),P8=b8();function ty(t,e,n){return r=>{t.add(e,{...n,...r?{[nd.ATTR_ERROR_TYPE]:r}:{}})}}function x8(t,e,n){return r=>{t.record((Date.now()-e)/1e3,{...n,...r?{[nd.ATTR_ERROR_TYPE]:r}:{}})}}var v8=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],dM=class extends Uo.InstrumentationBase{constructor(e={}){super(P8.PACKAGE_NAME,P8.PACKAGE_VERSION,e)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(te.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:v8}}),this._sentMessages=this.meter.createCounter(te.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(te.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(te.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:v8}})}init(){let e=r=>{(0,Uo.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Uo.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Uo.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(e(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Uo.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),e._setKafkaEventListeners(s),s}}_setKafkaEventListeners(e){e[O8.EVENT_LISTENERS_SET]||(e.events?.REQUEST&&e.on(e.events.REQUEST,this._recordClientDurationMetric.bind(this)),e[O8.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(e){let[n,r]=e.payload.broker.split(":");this._clientDuration.record(e.payload.duration/1e3,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:`${e.payload.apiName}`,[nd.ATTR_SERVER_ADDRESS]:n,[nd.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Uo.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getSendBatchPatch()),(0,Uo.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getSendPatch()),(0,Uo.isWrapped)(s.transaction)&&e._unwrap(s,"transaction"),e._wrap(s,"transaction",e._getProducerTransactionPatch()),e._setKafkaEventListeners(s),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,Uo.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,Uo.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=We.propagation.extract(We.ROOT_CONTEXT,s.message.headers,C8.bufferTextMapGetter),a=e._startConsumerSpan({topic:s.topic,message:s.message,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:i,attributes:{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}}),c=[x8(e._processDuration,Date.now(),{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)}),ty(e._consumedMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.partition)})],d=We.context.with(We.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c,d)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan({topic:s.batch.topic,message:void 0,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:We.ROOT_CONTEXT,attributes:{[te.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:s.batch.messages.length,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}});return We.context.with(We.trace.setSpan(We.context.active(),i),()=>{let a=Date.now(),c=[],d=[ty(n._consumedMessages,s.batch.messages.length,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)})];s.batch.messages.forEach(m=>{let _=We.propagation.extract(We.ROOT_CONTEXT,m.headers,C8.bufferTextMapGetter),g=We.trace.getSpan(_)?.spanContext(),T;g&&(T={context:g}),c.push(n._startConsumerSpan({topic:s.batch.topic,message:m,operationType:te.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:T,attributes:{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}})),d.push(x8(n._processDuration,a,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"process",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.batch.topic,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(s.batch.partition)}))});let f=e.apply(this,o);return c.unshift(i),n._endSpansOnPromise(c,d,f)})}}}_getProducerTransactionPatch(){let e=this;return n=>function(...o){let s=e.tracer.startSpan("transaction"),i=n.apply(this,o);return i.then(a=>{let c=a.send;a.send=function(...g){return We.context.with(We.trace.setSpan(We.context.active(),s),()=>e._getSendPatch()(c).apply(this,g).catch(A=>{throw s.setStatus({code:We.SpanStatusCode.ERROR,message:A?.message}),s.recordException(A),A}))};let d=a.sendBatch;a.sendBatch=function(...g){return We.context.with(We.trace.setSpan(We.context.active(),s),()=>e._getSendBatchPatch()(d).apply(this,g).catch(A=>{throw s.setStatus({code:We.SpanStatusCode.ERROR,message:A?.message}),s.recordException(A),A}))};let f=a.commit;a.commit=function(...g){let T=f.apply(this,g).then(()=>{s.setStatus({code:We.SpanStatusCode.OK})});return e._endSpansOnPromise([s],[],T)};let m=a.abort;a.abort=function(...g){let T=m.apply(this,g);return e._endSpansOnPromise([s],[],T)}}).catch(a=>{s.setStatus({code:We.SpanStatusCode.ERROR,message:a?.message}),s.recordException(a),s.end()}),i}}_getSendBatchPatch(){let e=this;return n=>function(...o){let i=o[0].topicMessages||[],a=[],c=[];i.forEach(f=>{f.messages.forEach(m=>{a.push(e._startProducerSpan(f.topic,m)),c.push(ty(e._sentMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_DESTINATION_NAME]:f.topic,...m.partition!==void 0?{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(m.partition)}:{}}))})});let d=n.apply(this,o);return e._endSpansOnPromise(a,c,d)}}_getSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(d=>e._startProducerSpan(s.topic,d)),a=s.messages.map(d=>ty(e._sentMessages,1,{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_DESTINATION_NAME]:s.topic,...d.partition!==void 0?{[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(d.partition)}:{}})),c=n.apply(this,o);return e._endSpansOnPromise(i,a,c)}}_endSpansOnPromise(e,n,r){return Promise.resolve(r).then(o=>(n.forEach(s=>s()),o)).catch(o=>{let s,i=nd.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?s=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(s=o.message,i=o.constructor.name),n.forEach(a=>a(i)),e.forEach(a=>{a.setAttribute(nd.ATTR_ERROR_TYPE,i),a.setStatus({code:We.SpanStatusCode.ERROR,message:s})}),o}).finally(()=>{e.forEach(o=>o.end())})}_startConsumerSpan({topic:e,message:n,operationType:r,ctx:o,link:s,attributes:i}){let a=r===te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,c=this.tracer.startSpan(`${a} ${e}`,{kind:r===te.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?We.SpanKind.CLIENT:We.SpanKind.CONSUMER,attributes:{...i,[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_DESTINATION_NAME]:e,[te.ATTR_MESSAGING_OPERATION_TYPE]:r,[te.ATTR_MESSAGING_OPERATION_NAME]:a,[te.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[te.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[te.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:s?[s]:[]},o),{consumerHook:d}=this.getConfig();return d&&n&&(0,Uo.safeExecuteInTheMiddle)(()=>d(c,{topic:e,message:n}),f=>{f&&this._diag.error("consumerHook error",f)},!0),c}_startProducerSpan(e,n){let r=this.tracer.startSpan(`send ${e}`,{kind:We.SpanKind.PRODUCER,attributes:{[te.ATTR_MESSAGING_SYSTEM]:te.MESSAGING_SYSTEM_VALUE_KAFKA,[te.ATTR_MESSAGING_DESTINATION_NAME]:e,[te.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[te.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[te.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[te.ATTR_MESSAGING_OPERATION_NAME]:"send",[te.ATTR_MESSAGING_OPERATION_TYPE]:te.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},We.propagation.inject(We.trace.setSpan(We.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,Uo.safeExecuteInTheMiddle)(()=>o(r,{topic:e,message:n}),s=>{s&&this._diag.error("producerHook error",s)},!0),r}};ny.KafkaJsInstrumentation=dM});var L8=y(ry=>{"use strict";p();u();l();Object.defineProperty(ry,"__esModule",{value:!0});ry.KafkaJsInstrumentation=void 0;var Aje=M8();Object.defineProperty(ry,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return Aje.KafkaJsInstrumentation}})});var w8,D8,U8,yje,k8,j8=S(()=>{p();u();l();w8=B(L8(),1);Be();D8="Kafka",U8=Z(D8,()=>new w8.KafkaJsInstrumentation({consumerHook(t){qe(t,"auto.kafkajs.otel.consumer")},producerHook(t){qe(t,"auto.kafkajs.otel.producer")}})),yje=(()=>({name:D8,setupOnce(){U8()}})),k8=yje});var B8=y(rd=>{"use strict";p();u();l();Object.defineProperty(rd,"__esModule",{value:!0});rd.PACKAGE_NAME=rd.PACKAGE_VERSION=void 0;rd.PACKAGE_VERSION="0.55.0";rd.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var H8=y(oy=>{"use strict";p();u();l();Object.defineProperty(oy,"__esModule",{value:!0});oy.LruMemoizerInstrumentation=void 0;var G8=(U(),D(J)),$8=he(),F8=B8(),fM=class extends $8.InstrumentationBase{constructor(e={}){super(F8.PACKAGE_NAME,F8.PACKAGE_VERSION,e)}init(){return[new $8.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <3"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?G8.context.bind(G8.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};oy.LruMemoizerInstrumentation=fM});var V8=y(sy=>{"use strict";p();u();l();Object.defineProperty(sy,"__esModule",{value:!0});sy.LruMemoizerInstrumentation=void 0;var Rje=H8();Object.defineProperty(sy,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return Rje.LruMemoizerInstrumentation}})});var q8,Y8,W8,Ije,K8,z8=S(()=>{p();u();l();q8=B(V8(),1);Be();Y8="LruMemoizer",W8=Z(Y8,()=>new q8.LruMemoizerInstrumentation),Ije=(()=>({name:Y8,setupOnce(){W8()}})),K8=Ije});var X8=y(ct=>{"use strict";p();u();l();Object.defineProperty(ct,"__esModule",{value:!0});ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ct.DB_SYSTEM_VALUE_MONGODB=ct.DB_SYSTEM_NAME_VALUE_MONGODB=ct.ATTR_NET_PEER_PORT=ct.ATTR_NET_PEER_NAME=ct.ATTR_DB_SYSTEM=ct.ATTR_DB_STATEMENT=ct.ATTR_DB_OPERATION=ct.ATTR_DB_NAME=ct.ATTR_DB_MONGODB_COLLECTION=ct.ATTR_DB_CONNECTION_STRING=void 0;ct.ATTR_DB_CONNECTION_STRING="db.connection_string";ct.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";ct.ATTR_DB_NAME="db.name";ct.ATTR_DB_OPERATION="db.operation";ct.ATTR_DB_STATEMENT="db.statement";ct.ATTR_DB_SYSTEM="db.system";ct.ATTR_NET_PEER_NAME="net.peer.name";ct.ATTR_NET_PEER_PORT="net.peer.port";ct.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";ct.DB_SYSTEM_VALUE_MONGODB="mongodb";ct.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var Q8=y(W_=>{"use strict";p();u();l();Object.defineProperty(W_,"__esModule",{value:!0});W_.MongodbCommandType=void 0;var Nje;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(Nje=W_.MongodbCommandType||(W_.MongodbCommandType={}))});var J8=y(od=>{"use strict";p();u();l();Object.defineProperty(od,"__esModule",{value:!0});od.PACKAGE_NAME=od.PACKAGE_VERSION=void 0;od.PACKAGE_VERSION="0.64.0";od.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var tJ=y(iy=>{"use strict";p();u();l();Object.defineProperty(iy,"__esModule",{value:!0});iy.MongoDBInstrumentation=void 0;var _t=(U(),D(J)),De=he(),Wi=(Le(),D(Xe)),io=X8(),ku=Q8(),Z8=J8(),eJ={requireParentSpan:!0},mM=class t extends De.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(Z8.PACKAGE_NAME,Z8.PACKAGE_VERSION,{...eJ,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,De.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,De.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...eJ,...e})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(io.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsage?.add(e,{"pool.name":n,state:r})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:d}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:f,v4UnpatchSessions:m}=this._getV4SessionsPatches();return[new De.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new De.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new De.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,a),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,d),new De.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new De.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],f,m)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,De.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,De.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,De.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,De.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,De.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,De.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,De.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,De.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,De.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,De.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connCountAdd(1,e._poolName,"used"):o-1===i&&(e._connCountAdd(-1,e._poolName,"idle"),e._connCountAdd(1,e._poolName,"used")),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connCountAdd(-1,e._poolName,"used"),e._connCountAdd(1,e._poolName,"idle"),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,De.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,De.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=_t.context.bind(_t.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,De.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,De.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=n._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,d);let g=n._getV3SpanAttributes(i,s,a[0],e),T=n._spanNameFromAttrs(g),A=n.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=n._patchEnd(A,_);return typeof c=="function"?r.call(this,s,i,a,R):r.call(this,s,i,a,c,R)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let d=_t.trace.getSpan(_t.context.active()),f=e._checkSkipInstrumentation(d),m=typeof a=="function"?a:c;if(f||typeof m!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let _=t._getCommandType(i),g=_===ku.MongodbCommandType.UNKNOWN?void 0:_,T=e._getV3SpanAttributes(s,o,i,g),A=e._spanNameFromAttrs(T),R=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T}),b=e._patchEnd(R,m);return typeof a=="function"?n.call(this,o,s,i,b):n.call(this,o,s,i,a,b)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=_t.trace.getSpan(_t.context.active()),d=e._checkSkipInstrumentation(c),f=a,m=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let _;if(!d){let T=e._getV4SpanAttributes(this,o,s,m),A=e._spanNameFromAttrs(T);_=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T})}let g=e._patchEnd(_,f,this.id,m);return n.call(this,o,s,i,g)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=_t.trace.getSpan(_t.context.active()),c=e._checkSkipInstrumentation(a),d=Object.keys(i)[0],f=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let m;if(!c){let T=e._getV4SpanAttributes(this,s,i,d),A=e._spanNameFromAttrs(T);m=e.tracer.startSpan(A,{kind:_t.SpanKind.CLIENT,attributes:T})}let _=e._patchEnd(m,f,this.id,d),g=n.apply(this,o);return g.then(T=>_(null,T),T=>_(T)),g}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=e._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,d);let g=e._getV3SpanAttributes(s,o,i,"find"),T=e._spanNameFromAttrs(g),A=e.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=e._patchEnd(A,_);return typeof c=="function"?n.call(this,o,s,i,a,R):n.call(this,o,s,i,a,c,R)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,d){let f=_t.trace.getSpan(_t.context.active()),m=e._checkSkipInstrumentation(f),_=typeof c=="function"?c:d;if(m||typeof _!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,d);let g=e._getV3SpanAttributes(s,o,i.cmd,"getMore"),T=e._spanNameFromAttrs(g),A=e.tracer.startSpan(T,{kind:_t.SpanKind.CLIENT,attributes:g}),R=e._patchEnd(A,_);return typeof c=="function"?n.call(this,o,s,i,a,R):n.call(this,o,s,i,a,c,R)}}static _getCommandType(e){return e.createIndexes!==void 0?ku.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?ku.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?ku.MongodbCommandType.IS_MASTER:e.count!==void 0?ku.MongodbCommandType.COUNT:e.aggregate!==void 0?ku.MongodbCommandType.AGGREGATE:ku.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(e,n,r,o){let s,i;if(e){let c=typeof e.address=="string"?e.address.split(":"):"";c.length===2&&(s=c[0],i=c[1])}let a;return r?.documents&&r.documents[0]?a=r.documents[0]:r?.cursors?a=r.cursors:a=r,this._getSpanAttributes(n.db,n.collection,s,i,a,o)}_getV3SpanAttributes(e,n,r,o){let s,i;if(n&&n.s&&(s=n.s.options?.host??n.s.host,i=(n.s.options?.port??n.s.port)?.toString(),s==null||i==null)){let f=n.description?.address;if(f){let m=f.split(":");s=m[0],i=m[1]}}let[a,c]=e.toString().split("."),d=r?.query??r?.q??r;return this._getSpanAttributes(a,c,s,i,d,o)}_getSpanAttributes(e,n,r,o,s,i){let a={};if(this._dbSemconvStability&De.SemconvStability.OLD&&(a[io.ATTR_DB_SYSTEM]=io.DB_SYSTEM_VALUE_MONGODB,a[io.ATTR_DB_NAME]=e,a[io.ATTR_DB_MONGODB_COLLECTION]=n,a[io.ATTR_DB_OPERATION]=i,a[io.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${e}`),this._dbSemconvStability&De.SemconvStability.STABLE&&(a[Wi.ATTR_DB_SYSTEM_NAME]=io.DB_SYSTEM_NAME_VALUE_MONGODB,a[Wi.ATTR_DB_NAMESPACE]=e,a[Wi.ATTR_DB_OPERATION_NAME]=i,a[Wi.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&De.SemconvStability.OLD&&(a[io.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&De.SemconvStability.STABLE&&(a[Wi.ATTR_SERVER_ADDRESS]=r);let c=parseInt(o,10);isNaN(c)||(this._netSemconvStability&De.SemconvStability.OLD&&(a[io.ATTR_NET_PEER_PORT]=c),this._netSemconvStability&De.SemconvStability.STABLE&&(a[Wi.ATTR_SERVER_PORT]=c))}if(s){let{dbStatementSerializer:c}=this.getConfig(),d=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,De.safeExecuteInTheMiddle)(()=>{let f=d(s);this._dbSemconvStability&De.SemconvStability.OLD&&(a[io.ATTR_DB_STATEMENT]=f),this._dbSemconvStability&De.SemconvStability.STABLE&&(a[Wi.ATTR_DB_QUERY_TEXT]=f)},f=>{f&&this._diag.error("Error running dbStatementSerializer hook",f)},!0)}return a}_spanNameFromAttrs(e){let n;return this._dbSemconvStability&De.SemconvStability.STABLE?n=[e[Wi.ATTR_DB_OPERATION_NAME],e[Wi.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||io.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${e[io.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let e=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":e.has(r)?"[Circular]":(e.add(r),r)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(e):JSON.stringify(e,this._getDefaultDbStatementReplacer())}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,De.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=_t.context.active(),i=this,a=!1;return function(...d){if(!a){a=!0;let f=d[0];if(e){if(f instanceof Error)e.setStatus({code:_t.SpanStatusCode.ERROR,message:f.message});else{let m=d[1];i._handleExecutionResult(e,m)}e.end()}o==="endSessions"&&i._connCountAdd(-1,i._poolName,"idle")}return _t.context.with(s,()=>n.apply(this,d))}}setPoolName(e){let n=e.hostAddress?.host,r=e.hostAddress?.port,o=e.dbName,s=`mongodb://${n}:${r}/${o}`;this._poolName=s}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};iy.MongoDBInstrumentation=mM});var nJ=y(K_=>{"use strict";p();u();l();Object.defineProperty(K_,"__esModule",{value:!0});K_.MongodbCommandType=void 0;var bje;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(bje=K_.MongodbCommandType||(K_.MongodbCommandType={}))});var rJ=y(sd=>{"use strict";p();u();l();Object.defineProperty(sd,"__esModule",{value:!0});sd.MongodbCommandType=sd.MongoDBInstrumentation=void 0;var Oje=tJ();Object.defineProperty(sd,"MongoDBInstrumentation",{enumerable:!0,get:function(){return Oje.MongoDBInstrumentation}});var Cje=nJ();Object.defineProperty(sd,"MongodbCommandType",{enumerable:!0,get:function(){return Cje.MongodbCommandType}})});function Pje(t){let e=_M(t);return JSON.stringify(e)}function _M(t){if(Array.isArray(t))return t.map(e=>_M(e));if(xje(t)){let e={};return Object.entries(t).map(([n,r])=>[n,_M(r)]).reduce((n,r)=>(Mje(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function xje(t){return typeof t=="object"&&t!==null&&!vje(t)}function vje(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function Mje(t){return Array.isArray(t)}var oJ,sJ,iJ,Lje,aJ,cJ=S(()=>{p();u();l();oJ=B(rJ(),1);Be();sJ="Mongo",iJ=Z(sJ,()=>new oJ.MongoDBInstrumentation({dbStatementSerializer:Pje,responseHook(t){qe(t,"auto.db.otel.mongo")}}));Lje=(()=>({name:sJ,setupOnce(){iJ()}})),aJ=Lje});var hM=y(Yt=>{"use strict";p();u();l();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.DB_SYSTEM_NAME_VALUE_MONGODB=Yt.ATTR_NET_PEER_PORT=Yt.ATTR_NET_PEER_NAME=Yt.ATTR_DB_USER=Yt.ATTR_DB_SYSTEM=Yt.ATTR_DB_STATEMENT=Yt.ATTR_DB_OPERATION=Yt.ATTR_DB_NAME=Yt.ATTR_DB_MONGODB_COLLECTION=void 0;Yt.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Yt.ATTR_DB_NAME="db.name";Yt.ATTR_DB_OPERATION="db.operation";Yt.ATTR_DB_STATEMENT="db.statement";Yt.ATTR_DB_SYSTEM="db.system";Yt.ATTR_DB_USER="db.user";Yt.ATTR_NET_PEER_NAME="net.peer.name";Yt.ATTR_NET_PEER_PORT="net.peer.port";Yt.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var pJ=y(oc=>{"use strict";p();u();l();Object.defineProperty(oc,"__esModule",{value:!0});oc.handleCallbackResponse=oc.handlePromiseResponse=oc.getAttributesFromCollection=void 0;var uJ=(U(),D(J)),X_=he(),z_=hM(),ay=(Le(),D(Xe));function wje(t,e,n){let r={};return e&X_.SemconvStability.OLD&&(r[z_.ATTR_DB_MONGODB_COLLECTION]=t.name,r[z_.ATTR_DB_NAME]=t.conn.name,r[z_.ATTR_DB_USER]=t.conn.user),e&X_.SemconvStability.STABLE&&(r[ay.ATTR_DB_COLLECTION_NAME]=t.name,r[ay.ATTR_DB_NAMESPACE]=t.conn.name),n&X_.SemconvStability.OLD&&(r[z_.ATTR_NET_PEER_NAME]=t.conn.host,r[z_.ATTR_NET_PEER_PORT]=t.conn.port),n&X_.SemconvStability.STABLE&&(r[ay.ATTR_SERVER_ADDRESS]=t.conn.host,r[ay.ATTR_SERVER_PORT]=t.conn.port),r}oc.getAttributesFromCollection=wje;function lJ(t,e={}){t.recordException(e),t.setStatus({code:uJ.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
64
- Mongoose Error Code: ${e.code}`:""}`})}function gM(t,e,n,r=void 0){n&&(0,X_.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&uJ.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Dje(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(gM(e,o,n,r),o)).catch(o=>{throw lJ(e,o),o}).finally(()=>e.end()):(gM(e,t,n,r),e.end(),t)}oc.handlePromiseResponse=Dje;function Uje(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,d)=>(c?lJ(r,c):gM(r,d,s,i),r.end(),t(c,d)),e.apply(n,o)}oc.handleCallbackResponse=Uje});var dJ=y(id=>{"use strict";p();u();l();Object.defineProperty(id,"__esModule",{value:!0});id.PACKAGE_NAME=id.PACKAGE_VERSION=void 0;id.PACKAGE_VERSION="0.57.0";id.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var gJ=y(Dr=>{"use strict";p();u();l();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.MongooseInstrumentation=Dr._ALREADY_INSTRUMENTED=Dr._STORED_PARENT_SPAN=void 0;var sn=(U(),D(J)),kje=Ge(),EM=pJ(),Nn=he(),fJ=dJ(),sc=hM(),ju=(Le(),D(Xe)),cy=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],jje=["remove","count","findOneAndRemove",...cy],Bje=["count","findOneAndRemove",...cy],Gje=[...cy];function mJ(t){return t?t.startsWith("6.")||t.startsWith("5.")?jje:t.startsWith("7.")?Bje:Gje:cy}function _J(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function hJ(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Dr._STORED_PARENT_SPAN=Symbol("stored-parent-span");Dr._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var TM=class extends Nn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(fJ.PACKAGE_NAME,fJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Nn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Nn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Nn.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,_J(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),hJ(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),mJ(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=mJ(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,_J(n)&&this._unwrap(r.Model.prototype,"remove"),hJ(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Nn.SemconvStability.OLD&&(a[sc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&Nn.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Dr._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Nn.SemconvStability.OLD&&(a[sc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&Nn.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let d={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,c);r._dbSemconvStability&Nn.SemconvStability.OLD&&(d[sc.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(d[ju.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(m,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);let d=c,f=i,m=a;typeof i=="function"?(d=i,f=void 0,m=void 0):typeof a=="function"&&(d=a,m=void 0);let _={},g=r.getConfig().dbStatementSerializer;if(g){let R=g(e,{condition:{_id:this._id},updates:f,options:m});r._dbSemconvStability&Nn.SemconvStability.OLD&&(_[sc.ATTR_DB_STATEMENT]=R),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(_[ju.ATTR_DB_QUERY_TEXT]=R)}let T=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),A=r._handleResponse(T,o,this,arguments,d,n);return A&&typeof A=="object"&&(A[Dr._ALREADY_INSTRUMENTED]=!0),A}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let f={},{dbStatementSerializer:m}=r.getConfig();if(m){let g=m(e,d);r._dbSemconvStability&Nn.SemconvStability.OLD&&(f[sc.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(f[ju.ATTR_DB_QUERY_TEXT]=g)}let _=r._startSpan(this.collection,this.modelName,e,f);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=sn.trace.getSpan(sn.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Dr._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Dr._STORED_PARENT_SPAN]=sn.trace.getSpan(sn.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,EM.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Nn.SemconvStability.OLD&&(i[sc.ATTR_DB_OPERATION]=r,i[sc.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Nn.SemconvStability.STABLE&&(i[ju.ATTR_DB_OPERATION_NAME]=r,i[ju.ATTR_DB_SYSTEM_NAME]=sc.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&Nn.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:sn.SpanKind.CLIENT,attributes:i},s?sn.trace.setSpan(sn.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,EM.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,EM.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?sn.context.with((0,kje.suppressTracing)(sn.context.active()),e):e()}};Dr.MongooseInstrumentation=TM});var EJ=y(uy=>{"use strict";p();u();l();Object.defineProperty(uy,"__esModule",{value:!0});uy.MongooseInstrumentation=void 0;var $je=gJ();Object.defineProperty(uy,"MongooseInstrumentation",{enumerable:!0,get:function(){return $je.MongooseInstrumentation}})});var TJ,SJ,AJ,Fje,yJ,RJ=S(()=>{p();u();l();TJ=B(EJ(),1);Be();SJ="Mongoose",AJ=Z(SJ,()=>new TJ.MongooseInstrumentation({responseHook(t){qe(t,"auto.db.otel.mongoose")}})),Fje=(()=>({name:SJ,setupOnce(){AJ()}})),yJ=Fje});var IJ=y(Wt=>{"use strict";p();u();l();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wt.DB_SYSTEM_VALUE_MYSQL=Wt.ATTR_NET_PEER_PORT=Wt.ATTR_NET_PEER_NAME=Wt.ATTR_DB_USER=Wt.ATTR_DB_SYSTEM=Wt.ATTR_DB_STATEMENT=Wt.ATTR_DB_NAME=Wt.ATTR_DB_CONNECTION_STRING=void 0;Wt.ATTR_DB_CONNECTION_STRING="db.connection_string";Wt.ATTR_DB_NAME="db.name";Wt.ATTR_DB_STATEMENT="db.statement";Wt.ATTR_DB_SYSTEM="db.system";Wt.ATTR_DB_USER="db.user";Wt.ATTR_NET_PEER_NAME="net.peer.name";Wt.ATTR_NET_PEER_PORT="net.peer.port";Wt.DB_SYSTEM_VALUE_MYSQL="mysql";Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var NJ=y(Q_=>{"use strict";p();u();l();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.AttributeNames=void 0;var Hje;(function(t){t.MYSQL_VALUES="db.mysql.values"})(Hje=Q_.AttributeNames||(Q_.AttributeNames={}))});var bJ=y(qn=>{"use strict";p();u();l();Object.defineProperty(qn,"__esModule",{value:!0});qn.getPoolNameOld=qn.arrayStringifyHelper=qn.getSpanName=qn.getDbValues=qn.getDbQueryText=qn.getJDBCString=qn.getConfig=void 0;function Vje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}qn.getConfig=Vje;function qje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}qn.getJDBCString=qje;function Yje(t){return typeof t=="string"?t:t.sql}qn.getDbQueryText=Yje;function Wje(t,e){return SM(typeof t=="string"?e:e||t.values)}qn.getDbValues=Wje;function Kje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}qn.getSpanName=Kje;function SM(t){return t?`[${t.toString()}]`:""}qn.arrayStringifyHelper=SM;function zje(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}qn.getPoolNameOld=zje});var OJ=y(ad=>{"use strict";p();u();l();Object.defineProperty(ad,"__esModule",{value:!0});ad.PACKAGE_NAME=ad.PACKAGE_VERSION=void 0;ad.PACKAGE_VERSION="0.57.0";ad.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var PJ=y(ly=>{"use strict";p();u();l();Object.defineProperty(ly,"__esModule",{value:!0});ly.MySQLInstrumentation=void 0;var Ur=(U(),D(J)),ko=he(),cd=(Le(),D(Xe)),Ki=IJ(),Xje=NJ(),Bu=bJ(),CJ=OJ(),AM=class extends ko.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(CJ.PACKAGE_NAME,CJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ko.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ko.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Ki.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new ko.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,ko.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,ko.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,ko.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,d=(0,Bu.getPoolNameOld)(e);r._connCountAdd(-c,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[c].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Ur.context.active();return function(o,s){s&&((0,ko.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Ur.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:d,database:f,user:m}=(0,Bu.getConfig)(e.config),_=parseInt(d,10),g=(0,Bu.getDbQueryText)(o);r._dbSemconvStability&ko.SemconvStability.OLD&&(a[Ki.ATTR_DB_SYSTEM]=Ki.DB_SYSTEM_VALUE_MYSQL,a[Ki.ATTR_DB_CONNECTION_STRING]=(0,Bu.getJDBCString)(c,d,f),a[Ki.ATTR_DB_NAME]=f,a[Ki.ATTR_DB_USER]=m,a[Ki.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&ko.SemconvStability.STABLE&&(a[cd.ATTR_DB_SYSTEM_NAME]=cd.DB_SYSTEM_NAME_VALUE_MYSQL,a[cd.ATTR_DB_NAMESPACE]=f,a[cd.ATTR_DB_QUERY_TEXT]=g),r._netSemconvStability&ko.SemconvStability.OLD&&(a[Ki.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Ki.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&ko.SemconvStability.STABLE&&(a[cd.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[cd.ATTR_SERVER_PORT]=_));let T=r.tracer.startSpan((0,Bu.getSpanName)(o),{kind:Ur.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let b;Array.isArray(s)?b=s:arguments[2]&&(b=[s]),T.setAttribute(Xje.AttributeNames.MYSQL_VALUES,(0,Bu.getDbValues)(o,b))}let A=Array.from(arguments).findIndex(b=>typeof b=="function"),R=Ur.context.active();if(A===-1){let b=Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments));return Ur.context.bind(R,b),b.on("error",I=>T.setStatus({code:Ur.SpanStatusCode.ERROR,message:I.message})).on("end",()=>{T.end()})}else return r._wrap(arguments,A,r._patchCallbackQuery(T,R)),Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Ur.SpanStatusCode.ERROR,message:o.message}),e.end(),Ur.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Bu.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};ly.MySQLInstrumentation=AM});var xJ=y(py=>{"use strict";p();u();l();Object.defineProperty(py,"__esModule",{value:!0});py.MySQLInstrumentation=void 0;var Qje=PJ();Object.defineProperty(py,"MySQLInstrumentation",{enumerable:!0,get:function(){return Qje.MySQLInstrumentation}})});var vJ,MJ,LJ,Jje,wJ,DJ=S(()=>{p();u();l();vJ=B(xJ(),1);Be();MJ="Mysql",LJ=Z(MJ,()=>new vJ.MySQLInstrumentation({})),Jje=(()=>({name:MJ,setupOnce(){LJ()}})),wJ=Jje});var yM=y(fn=>{"use strict";p();u();l();Object.defineProperty(fn,"__esModule",{value:!0});fn.DB_SYSTEM_VALUE_MYSQL=fn.ATTR_NET_PEER_PORT=fn.ATTR_NET_PEER_NAME=fn.ATTR_DB_USER=fn.ATTR_DB_SYSTEM=fn.ATTR_DB_STATEMENT=fn.ATTR_DB_NAME=fn.ATTR_DB_CONNECTION_STRING=void 0;fn.ATTR_DB_CONNECTION_STRING="db.connection_string";fn.ATTR_DB_NAME="db.name";fn.ATTR_DB_STATEMENT="db.statement";fn.ATTR_DB_SYSTEM="db.system";fn.ATTR_DB_USER="db.user";fn.ATTR_NET_PEER_NAME="net.peer.name";fn.ATTR_NET_PEER_PORT="net.peer.port";fn.DB_SYSTEM_VALUE_MYSQL="mysql"});var IM=y(dy=>{"use strict";p();u();l();Object.defineProperty(dy,"__esModule",{value:!0});dy.addSqlCommenterComment=void 0;var RM=(U(),D(J)),Zje=Ge();function eBe(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function tBe(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function nBe(t,e){if(typeof e!="string"||e.length===0||eBe(e))return e;let n=new Zje.W3CTraceContextPropagator,r={};n.inject(RM.trace.setSpan(RM.ROOT_CONTEXT,t),r,RM.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=tBe(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}dy.addSqlCommenterComment=nBe});var UJ=y(jo=>{"use strict";p();u();l();Object.defineProperty(jo,"__esModule",{value:!0});jo.getConnectionPrototypeToInstrument=jo.once=jo.getSpanName=jo.getQueryText=jo.getConnectionAttributes=void 0;var J_=yM(),fy=he(),NM=(Le(),D(Xe));function rBe(t,e,n){let{host:r,port:o,database:s,user:i}=oBe(t),a={};e&fy.SemconvStability.OLD&&(a[J_.ATTR_DB_CONNECTION_STRING]=sBe(r,o,s),a[J_.ATTR_DB_NAME]=s,a[J_.ATTR_DB_USER]=i),e&fy.SemconvStability.STABLE&&(a[NM.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&fy.SemconvStability.OLD&&(a[J_.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[J_.ATTR_NET_PEER_PORT]=c)),n&fy.SemconvStability.STABLE&&(a[NM.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[NM.ATTR_SERVER_PORT]=c)),a}jo.getConnectionAttributes=rBe;function oBe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function sBe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function iBe(t,e,n,r=!1,o=aBe){let[s,i]=typeof t=="string"?[t,n]:[t.sql,cBe(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}jo.getQueryText=iBe;function aBe(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function cBe(t){return"values"in t}function uBe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}jo.getSpanName=uBe;var lBe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};jo.once=lBe;function pBe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}jo.getConnectionPrototypeToInstrument=pBe});var kJ=y(ud=>{"use strict";p();u();l();Object.defineProperty(ud,"__esModule",{value:!0});ud.PACKAGE_NAME=ud.PACKAGE_VERSION=void 0;ud.PACKAGE_VERSION="0.57.0";ud.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var $J=y(my=>{"use strict";p();u();l();Object.defineProperty(my,"__esModule",{value:!0});my.MySQL2Instrumentation=void 0;var jJ=(U(),D(J)),ms=he(),bM=yM(),BJ=IM(),ld=UJ(),GJ=kJ(),OM=(Le(),D(Xe)),CM=[">=1.4.2 <4"],PM=class extends ms.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(GJ.PACKAGE_NAME,GJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ms.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ms.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,ms.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,ms.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new ms.InstrumentationNodeModuleDefinition("mysql2",CM,s=>(n(s),s),()=>{},[new ms.InstrumentationNodeModuleFile("mysql2/promise.js",CM,s=>(n(s),s),()=>{}),new ms.InstrumentationNodeModuleFile("mysql2/lib/connection.js",CM,s=>{let i=(0,ld.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,ld.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:d,maskStatementHook:f,responseHook:m}=o.getConfig(),_=(0,ld.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),g=(0,ld.getQueryText)(s,e,c,d,f);o._dbSemconvStability&ms.SemconvStability.OLD&&(_[bM.ATTR_DB_SYSTEM]=bM.DB_SYSTEM_VALUE_MYSQL,_[bM.ATTR_DB_STATEMENT]=g),o._dbSemconvStability&ms.SemconvStability.STABLE&&(_[OM.ATTR_DB_SYSTEM_NAME]=OM.DB_SYSTEM_NAME_VALUE_MYSQL,_[OM.ATTR_DB_QUERY_TEXT]=g);let T=o.tracer.startSpan((0,ld.getSpanName)(s),{kind:jJ.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,BJ.addSqlCommenterComment)(T,s):Object.assign(s,{sql:(0,BJ.addSqlCommenterComment)(T,s.sql)}));let A=(0,ld.once)((R,b)=>{R?T.setStatus({code:jJ.SpanStatusCode.ERROR,message:R.message}):typeof m=="function"&&(0,ms.safeExecuteInTheMiddle)(()=>{m(T,{queryResults:b})},I=>{I&&o._diag.warn("Failed executing responseHook",I)},!0),T.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(A));let R=r.apply(this,arguments);return R.once("error",b=>{A(b)}).once("result",b=>{A(void 0,b)}),R}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(A)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(A)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};my.MySQL2Instrumentation=PM});var FJ=y(_y=>{"use strict";p();u();l();Object.defineProperty(_y,"__esModule",{value:!0});_y.MySQL2Instrumentation=void 0;var dBe=$J();Object.defineProperty(_y,"MySQL2Instrumentation",{enumerable:!0,get:function(){return dBe.MySQL2Instrumentation}})});var HJ,VJ,qJ,fBe,YJ,WJ=S(()=>{p();u();l();HJ=B(FJ(),1);Be();VJ="Mysql2",qJ=Z(VJ,()=>new HJ.MySQL2Instrumentation({responseHook(t){qe(t,"auto.db.otel.mysql2")}})),fBe=(()=>({name:VJ,setupOnce(){qJ()}})),YJ=fBe});var KJ=y(Yn=>{"use strict";p();u();l();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.DB_SYSTEM_VALUE_REDIS=Yn.DB_SYSTEM_NAME_VALUE_REDIS=Yn.ATTR_NET_PEER_PORT=Yn.ATTR_NET_PEER_NAME=Yn.ATTR_DB_SYSTEM=Yn.ATTR_DB_STATEMENT=Yn.ATTR_DB_CONNECTION_STRING=void 0;Yn.ATTR_DB_CONNECTION_STRING="db.connection_string";Yn.ATTR_DB_STATEMENT="db.statement";Yn.ATTR_DB_SYSTEM="db.system";Yn.ATTR_NET_PEER_NAME="net.peer.name";Yn.ATTR_NET_PEER_PORT="net.peer.port";Yn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Yn.DB_SYSTEM_VALUE_REDIS="redis"});var zJ=y(hy=>{"use strict";p();u();l();Object.defineProperty(hy,"__esModule",{value:!0});hy.endSpan=void 0;var mBe=(U(),D(J)),_Be=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:mBe.SpanStatusCode.ERROR,message:e.message})),t.end()};hy.endSpan=_Be});var Ey=y(gy=>{"use strict";p();u();l();Object.defineProperty(gy,"__esModule",{value:!0});gy.defaultDbStatementSerializer=void 0;var hBe=[{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}],gBe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=hBe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};gy.defaultDbStatementSerializer=gBe});var XJ=y(pd=>{"use strict";p();u();l();Object.defineProperty(pd,"__esModule",{value:!0});pd.PACKAGE_NAME=pd.PACKAGE_VERSION=void 0;pd.PACKAGE_VERSION="0.59.0";pd.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var eZ=y(Ty=>{"use strict";p();u();l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.IORedisInstrumentation=void 0;var ic=(U(),D(J)),kr=he(),ac=(Le(),D(Xe)),jr=KJ(),QJ=he(),Z_=zJ(),EBe=Ey(),JJ=XJ(),ZJ={requireParentSpan:!0},xM=class extends kr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(JJ.PACKAGE_NAME,JJ.PACKAGE_VERSION,{...ZJ,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,kr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,kr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...ZJ,...e})}init(){return[new kr.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,kr.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,kr.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||EBe.defaultDbStatementSerializer,a=ic.trace.getSpan(ic.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:d,port:f}=this.options,m=i(o.name,o.args);r._dbSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,c[jr.ATTR_DB_STATEMENT]=m,c[jr.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${f}`),r._dbSemconvStability&kr.SemconvStability.STABLE&&(c[ac.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,c[ac.ATTR_DB_QUERY_TEXT]=m),r._netSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_NET_PEER_NAME]=d,c[jr.ATTR_NET_PEER_PORT]=f),r._netSemconvStability&kr.SemconvStability.STABLE&&(c[ac.ATTR_SERVER_ADDRESS]=d,c[ac.ATTR_SERVER_PORT]=f);let _=r.tracer.startSpan(o.name,{kind:ic.SpanKind.CLIENT,attributes:c}),{requestHook:g}=s;g&&(0,QJ.safeExecuteInTheMiddle)(()=>g(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),T=>{T&&ic.diag.error("ioredis instrumentation: request hook failed",T)},!0);try{let T=e.apply(this,arguments),A=o.resolve;o.resolve=function(b){(0,QJ.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,b),I=>{I&&ic.diag.error("ioredis instrumentation: response hook failed",I)},!0),(0,Z_.endSpan)(_,null),A(b)};let R=o.reject;return o.reject=function(b){(0,Z_.endSpan)(_,b),R(b)},T}catch(T){throw(0,Z_.endSpan)(_,T),T}}}_traceConnection(e){let n=this;return function(){let r=ic.trace.getSpan(ic.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,o[jr.ATTR_DB_STATEMENT]="connect",o[jr.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&kr.SemconvStability.STABLE&&(o[ac.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,o[ac.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_NET_PEER_NAME]=s,o[jr.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&kr.SemconvStability.STABLE&&(o[ac.ATTR_SERVER_ADDRESS]=s,o[ac.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:ic.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,Z_.endSpan)(a,null),c}catch(c){throw(0,Z_.endSpan)(a,c),c}}}};Ty.IORedisInstrumentation=xM});var tZ=y(Sy=>{"use strict";p();u();l();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IORedisInstrumentation=void 0;var TBe=eZ();Object.defineProperty(Sy,"IORedisInstrumentation",{enumerable:!0,get:function(){return TBe.IORedisInstrumentation}})});var Ay=y(dd=>{"use strict";p();u();l();Object.defineProperty(dd,"__esModule",{value:!0});dd.PACKAGE_NAME=dd.PACKAGE_VERSION=void 0;dd.PACKAGE_VERSION="0.59.0";dd.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var nZ=y(cc=>{"use strict";p();u();l();Object.defineProperty(cc,"__esModule",{value:!0});cc.getTracedCreateStreamTrace=cc.getTracedCreateClient=cc.endSpan=void 0;var eh=(U(),D(J)),SBe=(t,e)=>{e&&t.setStatus({code:eh.SpanStatusCode.ERROR,message:e.message}),t.end()};cc.endSpan=SBe;var ABe=t=>function(){let n=t.apply(this,arguments);return eh.context.bind(eh.context.active(),n)};cc.getTracedCreateClient=ABe;var yBe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){eh.context.bind(eh.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};cc.getTracedCreateStreamTrace=yBe});var yy=y(Wn=>{"use strict";p();u();l();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.DB_SYSTEM_VALUE_REDIS=Wn.DB_SYSTEM_NAME_VALUE_REDIS=Wn.ATTR_NET_PEER_PORT=Wn.ATTR_NET_PEER_NAME=Wn.ATTR_DB_SYSTEM=Wn.ATTR_DB_STATEMENT=Wn.ATTR_DB_CONNECTION_STRING=void 0;Wn.ATTR_DB_CONNECTION_STRING="db.connection_string";Wn.ATTR_DB_STATEMENT="db.statement";Wn.ATTR_DB_SYSTEM="db.system";Wn.ATTR_NET_PEER_NAME="net.peer.name";Wn.ATTR_NET_PEER_PORT="net.peer.port";Wn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Wn.DB_SYSTEM_VALUE_REDIS="redis"});var oZ=y(Iy=>{"use strict";p();u();l();Object.defineProperty(Iy,"__esModule",{value:!0});Iy.RedisInstrumentationV2_V3=void 0;var ao=he(),Ry=nZ(),rZ=Ay(),th=(U(),D(J)),nh=(Le(),D(Xe)),Gu=yy(),RBe=Ey(),vM=class t extends ao.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(rZ.PACKAGE_NAME,rZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,ao.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,ao.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ao.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,ao.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,ao.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,ao.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=th.trace.getSpan(th.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||RBe.defaultDbStatementSerializer,d={};e._semconvStability&ao.SemconvStability.OLD&&Object.assign(d,{[Gu.ATTR_DB_SYSTEM]:Gu.DB_SYSTEM_VALUE_REDIS,[Gu.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&ao.SemconvStability.STABLE&&Object.assign(d,{[nh.ATTR_DB_SYSTEM_NAME]:Gu.DB_SYSTEM_NAME_VALUE_REDIS,[nh.ATTR_DB_OPERATION_NAME]:s.command,[nh.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let f=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:th.SpanKind.CLIENT,attributes:d});if(this.connection_options){let _={};e._semconvStability&ao.SemconvStability.OLD&&Object.assign(_,{[Gu.ATTR_NET_PEER_NAME]:this.connection_options.host,[Gu.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&ao.SemconvStability.STABLE&&Object.assign(_,{[nh.ATTR_SERVER_ADDRESS]:this.connection_options.host,[nh.ATTR_SERVER_PORT]:this.connection_options.port}),f.setAttributes(_)}this.address&&e._semconvStability&ao.SemconvStability.OLD&&f.setAttribute(Gu.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let m=arguments[0].callback;if(m){let _=th.context.active();arguments[0].callback=function(T,A){if(i?.responseHook){let R=i.responseHook;(0,ao.safeExecuteInTheMiddle)(()=>{R(f,s.command,s.args,A)},b=>{b&&e._diag.error("Error executing responseHook",b)},!0)}return(0,Ry.endSpan)(f,T),th.context.with(_,m,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,Ry.endSpan)(f,_),_}}}}_getPatchCreateClient(){return function(n){return(0,Ry.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,Ry.getTracedCreateStreamTrace)(n)}}};Iy.RedisInstrumentationV2_V3=vM});var iZ=y(Ny=>{"use strict";p();u();l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.getClientAttributes=void 0;var MM=(Le(),D(Xe)),fd=yy(),sZ=he();function IBe(t,e,n){let r={};return n&sZ.SemconvStability.OLD&&Object.assign(r,{[fd.ATTR_DB_SYSTEM]:fd.DB_SYSTEM_VALUE_REDIS,[fd.ATTR_NET_PEER_NAME]:e?.socket?.host,[fd.ATTR_NET_PEER_PORT]:e?.socket?.port,[fd.ATTR_DB_CONNECTION_STRING]:NBe(t,e?.url)}),n&sZ.SemconvStability.STABLE&&Object.assign(r,{[MM.ATTR_DB_SYSTEM_NAME]:fd.DB_SYSTEM_NAME_VALUE_REDIS,[MM.ATTR_SERVER_ADDRESS]:e?.socket?.host,[MM.ATTR_SERVER_PORT]:e?.socket?.port}),r}Ny.getClientAttributes=IBe;function NBe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var lZ=y(by=>{"use strict";p();u();l();Object.defineProperty(by,"__esModule",{value:!0});by.RedisInstrumentationV4_V5=void 0;var Bo=(U(),D(J)),st=he(),aZ=iZ(),bBe=Ey(),cZ=Ay(),LM=(Le(),D(Xe)),OBe=yy(),rh=Symbol("opentelemetry.instrumentation.redis.open_spans"),uZ=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),wM=class t extends st.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(cZ.PACKAGE_NAME,cZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,st.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,st.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,st.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,st.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new st.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,d){let f=e(c,d).args;return n._traceClientCommand(a,this,arguments,f)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[rh];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[rh];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[uZ]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,aZ.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Bo.SpanKind.CLIENT,attributes:i});return Bo.context.with(Bo.trace.setSpan(Bo.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Bo.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Bo.trace.getSpan(Bo.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[uZ],a=o[0],c=o.slice(1),d=this.getConfig().dbStatementSerializer||bBe.defaultDbStatementSerializer,f=(0,aZ.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&st.SemconvStability.STABLE&&(f[LM.ATTR_DB_OPERATION_NAME]=a);try{let g=d(a,c);g!=null&&(this._semconvStability&st.SemconvStability.OLD&&(f[OBe.ATTR_DB_STATEMENT]=g),this._semconvStability&st.SemconvStability.STABLE&&(f[LM.ATTR_DB_QUERY_TEXT]=g))}catch(g){this._diag.error("dbStatementSerializer throw an exception",g,{commandName:a})}let m=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Bo.SpanKind.CLIENT,attributes:f}),_=Bo.context.with(Bo.trace.setSpan(Bo.context.active(),m),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(g=>{this._endSpanWithResponse(m,a,c,g,void 0)},g=>{this._endSpanWithResponse(m,a,c,null,g)});else{let g=_;g[rh]=g[rh]||[],g[rh].push({span:m,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:d}=e[a],f=n[a],[m,_]=f instanceof Error?[null,f]:[f,void 0];this._semconvStability&st.SemconvStability.STABLE&&c.setAttribute(LM.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],d,m,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Bo.SpanStatusCode.ERROR,message:s?.message})),e.end()}};by.RedisInstrumentationV4_V5=wM});var fZ=y(Oy=>{"use strict";p();u();l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.RedisInstrumentation=void 0;var CBe=he(),pZ=Ay(),PBe=oZ(),xBe=lZ(),dZ={requireParentSpan:!1},DM=class extends CBe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...dZ,...e};super(pZ.PACKAGE_NAME,pZ.PACKAGE_VERSION,n),this.instrumentationV2_V3=new PBe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new xBe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...dZ,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};Oy.RedisInstrumentation=DM});var mZ=y(Cy=>{"use strict";p();u();l();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RedisInstrumentation=void 0;var vBe=fZ();Object.defineProperty(Cy,"RedisInstrumentation",{enumerable:!0,get:function(){return vBe.RedisInstrumentation}})});function oh(t,e){return t.includes(e.toLowerCase())}function kM(t){return oh(UM,t)?"cache.get":oh(LBe,t)?"cache.put":void 0}function wBe(t,e){return e.some(n=>t.startsWith(n))}function hZ(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?_Z(o.map(s=>n(s))):["<unknown>"],r=e[0];return oh(MBe,t)&&r!=null?n(r):_Z(e.map(o=>n(o)))}catch{return}}function gZ(t,e,n){if(!kM(t))return!1;for(let r of e)if(wBe(r,n))return!0;return!1}function EZ(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function _Z(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var MBe,UM,LBe,TZ=S(()=>{p();u();l();MBe=["get","set","setex"],UM=["get","mget"],LBe=["set","setex"]});var SZ,AZ,Py,sh,yZ,DBe,UBe,RZ,kBe,IZ,NZ=S(()=>{p();u();l();SZ=B(tZ(),1),AZ=B(mZ(),1);ne();Be();TZ();Py="Redis",sh={},yZ=(t,e,n,r)=>{t.setAttribute(fe,"auto.db.otel.redis");let o=hZ(e,n),s=kM(e);if(!o||!s||!sh.cachePrefixes||!gZ(e,o,sh.cachePrefixes))return;let i=ae(t).data["net.peer.name"],a=ae(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=EZ(r);c&&t.setAttribute(MC,c),oh(UM,e)&&c!==void 0&&t.setAttribute(xC,c>0),t.setAttributes({[Ee]:s,[vC]:o});let d=o.join(", ");t.updateName(sh.maxCacheKeyLength?Ra(d,sh.maxCacheKeyLength):d)},DBe=Z(`${Py}.IORedis`,()=>new SZ.IORedisInstrumentation({responseHook:yZ})),UBe=Z(`${Py}.Redis`,()=>new AZ.RedisInstrumentation({responseHook:yZ})),RZ=Object.assign(()=>{DBe(),UBe()},{id:Py}),kBe=((t={})=>({name:Py,setupOnce(){sh=t,RZ()}})),IZ=kBe});var bZ=y(xy=>{"use strict";p();u();l();Object.defineProperty(xy,"__esModule",{value:!0});xy.EVENT_LISTENERS_SET=void 0;xy.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var jM=y(ih=>{"use strict";p();u();l();Object.defineProperty(ih,"__esModule",{value:!0});ih.AttributeNames=void 0;var jBe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(jBe=ih.AttributeNames||(ih.AttributeNames={}))});var BM=y(He=>{"use strict";p();u();l();Object.defineProperty(He,"__esModule",{value:!0});He.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=He.METRIC_DB_CLIENT_CONNECTION_COUNT=He.DB_SYSTEM_VALUE_POSTGRESQL=He.DB_CLIENT_CONNECTION_STATE_VALUE_USED=He.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=He.ATTR_NET_PEER_PORT=He.ATTR_NET_PEER_NAME=He.ATTR_DB_USER=He.ATTR_DB_SYSTEM=He.ATTR_DB_STATEMENT=He.ATTR_DB_NAME=He.ATTR_DB_CONNECTION_STRING=He.ATTR_DB_CLIENT_CONNECTION_STATE=He.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;He.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";He.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";He.ATTR_DB_CONNECTION_STRING="db.connection_string";He.ATTR_DB_NAME="db.name";He.ATTR_DB_STATEMENT="db.statement";He.ATTR_DB_SYSTEM="db.system";He.ATTR_DB_USER="db.user";He.ATTR_NET_PEER_NAME="net.peer.name";He.ATTR_NET_PEER_PORT="net.peer.port";He.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";He.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";He.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";He.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";He.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var GM=y(ah=>{"use strict";p();u();l();Object.defineProperty(ah,"__esModule",{value:!0});ah.SpanNames=void 0;var BBe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(BBe=ah.SpanNames||(ah.SpanNames={}))});var LZ=y(Ue=>{"use strict";p();u();l();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.sanitizedErrorMessage=Ue.isObjectWithTextString=Ue.getErrorMessage=Ue.patchClientConnectCallback=Ue.patchCallbackPGPool=Ue.updateCounter=Ue.getPoolName=Ue.patchCallback=Ue.handleExecutionResult=Ue.handleConfigQuery=Ue.shouldSkipInstrumentation=Ue.getSemanticAttributesFromPoolConnection=Ue.getSemanticAttributesFromConnection=Ue.getConnectionString=Ue.parseAndMaskConnectionString=Ue.parseNormalizedOperationName=Ue.getQuerySpanName=void 0;var uc=(U(),D(J)),vy=jM(),Go=(Le(),D(Xe)),Ot=BM(),$u=he(),OZ=GM();function CZ(t,e){if(!e)return OZ.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:PZ(e.text);return`${OZ.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ue.getQuerySpanName=CZ;function PZ(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ue.parseNormalizedOperationName=PZ;function xZ(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ue.parseAndMaskConnectionString=xZ;function $M(t){if("connectionString"in t&&t.connectionString)return xZ(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ue.getConnectionString=$M;function My(t){if(Number.isInteger(t))return t}function vZ(t,e){let n={};return e&$u.SemconvStability.OLD&&(n={...n,[Ot.ATTR_DB_SYSTEM]:Ot.DB_SYSTEM_VALUE_POSTGRESQL,[Ot.ATTR_DB_NAME]:t.database,[Ot.ATTR_DB_CONNECTION_STRING]:$M(t),[Ot.ATTR_DB_USER]:t.user,[Ot.ATTR_NET_PEER_NAME]:t.host,[Ot.ATTR_NET_PEER_PORT]:My(t.port)}),e&$u.SemconvStability.STABLE&&(n={...n,[Go.ATTR_DB_SYSTEM_NAME]:Go.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Go.ATTR_DB_NAMESPACE]:t.namespace,[Go.ATTR_SERVER_ADDRESS]:t.host,[Go.ATTR_SERVER_PORT]:My(t.port)}),n}Ue.getSemanticAttributesFromConnection=vZ;function GBe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[vy.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[vy.AttributeNames.MAX_CLIENT]:t.maxClient};return e&$u.SemconvStability.OLD&&(r={...r,[Ot.ATTR_DB_SYSTEM]:Ot.DB_SYSTEM_VALUE_POSTGRESQL,[Ot.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Ot.ATTR_DB_CONNECTION_STRING]:$M(t),[Ot.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Ot.ATTR_NET_PEER_PORT]:Number(n?.port)||My(t.port),[Ot.ATTR_DB_USER]:n?.username??t.user}),e&$u.SemconvStability.STABLE&&(r={...r,[Go.ATTR_DB_SYSTEM_NAME]:Go.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Go.ATTR_DB_NAMESPACE]:t.namespace,[Go.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[Go.ATTR_SERVER_PORT]:Number(n?.port)||My(t.port)}),r}Ue.getSemanticAttributesFromPoolConnection=GBe;function $Be(t){return t.requireParentSpan===!0&&uc.trace.getSpan(uc.context.active())===void 0}Ue.shouldSkipInstrumentation=$Be;function FBe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=CZ(s,r),a=t.startSpan(i,{kind:uc.SpanKind.CLIENT,attributes:vZ(o,n)});if(!r)return a;if(r.text&&(n&$u.SemconvStability.OLD&&a.setAttribute(Ot.ATTR_DB_STATEMENT,r.text),n&$u.SemconvStability.STABLE&&a.setAttribute(Go.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(vy.AttributeNames.PG_VALUES,c)}catch(c){uc.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(vy.AttributeNames.PG_PLAN,r.name),a}Ue.handleConfigQuery=FBe;function MZ(t,e,n){typeof t.responseHook=="function"&&(0,$u.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&uc.diag.error("Error running response hook",r)},!0)}Ue.handleExecutionResult=MZ;function HBe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Go.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(Ly(i)),e.setStatus({code:uc.SpanStatusCode.ERROR,message:i.message})):MZ(t,e,a),o(),e.end(),n.call(this,i,a)}}Ue.patchCallback=HBe;function VBe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ue.getPoolName=VBe;function qBe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Ot.ATTR_DB_CLIENT_CONNECTION_STATE]:Ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Ot.ATTR_DB_CLIENT_CONNECTION_STATE]:Ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Ue.updateCounter=qBe;function YBe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(Ly(r)),t.setStatus({code:uc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ue.patchCallbackPGPool=YBe;function WBe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(Ly(r)),t.setStatus({code:uc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ue.patchClientConnectCallback=WBe;function KBe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ue.getErrorMessage=KBe;function zBe(t){return typeof t=="object"&&typeof t?.text=="string"}Ue.isObjectWithTextString=zBe;function Ly(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ue.sanitizedErrorMessage=Ly});var wZ=y(md=>{"use strict";p();u();l();Object.defineProperty(md,"__esModule",{value:!0});md.PACKAGE_NAME=md.PACKAGE_VERSION=void 0;md.PACKAGE_VERSION="0.63.0";md.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var GZ=y(Dy=>{"use strict";p();u();l();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.PgInstrumentation=void 0;var Tr=he(),Ke=(U(),D(J)),DZ=bZ(),ht=LZ(),UZ=IM(),kZ=wZ(),jZ=GM(),wy=Ge(),_s=(Le(),D(Xe)),ch=BM();function _d(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var FM=class extends Tr.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(kZ.PACKAGE_NAME,kZ.PACKAGE_VERSION,e),this._semconvStability=(0,Tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(_s.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ke.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(ch.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(ch.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Tr.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new Tr.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=_d(a);return this._patchPgClient(c.Client),a},a=>{let c=_d(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new Tr.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=_d(a);return(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=_d(a);(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=_d(e);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()),e}_unpatchPgClient(e){let n=_d(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(jZ.SpanNames.CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchClientConnectCallback(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return BZ(i,a)}}recordOperationDuration(e,n){let r={},o=[_s.ATTR_DB_NAMESPACE,_s.ATTR_ERROR_TYPE,_s.ATTR_SERVER_PORT,_s.ATTR_SERVER_ADDRESS,_s.ATTR_DB_OPERATION_NAME];this._semconvStability&Tr.SemconvStability.OLD&&o.push(ch.ATTR_DB_SYSTEM),this._semconvStability&Tr.SemconvStability.STABLE&&o.push(_s.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,wy.hrTimeToMilliseconds)((0,wy.hrTimeDuration)(n,(0,wy.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ht.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,wy.hrTime)(),i=o[0],a=typeof i=="string",c=ht.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,f={[ch.ATTR_DB_SYSTEM]:ch.DB_SYSTEM_VALUE_POSTGRESQL,[_s.ATTR_DB_NAMESPACE]:this.database,[_s.ATTR_SERVER_PORT]:this.connectionParameters.port,[_s.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(f[_s.ATTR_DB_OPERATION_NAME]=ht.parseNormalizedOperationName(d?.text));let m=()=>{e.recordOperationDuration(f,s)},_=e.getConfig(),g=ht.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,d);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,UZ.addSqlCommenterComment)(g,i):c&&!("name"in i)&&(o[0]={...i,text:(0,UZ.addSqlCommenterComment)(g,i.text)})),o.length>0){let R=Ke.trace.getSpan(Ke.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ht.patchCallback(_,g,o[o.length-1],f,m),R&&(o[o.length-1]=Ke.context.bind(Ke.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let b=ht.patchCallback(e.getConfig(),g,d.callback,f,m);R&&(b=Ke.context.bind(Ke.context.active(),b)),o[0].callback=b}}let{requestHook:T}=_;typeof T=="function"&&d&&(0,Tr.safeExecuteInTheMiddle)(()=>{let{database:R,host:b,port:I,user:C}=this.connectionParameters;T(g,{connection:{database:R,host:b,port:I,user:C},query:{text:d.text,values:d.values,name:d.name}})},R=>{R&&e._diag.error("Error running query hook",R)},!0);let A;try{A=n.apply(this,o)}catch(R){throw R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(R)}),g.end(),R}return A instanceof Promise?A.then(R=>new Promise(b=>{ht.handleExecutionResult(e.getConfig(),g,R),m(),g.end(),b(R)})).catch(R=>new Promise((b,I)=>{R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:R.message}),m(),g.end(),I(R)})):A})}_setPoolConnectEventListeners(e){if(e[DZ.EVENT_LISTENERS_SET])return;let n=ht.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[DZ.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(jZ.SpanNames.POOL_CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchCallbackPGPool(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return BZ(i,a)}}};Dy.PgInstrumentation=FM;function BZ(t,e){if(!(e instanceof Promise))return e;let n=e;return Ke.context.bind(Ke.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ht.sanitizedErrorMessage(r)),t.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var $Z=y(hd=>{"use strict";p();u();l();Object.defineProperty(hd,"__esModule",{value:!0});hd.AttributeNames=hd.PgInstrumentation=void 0;var XBe=GZ();Object.defineProperty(hd,"PgInstrumentation",{enumerable:!0,get:function(){return XBe.PgInstrumentation}});var QBe=jM();Object.defineProperty(hd,"AttributeNames",{enumerable:!0,get:function(){return QBe.AttributeNames}})});var FZ,HZ,VZ,JBe,qZ,YZ=S(()=>{p();u();l();FZ=B($Z(),1);Be();HZ="Postgres",VZ=Z(HZ,()=>new FZ.PgInstrumentation({requireParentSpan:!0,requestHook(t){qe(t,"auto.db.otel.postgres")}})),JBe=(()=>({name:HZ,setupOnce(){VZ()}})),qZ=JBe});var zi,ky,WZ,ZBe,Uy,HM,KZ,zZ,VM,eGe,XZ,QZ=S(()=>{p();u();l();U();zi=B(he(),1);Le();ne();Be();Du();ky="PostgresJs",WZ=[">=3.0.0 <4"],ZBe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,Uy=Symbol("sentryPostgresConnectionContext"),HM=Symbol.for("sentry.instrumented.postgresjs"),KZ=Symbol.for("sentry.query.from.instrumented.sql"),zZ=Z(ky,t=>new VM({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),VM=class extends zi.InstrumentationBase{constructor(e){super("sentry-postgres-js",Pe,e)}init(){let e=new zi.InstrumentationNodeModuleDefinition("postgres",WZ,n=>{try{return this._patchPostgres(n)}catch(r){return bt&&N.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new zi.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,WZ,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return bt&&N.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);return!a||typeof a!="function"?(bt&&N.warn("postgres() did not return a valid instance"),a):o._instrumentSqlInstance(a)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(p_(e,"default",s),e)}_wrapQueryMethod(e,n,r){let o=this;return function(...s){let i=Reflect.apply(e,n,s);return i&&typeof i=="object"&&"handle"in i&&o._wrapSingleQueryHandle(i,r),i}}_wrapCallbackMethod(e,n,r){let o=this;return function(...s){let i=r[Uy];if(!(typeof s[s.length-1]=="function")){let m=Reflect.apply(e,n,s);return m&&typeof m.then=="function"?m.then(_=>o._instrumentSqlInstance(_,i)):m}let c=s.length===1?s[0]:s[1],d=function(m){let _=o._instrumentSqlInstance(m,i);return c(_)},f=s.length===1?[d]:[s[0],d];return Reflect.apply(e,n,f)}}_setConnectionAttributes(e,n){if(n&&(n.ATTR_DB_NAMESPACE&&e.setAttribute(Wf,n.ATTR_DB_NAMESPACE),n.ATTR_SERVER_ADDRESS&&e.setAttribute(Kf,n.ATTR_SERVER_ADDRESS),n.ATTR_SERVER_PORT!==void 0)){let r=parseInt(n.ATTR_SERVER_PORT,10);isNaN(r)||e.setAttribute(zf,r)}}_setOperationName(e,n,r){if(r){e.setAttribute(Dl,r);return}let o=n?.match(ZBe);o?.[1]&&e.setAttribute(Dl,o[1].toUpperCase())}_attachConnectionContext(e,n){let r=e;if(!r.options||typeof r.options!="object")return;let o=r.options,s=o.host?.[0]||"localhost",i=o.port?.[0]||5432,a={ATTR_DB_NAMESPACE:typeof o.database=="string"&&o.database!==""?o.database:void 0,ATTR_SERVER_ADDRESS:s,ATTR_SERVER_PORT:String(i)};n[Uy]=a}_instrumentSqlInstance(e,n){if(e[HM])return e;let r=this,o=new Proxy(e,{apply(s,i,a){let c=Reflect.apply(s,i,a);return c&&typeof c=="object"&&"handle"in c&&r._wrapSingleQueryHandle(c,o),c},get(s,i){let a=s[i];return typeof i!="string"||typeof a!="function"?a:i==="unsafe"||i==="file"?r._wrapQueryMethod(a,s,o):i==="begin"||i==="reserve"?r._wrapCallbackMethod(a,s,o):a}});return n?o[Uy]=n:this._attachConnectionContext(e,o),e[HM]=!0,o[HM]=!0,o}_wrapSingleQueryHandle(e,n){if(e.handle?.__sentryWrapped)return;e[KZ]=!0;let r=e.handle,o=this,s=async function(...i){if(!o._shouldCreateSpans())return r.apply(this,i);let a=o._reconstructQuery(e.strings),c=o._sanitizeSqlQuery(a);return Rt({name:c||"postgresjs.query",op:"db"},d=>{qe(d,"auto.db.postgresjs"),d.setAttributes({[_a]:"postgres",[fE]:c});let f=n?n[Uy]:void 0;o._setConnectionAttributes(d,f);let m=o.getConfig(),{requestHook:_}=m;_&&(0,zi.safeExecuteInTheMiddle)(()=>_(d,c,f),T=>{T&&(d.setAttribute("sentry.hook.error","requestHook failed"),bt&&N.error(`Error in requestHook for ${ky} integration:`,T))},!0);let g=this;g.resolve=new Proxy(g.resolve,{apply:(T,A,R)=>{try{o._setOperationName(d,c,R?.[0]?.command),d.end()}catch(b){bt&&N.error("Error ending span in resolve callback:",b)}return Reflect.apply(T,A,R)}}),g.reject=new Proxy(g.reject,{apply:(T,A,R)=>{try{d.setStatus({code:2,message:R?.[0]?.message||"unknown_error"}),d.setAttribute(mE,R?.[0]?.code||"unknown"),d.setAttribute(_E,R?.[0]?.name||"unknown"),o._setOperationName(d,c),d.end()}catch(b){bt&&N.error("Error ending span in reject callback:",b)}return Reflect.apply(T,A,R)}});try{return r.apply(this,i)}catch(T){throw d.setStatus({code:2,message:T instanceof Error?T.message:"unknown_error"}),d.end(),T}})};s.__sentryWrapped=!0,e.handle=s}_shouldCreateSpans(){let e=this.getConfig();return de.getSpan(V.active())!==void 0||!e.requireParentSpan}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[KZ])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return Rt({name:i||"postgresjs.query",op:"db"},a=>{qe(a,"auto.db.postgresjs"),a.setAttributes({[_a]:"postgres",[fE]:i});let c=n.getConfig(),{requestHook:d}=c;d&&(0,zi.safeExecuteInTheMiddle)(()=>d(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),bt&&N.error(`Error in requestHook for ${ky} integration:`,_))},!0);let f=this.resolve;this.resolve=new Proxy(f,{apply:(_,g,T)=>{try{n._setOperationName(a,i,T?.[0]?.command),a.end()}catch(A){bt&&N.error("Error ending span in resolve callback:",A)}return Reflect.apply(_,g,T)}});let m=this.reject;this.reject=new Proxy(m,{apply:(_,g,T)=>{try{a.setStatus({code:2,message:T?.[0]?.message||"unknown_error"}),a.setAttribute(mE,T?.[0]?.code||"unknown"),a.setAttribute(_E,T?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(A){bt&&N.error("Error ending span in reject callback:",A)}return Reflect.apply(_,g,T)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},eGe=(t=>({name:ky,setupOnce(){zZ(t)}})),XZ=eGe});var JZ=y(uh=>{"use strict";p();u();l();Object.defineProperty(uh,"__esModule",{value:!0});uh.SeverityNumber=void 0;var tGe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(tGe=uh.SeverityNumber||(uh.SeverityNumber={}))});var By=y(gd=>{"use strict";p();u();l();Object.defineProperty(gd,"__esModule",{value:!0});gd.NOOP_LOGGER=gd.NoopLogger=void 0;var jy=class{emit(e){}};gd.NoopLogger=jy;gd.NOOP_LOGGER=new jy});var $y=y(Ed=>{"use strict";p();u();l();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.NOOP_LOGGER_PROVIDER=Ed.NoopLoggerProvider=void 0;var nGe=By(),Gy=class{getLogger(e,n,r){return new nGe.NoopLogger}};Ed.NoopLoggerProvider=Gy;Ed.NOOP_LOGGER_PROVIDER=new Gy});var YM=y(Fy=>{"use strict";p();u();l();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ProxyLogger=void 0;var rGe=By(),qM=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rGe.NOOP_LOGGER}};Fy.ProxyLogger=qM});var KM=y(Hy=>{"use strict";p();u();l();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.ProxyLoggerProvider=void 0;var oGe=$y(),sGe=YM(),WM=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new sGe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:oGe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};Hy.ProxyLoggerProvider=WM});var ZZ=y(Vy=>{"use strict";p();u();l();Object.defineProperty(Vy,"__esModule",{value:!0});Vy._globalThis=void 0;Vy._globalThis=typeof globalThis=="object"?globalThis:global});var e7=y(qy=>{"use strict";p();u();l();Object.defineProperty(qy,"__esModule",{value:!0});qy._globalThis=void 0;var iGe=ZZ();Object.defineProperty(qy,"_globalThis",{enumerable:!0,get:function(){return iGe._globalThis}})});var t7=y(Yy=>{"use strict";p();u();l();Object.defineProperty(Yy,"__esModule",{value:!0});Yy._globalThis=void 0;var aGe=e7();Object.defineProperty(Yy,"_globalThis",{enumerable:!0,get:function(){return aGe._globalThis}})});var n7=y(ei=>{"use strict";p();u();l();Object.defineProperty(ei,"__esModule",{value:!0});ei.API_BACKWARDS_COMPATIBILITY_VERSION=ei.makeGetter=ei._global=ei.GLOBAL_LOGS_API_KEY=void 0;var cGe=t7();ei.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ei._global=cGe._globalThis;function uGe(t,e,n){return r=>r===t?e:n}ei.makeGetter=uGe;ei.API_BACKWARDS_COMPATIBILITY_VERSION=1});var o7=y(Wy=>{"use strict";p();u();l();Object.defineProperty(Wy,"__esModule",{value:!0});Wy.LogsAPI=void 0;var $o=n7(),lGe=$y(),r7=KM(),zM=class t{constructor(){this._proxyLoggerProvider=new r7.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return $o._global[$o.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():($o._global[$o.GLOBAL_LOGS_API_KEY]=(0,$o.makeGetter)($o.API_BACKWARDS_COMPATIBILITY_VERSION,e,lGe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=$o._global[$o.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call($o._global,$o.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete $o._global[$o.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new r7.ProxyLoggerProvider}};Wy.LogsAPI=zM});var XM=y(mn=>{"use strict";p();u();l();Object.defineProperty(mn,"__esModule",{value:!0});mn.logs=mn.ProxyLoggerProvider=mn.ProxyLogger=mn.NoopLoggerProvider=mn.NOOP_LOGGER_PROVIDER=mn.NoopLogger=mn.NOOP_LOGGER=mn.SeverityNumber=void 0;var pGe=JZ();Object.defineProperty(mn,"SeverityNumber",{enumerable:!0,get:function(){return pGe.SeverityNumber}});var s7=By();Object.defineProperty(mn,"NOOP_LOGGER",{enumerable:!0,get:function(){return s7.NOOP_LOGGER}});Object.defineProperty(mn,"NoopLogger",{enumerable:!0,get:function(){return s7.NoopLogger}});var i7=$y();Object.defineProperty(mn,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return i7.NOOP_LOGGER_PROVIDER}});Object.defineProperty(mn,"NoopLoggerProvider",{enumerable:!0,get:function(){return i7.NoopLoggerProvider}});var dGe=YM();Object.defineProperty(mn,"ProxyLogger",{enumerable:!0,get:function(){return dGe.ProxyLogger}});var fGe=KM();Object.defineProperty(mn,"ProxyLoggerProvider",{enumerable:!0,get:function(){return fGe.ProxyLoggerProvider}});var mGe=o7();mn.logs=mGe.LogsAPI.getInstance()});var a7=y(Td=>{"use strict";p();u();l();Object.defineProperty(Td,"__esModule",{value:!0});Td.disableInstrumentations=Td.enableInstrumentations=void 0;function _Ge(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Td.enableInstrumentations=_Ge;function hGe(t){t.forEach(e=>e.disable())}Td.disableInstrumentations=hGe});var l7=y(Ky=>{"use strict";p();u();l();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.registerInstrumentations=void 0;var c7=(U(),D(J)),gGe=XM(),u7=a7();function EGe(t){let e=t.tracerProvider||c7.trace.getTracerProvider(),n=t.meterProvider||c7.metrics.getMeterProvider(),r=t.loggerProvider||gGe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,u7.enableInstrumentations)(o,e,n,r),()=>{(0,u7.disableInstrumentations)(o)}}Ky.registerInstrumentations=EGe});var T7=y(zy=>{"use strict";p();u();l();Object.defineProperty(zy,"__esModule",{value:!0});zy.satisfies=void 0;var eL=(U(),D(J)),_7=/^(?: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-]+)*))?$/,TGe=/^(?<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-]+)*))?$/,SGe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function AGe(t,e,n){if(!yGe(t))return eL.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=bGe(t);if(!r)return!1;let o=[],s=h7(r,e,o,n);return s&&!n?.includePrerelease?IGe(r,o):s}zy.satisfies=AGe;function yGe(t){return typeof t=="string"&&_7.test(t)}function h7(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(QM(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=WGe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!QM(t,s,n,r))return!1;return!0}return QM(t,e,n,r)}function QM(t,e,n,r){if(e=NGe(e,r),e.includes(" "))return h7(t,e,n,r);{let o=OGe(e);return n.push(o),RGe(t,o)}}function RGe(t,e){if(e.invalid)return!1;if(!e.version||ZM(e.version))return!0;let n=d7(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=d7(r,o)}return SGe[e.op]?.includes(n)}function IGe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function NGe(t,e){return t=t.trim(),t=qGe(t,e),t=VGe(t),t=YGe(t,e),t=t.trim(),t}function Sr(t){return!t||t.toLowerCase()==="x"||t==="*"}function bGe(t){let e=t.match(_7);if(!e){eL.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function OGe(t){if(!t)return{};let e=t.match(TGe);if(!e)return eL.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function ZM(t){return t==="*"||t==="x"||t==="X"}function p7(t){let e=parseInt(t,10);return isNaN(e)?t:e}function CGe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function PGe(t,e){if(ZM(t)||ZM(e))return 0;let[n,r]=CGe(p7(t),p7(e));return n>r?1:n<r?-1:0}function d7(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=PGe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var g7="[a-zA-Z0-9-]",E7="0|[1-9]\\d*",xGe=`\\d*[a-zA-Z-]${g7}*`,vGe="((?:<|>)?=?)",f7=`(?:${E7}|${xGe})`,MGe=`(?:-(${f7}(?:\\.${f7})*))`,m7=`${g7}+`,LGe=`(?:\\+(${m7}(?:\\.${m7})*))`,JM=`${E7}|x|X|\\*`,lh=`[v=\\s]*(${JM})(?:\\.(${JM})(?:\\.(${JM})(?:${MGe})?${LGe}?)?)?`,wGe=`^${vGe}\\s*${lh}$`,DGe=new RegExp(wGe),UGe=`^\\s*(${lh})\\s+-\\s+(${lh})\\s*$`,kGe=new RegExp(UGe),jGe="(?:~>?)",BGe=`^${jGe}${lh}$`,GGe=new RegExp(BGe),$Ge="(?:\\^)",FGe=`^${$Ge}${lh}$`,HGe=new RegExp(FGe);function VGe(t){let e=GGe;return t.replace(e,(n,r,o,s,i)=>{let a;return Sr(r)?a="":Sr(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Sr(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function qGe(t,e){let n=HGe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let d;return Sr(s)?d="":Sr(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Sr(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function YGe(t,e){let n=DGe;return t.replace(n,(r,o,s,i,a,c)=>{let d=Sr(s),f=d||Sr(i),m=f||Sr(a),_=m;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function WGe(t,e){let n=kGe;return t.replace(n,(r,o,s,i,a,c,d,f,m,_,g,T)=>(Sr(s)?o="":Sr(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Sr(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Sr(m)?f="":Sr(_)?f=`<${+m+1}.0.0-0`:Sr(g)?f=`<${m}.${+_+1}.0-0`:T?f=`<=${m}.${_}.${g}-${T}`:e?.includePrerelease?f=`<${m}.${_}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}});var tL=y(bn=>{"use strict";p();u();l();Object.defineProperty(bn,"__esModule",{value:!0});bn.massUnwrap=bn.unwrap=bn.massWrap=bn.wrap=void 0;var Ar=console.error.bind(console);function ph(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var KGe=(t,e,n)=>{if(!t||!t[e]){Ar("no original function "+String(e)+" to wrap");return}if(!n){Ar("no wrapper function"),Ar(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Ar("original object and wrapper must be functions");return}let o=n(r,e);return ph(o,"__original",r),ph(o,"__unwrap",()=>{t[e]===o&&ph(t,e,r)}),ph(o,"__wrapped",!0),ph(t,e,o),o};bn.wrap=KGe;var zGe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,bn.wrap)(r,o,n)})})};bn.massWrap=zGe;var XGe=(t,e)=>{if(!t||!t[e]){Ar("no function to unwrap."),Ar(new Error().stack);return}let n=t[e];if(!n.__unwrap)Ar("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};bn.unwrap=XGe;var QGe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,bn.unwrap)(n,r)})})};bn.massUnwrap=QGe;function dh(t){t&&t.logger&&(typeof t.logger!="function"?Ar("new logger isn't a function, not replacing"):Ar=t.logger)}bn.default=dh;dh.wrap=bn.wrap;dh.massWrap=bn.massWrap;dh.unwrap=bn.unwrap;dh.massUnwrap=bn.massUnwrap});var S7=y(Qy=>{"use strict";p();u();l();Object.defineProperty(Qy,"__esModule",{value:!0});Qy.InstrumentationAbstract=void 0;var nL=(U(),D(J)),JGe=XM(),Xy=tL(),rL=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=nL.diag.createComponentLogger({namespace:e}),this._tracer=nL.trace.getTracer(e,n),this._meter=nL.metrics.getMeter(e,n),this._logger=JGe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=Xy.wrap;_unwrap=Xy.unwrap;_massWrap=Xy.massWrap;_massUnwrap=Xy.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};Qy.InstrumentationAbstract=rL});var A7=y(lc=>{"use strict";p();u();l();Object.defineProperty(lc,"__esModule",{value:!0});lc.ModuleNameTrie=lc.ModuleNameSeparator=void 0;lc.ModuleNameSeparator="/";var Jy=class{hooks=[];children=new Map},oL=class{_trie=new Jy;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(lc.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new Jy,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(lc.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};lc.ModuleNameTrie=oL});var R7=y(Zy=>{"use strict";p();u();l();Object.defineProperty(Zy,"__esModule",{value:!0});Zy.RequireInTheMiddleSingleton=void 0;var ZGe=om(),y7=require("path"),sL=A7(),e$e=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),iL=class t{_moduleNameTrie=new sL.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new ZGe.Hook(null,{internals:!0},(e,n,r)=>{let o=t$e(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return e$e?new t:this._instance=this._instance??new t}};Zy.RequireInTheMiddleSingleton=iL;function t$e(t){return y7.sep!==sL.ModuleNameSeparator?t.split(y7.sep).join(sL.ModuleNameSeparator):t}});var P7=y(Fu=>{p();u();l();var I7=[],aL=new WeakMap,N7=new WeakMap,b7=new Map,O7=[],n$e={set(t,e,n){let r=aL.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=N7.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=aL.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function r$e(t,e,n,r,o){b7.set(t,o),aL.set(e,n),N7.set(e,r);let s=new Proxy(e,n$e);I7.forEach(i=>i(t,s,o)),O7.push([t,s,o])}var C7=!1;function o$e(){return C7}function s$e(t){C7=t}Fu.register=r$e;Fu.importHooks=I7;Fu.specifiers=b7;Fu.toHook=O7;Fu.getExperimentalPatchInternals=o$e;Fu.setExperimentalPatchInternals=s$e});var D7=y((hGt,Sd)=>{p();u();l();var x7=require("path"),i$e=JE(),{fileURLToPath:v7}=require("url"),{MessageChannel:a$e}=require("worker_threads"),{importHooks:cL,specifiers:c$e,toHook:u$e,getExperimentalPatchInternals:l$e}=P7();function L7(t){cL.push(t),u$e.forEach(([e,n,r])=>t(e,n,r))}function w7(t){let e=cL.indexOf(t);e>-1&&cL.splice(e,1)}function M7(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var uL;function p$e(){let{port1:t,port2:e}=new a$e,n=0,r;uL=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(d=>{r=d}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function fh(t,e,n){if(!(this instanceof fh))return new fh(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;uL&&Array.isArray(t)&&uL(t),this._iitmHook=(o,s,i)=>{let a=o,c=o.startsWith("node:"),d;if(c)o=o.replace(/^node:/,"");else{if(o.startsWith("file://")){let m=Error.stackTraceLimit;Error.stackTraceLimit=0;try{o=v7(o)}catch{}Error.stackTraceLimit=m}let f=i$e(o);f&&(o=f.name,d=f.basedir)}if(t)for(let f of t){let m=f===o,_=f===i;if(m||_){if(d){if(r)o=o+x7.sep+x7.relative(d,v7(a));else if(!l$e()&&!_&&!d.endsWith(c$e.get(a)))continue}M7(n,s,o,d)}}else M7(n,s,o,d)},L7(this._iitmHook)}fh.prototype.unhook=function(){w7(this._iitmHook)};Sd.exports=fh;Sd.exports.Hook=fh;Sd.exports.addHook=L7;Sd.exports.removeHook=w7;Sd.exports.createAddHookMessageChannel=p$e});var lL=y(pc=>{"use strict";p();u();l();Object.defineProperty(pc,"__esModule",{value:!0});pc.isWrapped=pc.safeExecuteInTheMiddleAsync=pc.safeExecuteInTheMiddle=void 0;function d$e(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}pc.safeExecuteInTheMiddle=d$e;async function f$e(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}pc.safeExecuteInTheMiddleAsync=f$e;function m$e(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}pc.isWrapped=m$e});var j7=y(eR=>{"use strict";p();u();l();Object.defineProperty(eR,"__esModule",{value:!0});eR.InstrumentationBase=void 0;var mh=require("path"),U7=require("util"),_$e=T7(),pL=tL(),h$e=S7(),g$e=R7(),E$e=D7(),_h=(U(),D(J)),T$e=om(),S$e=require("fs"),A$e=lL(),dL=class extends h$e.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=g$e.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,A$e.isWrapped)(e[n])&&this._unwrap(e,n),U7.types.isProxy(e)){let o=(0,pL.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,pL.wrap)(e,n,r)};_unwrap=(e,n)=>U7.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,pL.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,S$e.readFileSync)(mh.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{_h.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return k7(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=mh.normalize(r);return i.filter(d=>d.name===a).filter(d=>k7(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&mh.isAbsolute(a)){let d=mh.parse(a);a=d.name,c=d.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=mh.isAbsolute(e.name)?new T$e.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new E$e.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};eR.InstrumentationBase=dL;function k7(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,_$e.satisfies)(e,r,{includePrerelease:n}))}});var B7=y(tR=>{"use strict";p();u();l();Object.defineProperty(tR,"__esModule",{value:!0});tR.normalize=void 0;var y$e=require("path");Object.defineProperty(tR,"normalize",{enumerable:!0,get:function(){return y$e.normalize}})});var G7=y(Ad=>{"use strict";p();u();l();Object.defineProperty(Ad,"__esModule",{value:!0});Ad.normalize=Ad.InstrumentationBase=void 0;var R$e=j7();Object.defineProperty(Ad,"InstrumentationBase",{enumerable:!0,get:function(){return R$e.InstrumentationBase}});var I$e=B7();Object.defineProperty(Ad,"normalize",{enumerable:!0,get:function(){return I$e.normalize}})});var fL=y(yd=>{"use strict";p();u();l();Object.defineProperty(yd,"__esModule",{value:!0});yd.normalize=yd.InstrumentationBase=void 0;var $7=G7();Object.defineProperty(yd,"InstrumentationBase",{enumerable:!0,get:function(){return $7.InstrumentationBase}});Object.defineProperty(yd,"normalize",{enumerable:!0,get:function(){return $7.normalize}})});var F7=y(nR=>{"use strict";p();u();l();Object.defineProperty(nR,"__esModule",{value:!0});nR.InstrumentationNodeModuleDefinition=void 0;var mL=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};nR.InstrumentationNodeModuleDefinition=mL});var H7=y(rR=>{"use strict";p();u();l();Object.defineProperty(rR,"__esModule",{value:!0});rR.InstrumentationNodeModuleFile=void 0;var N$e=fL(),_L=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,N$e.normalize)(e)}};rR.InstrumentationNodeModuleFile=_L});var V7=y(Hu=>{"use strict";p();u();l();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.semconvStabilityFromStr=Hu.SemconvStability=void 0;var oR;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(oR=Hu.SemconvStability||(Hu.SemconvStability={}));function b$e(t,e){let n=oR.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=oR.DUPLICATE;break}else o.toLowerCase()===t&&(n=oR.STABLE);return n}Hu.semconvStabilityFromStr=b$e});var Y7=y(Kt=>{"use strict";p();u();l();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.semconvStabilityFromStr=Kt.SemconvStability=Kt.safeExecuteInTheMiddleAsync=Kt.safeExecuteInTheMiddle=Kt.isWrapped=Kt.InstrumentationNodeModuleFile=Kt.InstrumentationNodeModuleDefinition=Kt.InstrumentationBase=Kt.registerInstrumentations=void 0;var O$e=l7();Object.defineProperty(Kt,"registerInstrumentations",{enumerable:!0,get:function(){return O$e.registerInstrumentations}});var C$e=fL();Object.defineProperty(Kt,"InstrumentationBase",{enumerable:!0,get:function(){return C$e.InstrumentationBase}});var P$e=F7();Object.defineProperty(Kt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return P$e.InstrumentationNodeModuleDefinition}});var x$e=H7();Object.defineProperty(Kt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return x$e.InstrumentationNodeModuleFile}});var hL=lL();Object.defineProperty(Kt,"isWrapped",{enumerable:!0,get:function(){return hL.isWrapped}});Object.defineProperty(Kt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return hL.safeExecuteInTheMiddle}});Object.defineProperty(Kt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return hL.safeExecuteInTheMiddleAsync}});var q7=V7();Object.defineProperty(Kt,"SemconvStability",{enumerable:!0,get:function(){return q7.SemconvStability}});Object.defineProperty(Kt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return q7.semconvStabilityFromStr}})});function L$e(){let t=Rd[EL];return t?.helper?t.helper:Rd[gL]?.helper}function w$e(t){let e={helper:t};Rd[EL]=e,Rd[gL]=e}function D$e(){delete Rd[EL],delete Rd[gL]}function j$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}function z7(t,e,n,r,o){if(X7(e.name,o))return;let s={attributes:e.attributes,kind:j$e(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let d=r.get(c);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)z7(t,c,n,r,o);i.end(e.endTime)})}function W7(t,e){return G$e(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function G$e(t){return t!=null&&typeof t.then=="function"}function X7(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var sR,v$e,M$e,gL,EL,Rd,U$e,k$e,B$e,Q7,K7,$$e,F$e,J7,Z7=S(()=>{p();u();l();U();sR=B(Y7(),1);U();v$e={name:"@prisma/instrumentation-contract",version:"7.2.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"}},M$e=v$e.version.split(".")[0],gL="PRISMA_INSTRUMENTATION",EL=`V${M$e}_PRISMA_INSTRUMENTATION`,Rd=globalThis;U$e=process.env.PRISMA_SHOW_ALL_TRACES==="true",k$e="00-10-10-00";B$e=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=de.getSpanContext(t??V.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:k$e}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)z7(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return V.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!U$e)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(X7(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return W7(s,e(s,r))}return n.startActiveSpan(o,t,s=>W7(s,e(s,r)))}};Q7={name:"@prisma/instrumentation",version:"7.2.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},K7=Q7.version,$$e=Q7.name,F$e="@prisma/client",J7=class extends sR.InstrumentationBase{tracerProvider;constructor(t={}){super($$e,K7,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new sR.InstrumentationNodeModuleDefinition(F$e,[K7])]}enable(){let t=this._config;w$e(new B$e({tracerProvider:this.tracerProvider??de.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){D$e()}isEnabled(){return L$e()!==void 0}}});function H$e(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function tee(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}function V$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}var eee,TL,q$e,nee,ree=S(()=>{p();u();l();U();Z7();ne();Be();eee="Prisma";TL=class extends J7{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=tee();H$e(e)&&(e.createEngineSpan=n=>{let r=de.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Ut(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=V$e(s.kind),a=s.parent_span_id,c=s.span_id,d=s.trace_id,f=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:rr.SAMPLED}})),m=de.setSpanContext(V.active(),{traceId:d,spanId:a,traceFlags:rr.SAMPLED});V.with(m,()=>{let _={generateTraceId:()=>d,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:f,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};q$e=Z(eee,t=>new TL(t)),nee=t=>({name:eee,setupOnce(){q$e(t)},setup(e){tee()&&e.on("spanStart",n=>{let r=ae(n);r.description?.startsWith("prisma:")&&n.setAttribute(fe,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var oee=y(Id=>{"use strict";p();u();l();Object.defineProperty(Id,"__esModule",{value:!0});Id.PACKAGE_NAME=Id.PACKAGE_VERSION=void 0;Id.PACKAGE_VERSION="0.57.0";Id.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var SL=y(ti=>{"use strict";p();u();l();Object.defineProperty(ti,"__esModule",{value:!0});ti.HapiLifecycleMethodNames=ti.HapiLayerType=ti.handlerPatched=ti.HapiComponentName=void 0;ti.HapiComponentName="@hapi/hapi";ti.handlerPatched=Symbol("hapi-handler-patched");ti.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ti.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var see=y(iR=>{"use strict";p();u();l();Object.defineProperty(iR,"__esModule",{value:!0});iR.ATTR_HTTP_METHOD=void 0;iR.ATTR_HTTP_METHOD="http.method"});var AL=y(hh=>{"use strict";p();u();l();Object.defineProperty(hh,"__esModule",{value:!0});hh.AttributeNames=void 0;var Y$e;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(Y$e=hh.AttributeNames||(hh.AttributeNames={}))});var cee=y(zt=>{"use strict";p();u();l();Object.defineProperty(zt,"__esModule",{value:!0});zt.getPluginFromInput=zt.getExtMetadata=zt.getRouteMetadata=zt.isPatchableExtMethod=zt.isDirectExtInput=zt.isLifecycleExtEventObj=zt.isLifecycleExtType=zt.getPluginName=void 0;var iee=(Le(),D(Xe)),W$e=see(),gh=SL(),dc=AL(),aee=he();function K$e(t){return t.name?t.name:t.pkg.name}zt.getPluginName=K$e;var z$e=t=>typeof t=="string"&&gh.HapiLifecycleMethodNames.has(t);zt.isLifecycleExtType=z$e;var X$e=t=>{let e=t?.type;return e!==void 0&&(0,zt.isLifecycleExtType)(e)};zt.isLifecycleExtEventObj=X$e;var Q$e=t=>Array.isArray(t)&&t.length<=3&&(0,zt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";zt.isDirectExtInput=Q$e;var J$e=t=>!Array.isArray(t);zt.isPatchableExtMethod=J$e;var Z$e=(t,e,n)=>{let r={[iee.ATTR_HTTP_ROUTE]:t.path};e&aee.SemconvStability.OLD&&(r[W$e.ATTR_HTTP_METHOD]=t.method),e&aee.SemconvStability.STABLE&&(r[iee.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[dc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.PLUGIN,r[dc.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[dc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};zt.getRouteMetadata=Z$e;var eFe=(t,e)=>e?{attributes:{[dc.AttributeNames.EXT_TYPE]:t,[dc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT,[dc.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[dc.AttributeNames.EXT_TYPE]:t,[dc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT},name:`ext - ${t}`};zt.getExtMetadata=eFe;var tFe=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;zt.getPluginFromInput=tFe});var pee=y(aR=>{"use strict";p();u();l();Object.defineProperty(aR,"__esModule",{value:!0});aR.HapiInstrumentation=void 0;var co=(U(),D(J)),uee=Ge(),Eh=he(),lee=oee(),Th=SL(),Xi=cee(),yL=class extends Eh.InstrumentationBase{_semconvStability;constructor(e={}){super(lee.PACKAGE_NAME,lee.PACKAGE_VERSION,e),this._semconvStability=(0,Eh.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Eh.InstrumentationNodeModuleDefinition(Th.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Eh.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Eh.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Xi.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Xi.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Xi.isLifecycleExtType)(c.type)){let d=c,f=r._wrapExtMethods(d.method,c.type,n);d.method=f,i[a]=d}}return e.apply(this,s)}else if((0,Xi.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Xi.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Xi.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Xi.isPatchableExtMethod)(e))return e[Th.handlerPatched]===!0?e:(e[Th.handlerPatched]=!0,async function(...i){if(co.trace.getSpan(co.context.active())===void 0)return await e.apply(this,i);let a=(0,Xi.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await co.context.with(co.trace.setSpan(co.context.active(),c),e,void 0,...i)}catch(d){throw c.recordException(d),c.setStatus({code:co.SpanStatusCode.ERROR,message:d.message}),d}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Th.handlerPatched]===!0)return e;e[Th.handlerPatched]=!0;let o=s=>async function(...i){if(co.trace.getSpan(co.context.active())===void 0)return await s.call(this,...i);let a=(0,uee.getRPCMetadata)(co.context.active());a?.type===uee.RPCType.HTTP&&(a.route=e.path);let c=(0,Xi.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await co.context.with(co.trace.setSpan(co.context.active(),d),()=>s.call(this,...i))}catch(f){throw d.recordException(f),d.setStatus({code:co.SpanStatusCode.ERROR,message:f.message}),f}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};aR.HapiInstrumentation=yL});var dee=y(Nd=>{"use strict";p();u();l();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.AttributeNames=Nd.HapiInstrumentation=void 0;var nFe=pee();Object.defineProperty(Nd,"HapiInstrumentation",{enumerable:!0,get:function(){return nFe.HapiInstrumentation}});var rFe=AL();Object.defineProperty(Nd,"AttributeNames",{enumerable:!0,get:function(){return rFe.AttributeNames}})});var fee,mee,_ee,oFe,hee,gee=S(()=>{p();u();l();fee=B(dee(),1);Be();mee="Hapi",_ee=Z(mee,()=>new fee.HapiInstrumentation),oFe=(()=>({name:mee,setupOnce(){_ee()}})),hee=oFe});var fc,Sh,RL=S(()=>{p();u();l();fc={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Sh={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var uR,sFe,iFe,cR,Eee=S(()=>{p();u();l();U();uR=B(he(),1);ne();RL();sFe="@sentry/instrumentation-hono",iFe="0.0.1",cR=class extends uR.InstrumentationBase{constructor(e={}){super(sFe,iFe,e)}init(){return[new uR.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return V.with(de.setSpan(V.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(ur(a))return a.then(c=>{let d=n._determineHandlerType(c);return i.setAttributes({[fc.HONO_TYPE]:d,[fc.HONO_NAME]:d===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[fc.HONO_TYPE]:c,[fc.HONO_NAME]:c===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return ur(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Sh.MIDDLEWARE:Sh.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:it.ERROR,message:n.message}),e.recordException(n))}}});function aFe(t){let e=ae(t).data,n=e[fc.HONO_TYPE];if(e[Ee]||!n)return;t.setAttributes({[fe]:"auto.http.otel.hono",[Ee]:`${n}.hono`});let r=e[fc.HONO_NAME];if(typeof r=="string"&&t.updateName(r),ge()===bo()){bt&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[br],s=e[Ri];typeof o=="string"&&typeof s=="string"&&ge().setTransactionName(`${s} ${o}`)}var Tee,See,cFe,Aee,yee=S(()=>{p();u();l();Le();ne();Be();Du();RL();Eee();Tee="Hono";See=Z(Tee,()=>new cR({responseHook:t=>{aFe(t)}})),cFe=(()=>({name:Tee,setupOnce(){See()}})),Aee=cFe});var lR=y(Ah=>{"use strict";p();u();l();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.KoaLayerType=void 0;var uFe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(uFe=Ah.KoaLayerType||(Ah.KoaLayerType={}))});var Ree=y(bd=>{"use strict";p();u();l();Object.defineProperty(bd,"__esModule",{value:!0});bd.PACKAGE_NAME=bd.PACKAGE_VERSION=void 0;bd.PACKAGE_VERSION="0.59.0";bd.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var IL=y(yh=>{"use strict";p();u();l();Object.defineProperty(yh,"__esModule",{value:!0});yh.AttributeNames=void 0;var lFe;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(lFe=yh.AttributeNames||(yh.AttributeNames={}))});var Nee=y(Od=>{"use strict";p();u();l();Object.defineProperty(Od,"__esModule",{value:!0});Od.isLayerIgnored=Od.getMiddlewareMetadata=void 0;var Iee=lR(),pR=IL(),pFe=(Le(),D(Xe)),dFe=(t,e,n,r)=>n?{attributes:{[pR.AttributeNames.KOA_NAME]:r?.toString(),[pR.AttributeNames.KOA_TYPE]:Iee.KoaLayerType.ROUTER,[pFe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[pR.AttributeNames.KOA_NAME]:e.name??"middleware",[pR.AttributeNames.KOA_TYPE]:Iee.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Od.getMiddlewareMetadata=dFe;var fFe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Od.isLayerIgnored=fFe});var bee=y(dR=>{"use strict";p();u();l();Object.defineProperty(dR,"__esModule",{value:!0});dR.kLayerPatched=void 0;dR.kLayerPatched=Symbol("koa-layer-patched")});var Mee=y(fR=>{"use strict";p();u();l();Object.defineProperty(fR,"__esModule",{value:!0});fR.KoaInstrumentation=void 0;var ni=(U(),D(J)),Rh=he(),Oee=lR(),Cee=Ree(),Pee=Nee(),xee=Ge(),vee=bee(),NL=class extends Rh.InstrumentationBase{constructor(e={}){super(Cee.PACKAGE_NAME,Cee.PACKAGE_VERSION,e)}init(){return new Rh.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){ni.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?Oee.KoaLayerType.ROUTER:Oee.KoaLayerType.MIDDLEWARE;return e[vee.kLayerPatched]===!0||(0,Pee.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(ni.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[vee.kLayerPatched]=!0,ni.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(ni.trace.getSpan(ni.context.active())===void 0)return e(s,i);let c=(0,Pee.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(c.name,{attributes:c.attributes}),f=(0,xee.getRPCMetadata)(ni.context.active());f?.type===xee.RPCType.HTTP&&s._matchedRoute&&(f.route=s._matchedRoute.toString());let{requestHook:m}=this.getConfig();m&&(0,Rh.safeExecuteInTheMiddle)(()=>m(d,{context:s,middlewareLayer:e,layerType:o}),g=>{g&&ni.diag.error("koa instrumentation: request hook failed",g)},!0);let _=ni.trace.setSpan(ni.context.active(),d);return ni.context.with(_,async()=>{try{return await e(s,i)}catch(g){throw d.recordException(g),g}finally{d.end()}})})}};fR.KoaInstrumentation=NL});var Lee=y(mc=>{"use strict";p();u();l();Object.defineProperty(mc,"__esModule",{value:!0});mc.KoaLayerType=mc.AttributeNames=mc.KoaInstrumentation=void 0;var mFe=Mee();Object.defineProperty(mc,"KoaInstrumentation",{enumerable:!0,get:function(){return mFe.KoaInstrumentation}});var _Fe=IL();Object.defineProperty(mc,"AttributeNames",{enumerable:!0,get:function(){return _Fe.AttributeNames}});var hFe=lR();Object.defineProperty(mc,"KoaLayerType",{enumerable:!0,get:function(){return hFe.KoaLayerType}})});var wee,Dee,Uee,gFe,kee,jee=S(()=>{p();u();l();wee=B(Lee(),1);Le();ne();Be();Du();Dee="Koa",Uee=Z(Dee,wee.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){qe(e,"auto.http.otel.koa");let r=ae(e).data,o=r["koa.type"];o&&e.setAttribute(Ee,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),ge()===bo()){bt&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[br],a=n.context?.request?.method?.toUpperCase()||"GET";i&&ge().setTransactionName(`${a} ${i}`)}})),gFe=((t={})=>({name:Dee,setupOnce(){Uee(t)}})),kee=gFe});var bL=y(hs=>{"use strict";p();u();l();Object.defineProperty(hs,"__esModule",{value:!0});hs.ConnectNames=hs.ConnectTypes=hs.AttributeNames=void 0;var EFe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(EFe=hs.AttributeNames||(hs.AttributeNames={}));var TFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(TFe=hs.ConnectTypes||(hs.ConnectTypes={}));var SFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(SFe=hs.ConnectNames||(hs.ConnectNames={}))});var Bee=y(Cd=>{"use strict";p();u();l();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.PACKAGE_NAME=Cd.PACKAGE_VERSION=void 0;Cd.PACKAGE_VERSION="0.54.0";Cd.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Gee=y(mR=>{"use strict";p();u();l();Object.defineProperty(mR,"__esModule",{value:!0});mR._LAYERS_STORE_PROPERTY=void 0;mR._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var $ee=y(hc=>{"use strict";p();u();l();Object.defineProperty(hc,"__esModule",{value:!0});hc.generateRoute=hc.replaceCurrentStackRoute=hc.addNewStackLayer=void 0;var AFe=(U(),D(J)),_c=Gee(),yFe=t=>{Array.isArray(t[_c._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,_c._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[_c._LAYERS_STORE_PROPERTY].push("/");let e=t[_c._LAYERS_STORE_PROPERTY].length;return()=>{e===t[_c._LAYERS_STORE_PROPERTY].length?t[_c._LAYERS_STORE_PROPERTY].pop():AFe.diag.warn("Connect: Trying to pop the stack multiple time")}};hc.addNewStackLayer=yFe;var RFe=(t,e)=>{e&&t[_c._LAYERS_STORE_PROPERTY].splice(-1,1,e)};hc.replaceCurrentStackRoute=RFe;var IFe=t=>t[_c._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);hc.generateRoute=IFe});var Vee=y(gc=>{"use strict";p();u();l();Object.defineProperty(gc,"__esModule",{value:!0});gc.ConnectInstrumentation=gc.ANONYMOUS_NAME=void 0;var NFe=(U(),D(J)),Fee=Ge(),Pd=bL(),Hee=Bee(),_R=he(),bFe=(Le(),D(Xe)),OL=$ee();gc.ANONYMOUS_NAME="anonymous";var CL=class extends _R.InstrumentationBase{constructor(e={}){super(Hee.PACKAGE_NAME,Hee.PACKAGE_VERSION,e)}init(){return[new _R.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,_R.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,_R.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=Pd.ConnectTypes.REQUEST_HANDLER,s=Pd.ConnectNames.REQUEST_HANDLER,o=e):(r=Pd.ConnectTypes.MIDDLEWARE,s=Pd.ConnectNames.MIDDLEWARE,o=n.name||gc.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[bFe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[Pd.AttributeNames.CONNECT_TYPE]:r,[Pd.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],d=arguments[i],f=arguments[a],m=arguments[c];(0,OL.replaceCurrentStackRoute)(d,e);let _=(0,Fee.getRPCMetadata)(NFe.context.active());e&&_?.type===Fee.RPCType.HTTP&&(_.route=(0,OL.generateRoute)(d));let g="";e?g=`request handler - ${e}`:g=`middleware - ${n.name||gc.ANONYMOUS_NAME}`;let T=r._startSpan(e,n);r._diag.debug("start span",g);let A=!1;function R(){A?r._diag.debug(`span ${T.name} - already finished`):(A=!0,r._diag.debug(`finishing span ${T.name}`),T.end()),f.removeListener("close",R)}return f.addListener("close",R),arguments[c]=r._patchNext(m,R),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,OL.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};gc.ConnectInstrumentation=CL});var Yee=y(Fo=>{"use strict";p();u();l();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ConnectTypes=Fo.ConnectNames=Fo.AttributeNames=Fo.ANONYMOUS_NAME=Fo.ConnectInstrumentation=void 0;var qee=Vee();Object.defineProperty(Fo,"ConnectInstrumentation",{enumerable:!0,get:function(){return qee.ConnectInstrumentation}});Object.defineProperty(Fo,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return qee.ANONYMOUS_NAME}});var PL=bL();Object.defineProperty(Fo,"AttributeNames",{enumerable:!0,get:function(){return PL.AttributeNames}});Object.defineProperty(Fo,"ConnectNames",{enumerable:!0,get:function(){return PL.ConnectNames}});Object.defineProperty(Fo,"ConnectTypes",{enumerable:!0,get:function(){return PL.ConnectTypes}})});var Wee,Kee,zee,OFe,Xee,Qee=S(()=>{p();u();l();Wee=B(Yee(),1);Be();Kee="Connect",zee=Z(Kee,()=>new Wee.ConnectInstrumentation),OFe=(()=>({name:Kee,setupOnce(){zee()}})),Xee=OFe});var Jee=y(_n=>{"use strict";p();u();l();Object.defineProperty(_n,"__esModule",{value:!0});_n.DB_SYSTEM_VALUE_MSSQL=_n.ATTR_NET_PEER_PORT=_n.ATTR_NET_PEER_NAME=_n.ATTR_DB_USER=_n.ATTR_DB_SYSTEM=_n.ATTR_DB_STATEMENT=_n.ATTR_DB_SQL_TABLE=_n.ATTR_DB_NAME=void 0;_n.ATTR_DB_NAME="db.name";_n.ATTR_DB_SQL_TABLE="db.sql.table";_n.ATTR_DB_STATEMENT="db.statement";_n.ATTR_DB_SYSTEM="db.system";_n.ATTR_DB_USER="db.user";_n.ATTR_NET_PEER_NAME="net.peer.name";_n.ATTR_NET_PEER_PORT="net.peer.port";_n.DB_SYSTEM_VALUE_MSSQL="mssql"});var Zee=y(xd=>{"use strict";p();u();l();Object.defineProperty(xd,"__esModule",{value:!0});xd.once=xd.getSpanName=void 0;function CFe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}xd.getSpanName=CFe;var PFe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};xd.once=PFe});var ete=y(vd=>{"use strict";p();u();l();Object.defineProperty(vd,"__esModule",{value:!0});vd.PACKAGE_NAME=vd.PACKAGE_VERSION=void 0;vd.PACKAGE_VERSION="0.30.0";vd.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var ste=y(Tc=>{"use strict";p();u();l();Object.defineProperty(Tc,"__esModule",{value:!0});Tc.TediousInstrumentation=Tc.INJECTED_CTX=void 0;var Md=(U(),D(J)),xFe=require("events"),ri=he(),Vu=(Le(),D(Xe)),Ec=Jee(),tte=Zee(),nte=ete(),ote=Symbol("opentelemetry.instrumentation-tedious.current-database");Tc.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var rte=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function hR(t){Object.defineProperty(this,ote,{value:t,writable:!0})}var xL=class t extends ri.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(nte.PACKAGE_NAME,nte.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ri.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ri.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ri.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of rte)(0,ri.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,ri.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of rte)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return hR.call(this,this.config?.options?.database),this.removeListener("databaseChange",hR),this.on("databaseChange",hR),this.once("end",()=>{this.removeListener("databaseChange",hR)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Md.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,Tc.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[Tc.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof xFe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,d=()=>c++,f=()=>a++,m=this[ote],_=(O=>O.sqlTextOrProcedure==="sp_prepare"&&O.parametersByName?.stmt?.value?O.parametersByName.stmt.value:O.sqlTextOrProcedure)(i),g={};o._dbSemconvStability&ri.SemconvStability.OLD&&(g[Ec.ATTR_DB_SYSTEM]=Ec.DB_SYSTEM_VALUE_MSSQL,g[Ec.ATTR_DB_NAME]=m,g[Ec.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,g[Ec.ATTR_DB_STATEMENT]=_,g[Ec.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&ri.SemconvStability.STABLE&&(g[Vu.ATTR_DB_NAMESPACE]=m,g[Vu.ATTR_DB_SYSTEM_NAME]=Vu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,g[Vu.ATTR_DB_QUERY_TEXT]=_,g[Vu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&ri.SemconvStability.OLD&&(g[Ec.ATTR_NET_PEER_NAME]=this.config?.server,g[Ec.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&ri.SemconvStability.STABLE&&(g[Vu.ATTR_SERVER_ADDRESS]=this.config?.server,g[Vu.ATTR_SERVER_PORT]=this.config?.options?.port);let T=o.tracer.startSpan((0,tte.getSpanName)(e,m,_,i.table),{kind:Md.SpanKind.CLIENT,attributes:g}),A=(0,tte.once)(O=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",f),i.removeListener("error",A),this.removeListener("end",A),T.setAttribute("tedious.procedure_count",a),T.setAttribute("tedious.statement_count",c),O&&T.setStatus({code:Md.SpanStatusCode.ERROR,message:O.message}),T.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",f),i.once("error",A),this.on("end",A),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(A)):o._diag.error("Expected request.callback to be a function");let R=()=>Md.context.with(Md.trace.setSpan(Md.context.active(),T),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return R();let C=o._buildTraceparent(T);o._injectContextInfo(this,n,C).finally(R)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};Tc.TediousInstrumentation=xL});var ite=y(gR=>{"use strict";p();u();l();Object.defineProperty(gR,"__esModule",{value:!0});gR.TediousInstrumentation=void 0;var vFe=ste();Object.defineProperty(gR,"TediousInstrumentation",{enumerable:!0,get:function(){return vFe.TediousInstrumentation}})});var ate,MFe,cte,ute,LFe,lte,pte=S(()=>{p();u();l();ate=B(ite(),1);ne();Be();MFe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),cte="Tedious",ute=Z(cte,()=>new ate.TediousInstrumentation({})),LFe=(()=>{let t;return{name:cte,setupOnce(){let e=ute();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=ae(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";MFe.has(s)&&n.setAttribute(fe,"auto.db.otel.tedious")}))}}}),lte=LFe});var dte=y(Ld=>{"use strict";p();u();l();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.PACKAGE_NAME=Ld.PACKAGE_VERSION=void 0;Ld.PACKAGE_VERSION="0.54.0";Ld.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var mte=y(ER=>{"use strict";p();u();l();Object.defineProperty(ER,"__esModule",{value:!0});ER.GenericPoolInstrumentation=void 0;var wd=(U(),D(J)),qu=he(),fte=dte(),vL="generic-pool",ML=class extends qu.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(fte.PACKAGE_NAME,fte.PACKAGE_VERSION,e)}init(){return[new qu.InstrumentationNodeModuleDefinition(vL,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(vL,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(vL,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,qu.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=wd.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return wd.context.with(wd.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=wd.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return wd.context.with(wd.trace.setSpan(i,a),()=>{e.call(this,(c,d)=>{if(a.end(),o)return o(c,d)},s)})}}};ER.GenericPoolInstrumentation=ML});var _te=y(TR=>{"use strict";p();u();l();Object.defineProperty(TR,"__esModule",{value:!0});TR.GenericPoolInstrumentation=void 0;var wFe=mte();Object.defineProperty(TR,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return wFe.GenericPoolInstrumentation}})});var hte,gte,Ete,DFe,Tte,Ste=S(()=>{p();u();l();hte=B(_te(),1);ne();Be();gte="GenericPool",Ete=Z(gte,()=>new hte.GenericPoolInstrumentation({})),DFe=(()=>{let t;return{name:gte,setupOnce(){let e=Ete();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=ae(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(fe,"auto.db.otel.generic_pool")}))}}}),Tte=DFe});var LL=y(oi=>{"use strict";p();u();l();Object.defineProperty(oi,"__esModule",{value:!0});oi.ATTR_NET_PEER_PORT=oi.ATTR_NET_PEER_NAME=oi.ATTR_MESSAGING_SYSTEM=oi.ATTR_MESSAGING_OPERATION=void 0;oi.ATTR_MESSAGING_OPERATION="messaging.operation";oi.ATTR_MESSAGING_SYSTEM="messaging.system";oi.ATTR_NET_PEER_NAME="net.peer.name";oi.ATTR_NET_PEER_PORT="net.peer.port"});var wL=y(Ct=>{"use strict";p();u();l();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ATTR_MESSAGING_CONVERSATION_ID=Ct.OLD_ATTR_MESSAGING_MESSAGE_ID=Ct.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Ct.ATTR_MESSAGING_URL=Ct.ATTR_MESSAGING_PROTOCOL_VERSION=Ct.ATTR_MESSAGING_PROTOCOL=Ct.MESSAGING_OPERATION_VALUE_PROCESS=Ct.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Ct.ATTR_MESSAGING_DESTINATION_KIND=Ct.ATTR_MESSAGING_DESTINATION=void 0;Ct.ATTR_MESSAGING_DESTINATION="messaging.destination";Ct.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Ct.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Ct.MESSAGING_OPERATION_VALUE_PROCESS="process";Ct.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Ct.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Ct.ATTR_MESSAGING_URL="messaging.url";Ct.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Ct.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Ct.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var DL=y(Yu=>{"use strict";p();u();l();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DEFAULT_CONFIG=Yu.EndOperation=void 0;var UFe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(UFe=Yu.EndOperation||(Yu.EndOperation={}));Yu.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var Ite=y(Pt=>{"use strict";p();u();l();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.isConfirmChannelTracing=Pt.unmarkConfirmChannelTracing=Pt.markConfirmChannelTracing=Pt.getConnectionAttributesFromUrl=Pt.getConnectionAttributesFromServer=Pt.normalizeExchange=Pt.CONNECTION_ATTRIBUTES=Pt.CHANNEL_CONSUME_TIMEOUT_TIMER=Pt.CHANNEL_SPANS_NOT_ENDED=Pt.MESSAGE_STORED_SPAN=void 0;var UL=(U(),D(J)),Sc=he(),SR=(Le(),D(Xe)),Ih=LL(),AR=wL();Pt.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Pt.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Pt.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Pt.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var kL=(0,UL.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),kFe=t=>t!==""?t:"<default>";Pt.normalizeExchange=kFe;var jFe=t=>t.replace(/:[^:@/]*@/,":***@"),Ate=(t,e)=>t||(e==="AMQP"?5672:5671),yte=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},Rte=t=>t||"localhost",si=(t,e,n,r)=>n?{[e]:n}:(UL.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),BFe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Ih.ATTR_MESSAGING_SYSTEM]:e}:{}};Pt.getConnectionAttributesFromServer=BFe;var GFe=(t,e)=>{let n={[AR.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=yte(r?.protocol);Object.assign(n,{...si(t,AR.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=Rte(r?.hostname);e&Sc.SemconvStability.OLD&&Object.assign(n,{...si(t,Ih.ATTR_NET_PEER_NAME,s,"hostname")}),e&Sc.SemconvStability.STABLE&&Object.assign(n,{...si(t,SR.ATTR_SERVER_ADDRESS,s,"hostname")});let i=Ate(r.port,o);e&Sc.SemconvStability.OLD&&Object.assign(n,si(t,Ih.ATTR_NET_PEER_PORT,i,"port")),e&Sc.SemconvStability.STABLE&&Object.assign(n,si(t,SR.ATTR_SERVER_PORT,i,"port"))}else{let r=jFe(t);n[AR.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=yte(o.protocol);Object.assign(n,{...si(r,AR.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=Rte(o.hostname);e&Sc.SemconvStability.OLD&&Object.assign(n,{...si(r,Ih.ATTR_NET_PEER_NAME,i,"hostname")}),e&Sc.SemconvStability.STABLE&&Object.assign(n,{...si(r,SR.ATTR_SERVER_ADDRESS,i,"hostname")});let a=Ate(o.port?parseInt(o.port):void 0,s);e&Sc.SemconvStability.OLD&&Object.assign(n,si(r,Ih.ATTR_NET_PEER_PORT,a,"port")),e&Sc.SemconvStability.STABLE&&Object.assign(n,si(r,SR.ATTR_SERVER_PORT,a,"port"))}catch(o){UL.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Pt.getConnectionAttributesFromUrl=GFe;var $Fe=t=>t.setValue(kL,!0);Pt.markConfirmChannelTracing=$Fe;var FFe=t=>t.deleteValue(kL);Pt.unmarkConfirmChannelTracing=FFe;var HFe=t=>t.getValue(kL)===!0;Pt.isConfirmChannelTracing=HFe});var Nte=y(Dd=>{"use strict";p();u();l();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.PACKAGE_NAME=Dd.PACKAGE_VERSION=void 0;Dd.PACKAGE_VERSION="0.58.0";Dd.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Ote=y(IR=>{"use strict";p();u();l();Object.defineProperty(IR,"__esModule",{value:!0});IR.AmqplibInstrumentation=void 0;var gt=(U(),D(J)),yR=Ge(),$e=he(),VFe=LL(),uo=wL(),yr=DL(),xt=Ite(),bte=Nte(),RR=[">=0.5.5 <1"],jL=class extends $e.InstrumentationBase{_netSemconvStability;constructor(e={}){super(bte.PACKAGE_NAME,bte.PACKAGE_VERSION,{...yr.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$e.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...yr.DEFAULT_CONFIG,...e})}init(){let e=new $e.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",RR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new $e.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",RR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new $e.InstrumentationNodeModuleFile("amqplib/lib/connect.js",RR,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new $e.InstrumentationNodeModuleDefinition("amqplib",RR,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,$e.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,$e.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,$e.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,yr.EndOperation.Ack)),(0,$e.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,yr.EndOperation.Nack)),(0,$e.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,yr.EndOperation.Reject)),(0,$e.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,yr.EndOperation.AckAll)),(0,$e.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,yr.EndOperation.NackAll)),(0,$e.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,$e.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,$e.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,$e.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,$e.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,$e.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,$e.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,$e.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,$e.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let d=(0,xt.getConnectionAttributesFromUrl)(o,n._netSemconvStability),f=(0,xt.getConnectionAttributesFromServer)(c);c[xt.CONNECTION_ATTRIBUTES]={...d,...f}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelClosed,void 0);let s=this[xt.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[xt.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let d=this,f=n===yr.EndOperation.Reject?a:c,m=d[xt.CHANNEL_SPANS_NOT_ENDED]??[],_=m.findIndex(g=>g.msg===i);if(_<0)o.endConsumerSpan(i,e,n,f);else if(n!==yr.EndOperation.Reject&&a){for(let g=0;g<=_;g++)o.endConsumerSpan(m[g].msg,e,n,f);m.splice(0,_+1)}else o.endConsumerSpan(i,e,n,f),m.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,xt.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:f}=r.getConfig();if(f){let m=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},f);m.unref(),c[xt.CHANNEL_CONSUME_TIMEOUT_TIMER]=m}c[xt.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(f){if(!f)return i.call(this,f);let m=f.properties.headers??{},_=gt.propagation.extract(gt.ROOT_CONTEXT,m),g=f.fields?.exchange,T;if(r._config.useLinksForConsume){let I=_?gt.trace.getSpan(_)?.spanContext():void 0;_=void 0,I&&(T=[{context:I}])}let A=r.tracer.startSpan(`${s} process`,{kind:gt.SpanKind.CONSUMER,attributes:{...c?.connection?.[xt.CONNECTION_ATTRIBUTES],[uo.ATTR_MESSAGING_DESTINATION]:g,[uo.ATTR_MESSAGING_DESTINATION_KIND]:uo.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[uo.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:f.fields?.routingKey,[VFe.ATTR_MESSAGING_OPERATION]:uo.MESSAGING_OPERATION_VALUE_PROCESS,[uo.OLD_ATTR_MESSAGING_MESSAGE_ID]:f?.properties.messageId,[uo.ATTR_MESSAGING_CONVERSATION_ID]:f?.properties.correlationId},links:T},_),{consumeHook:R}=r.getConfig();R&&(0,$e.safeExecuteInTheMiddle)(()=>R(A,{moduleVersion:e,msg:f}),I=>{I&&gt.diag.error("amqplib instrumentation: consumerHook error",I)},!0),a?.noAck||(c[xt.CHANNEL_SPANS_NOT_ENDED].push({msg:f,timeOfConsume:(0,yR.hrTime)()}),f[xt.MESSAGE_STORED_SPAN]=A);let b=_||gt.ROOT_CONTEXT;gt.context.with(gt.trace.setSpan(b,A),()=>{i.call(this,f)}),a?.noAck&&(r.callConsumeEndHook(A,f,!1,yr.EndOperation.AutoAck),A.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,d){let f=this,{span:m,modifiedOptions:_}=r.createPublishSpan(r,s,i,f,c),{publishHook:g}=r.getConfig();g&&(0,$e.safeExecuteInTheMiddle)(()=>g(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),b=>{b&&gt.diag.error("amqplib instrumentation: publishHook error",b)},!0);let T=function(b,I){try{d?.call(this,b,I)}finally{let{publishConfirmHook:C}=r.getConfig();C&&(0,$e.safeExecuteInTheMiddle)(()=>C(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:b}),O=>{O&&gt.diag.error("amqplib instrumentation: publishConfirmHook error",O)},!0),b&&m.setStatus({code:gt.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),m.end()}},A=(0,xt.markConfirmChannelTracing)(gt.context.active()),R=[...arguments];return R[3]=_,R[4]=gt.context.bind((0,xt.unmarkConfirmChannelTracing)(gt.trace.setSpan(A,m)),T),gt.context.with(A,n.bind(this,...R))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,xt.isConfirmChannelTracing)(gt.context.active()))return n.apply(this,arguments);{let d=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,d,c),{publishHook:_}=r.getConfig();_&&(0,$e.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!1}),A=>{A&&gt.diag.error("amqplib instrumentation: publishHook error",A)},!0);let g=[...arguments];g[3]=m;let T=n.apply(this,g);return f.end(),T}}}createPublishSpan(e,n,r,o,s){let i=(0,xt.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:gt.SpanKind.PRODUCER,attributes:{...o.connection[xt.CONNECTION_ATTRIBUTES],[uo.ATTR_MESSAGING_DESTINATION]:n,[uo.ATTR_MESSAGING_DESTINATION_KIND]:uo.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[uo.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[uo.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[uo.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},gt.propagation.inject(gt.trace.setSpan(gt.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[xt.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:gt.SpanStatusCode.ERROR,message:r!==yr.EndOperation.ChannelClosed&&r!==yr.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[xt.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[xt.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[xt.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,$e.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&gt.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,yR.hrTime)(),r=e[xt.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,yR.hrTimeDuration)(i.timeOfConsume,n);if((0,yR.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,yr.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};IR.AmqplibInstrumentation=jL});var Pte=y(Ac=>{"use strict";p();u();l();Object.defineProperty(Ac,"__esModule",{value:!0});Ac.EndOperation=Ac.DEFAULT_CONFIG=Ac.AmqplibInstrumentation=void 0;var qFe=Ote();Object.defineProperty(Ac,"AmqplibInstrumentation",{enumerable:!0,get:function(){return qFe.AmqplibInstrumentation}});var Cte=DL();Object.defineProperty(Ac,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Cte.DEFAULT_CONFIG}});Object.defineProperty(Ac,"EndOperation",{enumerable:!0,get:function(){return Cte.EndOperation}})});var xte,vte,YFe,Mte,WFe,Lte,wte=S(()=>{p();u();l();xte=B(Pte(),1);Be();vte="Amqplib",YFe={consumeEndHook:t=>{qe(t,"auto.amqplib.otel.consumer")},publishHook:t=>{qe(t,"auto.amqplib.otel.publisher")}},Mte=Z(vte,()=>new xte.AmqplibInstrumentation(YFe)),WFe=(()=>({name:vte,setupOnce(){Mte()}})),Lte=WFe});var Nh,BL=S(()=>{p();u();l();Nh="VercelAI"});function zFe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function XFe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;if(Array.isArray(e.content)){for(let n of e.content)if(zFe(n)){let r=qP(n.toolCallId);if(r){let o=r.spanContext();Xr(s=>{s.setContext("trace",{trace_id:o.traceId,span_id:o.spanId}),s.setTag("vercel.ai.tool.name",n.toolName),s.setTag("vercel.ai.tool.callId",n.toolCallId),s.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}),YP(n.toolCallId)}else Xr(o=>{o.setTag("vercel.ai.tool.name",n.toolName),o.setTag("vercel.ai.tool.callId",n.toolCallId),o.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}}function QFe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var bR,KFe,Dte,NR,Ute=S(()=>{p();u();l();bR=B(he(),1);ne();BL();KFe=[">=3.0.0 <7"],Dte=["generateText","streamText","generateObject","streamObject","embed","embedMany"];NR=class t extends bR.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new bR.InstrumentationNodeModuleDefinition("ai",KFe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,d=F(),f=d?.getIntegrationByName(Nh),m=f?.options,_=f?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:g,recordOutputs:T}=QFe(m,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:g,recordOutputs:T},eo(()=>Reflect.apply(o,s,i),A=>{A&&typeof A=="object"&&$t(A,"_sentry_active_span",cs())},()=>{},A=>{XFe(A)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of Dte)e[r]=n(e[r]);return e}else{let r=Dte.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}}});function JFe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var kte,ZFe,jte,Bte=S(()=>{p();u();l();ne();Be();BL();Ute();kte=Z(Nh,()=>new NR({}));ZFe=((t={})=>{let e;return{name:Nh,options:t,setupOnce(){e=kte()},afterAllSetup(n){t.force??JFe(n)?oS(n):e?.callWhenPatched(()=>oS(n))}}}),jte=ZFe});var CR,eHe,OR,Gte=S(()=>{p();u();l();CR=B(he(),1);ne();eHe=[">=4.0.0 <7"],OR=class extends CR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Pe,e)}init(){return new CR.InstrumentationNodeModuleDefinition("openai",eHe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(Su(qa))return Reflect.construct(r,i);let a=Reflect.construct(r,i),d=!!F()?.getOptions().sendDefaultPii,f=o.recordInputs??d,m=o.recordOutputs??d;return cS(a,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}}});var $te,tHe,Fte,Hte=S(()=>{p();u();l();ne();Be();Gte();$te=Z(qa,t=>new OR(t)),tHe=((t={})=>({name:qa,setupOnce(){$te(t)}})),Fte=tHe});var xR,nHe,PR,Vte=S(()=>{p();u();l();xR=B(he(),1);ne();nHe=[">=0.19.2 <1.0.0"],PR=class extends xR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",Pe,e)}init(){return new xR.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",nHe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(Su(Ya))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r.recordInputs??c,f=r.recordOutputs??c;return uS(i,{recordInputs:d,recordOutputs:f})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}}});var qte,rHe,Yte,Wte=S(()=>{p();u();l();ne();Be();Vte();qte=Z(Ya,t=>new PR(t)),rHe=((t={})=>({name:Ya,options:t,setupOnce(){qte(t)}})),Yte=rHe});var Ud,Kte,vR,zte=S(()=>{p();u();l();Ud=B(he(),1);ne();Kte=[">=0.10.0 <2"],vR=class extends Ud.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",Pe,e)}init(){return new Ud.InstrumentationNodeModuleDefinition("@google/genai",Kte,n=>this._patch(n),n=>n,[new Ud.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",Kte,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(Su(Wa))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r,f=d?.recordInputs??c,m=d?.recordOutputs??c;return pS(i,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return p_(e,"GoogleGenAI",o),e}}});var Xte,oHe,Qte,Jte=S(()=>{p();u();l();ne();Be();zte();Xte=Z(Wa,t=>new vR(t)),oHe=((t={})=>({name:Wa,setupOnce(){Xte(t)}})),Qte=oHe});function sHe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function iHe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,d=sHe(c,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var yc,MR,LR,Zte=S(()=>{p();u();l();yc=B(he(),1);ne();MR=[">=0.1.0 <2.0.0"];LR=class extends yc.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",Pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new yc.InstrumentationNodeModuleDefinition(r,MR,this._patch.bind(this),o=>o,[new yc.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,MR,this._patch.bind(this),o=>o)]));return e.push(new yc.InstrumentationNodeModuleDefinition("langchain",MR,this._patch.bind(this),r=>r,[new yc.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",MR,this._patch.bind(this),r=>r)])),e}_patch(e){TP([qa,Ya,Wa]);let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o?.recordInputs??r,i=o?.recordOutputs??r,a=_S({recordInputs:s,recordOutputs:i});return this._patchRunnableMethods(e,a),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype,a=["invoke","stream","batch"];for(let c of a){let d=i[c];typeof d=="function"&&(i[c]=iHe(d,n))}}}});var ene,aHe,tne,nne=S(()=>{p();u();l();ne();Be();Zte();ene=Z(dS,t=>new LR(t)),aHe=((t={})=>({name:dS,setupOnce(){ene(t)}})),tne=aHe});var kd,rne,wR,one=S(()=>{p();u();l();kd=B(he(),1);ne();rne=[">=0.0.0 <2.0.0"],wR=class extends kd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",Pe,e)}init(){return new kd.InstrumentationNodeModuleDefinition("@langchain/langgraph",rne,this._patch.bind(this),n=>n,[new kd.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",rne,this._patch.bind(this),n=>n)])}_patch(e){let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o.recordInputs??r,i=o.recordOutputs??r,a={recordInputs:s,recordOutputs:i};if(e.StateGraph&&typeof e.StateGraph=="function"){let c=e.StateGraph;c.prototype.compile=gS(c.prototype.compile,a)}return e}}});var sne,cHe,ine,ane=S(()=>{p();u();l();ne();Be();one();sne=Z(hS,t=>new wR(t)),cHe=((t={})=>({name:hS,setupOnce(){sne(t)}})),ine=cHe});function lne(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=f=>{(0,Qi.safeExecuteInTheMiddle)(()=>a(f),m=>{m&&or.error(m?.message)},!0)});let c=new Qi.InstrumentationNodeModuleDefinition("@firebase/firestore",e,f=>cne(f,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let f of d)c.files.push(new Qi.InstrumentationNodeModuleFile(f,e,m=>cne(m,n,r,t,i),m=>pne(m,r)));return c}function cne(t,e,n,r,o){return pne(t,n),e(t,"addDoc",uHe(r,o)),e(t,"getDocs",pHe(r,o)),e(t,"setDoc",dHe(r,o)),e(t,"deleteDoc",lHe(r,o)),t}function pne(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Qi.isWrapped)(t[n])&&e(t,n);return t}function uHe(t,e){return function(r){return function(o,s){let i=UR(t,"addDoc",o);return e(i),DR(i,()=>r(o,s))}}}function lHe(t,e){return function(r){return function(o){let s=UR(t,"deleteDoc",o.parent||o);return e(s),DR(s,()=>r(o))}}}function pHe(t,e){return function(r){return function(o){let s=UR(t,"getDocs",o);return e(s),DR(s,()=>r(o))}}}function dHe(t,e){return function(r){return function(o,s,i){let a=UR(t,"setDoc",o.parent||o);return e(a),DR(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function DR(t,e){return V.with(de.setSpan(V.active(),t),()=>(0,Qi.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function UR(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Ze.CLIENT});return mHe(r,n),r.setAttribute(Dl,e),r}function fHe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(une.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function mHe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[iO]:e.path,[Wf]:n.name,[_a]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=fHe(s);a&&(i[Kf]=a),c&&(i[zf]=c),t.setAttributes(i)}var une,Qi,dne=S(()=>{p();u();l();une=B(require("node:net"),1);U();Qi=B(he(),1);Le()});function fne(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(_,g)=>{(0,Ji.safeExecuteInTheMiddle)(()=>d(_,g),T=>{T&&or.error(T?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Ji.safeExecuteInTheMiddle)(()=>c(_),g=>{g&&or.error(g?.message)},!0)});let f=new Ji.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:g})=>{f.files.push(new Ji.InstrumentationNodeModuleFile(_,e,T=>_He(T,n,r,t,{requestHook:s,responseHook:i,errorHook:a},g),T=>mne(T,r)))}),f}function Rr(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...d){let f=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",m=t.startSpan(`firebase.function.${n}`,{kind:Ze.SERVER}),_={"faas.name":f,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),m.setAttributes(_),e?.requestHook?.(m),V.with(de.setSpan(V.active(),m),async()=>{let g,T;try{T=await i.apply(this,d)}catch(A){g=A}if(e?.responseHook?.(m,g),g&&m.recordException(g),m.end(),g)throw await e?.errorHook?.(m,g),g;return T})};return a?o.call(this,a,c):o.call(this,c)}}}function _He(t,e,n,r,o,s){switch(mne(t,n),s){case"function":e(t,"onRequest",Rr(r,o,"http.request")),e(t,"onCall",Rr(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Rr(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Rr(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Rr(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Rr(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Rr(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Rr(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Rr(r,o,"storage.object.metadataUpdated"));break}return t}function mne(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ji.isWrapped)(t[r])&&e(t,r);return t}var Ji,_ne=S(()=>{p();u();l();U();Ji=B(he(),1)});var gne,hne,hHe,gHe,kR,Ene=S(()=>{p();u();l();gne=B(he(),1);ne();dne();_ne();hne={},hHe=[">=3.0.0 <5"],gHe=[">=6.0.0 <7"],kR=class extends gne.InstrumentationBase{constructor(e=hne){super("@sentry/instrumentation-firebase",Pe,e)}setConfig(e={}){super.setConfig({...hne,...e})}init(){let e=[];return e.push(lne(this.tracer,hHe,this._wrap,this._unwrap,this.getConfig())),e.push(fne(this.tracer,gHe,this._wrap,this._unwrap,this.getConfig())),e}}});var Tne,EHe,Sne,THe,Ane,yne=S(()=>{p();u();l();ne();Be();Ene();Tne="Firebase",EHe={firestoreSpanCreationHook:t=>{qe(t,"auto.firebase.otel.firestore"),t.setAttribute(Ee,"db.query")},functions:{requestHook:t=>{qe(t,"auto.firebase.otel.functions"),t.setAttribute(Ee,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Eu(2e3))}}},Sne=Z(Tne,()=>new kR(EHe)),THe=(()=>({name:Tne,setupOnce(){Sne()}})),Ane=THe});function Rne(){return[eQ(),WQ(),S8(),Aee(),aJ(),yJ(),wJ(),YJ(),IZ(),qZ(),nee(),hee(),kee(),Xee(),lte(),Tte(),k8(),Lte(),K8(),tne(),ine(),jte(),Fte(),Yte(),Qte(),XZ(),Ane()]}var Ine=S(()=>{p();u();l();wte();Wte();Qee();tQ();XQ();yne();Ste();Jte();y8();gee();yee();j8();jee();nne();ane();z8();cJ();RJ();DJ();WJ();Hte();YZ();QZ();ree();NZ();pte();Bte()});function bne(t,e={}){t.getOptions().debug&&kv();let[n,r]=SHe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function SHe(t,e={}){let n=new Nne.BasicTracerProvider({sampler:new pA(t),resource:(0,jR.defaultResource)().merge((0,jR.resourceFromAttributes)({[zr]:"node",[sO]:"sentry",[aO]:Pe})),forceFlushTimeoutMillis:500,spanProcessors:[new lA({timeout:AHe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});de.setGlobalTracerProvider(n),sr.setGlobalPropagator(new uA);let r=new yA;return V.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function AHe(t){if(t!=null){if(t>GL)return bt&&N.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${GL}`),GL;if(t<=0||Number.isNaN(t)){bt&&N.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}var jR,Nne,GL,One=S(()=>{p();u();l();U();jR=B(Rx(),1),Nne=B(Kx(),1);Le();ne();Be();Xa();Du();GL=1e6});function Cne(){return CA().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(xX(),BX())}function Pne(t){return[...Cne(),...jt(t)?Rne():[]]}function $L(t={}){return yHe(t,Pne)}function yHe(t={},e){Au(t,"node");let n=qv({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(bne(n,{spanProcessors:t.openTelemetrySpanProcessors}),PA()),n}var xne=S(()=>{p();u();l();ne();Be();vX();GX();Ine();One()});var Zi=S(()=>{p();u();l();xne();ne();Be()});var Wu,FL=S(()=>{p();u();l();Wu=class extends Error{response;request;options;constructor(e,n,r){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),a=i?`status code ${i}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=r}}});var jd,HL=S(()=>{p();u();l();jd=class extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}});var Bd,vne=S(()=>{p();u();l();HL();Bd=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let n=e?.cause?e.cause instanceof Error?e.cause:new jd(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}});var VL,Mne,BR,Lne,wne,GR,RHe,Dne,$R,Une,FR,bh,kne,jne,Bne,Gne,Ku=S(()=>{p();u();l();VL=(()=>{let t=!1,e=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),Mne=typeof globalThis.AbortController=="function",BR=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Lne=typeof globalThis.ReadableStream=="function",wne=typeof globalThis.FormData=="function",GR=["get","post","put","patch","head","delete"],RHe=()=>{};RHe();Dne={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},$R=2147483647,Une=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,FR=Symbol("stop"),bh=class{options;constructor(e){this.options=e}},kne=t=>new bh(t),jne={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Bne={next:!0},Gne={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var IHe,$ne,Fne,Hne,Vne=S(()=>{p();u();l();Ku();IHe=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[n,r]of t)e+=Une,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},$ne=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),r){o+=r.byteLength;let a=e===0?0:o/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=s},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},Fne=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response($ne(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Hne=(t,e,n)=>{if(!t.body)return t;let r=IHe(n??t.body);return new Request(t,{duplex:"half",body:$ne(t.body,r,e)})}});var Ic,qne=S(()=>{p();u();l();Ic=t=>t!==null&&typeof t=="object"});function HR(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:WL(t[n]??[],e[n]??[])}var Oh,qL,YL,NHe,WL,KL=S(()=>{p();u();l();Ku();qne();Oh=(...t)=>{for(let e of t)if((!Ic(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return WL({},...t)},qL=(t={},e={})=>{let n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())r&&i==="undefined"||i===void 0?n.delete(s):n.set(s,i);return n};YL=(t={},e={})=>({beforeRequest:HR(t,e,"beforeRequest"),beforeRetry:HR(t,e,"beforeRetry"),afterResponse:HR(t,e,"afterResponse"),beforeError:HR(t,e,"beforeError")}),NHe=(t,e)=>{let n=new URLSearchParams;for(let r of[t,e])if(r!==void 0)if(r instanceof URLSearchParams)for(let[o,s]of r.entries())n.append(o,s);else if(Array.isArray(r))for(let o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(Ic(r))for(let[o,s]of Object.entries(r))s!==void 0&&n.append(o,String(s));else{let o=new URLSearchParams(r);for(let[s,i]of o.entries())n.append(s,i)}return n},WL=(...t)=>{let e={},n={},r={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(Ic(i)){for(let[a,c]of Object.entries(i)){if(a==="signal"&&c instanceof globalThis.AbortSignal){s.push(c);continue}if(a==="context"){if(c!=null&&(!Ic(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(a==="searchParams"){c==null?o=void 0:o=o===void 0?c:NHe(o,c);continue}Ic(c)&&a in e&&(c=WL(e[a],c)),e={...e,[a]:c}}Ic(i.hooks)&&(r=YL(r,i.hooks),e.hooks=r),Ic(i.headers)&&(n=qL(n,i.headers),e.headers=n)}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:BR?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e.context===void 0&&(e.context={}),e}});var Wne,bHe,OHe,CHe,Yne,Kne,zne=S(()=>{p();u();l();Ku();Wne=t=>GR.includes(t)?t.toUpperCase():t,bHe=["get","put","head","delete","options","trace"],OHe=[408,413,429,500,502,503,504],CHe=[413,429,503],Yne={limit:2,methods:bHe,statusCodes:OHe,afterStatusCodes:CHe,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Kne=(t={})=>{if(typeof t=="number")return{...Yne,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...Yne,...e}}});var zu,zL=S(()=>{p();u();l();zu=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}});async function XL(t,e,n,r){return new Promise((o,s)=>{let i=setTimeout(()=>{n&&n.abort(),s(new zu(t))},r.timeout);r.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}var Xne=S(()=>{p();u();l();zL()});async function QL(t,{signal:e}){return new Promise((n,r)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),r(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),n()},t)})}var Qne=S(()=>{p();u();l()});var Jne,Zne,ere=S(()=>{p();u();l();Ku();Jne=(t,e)=>{let n={};for(let r in e)Object.hasOwn(e,r)&&!(r in Gne)&&!(r in jne)&&(!(r in t)||r in Bne)&&(n[r]=e[r]);return n},Zne=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t});function tre(t){return t instanceof Wu||t?.name===Wu.name}function nre(t){return t instanceof zu||t?.name===zu.name}var rre=S(()=>{p();u();l();FL();zL()});var Ch,ore=S(()=>{p();u();l();FL();HL();vne();Vne();KL();zne();Xne();Qne();ere();rre();Ku();Ch=class t{static create(e,n){let r=new t(e,n),o=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>$R)throw new RangeError(`The \`timeout\` option cannot be greater than ${$R}`);await Promise.resolve();let i=await r.#_();for(let a of r.#e.hooks.afterResponse){let c=r.#p(i.clone()),d;try{d=await a(r.request,r.#m(),c,{retryCount:r.#o})}catch(m){throw r.#c(c),r.#c(i),m}if(d instanceof bh)throw r.#c(c),r.#c(i),new Bd(d.options);let f=d instanceof globalThis.Response?d:i;c!==f&&r.#c(c),i!==f&&r.#c(i),i=f}if(r.#p(i),!i.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(i.status):r.#e.throwHttpErrors)){let a=new Wu(i,r.request,r.#m());for(let c of r.#e.hooks.beforeError)a=await c(a,{retryCount:r.#o});throw a}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Lne)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let a=i.clone();return r.#c(i),Fne(a,r.#e.onDownloadProgress)}return i},s=r.#f(o).finally(()=>{let i=r.#i;r.#d(i?.body??void 0),r.#d(r.request.body??void 0)});for(let[i,a]of Object.entries(Dne))i==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(s[i]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||a);let c=await s;if(i==="json"){if(c.status===204)return"";let d=await c.text();return d===""?"":n.parseJson?n.parseJson(d):JSON.parse(d)}return c[i]()});return s}static#n(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#r;#o=0;#t;#e;#i;#s;#u;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:qL(this.#t.headers,n.headers),hooks:YL({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:Wne(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:Kne(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Mne&&BR&&(this.#s=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal),VL&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(wne&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),Zne(this.#e.searchParams)){let s="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(t.#n(this.#e.searchParams)).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);this.request=new globalThis.Request(i,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!VL)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#a(){let e=this.#e.retry.delay(this.#o),n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));let r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(e){if(this.#o++,this.#o>this.#e.retry.limit)throw e;let n=e instanceof Error?e:new jd(e);if(n instanceof Bd)return n.customDelay??this.#a();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#o});if(r===!1)throw e;if(r===!0)return this.#a()}if(nre(e)&&!this.#e.retry.retryOnTimeout)throw e;if(tre(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let r=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let s=this.#e.retry.maxRetryAfter??o;return o<s?o:s}if(e.response.status===413)throw e}return this.#a()}#p(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#d(e){e&&e.cancel().catch(()=>{})}#c(e){this.#d(e.body??void 0)}async#f(e){try{return await e()}catch(n){let r=Math.min(await this.#l(n),$R);if(this.#o<1)throw n;if(await QL(r,this.#s?{signal:this.#s}:{}),n instanceof Bd&&n.customRequest){let o=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#h(o)}for(let o of this.#e.hooks.beforeRetry){let s=await o({request:this.request,options:this.#m(),error:n,retryCount:this.#o});if(s instanceof globalThis.Request){this.#h(s);break}if(s instanceof globalThis.Response)return s;if(s===FR)return}return this.#f(e)}}async#_(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let n of this.#e.hooks.beforeRequest){let r=await n(this.request,this.#m(),{retryCount:this.#o});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#h(r);break}}let e=Jne(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,e):XL(this.#i,e,this.#r,this.#e)}#m(){if(!this.#u){let{hooks:e,...n}=this.#e;this.#u=Object.freeze(n)}return this.#u}#h(e){this.#u=void 0,this.request=this.#g(e)}#g(e,n){return!this.#e.onUploadProgress||!e.body?e:Hne(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}}});var JL,PHe,Ph,sre=S(()=>{p();u();l();ore();Ku();KL();JL=t=>{let e=(n,r)=>Ch.create(n,Oh(t,r));for(let n of GR)e[n]=(r,o)=>Ch.create(r,Oh(t,o,{method:n}));return e.create=n=>JL(Oh(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),JL(Oh(t,n))),e.stop=FR,e.retry=kne,e},PHe=JL(),Ph=PHe});var ve,ZL,Y,ii,xh=S(()=>{p();u();l();(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ZL||(ZL={}));Y=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ii=t=>{switch(typeof t){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(t)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(t)?Y.array:t===null?Y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Y.promise:typeof Map<"u"&&t instanceof Map?Y.map:typeof Set<"u"&&t instanceof Set?Y.set:typeof Date<"u"&&t instanceof Date?Y.date:Y.object;default:return Y.unknown}}});var w,xHe,Br,VR=S(()=>{p();u();l();xh();w=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xHe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Br=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let d=i.path[c];c===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Br.create=t=>new Br(t)});var vHe,ea,ew=S(()=>{p();u();l();VR();xh();vHe=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===Y.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,ve.assertNever(t)}return{message:n}},ea=vHe});function MHe(t){ire=t}function Gd(){return ire}var ire,qR=S(()=>{p();u();l();ew();ire=ea});function H(t,e){let n=Gd(),r=vh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ea?void 0:ea].filter(o=>!!o)});t.common.issues.push(r)}var vh,LHe,On,pe,Xu,Kn,YR,WR,Nc,$d,tw=S(()=>{p();u();l();qR();ew();vh=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(d=>!!d).slice().reverse();for(let d of c)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},LHe=[];On=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},pe=Object.freeze({status:"aborted"}),Xu=t=>({status:"dirty",value:t}),Kn=t=>({status:"valid",value:t}),YR=t=>t.status==="aborted",WR=t=>t.status==="dirty",Nc=t=>t.status==="valid",$d=t=>typeof Promise<"u"&&t instanceof Promise});var are=S(()=>{p();u();l()});var re,cre=S(()=>{p();u();l();(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}))});function Re(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}function dre(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function XHe(t){return new RegExp(`^${dre(t)}$`)}function fre(t){let e=`${pre}T${dre(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function QHe(t,e){return!!((e==="v4"||!e)&&HHe.test(t)||(e==="v6"||!e)&&qHe.test(t))}function JHe(t,e){if(!BHe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function ZHe(t,e){return!!((e==="v4"||!e)&&VHe.test(t)||(e==="v6"||!e)&&YHe.test(t))}function eVe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function Fd(t){if(t instanceof Gr){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ho.create(Fd(r))}return new Gr({...t._def,shape:()=>e})}else return t instanceof ra?new ra({...t._def,type:Fd(t.element)}):t instanceof Ho?Ho.create(Fd(t.unwrap())):t instanceof ci?ci.create(Fd(t.unwrap())):t instanceof ai?ai.create(t.items.map(e=>Fd(e))):t}function rw(t,e){let n=ii(t),r=ii(e);if(t===e)return{valid:!0,data:t};if(n===Y.object&&r===Y.object){let o=ve.objectKeys(e),s=ve.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=rw(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=rw(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===Y.date&&r===Y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function mre(t,e){return new al({values:t,typeName:me.ZodEnum,...Re(e)})}function lre(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function _re(t,e={},n){return t?Oc.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=lre(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=lre(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Oc.create()}var Vo,ure,be,wHe,DHe,UHe,kHe,jHe,BHe,GHe,$He,FHe,nw,HHe,VHe,qHe,YHe,WHe,KHe,pre,zHe,bc,Qu,Ju,Zu,el,Hd,tl,nl,Oc,na,gs,Vd,ra,Gr,rl,ta,KR,ol,ai,zR,qd,Yd,XR,sl,il,al,cl,Cc,qo,Ho,ci,ul,ll,Wd,tVe,Mh,Lh,pl,nVe,me,rVe,hre,gre,oVe,sVe,Ere,iVe,aVe,cVe,uVe,lVe,pVe,dVe,fVe,mVe,_Ve,hVe,gVe,EVe,TVe,SVe,AVe,yVe,RVe,IVe,NVe,bVe,OVe,CVe,PVe,xVe,vVe,MVe,LVe,wVe,DVe,UVe,kVe,jVe,BVe,Tre=S(()=>{p();u();l();VR();qR();cre();tw();xh();Vo=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ure=(t,e)=>{if(Nc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Br(t.common.issues);return this._error=n,this._error}}};be=class{get description(){return this._def.description}_getType(e){return ii(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ii(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new On,ctx:{common:e.parent.common,data:e.data,parsedType:ii(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if($d(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)},o=this._parseSync({data:e,path:r.path,parent:r});return ure(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Nc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Nc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await($d(o)?o:Promise.resolve(o));return ure(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new qo({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ho.create(this,this._def)}nullable(){return ci.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ra.create(this)}promise(){return Cc.create(this,this._def)}or(e){return rl.create([this,e],this._def)}and(e){return ol.create(this,e,this._def)}transform(e){return new qo({...Re(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ul({...Re(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new Mh({typeName:me.ZodBranded,type:this,...Re(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ll({...Re(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Lh.create(this,e)}readonly(){return pl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wHe=/^c[^\s-]{8,}$/i,DHe=/^[0-9a-z]+$/,UHe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kHe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jHe=/^[a-z0-9_-]{21}$/i,BHe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GHe=/^[-+]?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)?)??$/,$He=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",HHe=/^(?:(?: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])$/,VHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,YHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WHe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KHe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pre="((\\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])))",zHe=new RegExp(`^${pre}$`);bc=class t extends be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.string,received:s.parsedType}),pe}let r=new On,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?H(o,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&H(o,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")$He.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"email",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")nw||(nw=new RegExp(FHe,"u")),nw.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"emoji",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")kHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"uuid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")jHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"nanoid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")wHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")DHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid2",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")UHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ulid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),H(o,{validation:"url",code:w.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"regex",code:w.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?fre(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?zHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?XHe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?GHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"duration",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?QHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ip",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?JHe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"jwt",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?ZHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cidr",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?WHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?KHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64url",code:w.invalid_string,message:s.message}),r.dirty()):ve.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...re.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...re.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...re.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...re.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...re.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...re.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...re.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...re.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...re.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...re.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...re.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...re.errToObj(n)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};bc.create=t=>new bc({checks:[],typeName:me.ZodString,coerce:t?.coerce??!1,...Re(t)});Qu=class t extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.number,received:s.parsedType}),pe}let r,o=new On;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:w.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?eVe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_finite,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Qu.create=t=>new Qu({checks:[],typeName:me.ZodNumber,coerce:t?.coerce||!1,...Re(t)});Ju=class t extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let r,o=new On;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:w.invalid_type,expected:Y.bigint,received:n.parsedType}),pe}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ju.create=t=>new Ju({checks:[],typeName:me.ZodBigInt,coerce:t?.coerce??!1,...Re(t)});Zu=class extends be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.boolean,received:r.parsedType}),pe}return Kn(e.data)}};Zu.create=t=>new Zu({typeName:me.ZodBoolean,coerce:t?.coerce||!1,...Re(t)});el=class t extends be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.date,received:s.parsedType}),pe}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_date}),pe}let r=new On,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};el.create=t=>new el({checks:[],coerce:t?.coerce||!1,typeName:me.ZodDate,...Re(t)});Hd=class extends be{_parse(e){if(this._getType(e)!==Y.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.symbol,received:r.parsedType}),pe}return Kn(e.data)}};Hd.create=t=>new Hd({typeName:me.ZodSymbol,...Re(t)});tl=class extends be{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.undefined,received:r.parsedType}),pe}return Kn(e.data)}};tl.create=t=>new tl({typeName:me.ZodUndefined,...Re(t)});nl=class extends be{_parse(e){if(this._getType(e)!==Y.null){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.null,received:r.parsedType}),pe}return Kn(e.data)}};nl.create=t=>new nl({typeName:me.ZodNull,...Re(t)});Oc=class extends be{constructor(){super(...arguments),this._any=!0}_parse(e){return Kn(e.data)}};Oc.create=t=>new Oc({typeName:me.ZodAny,...Re(t)});na=class extends be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Kn(e.data)}};na.create=t=>new na({typeName:me.ZodUnknown,...Re(t)});gs=class extends be{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:w.invalid_type,expected:Y.never,received:n.parsedType}),pe}};gs.create=t=>new gs({typeName:me.ZodNever,...Re(t)});Vd=class extends be{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.void,received:r.parsedType}),pe}return Kn(e.data)}};Vd.create=t=>new Vd({typeName:me.ZodVoid,...Re(t)});ra=class t extends be{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Y.array)return H(n,{code:w.invalid_type,expected:Y.array,received:n.parsedType}),pe;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(H(n,{code:i?w.too_big:w.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(H(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(H(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Vo(n,i,n.path,a)))).then(i=>On.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Vo(n,i,n.path,a)));return On.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:re.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:re.toString(n)}})}nonempty(e){return this.min(1,e)}};ra.create=(t,e)=>new ra({type:t,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...Re(e)});Gr=class t extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ve.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Y.object){let d=this._getOrReturnCtx(e);return H(d,{code:w.invalid_type,expected:Y.object,received:d.parsedType}),pe}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gs&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let c=[];for(let d of i){let f=s[d],m=o.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new Vo(o,m,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof gs){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")a.length>0&&(H(o,{code:w.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of a){let m=o.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new Vo(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of c){let m=await f.key,_=await f.value;d.push({key:m,value:_,alwaysSet:f.alwaysSet})}return d}).then(d=>On.mergeObjectSync(r,d)):On.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:re.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ve.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ve.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Fd(this)}partial(e){let n={};for(let r of ve.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ve.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ho;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return mre(ve.objectKeys(this.shape))}};Gr.create=(t,e)=>new Gr({shape:()=>t,unknownKeys:"strip",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});Gr.strictCreate=(t,e)=>new Gr({shape:()=>t,unknownKeys:"strict",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});Gr.lazycreate=(t,e)=>new Gr({shape:t,unknownKeys:"strip",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});rl=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Br(a.ctx.common.issues));return H(n,{code:w.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Br(c));return H(n,{code:w.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};rl.create=(t,e)=>new rl({options:t,typeName:me.ZodUnion,...Re(e)});ta=t=>t instanceof sl?ta(t.schema):t instanceof qo?ta(t.innerType()):t instanceof il?[t.value]:t instanceof al?t.options:t instanceof cl?ve.objectValues(t.enum):t instanceof ul?ta(t._def.innerType):t instanceof tl?[void 0]:t instanceof nl?[null]:t instanceof Ho?[void 0,...ta(t.unwrap())]:t instanceof ci?[null,...ta(t.unwrap())]:t instanceof Mh||t instanceof pl?ta(t.unwrap()):t instanceof ll?ta(t._def.innerType):[],KR=class t extends be{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return H(n,{code:w.invalid_type,expected:Y.object,received:n.parsedType}),pe;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=ta(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:me.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...Re(r)})}};ol=class extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(YR(s)||YR(i))return pe;let a=rw(s.value,i.value);return a.valid?((WR(s)||WR(i))&&n.dirty(),{status:n.value,value:a.data}):(H(r,{code:w.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ol.create=(t,e,n)=>new ol({left:t,right:e,typeName:me.ZodIntersection,...Re(n)});ai=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.array)return H(r,{code:w.invalid_type,expected:Y.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return H(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Vo(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>On.mergeArray(n,i)):On.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ai.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ai({items:t,typeName:me.ZodTuple,rest:null,...Re(e)})};zR=class t extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.object)return H(r,{code:w.invalid_type,expected:Y.object,received:r.parsedType}),pe;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Vo(r,a,r.path,a)),value:i._parse(new Vo(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?On.mergeObjectAsync(n,o):On.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof be?new t({keyType:e,valueType:n,typeName:me.ZodRecord,...Re(r)}):new t({keyType:bc.create(),valueType:e,typeName:me.ZodRecord,...Re(n)})}},qd=class extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.map)return H(r,{code:w.invalid_type,expected:Y.map,received:r.parsedType}),pe;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],d)=>({key:o._parse(new Vo(r,a,r.path,[d,"key"])),value:s._parse(new Vo(r,c,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}}}};qd.create=(t,e,n)=>new qd({valueType:e,keyType:t,typeName:me.ZodMap,...Re(n)});Yd=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.set)return H(r,{code:w.invalid_type,expected:Y.set,received:r.parsedType}),pe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(H(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(H(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let d=new Set;for(let f of c){if(f.status==="aborted")return pe;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((c,d)=>s._parse(new Vo(r,c,r.path,d)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:re.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Yd.create=(t,e)=>new Yd({valueType:t,minSize:null,maxSize:null,typeName:me.ZodSet,...Re(e)});XR=class t extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.function)return H(n,{code:w.invalid_type,expected:Y.function,received:n.parsedType}),pe;function r(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Gd(),ea].filter(d=>!!d),issueData:{code:w.invalid_arguments,argumentsError:c}})}function o(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Gd(),ea].filter(d=>!!d),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Cc){let a=this;return Kn(async function(...c){let d=new Br([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw d.addIssue(r(c,g)),d}),m=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(m,s).catch(g=>{throw d.addIssue(o(m,g)),d})})}else{let a=this;return Kn(function(...c){let d=a._def.args.safeParse(c,s);if(!d.success)throw new Br([r(c,d.error)]);let f=Reflect.apply(i,this,d.data),m=a._def.returns.safeParse(f,s);if(!m.success)throw new Br([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ai.create(e).rest(na.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||ai.create([]).rest(na.create()),returns:n||na.create(),typeName:me.ZodFunction,...Re(r)})}},sl=class extends be{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};sl.create=(t,e)=>new sl({getter:t,typeName:me.ZodLazy,...Re(e)});il=class extends be{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};il.create=(t,e)=>new il({value:t,typeName:me.ZodLiteral,...Re(e)});al=class t extends be{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{expected:ve.joinValues(r),received:n.parsedType,code:w.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{received:n.data,code:w.invalid_enum_value,options:r}),pe}return Kn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};al.create=mre;cl=class extends be{_parse(e){let n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Y.string&&r.parsedType!==Y.number){let o=ve.objectValues(n);return H(r,{expected:ve.joinValues(o),received:r.parsedType,code:w.invalid_type}),pe}if(this._cache||(this._cache=new Set(ve.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ve.objectValues(n);return H(r,{received:r.data,code:w.invalid_enum_value,options:o}),pe}return Kn(e.data)}get enum(){return this._def.values}};cl.create=(t,e)=>new cl({values:t,typeName:me.ZodNativeEnum,...Re(e)});Cc=class extends be{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.promise&&n.common.async===!1)return H(n,{code:w.invalid_type,expected:Y.promise,received:n.parsedType}),pe;let r=n.parsedType===Y.promise?n.data:Promise.resolve(n.data);return Kn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Cc.create=(t,e)=>new Cc({type:t,typeName:me.ZodPromise,...Re(e)});qo=class extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{H(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?pe:c.status==="dirty"?Xu(c.value):n.value==="dirty"?Xu(c.value):c});{if(n.value==="aborted")return pe;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?Xu(a.value):n.value==="dirty"?Xu(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Nc(i))return pe;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Nc(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):pe);ve.assertNever(o)}};qo.create=(t,e,n)=>new qo({schema:t,typeName:me.ZodEffects,effect:e,...Re(n)});qo.createWithPreprocess=(t,e,n)=>new qo({schema:e,effect:{type:"preprocess",transform:t},typeName:me.ZodEffects,...Re(n)});Ho=class extends be{_parse(e){return this._getType(e)===Y.undefined?Kn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ho.create=(t,e)=>new Ho({innerType:t,typeName:me.ZodOptional,...Re(e)});ci=class extends be{_parse(e){return this._getType(e)===Y.null?Kn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ci.create=(t,e)=>new ci({innerType:t,typeName:me.ZodNullable,...Re(e)});ul=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ul.create=(t,e)=>new ul({innerType:t,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Re(e)});ll=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $d(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Br(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Br(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ll.create=(t,e)=>new ll({innerType:t,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Re(e)});Wd=class extends be{_parse(e){if(this._getType(e)!==Y.nan){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}};Wd.create=t=>new Wd({typeName:me.ZodNaN,...Re(t)});tVe=Symbol("zod_brand"),Mh=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Lh=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Xu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:me.ZodPipeline})}},pl=class extends be{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Nc(o)&&(o.value=Object.freeze(o.value)),o);return $d(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};pl.create=(t,e)=>new pl({innerType:t,typeName:me.ZodReadonly,...Re(e)});nVe={object:Gr.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(me||(me={}));rVe=(t,e={message:`Input not instance of ${t.name}`})=>_re(n=>n instanceof t,e),hre=bc.create,gre=Qu.create,oVe=Wd.create,sVe=Ju.create,Ere=Zu.create,iVe=el.create,aVe=Hd.create,cVe=tl.create,uVe=nl.create,lVe=Oc.create,pVe=na.create,dVe=gs.create,fVe=Vd.create,mVe=ra.create,_Ve=Gr.create,hVe=Gr.strictCreate,gVe=rl.create,EVe=KR.create,TVe=ol.create,SVe=ai.create,AVe=zR.create,yVe=qd.create,RVe=Yd.create,IVe=XR.create,NVe=sl.create,bVe=il.create,OVe=al.create,CVe=cl.create,PVe=Cc.create,xVe=qo.create,vVe=Ho.create,MVe=ci.create,LVe=qo.createWithPreprocess,wVe=Lh.create,DVe=()=>hre().optional(),UVe=()=>gre().optional(),kVe=()=>Ere().optional(),jVe={string:(t=>bc.create({...t,coerce:!0})),number:(t=>Qu.create({...t,coerce:!0})),boolean:(t=>Zu.create({...t,coerce:!0})),bigint:(t=>Ju.create({...t,coerce:!0})),date:(t=>el.create({...t,coerce:!0}))},BVe=pe});var E={};Mn(E,{BRAND:()=>tVe,DIRTY:()=>Xu,EMPTY_PATH:()=>LHe,INVALID:()=>pe,NEVER:()=>BVe,OK:()=>Kn,ParseStatus:()=>On,Schema:()=>be,ZodAny:()=>Oc,ZodArray:()=>ra,ZodBigInt:()=>Ju,ZodBoolean:()=>Zu,ZodBranded:()=>Mh,ZodCatch:()=>ll,ZodDate:()=>el,ZodDefault:()=>ul,ZodDiscriminatedUnion:()=>KR,ZodEffects:()=>qo,ZodEnum:()=>al,ZodError:()=>Br,ZodFirstPartyTypeKind:()=>me,ZodFunction:()=>XR,ZodIntersection:()=>ol,ZodIssueCode:()=>w,ZodLazy:()=>sl,ZodLiteral:()=>il,ZodMap:()=>qd,ZodNaN:()=>Wd,ZodNativeEnum:()=>cl,ZodNever:()=>gs,ZodNull:()=>nl,ZodNullable:()=>ci,ZodNumber:()=>Qu,ZodObject:()=>Gr,ZodOptional:()=>Ho,ZodParsedType:()=>Y,ZodPipeline:()=>Lh,ZodPromise:()=>Cc,ZodReadonly:()=>pl,ZodRecord:()=>zR,ZodSchema:()=>be,ZodSet:()=>Yd,ZodString:()=>bc,ZodSymbol:()=>Hd,ZodTransformer:()=>qo,ZodTuple:()=>ai,ZodType:()=>be,ZodUndefined:()=>tl,ZodUnion:()=>rl,ZodUnknown:()=>na,ZodVoid:()=>Vd,addIssueToContext:()=>H,any:()=>lVe,array:()=>mVe,bigint:()=>sVe,boolean:()=>Ere,coerce:()=>jVe,custom:()=>_re,date:()=>iVe,datetimeRegex:()=>fre,defaultErrorMap:()=>ea,discriminatedUnion:()=>EVe,effect:()=>xVe,enum:()=>OVe,function:()=>IVe,getErrorMap:()=>Gd,getParsedType:()=>ii,instanceof:()=>rVe,intersection:()=>TVe,isAborted:()=>YR,isAsync:()=>$d,isDirty:()=>WR,isValid:()=>Nc,late:()=>nVe,lazy:()=>NVe,literal:()=>bVe,makeIssue:()=>vh,map:()=>yVe,nan:()=>oVe,nativeEnum:()=>CVe,never:()=>dVe,null:()=>uVe,nullable:()=>MVe,number:()=>gre,object:()=>_Ve,objectUtil:()=>ZL,oboolean:()=>kVe,onumber:()=>UVe,optional:()=>vVe,ostring:()=>DVe,pipeline:()=>wVe,preprocess:()=>LVe,promise:()=>PVe,quotelessJson:()=>xHe,record:()=>AVe,set:()=>RVe,setErrorMap:()=>MHe,strictObject:()=>hVe,string:()=>hre,symbol:()=>aVe,transformer:()=>xVe,tuple:()=>SVe,undefined:()=>cVe,union:()=>gVe,unknown:()=>pVe,util:()=>ve,void:()=>fVe});var ow=S(()=>{p();u();l();qR();tw();are();xh();Tre();VR()});var Pc=S(()=>{p();u();l();ow();ow()});var Sre,Are,QR,JR=S(()=>{"use strict";p();u();l();Pc();Sre=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string()}),Are=E.object({dsn:E.string(),projectId:E.string(),orgId:E.string().optional(),source:E.enum(["env","env_file","config","code","inferred"]),sourcePath:E.string().optional(),resolved:Sre.optional(),allResolved:E.array(Sre).optional(),cachedAt:E.number()}),QR=["packages","apps","libs","services","modules"]});var GVe,yre,Rre,$Ve,FVe,HVe,Ire=S(()=>{"use strict";p();u();l();Pc();JR();GVe=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string(),cachedAt:E.number()}),yre=E.object({orgSlug:E.string(),projectSlug:E.string()}),Rre=E.object({aliases:E.record(yre),cachedAt:E.number(),dsnFingerprint:E.string().optional()}),$Ve=E.object({token:E.string().optional(),refreshToken:E.string().optional(),expiresAt:E.number().optional(),issuedAt:E.number().optional()}),FVe=E.object({organization:E.string().optional(),project:E.string().optional()}),HVe=E.object({auth:$Ve.optional(),defaults:FVe.optional(),projectCache:E.record(GVe).optional(),dsnCache:E.record(Are).optional(),projectAliases:Rre.optional()})});var sw,ZR,eI,Nre=S(()=>{"use strict";p();u();l();Pc();sw=E.object({device_code:E.string(),user_code:E.string(),verification_uri:E.string(),verification_uri_complete:E.string().optional(),expires_in:E.number(),interval:E.number()}).passthrough(),ZR=E.object({access_token:E.string(),token_type:E.string(),expires_in:E.number(),expires_at:E.string().optional(),refresh_token:E.string().optional(),scope:E.string().optional(),user:E.object({id:E.string(),name:E.string(),email:E.string()}).passthrough().optional()}).passthrough(),eI=E.object({error:E.string(),error_description:E.string().optional()}).passthrough()});function iw(t){return Ore.includes(t)}function wh(t){if(!t.steps)return[];for(let e of t.steps)if(e.key==="root_cause_analysis"&&e.causes)return e.causes;return[]}function tqe(t){for(let e of t)if(e.key==="solution"){let n=Cre.safeParse(e);if(n.success)return n.data}return null}function bre(t){for(let e of t)if(e.artifacts){let n=tqe(e.artifacts);if(n)return n}return null}function tI(t){let e=t;if(e.blocks){let n=bre(e.blocks);if(n)return n}if(e.steps){let n=bre(e.steps);if(n)return n}return null}var Ore,VVe,qVe,YVe,WVe,KVe,zVe,XVe,QVe,Q4t,JVe,ZVe,Cre,eqe,J4t,Z4t,ezt,tzt,Dh=S(()=>{"use strict";p();u();l();Pc();Ore=["COMPLETED","ERROR","CANCELLED"],VVe=E.object({message:E.string(),timestamp:E.string(),type:E.string().optional()}),qVe=E.object({file_path:E.string(),repo_name:E.string()}),YVe=E.object({title:E.string(),code_snippet_and_analysis:E.string(),is_most_important_event:E.boolean().optional(),relevant_code_file:qVe.optional(),timeline_item_type:E.string().optional()}),WVe=E.object({id:E.number(),description:E.string(),relevant_repos:E.array(E.string()).optional(),reproduction_urls:E.array(E.string()).optional(),root_cause_reproduction:E.array(YVe).optional()}),KVe=E.object({cause_id:E.number(),instruction:E.string().nullable().optional()}),zVe=E.object({id:E.string(),key:E.string(),status:E.string(),title:E.string(),progress:E.array(VVe).optional(),causes:E.array(WVe).optional(),selection:KVe.optional()}).passthrough(),XVe=E.object({integration_id:E.number().optional(),url:E.string().optional(),external_id:E.string(),name:E.string(),provider:E.string().optional(),default_branch:E.string().optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),QVe=E.object({repo_external_id:E.string(),file_changes:E.array(E.unknown()).optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),Q4t=E.object({pr_number:E.number().optional(),pr_url:E.string().optional(),repo_name:E.string().optional()}),JVe=E.object({title:E.string(),description:E.string()}),ZVe=E.object({one_line_summary:E.string(),steps:E.array(JVe)}),Cre=E.object({key:E.literal("solution"),data:ZVe,reason:E.string().optional()}),eqe=E.object({run_id:E.number(),status:E.string(),updated_at:E.string().optional(),request:E.object({organization_id:E.number().optional(),project_id:E.number().optional(),repos:E.array(E.unknown()).optional()}).optional(),codebases:E.record(E.string(),QVe).optional(),steps:E.array(zVe).optional(),repositories:E.array(XVe).optional(),coding_agents:E.record(E.string(),E.unknown()).optional(),created_at:E.string().optional(),completed_at:E.string().optional()}).passthrough(),J4t=E.object({autofix:eqe.nullable()}),Z4t=E.object({type:E.literal("select_root_cause"),cause_id:E.number(),stopping_point:E.enum(["solution","code_changes","open_pr"]).optional()}),ezt=E.object({type:E.literal("select_solution")}),tzt=E.object({type:E.literal("create_pr")})});var kre={};Mn(kre,{BreadcrumbSchema:()=>mw,BreadcrumbsEntrySchema:()=>Lre,BrowserContextSchema:()=>_w,DetailedLogsResponseSchema:()=>cI,DetailedSentryLogSchema:()=>Sw,DeviceContextSchema:()=>gw,ExceptionEntrySchema:()=>Mre,ExceptionValueSchema:()=>fw,ISSUE_LEVELS:()=>Pre,ISSUE_PRIORITIES:()=>xre,ISSUE_STATUSES:()=>uw,ISSUE_SUBSTATUSES:()=>nqe,LOG_SEVERITIES:()=>Ure,LogsResponseSchema:()=>aI,MechanismSchema:()=>dw,OrganizationLinksSchema:()=>cw,OsContextSchema:()=>hw,ProjectKeyDsnSchema:()=>Dre,ProjectKeySchema:()=>iI,RegionSchema:()=>aw,ReleaseSchema:()=>Uh,RepositoryProviderSchema:()=>yw,RequestEntrySchema:()=>wre,SentryEventSchema:()=>sI,SentryIssueSchema:()=>fl,SentryLogSchema:()=>Tw,SentryOrganizationSchema:()=>Kd,SentryProjectSchema:()=>dl,SentryRepositorySchema:()=>lI,SentryTeamSchema:()=>pI,SentryUserSchema:()=>oI,SpanSchema:()=>vre,StackFrameSchema:()=>pw,StacktraceSchema:()=>nI,TraceContextSchema:()=>lw,TransactionListItemSchema:()=>Aw,TransactionsResponseSchema:()=>uI,UserGeoSchema:()=>Ew,UserRegionsResponseSchema:()=>rI});var aw,rI,cw,Kd,oI,dl,uw,Pre,xre,nqe,Uh,fl,lw,vre,pw,nI,dw,fw,Mre,mw,Lre,wre,_w,hw,gw,Ew,sI,Dre,iI,Ure,Tw,aI,Sw,cI,Aw,uI,yw,lI,pI,Rw=S(()=>{"use strict";p();u();l();Pc();aw=E.object({name:E.string(),url:E.string().url()}),rI=E.object({regions:E.array(aw)}),cw=E.object({organizationUrl:E.string(),regionUrl:E.string()}),Kd=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isEarlyAdopter:E.boolean().optional(),require2FA:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),features:E.array(E.string()).optional(),links:cw.optional()}).passthrough(),oI=E.object({id:E.string(),email:E.string().optional(),username:E.string().optional(),name:E.string().optional()}).passthrough(),dl=E.object({id:E.string(),slug:E.string(),name:E.string(),platform:E.string().nullable().optional(),dateCreated:E.string().optional(),isBookmarked:E.boolean().optional(),isMember:E.boolean().optional(),features:E.array(E.string()).optional(),firstEvent:E.string().nullable().optional(),firstTransactionEvent:E.boolean().optional(),access:E.array(E.string()).optional(),hasAccess:E.boolean().optional(),hasMinifiedStackTrace:E.boolean().optional(),hasMonitors:E.boolean().optional(),hasProfiles:E.boolean().optional(),hasReplays:E.boolean().optional(),hasSessions:E.boolean().optional(),isInternal:E.boolean().optional(),isPublic:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),color:E.string().optional(),status:E.string().optional(),organization:E.object({id:E.string(),slug:E.string(),name:E.string()}).passthrough().optional()}).passthrough(),uw=["resolved","unresolved","ignored"],Pre=["fatal","error","warning","info","debug"],xre=["high","medium","low"],nqe=["ongoing","escalating","regressed","new","archived_until_escalating","archived_until_condition_met","archived_forever"],Uh=E.object({id:E.number().optional(),version:E.string(),shortVersion:E.string().optional(),status:E.string().optional(),dateCreated:E.string().optional(),dateReleased:E.string().nullable().optional(),ref:E.string().nullable().optional(),url:E.string().nullable().optional(),commitCount:E.number().optional(),deployCount:E.number().optional(),authors:E.array(E.unknown()).optional(),projects:E.array(E.object({id:E.union([E.string(),E.number()]),slug:E.string(),name:E.string()}).passthrough()).optional()}).passthrough(),fl=E.object({id:E.string(),shortId:E.string(),title:E.string(),culprit:E.string().optional(),permalink:E.string().optional(),logger:E.string().nullable().optional(),level:E.string().optional(),status:E.enum(uw).optional(),statusDetails:E.record(E.unknown()).optional(),substatus:E.string().optional().nullable(),priority:E.string().optional(),isPublic:E.boolean().optional(),platform:E.string().optional(),project:E.object({id:E.string(),name:E.string(),slug:E.string(),platform:E.string().nullable().optional()}).passthrough().optional(),type:E.string().optional(),metadata:E.object({value:E.string().optional(),type:E.string().optional(),filename:E.string().optional(),function:E.string().optional(),display_title_with_tree_label:E.boolean().optional()}).passthrough().optional(),numComments:E.number().optional(),assignedTo:E.object({id:E.string(),name:E.string(),type:E.string()}).passthrough().nullable().optional(),isBookmarked:E.boolean().optional(),isSubscribed:E.boolean().optional(),subscriptionDetails:E.object({reason:E.string().optional()}).passthrough().nullable().optional(),hasSeen:E.boolean().optional(),annotations:E.array(E.object({displayName:E.string(),url:E.string()}).passthrough()).optional(),isUnhandled:E.boolean().optional(),count:E.string().optional(),userCount:E.number().optional(),firstSeen:E.string().datetime({offset:!0}).optional(),lastSeen:E.string().datetime({offset:!0}).optional(),firstRelease:Uh.nullable().optional(),lastRelease:Uh.nullable().optional(),seerFixabilityScore:E.number().nullable().optional()}).passthrough(),lw=E.object({trace_id:E.string().optional(),span_id:E.string().optional(),parent_span_id:E.string().nullable().optional(),op:E.string().optional(),status:E.string().optional(),description:E.string().nullable().optional()}).passthrough(),vre=E.object({span_id:E.string(),parent_span_id:E.string().nullable().optional(),trace_id:E.string().optional(),op:E.string().optional(),description:E.string().nullable().optional(),start_timestamp:E.number(),timestamp:E.number(),status:E.string().optional(),data:E.record(E.unknown()).optional(),tags:E.record(E.string()).optional()}).passthrough(),pw=E.object({filename:E.string().nullable().optional(),absPath:E.string().nullable().optional(),module:E.string().nullable().optional(),package:E.string().nullable().optional(),platform:E.string().nullable().optional(),function:E.string().nullable().optional(),rawFunction:E.string().nullable().optional(),symbol:E.string().nullable().optional(),lineNo:E.number().nullable().optional(),colNo:E.number().nullable().optional(),inApp:E.boolean().nullable().optional(),context:E.array(E.tuple([E.number(),E.string()])).nullable().optional(),vars:E.record(E.unknown()).nullable().optional(),instructionAddr:E.string().nullable().optional(),symbolAddr:E.string().nullable().optional(),trust:E.string().nullable().optional(),errors:E.array(E.unknown()).nullable().optional()}).passthrough(),nI=E.object({frames:E.array(pw).optional(),framesOmitted:E.array(E.number()).nullable().optional(),registers:E.record(E.string()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough(),dw=E.object({type:E.string().optional(),handled:E.boolean().optional(),synthetic:E.boolean().optional(),description:E.string().nullable().optional(),data:E.record(E.unknown()).optional()}).passthrough(),fw=E.object({type:E.string().nullable().optional(),value:E.string().nullable().optional(),module:E.string().nullable().optional(),threadId:E.union([E.string(),E.number()]).nullable().optional(),mechanism:dw.nullable().optional(),stacktrace:nI.nullable().optional(),rawStacktrace:nI.nullable().optional()}).passthrough(),Mre=E.object({type:E.literal("exception"),data:E.object({values:E.array(fw).optional(),excOmitted:E.array(E.number()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough()}),mw=E.object({type:E.string().optional(),category:E.string().nullable().optional(),level:E.string().optional(),message:E.string().nullable().optional(),timestamp:E.string().optional(),event_id:E.string().nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough(),Lre=E.object({type:E.literal("breadcrumbs"),data:E.object({values:E.array(mw).optional()}).passthrough()}),wre=E.object({type:E.literal("request"),data:E.object({url:E.string().nullable().optional(),method:E.string().nullable().optional(),fragment:E.string().nullable().optional(),query:E.union([E.array(E.tuple([E.string(),E.string()])),E.string(),E.record(E.string())]).nullable().optional(),data:E.unknown().nullable().optional(),headers:E.array(E.tuple([E.string(),E.string()])).nullable().optional(),cookies:E.union([E.array(E.tuple([E.string(),E.string()])),E.record(E.string())]).nullable().optional(),env:E.record(E.string()).nullable().optional(),inferredContentType:E.string().nullable().optional(),apiTarget:E.string().nullable().optional()}).passthrough()}),_w=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("browser").optional()}).passthrough(),hw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("os").optional()}).passthrough(),gw=E.object({family:E.string().optional(),model:E.string().optional(),brand:E.string().optional(),type:E.literal("device").optional()}).passthrough(),Ew=E.object({country_code:E.string().optional(),city:E.string().optional(),region:E.string().optional()}).passthrough(),sI=E.object({eventID:E.string(),id:E.string().optional(),projectID:E.string().optional(),context:E.record(E.unknown()).optional(),contexts:E.object({trace:lw.optional(),browser:_w.optional(),os:hw.optional(),device:gw.optional()}).passthrough().optional(),dateCreated:E.string().optional(),dateReceived:E.string().optional(),entries:E.array(E.unknown()).optional(),errors:E.array(E.unknown()).optional(),fingerprints:E.array(E.string()).optional(),groupID:E.string().optional(),message:E.string().optional(),metadata:E.record(E.unknown()).optional(),platform:E.string().optional(),location:E.string().nullable().optional(),culprit:E.string().nullable().optional(),sdk:E.object({name:E.string().nullable().optional(),version:E.string().nullable().optional()}).passthrough().nullable().optional(),tags:E.array(E.object({key:E.string(),value:E.string()})).optional(),title:E.string().optional(),type:E.string().optional(),user:E.object({id:E.string().nullable().optional(),email:E.string().nullable().optional(),username:E.string().nullable().optional(),ip_address:E.string().nullable().optional(),name:E.string().nullable().optional(),geo:Ew.nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough().nullable().optional(),release:Uh.nullable().optional(),sdkUpdates:E.array(E.object({type:E.string().optional(),sdkName:E.string().optional(),newSdkVersion:E.string().optional(),sdkUrl:E.string().optional()}).passthrough()).optional()}).passthrough(),Dre=E.object({public:E.string(),secret:E.string().optional()}),iI=E.object({id:E.string(),name:E.string(),dsn:Dre,isActive:E.boolean(),dateCreated:E.string().optional()}).passthrough(),Ure=["fatal","error","warning","warn","info","debug","trace"],Tw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional()}).passthrough(),aI=E.object({data:E.array(Tw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Sw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional(),project:E.string().nullable().optional(),environment:E.string().nullable().optional(),release:E.string().nullable().optional(),"sdk.name":E.string().nullable().optional(),"sdk.version":E.string().nullable().optional(),span_id:E.string().nullable().optional(),"code.function":E.string().nullable().optional(),"code.file.path":E.string().nullable().optional(),"code.line.number":E.string().nullable().optional(),"sentry.otel.kind":E.string().nullable().optional(),"sentry.otel.status_code":E.string().nullable().optional(),"sentry.otel.instrumentation_scope.name":E.string().nullable().optional()}).passthrough(),cI=E.object({data:E.array(Sw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Aw=E.object({trace:E.string(),id:E.string(),transaction:E.string(),timestamp:E.string(),"transaction.duration":E.number(),project:E.string()}).passthrough(),uI=E.object({data:E.array(Aw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),yw=E.object({id:E.string(),name:E.string()}),lI=E.object({id:E.string(),name:E.string(),url:E.string().nullable(),provider:yw,status:E.string(),dateCreated:E.string().optional(),integrationId:E.string().optional(),externalSlug:E.string().nullable().optional(),externalId:E.string().nullable().optional()}).passthrough(),pI=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isMember:E.boolean().optional(),teamRole:E.string().nullable().optional(),memberCount:E.number().optional()}).passthrough()});var Iw=S(()=>{"use strict";p();u();l();Ire();Nre();Dh();Rw()});function ml(){let t=typeof process.versions.bun<"u"?`bun/${process.versions.bun}`:`node/${process.versions.node}`;return`sentry-cli/${hn} (${process.platform}-${process.arch}) ${t}`}var oa,kh,hn,jre,lo=S(()=>{"use strict";p();u();l();oa="sentry.io",kh=`https://${oa}`,hn="0.10.1";jre="https://1188a86f3f8168f089450587b00bca66@o1.ingest.us.sentry.io/4510776311808000"});var rqe,Bre,Gre=S(()=>{p();u();l();rqe=globalThis.__bun_sqlite_polyfill,Bre=rqe.Database});function oqe(t){return t.query("SELECT value FROM metadata WHERE key = ?").get(Fre)?.value==="true"}function Nw(t){t.query("INSERT OR REPLACE INTO metadata (key, value) VALUES (?, ?)").run(Fre,"true")}function sqe(){let t=(0,dI.join)(sa(),bw),{existsSync:e}=require("node:fs");return e(t)}function iqe(){let t=(0,dI.join)(sa(),bw);try{let{readFileSync:e}=require("node:fs"),n=e(t,"utf-8");return JSON.parse(n)}catch{return null}}function aqe(){let t=(0,dI.join)(sa(),bw);try{return(0,$re.rmSync)(t),!0}catch(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"?!0:(console.error("Warning: Could not delete old config.json:",e),!1)}}function Hre(t){if(oqe(t))return;if(!sqe()){Nw(t);return}let e=iqe();if(!e){Nw(t);return}console.error("Migrating config to SQLite..."),t.exec("BEGIN TRANSACTION");try{if(e.auth?.token&&t.query(`
64
+ Mongoose Error Code: ${e.code}`:""}`})}function gM(t,e,n,r=void 0){n&&(0,X_.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&uJ.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function Dje(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(gM(e,o,n,r),o)).catch(o=>{throw lJ(e,o),o}).finally(()=>e.end()):(gM(e,t,n,r),e.end(),t)}oc.handlePromiseResponse=Dje;function Uje(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2?a=1:o.length===3&&(a=2),o[a]=(c,d)=>(c?lJ(r,c):gM(r,d,s,i),r.end(),t(c,d)),e.apply(n,o)}oc.handleCallbackResponse=Uje});var dJ=y(id=>{"use strict";p();u();l();Object.defineProperty(id,"__esModule",{value:!0});id.PACKAGE_NAME=id.PACKAGE_VERSION=void 0;id.PACKAGE_VERSION="0.57.0";id.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var gJ=y(Dr=>{"use strict";p();u();l();Object.defineProperty(Dr,"__esModule",{value:!0});Dr.MongooseInstrumentation=Dr._ALREADY_INSTRUMENTED=Dr._STORED_PARENT_SPAN=void 0;var sn=(U(),D(J)),kje=Ge(),EM=pJ(),Nn=he(),fJ=dJ(),sc=hM(),ju=(Le(),D(Xe)),cy=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],jje=["remove","count","findOneAndRemove",...cy],Bje=["count","findOneAndRemove",...cy],Gje=[...cy];function mJ(t){return t?t.startsWith("6.")||t.startsWith("5.")?jje:t.startsWith("7.")?Bje:Gje:cy}function _J(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}function hJ(t){return!t||!t.startsWith("8.")?!1:parseInt(t.split(".")[1],10)>=21}Dr._STORED_PARENT_SPAN=Symbol("stored-parent-span");Dr._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var TM=class extends Nn.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(fJ.PACKAGE_NAME,fJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Nn.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Nn.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Nn.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,_J(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),hJ(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),mJ(n).forEach(s=>{this._wrap(r.Query.prototype,s,this.patchAndCaptureSpanContext(s))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(e,n){let r=e[Symbol.toStringTag]==="Module"?e.default:e,o=mJ(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,_J(n)&&this._unwrap(r.Model.prototype,"remove"),hJ(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(s=>{this._unwrap(r.Query.prototype,s)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Nn.SemconvStability.OLD&&(a[sc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&Nn.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(this[Dr._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return r.apply(this,arguments);let i=this[Dr._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();if(c){let f=c(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Nn.SemconvStability.OLD&&(a[sc.ATTR_DB_STATEMENT]=f),n._dbSemconvStability&Nn.SemconvStability.STABLE&&(a[ju.ATTR_DB_QUERY_TEXT]=f)}let d=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(d,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let d={},{dbStatementSerializer:f}=r.getConfig();if(f){let _=f(e,c);r._dbSemconvStability&Nn.SemconvStability.OLD&&(d[sc.ATTR_DB_STATEMENT]=_),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(d[ju.ATTR_DB_QUERY_TEXT]=_)}let m=r._startSpan(this.constructor.collection,this.constructor.modelName,e,d);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(m,o,this,arguments,a,n)}}_patchDocumentUpdateMethods(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);let d=c,f=i,m=a;typeof i=="function"?(d=i,f=void 0,m=void 0):typeof a=="function"&&(d=a,m=void 0);let _={},g=r.getConfig().dbStatementSerializer;if(g){let R=g(e,{condition:{_id:this._id},updates:f,options:m});r._dbSemconvStability&Nn.SemconvStability.OLD&&(_[sc.ATTR_DB_STATEMENT]=R),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(_[ju.ATTR_DB_QUERY_TEXT]=R)}let T=r._startSpan(this.constructor.collection,this.constructor.modelName,e,_),A=r._handleResponse(T,o,this,arguments,d,n);return A&&typeof A=="object"&&(A[Dr._ALREADY_INSTRUMENTED]=!0),A}}patchModelStatic(e,n){let r=this;return o=>function(i,a,c){if(r.getConfig().requireParentSpan&&sn.trace.getSpan(sn.context.active())===void 0)return o.apply(this,arguments);typeof a=="function"&&(c=a,a=void 0);let d={};switch(e){case"insertMany":d.documents=i;break;case"bulkWrite":d.operations=i;break;default:d.document=i;break}a!==void 0&&(d.options=a);let f={},{dbStatementSerializer:m}=r.getConfig();if(m){let g=m(e,d);r._dbSemconvStability&Nn.SemconvStability.OLD&&(f[sc.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&Nn.SemconvStability.STABLE&&(f[ju.ATTR_DB_QUERY_TEXT]=g)}let _=r._startSpan(this.collection,this.modelName,e,f);return r._handleResponse(_,o,this,arguments,c,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=sn.trace.getSpan(sn.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[Dr._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[Dr._STORED_PARENT_SPAN]=sn.trace.getSpan(sn.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){let i={...o,...(0,EM.getAttributesFromCollection)(e,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Nn.SemconvStability.OLD&&(i[sc.ATTR_DB_OPERATION]=r,i[sc.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Nn.SemconvStability.STABLE&&(i[ju.ATTR_DB_OPERATION_NAME]=r,i[ju.ATTR_DB_SYSTEM_NAME]=sc.DB_SYSTEM_NAME_VALUE_MONGODB);let a=this._dbSemconvStability&Nn.SemconvStability.STABLE?`${r} ${e.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(a,{kind:sn.SpanKind.CLIENT,attributes:i},s?sn.trace.setSpan(sn.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,EM.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,EM.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?sn.context.with((0,kje.suppressTracing)(sn.context.active()),e):e()}};Dr.MongooseInstrumentation=TM});var EJ=y(uy=>{"use strict";p();u();l();Object.defineProperty(uy,"__esModule",{value:!0});uy.MongooseInstrumentation=void 0;var $je=gJ();Object.defineProperty(uy,"MongooseInstrumentation",{enumerable:!0,get:function(){return $je.MongooseInstrumentation}})});var TJ,SJ,AJ,Fje,yJ,RJ=S(()=>{p();u();l();TJ=B(EJ(),1);Be();SJ="Mongoose",AJ=Z(SJ,()=>new TJ.MongooseInstrumentation({responseHook(t){qe(t,"auto.db.otel.mongoose")}})),Fje=(()=>({name:SJ,setupOnce(){AJ()}})),yJ=Fje});var IJ=y(Wt=>{"use strict";p();u();l();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Wt.DB_SYSTEM_VALUE_MYSQL=Wt.ATTR_NET_PEER_PORT=Wt.ATTR_NET_PEER_NAME=Wt.ATTR_DB_USER=Wt.ATTR_DB_SYSTEM=Wt.ATTR_DB_STATEMENT=Wt.ATTR_DB_NAME=Wt.ATTR_DB_CONNECTION_STRING=void 0;Wt.ATTR_DB_CONNECTION_STRING="db.connection_string";Wt.ATTR_DB_NAME="db.name";Wt.ATTR_DB_STATEMENT="db.statement";Wt.ATTR_DB_SYSTEM="db.system";Wt.ATTR_DB_USER="db.user";Wt.ATTR_NET_PEER_NAME="net.peer.name";Wt.ATTR_NET_PEER_PORT="net.peer.port";Wt.DB_SYSTEM_VALUE_MYSQL="mysql";Wt.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var NJ=y(Q_=>{"use strict";p();u();l();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.AttributeNames=void 0;var Hje;(function(t){t.MYSQL_VALUES="db.mysql.values"})(Hje=Q_.AttributeNames||(Q_.AttributeNames={}))});var bJ=y(qn=>{"use strict";p();u();l();Object.defineProperty(qn,"__esModule",{value:!0});qn.getPoolNameOld=qn.arrayStringifyHelper=qn.getSpanName=qn.getDbValues=qn.getDbQueryText=qn.getJDBCString=qn.getConfig=void 0;function Vje(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}qn.getConfig=Vje;function qje(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}qn.getJDBCString=qje;function Yje(t){return typeof t=="string"?t:t.sql}qn.getDbQueryText=Yje;function Wje(t,e){return SM(typeof t=="string"?e:e||t.values)}qn.getDbValues=Wje;function Kje(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}qn.getSpanName=Kje;function SM(t){return t?`[${t.toString()}]`:""}qn.arrayStringifyHelper=SM;function zje(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}qn.getPoolNameOld=zje});var OJ=y(ad=>{"use strict";p();u();l();Object.defineProperty(ad,"__esModule",{value:!0});ad.PACKAGE_NAME=ad.PACKAGE_VERSION=void 0;ad.PACKAGE_VERSION="0.57.0";ad.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var PJ=y(ly=>{"use strict";p();u();l();Object.defineProperty(ly,"__esModule",{value:!0});ly.MySQLInstrumentation=void 0;var Ur=(U(),D(J)),ko=he(),cd=(Le(),D(Xe)),Ki=IJ(),Xje=NJ(),Bu=bJ(),CJ=OJ(),AM=class extends ko.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(CJ.PACKAGE_NAME,CJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ko.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ko.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(Ki.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(e,n,r){this._connectionsUsageOld?.add(e,{state:r,name:n})}init(){return[new ko.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,ko.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,ko.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,ko.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolCallbacks(s,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,d=(0,Bu.getPoolNameOld)(e);r._connCountAdd(-c,d,"used"),r._connCountAdd(-a,d,"idle"),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),d=a[c].pool;r._setPoolCallbacks(d,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=Ur.context.active();return function(o,s){s&&((0,ko.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&Ur.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a={},{host:c,port:d,database:f,user:m}=(0,Bu.getConfig)(e.config),_=parseInt(d,10),g=(0,Bu.getDbQueryText)(o);r._dbSemconvStability&ko.SemconvStability.OLD&&(a[Ki.ATTR_DB_SYSTEM]=Ki.DB_SYSTEM_VALUE_MYSQL,a[Ki.ATTR_DB_CONNECTION_STRING]=(0,Bu.getJDBCString)(c,d,f),a[Ki.ATTR_DB_NAME]=f,a[Ki.ATTR_DB_USER]=m,a[Ki.ATTR_DB_STATEMENT]=g),r._dbSemconvStability&ko.SemconvStability.STABLE&&(a[cd.ATTR_DB_SYSTEM_NAME]=cd.DB_SYSTEM_NAME_VALUE_MYSQL,a[cd.ATTR_DB_NAMESPACE]=f,a[cd.ATTR_DB_QUERY_TEXT]=g),r._netSemconvStability&ko.SemconvStability.OLD&&(a[Ki.ATTR_NET_PEER_NAME]=c,isNaN(_)||(a[Ki.ATTR_NET_PEER_PORT]=_)),r._netSemconvStability&ko.SemconvStability.STABLE&&(a[cd.ATTR_SERVER_ADDRESS]=c,isNaN(_)||(a[cd.ATTR_SERVER_PORT]=_));let T=r.tracer.startSpan((0,Bu.getSpanName)(o),{kind:Ur.SpanKind.CLIENT,attributes:a});if(r.getConfig().enhancedDatabaseReporting){let b;Array.isArray(s)?b=s:arguments[2]&&(b=[s]),T.setAttribute(Xje.AttributeNames.MYSQL_VALUES,(0,Bu.getDbValues)(o,b))}let A=Array.from(arguments).findIndex(b=>typeof b=="function"),R=Ur.context.active();if(A===-1){let b=Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments));return Ur.context.bind(R,b),b.on("error",I=>T.setStatus({code:Ur.SpanStatusCode.ERROR,message:I.message})).on("end",()=>{T.end()})}else return r._wrap(arguments,A,r._patchCallbackQuery(T,R)),Ur.context.with(Ur.trace.setSpan(Ur.context.active(),T),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:Ur.SpanStatusCode.ERROR,message:o.message}),e.end(),Ur.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(e,n){let r=n||(0,Bu.getPoolNameOld)(e);e.on("connection",o=>{this._connCountAdd(1,r,"idle")}),e.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),e.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};ly.MySQLInstrumentation=AM});var xJ=y(py=>{"use strict";p();u();l();Object.defineProperty(py,"__esModule",{value:!0});py.MySQLInstrumentation=void 0;var Qje=PJ();Object.defineProperty(py,"MySQLInstrumentation",{enumerable:!0,get:function(){return Qje.MySQLInstrumentation}})});var vJ,MJ,LJ,Jje,wJ,DJ=S(()=>{p();u();l();vJ=B(xJ(),1);Be();MJ="Mysql",LJ=Z(MJ,()=>new vJ.MySQLInstrumentation({})),Jje=(()=>({name:MJ,setupOnce(){LJ()}})),wJ=Jje});var yM=y(fn=>{"use strict";p();u();l();Object.defineProperty(fn,"__esModule",{value:!0});fn.DB_SYSTEM_VALUE_MYSQL=fn.ATTR_NET_PEER_PORT=fn.ATTR_NET_PEER_NAME=fn.ATTR_DB_USER=fn.ATTR_DB_SYSTEM=fn.ATTR_DB_STATEMENT=fn.ATTR_DB_NAME=fn.ATTR_DB_CONNECTION_STRING=void 0;fn.ATTR_DB_CONNECTION_STRING="db.connection_string";fn.ATTR_DB_NAME="db.name";fn.ATTR_DB_STATEMENT="db.statement";fn.ATTR_DB_SYSTEM="db.system";fn.ATTR_DB_USER="db.user";fn.ATTR_NET_PEER_NAME="net.peer.name";fn.ATTR_NET_PEER_PORT="net.peer.port";fn.DB_SYSTEM_VALUE_MYSQL="mysql"});var IM=y(dy=>{"use strict";p();u();l();Object.defineProperty(dy,"__esModule",{value:!0});dy.addSqlCommenterComment=void 0;var RM=(U(),D(J)),Zje=Ge();function eBe(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function tBe(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function nBe(t,e){if(typeof e!="string"||e.length===0||eBe(e))return e;let n=new Zje.W3CTraceContextPropagator,r={};n.inject(RM.trace.setSpan(RM.ROOT_CONTEXT,t),r,RM.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=tBe(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}dy.addSqlCommenterComment=nBe});var UJ=y(jo=>{"use strict";p();u();l();Object.defineProperty(jo,"__esModule",{value:!0});jo.getConnectionPrototypeToInstrument=jo.once=jo.getSpanName=jo.getQueryText=jo.getConnectionAttributes=void 0;var J_=yM(),fy=he(),NM=(Le(),D(Xe));function rBe(t,e,n){let{host:r,port:o,database:s,user:i}=oBe(t),a={};e&fy.SemconvStability.OLD&&(a[J_.ATTR_DB_CONNECTION_STRING]=sBe(r,o,s),a[J_.ATTR_DB_NAME]=s,a[J_.ATTR_DB_USER]=i),e&fy.SemconvStability.STABLE&&(a[NM.ATTR_DB_NAMESPACE]=s);let c=parseInt(o,10);return n&fy.SemconvStability.OLD&&(a[J_.ATTR_NET_PEER_NAME]=r,isNaN(c)||(a[J_.ATTR_NET_PEER_PORT]=c)),n&fy.SemconvStability.STABLE&&(a[NM.ATTR_SERVER_ADDRESS]=r,isNaN(c)||(a[NM.ATTR_SERVER_PORT]=c)),a}jo.getConnectionAttributes=rBe;function oBe(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function sBe(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function iBe(t,e,n,r=!1,o=aBe){let[s,i]=typeof t=="string"?[t,n]:[t.sql,cBe(t)?n||t.values:n];try{return r?o(s):e&&i?e(s,i):s}catch{return"Could not determine the query due to an error in masking or formatting"}}jo.getQueryText=iBe;function aBe(t){return t.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function cBe(t){return"values"in t}function uBe(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}jo.getSpanName=uBe;var lBe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};jo.once=lBe;function pBe(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}jo.getConnectionPrototypeToInstrument=pBe});var kJ=y(ud=>{"use strict";p();u();l();Object.defineProperty(ud,"__esModule",{value:!0});ud.PACKAGE_NAME=ud.PACKAGE_VERSION=void 0;ud.PACKAGE_VERSION="0.57.0";ud.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var $J=y(my=>{"use strict";p();u();l();Object.defineProperty(my,"__esModule",{value:!0});my.MySQL2Instrumentation=void 0;var jJ=(U(),D(J)),ms=he(),bM=yM(),BJ=IM(),ld=UJ(),GJ=kJ(),OM=(Le(),D(Xe)),CM=[">=1.4.2 <4"],PM=class extends ms.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(GJ.PACKAGE_NAME,GJ.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ms.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ms.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,ms.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,ms.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new ms.InstrumentationNodeModuleDefinition("mysql2",CM,s=>(n(s),s),()=>{},[new ms.InstrumentationNodeModuleFile("mysql2/promise.js",CM,s=>(n(s),s),()=>{}),new ms.InstrumentationNodeModuleFile("mysql2/lib/connection.js",CM,s=>{let i=(0,ld.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,ld.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let{maskStatement:d,maskStatementHook:f,responseHook:m}=o.getConfig(),_=(0,ld.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),g=(0,ld.getQueryText)(s,e,c,d,f);o._dbSemconvStability&ms.SemconvStability.OLD&&(_[bM.ATTR_DB_SYSTEM]=bM.DB_SYSTEM_VALUE_MYSQL,_[bM.ATTR_DB_STATEMENT]=g),o._dbSemconvStability&ms.SemconvStability.STABLE&&(_[OM.ATTR_DB_SYSTEM_NAME]=OM.DB_SYSTEM_NAME_VALUE_MYSQL,_[OM.ATTR_DB_QUERY_TEXT]=g);let T=o.tracer.startSpan((0,ld.getSpanName)(s),{kind:jJ.SpanKind.CLIENT,attributes:_});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,BJ.addSqlCommenterComment)(T,s):Object.assign(s,{sql:(0,BJ.addSqlCommenterComment)(T,s.sql)}));let A=(0,ld.once)((R,b)=>{R?T.setStatus({code:jJ.SpanStatusCode.ERROR,message:R.message}):typeof m=="function"&&(0,ms.safeExecuteInTheMiddle)(()=>{m(T,{queryResults:b})},I=>{I&&o._diag.warn("Failed executing responseHook",I)},!0),T.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(A));let R=r.apply(this,arguments);return R.once("error",b=>{A(b)}).once("result",b=>{A(void 0,b)}),R}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(A)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(A)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};my.MySQL2Instrumentation=PM});var FJ=y(_y=>{"use strict";p();u();l();Object.defineProperty(_y,"__esModule",{value:!0});_y.MySQL2Instrumentation=void 0;var dBe=$J();Object.defineProperty(_y,"MySQL2Instrumentation",{enumerable:!0,get:function(){return dBe.MySQL2Instrumentation}})});var HJ,VJ,qJ,fBe,YJ,WJ=S(()=>{p();u();l();HJ=B(FJ(),1);Be();VJ="Mysql2",qJ=Z(VJ,()=>new HJ.MySQL2Instrumentation({responseHook(t){qe(t,"auto.db.otel.mysql2")}})),fBe=(()=>({name:VJ,setupOnce(){qJ()}})),YJ=fBe});var KJ=y(Yn=>{"use strict";p();u();l();Object.defineProperty(Yn,"__esModule",{value:!0});Yn.DB_SYSTEM_VALUE_REDIS=Yn.DB_SYSTEM_NAME_VALUE_REDIS=Yn.ATTR_NET_PEER_PORT=Yn.ATTR_NET_PEER_NAME=Yn.ATTR_DB_SYSTEM=Yn.ATTR_DB_STATEMENT=Yn.ATTR_DB_CONNECTION_STRING=void 0;Yn.ATTR_DB_CONNECTION_STRING="db.connection_string";Yn.ATTR_DB_STATEMENT="db.statement";Yn.ATTR_DB_SYSTEM="db.system";Yn.ATTR_NET_PEER_NAME="net.peer.name";Yn.ATTR_NET_PEER_PORT="net.peer.port";Yn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Yn.DB_SYSTEM_VALUE_REDIS="redis"});var zJ=y(hy=>{"use strict";p();u();l();Object.defineProperty(hy,"__esModule",{value:!0});hy.endSpan=void 0;var mBe=(U(),D(J)),_Be=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:mBe.SpanStatusCode.ERROR,message:e.message})),t.end()};hy.endSpan=_Be});var Ey=y(gy=>{"use strict";p();u();l();Object.defineProperty(gy,"__esModule",{value:!0});gy.defaultDbStatementSerializer=void 0;var hBe=[{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}],gBe=(t,e)=>{if(Array.isArray(e)&&e.length){let n=hBe.find(({regex:o})=>o.test(t))?.args??0,r=n>=0?e.slice(0,n):e;return e.length>r.length&&r.push(`[${e.length-n} other arguments]`),`${t} ${r.join(" ")}`}return t};gy.defaultDbStatementSerializer=gBe});var XJ=y(pd=>{"use strict";p();u();l();Object.defineProperty(pd,"__esModule",{value:!0});pd.PACKAGE_NAME=pd.PACKAGE_VERSION=void 0;pd.PACKAGE_VERSION="0.59.0";pd.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var eZ=y(Ty=>{"use strict";p();u();l();Object.defineProperty(Ty,"__esModule",{value:!0});Ty.IORedisInstrumentation=void 0;var ic=(U(),D(J)),kr=he(),ac=(Le(),D(Xe)),jr=KJ(),QJ=he(),Z_=zJ(),EBe=Ey(),JJ=XJ(),ZJ={requireParentSpan:!0},xM=class extends kr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(e={}){super(JJ.PACKAGE_NAME,JJ.PACKAGE_VERSION,{...ZJ,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,kr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,kr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...ZJ,...e})}init(){return[new kr.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,kr.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,kr.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||EBe.defaultDbStatementSerializer,a=ic.trace.getSpan(ic.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c={},{host:d,port:f}=this.options,m=i(o.name,o.args);r._dbSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,c[jr.ATTR_DB_STATEMENT]=m,c[jr.ATTR_DB_CONNECTION_STRING]=`redis://${d}:${f}`),r._dbSemconvStability&kr.SemconvStability.STABLE&&(c[ac.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,c[ac.ATTR_DB_QUERY_TEXT]=m),r._netSemconvStability&kr.SemconvStability.OLD&&(c[jr.ATTR_NET_PEER_NAME]=d,c[jr.ATTR_NET_PEER_PORT]=f),r._netSemconvStability&kr.SemconvStability.STABLE&&(c[ac.ATTR_SERVER_ADDRESS]=d,c[ac.ATTR_SERVER_PORT]=f);let _=r.tracer.startSpan(o.name,{kind:ic.SpanKind.CLIENT,attributes:c}),{requestHook:g}=s;g&&(0,QJ.safeExecuteInTheMiddle)(()=>g(_,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),T=>{T&&ic.diag.error("ioredis instrumentation: request hook failed",T)},!0);try{let T=e.apply(this,arguments),A=o.resolve;o.resolve=function(b){(0,QJ.safeExecuteInTheMiddle)(()=>s.responseHook?.(_,o.name,o.args,b),I=>{I&&ic.diag.error("ioredis instrumentation: response hook failed",I)},!0),(0,Z_.endSpan)(_,null),A(b)};let R=o.reject;return o.reject=function(b){(0,Z_.endSpan)(_,b),R(b)},T}catch(T){throw(0,Z_.endSpan)(_,T),T}}}_traceConnection(e){let n=this;return function(){let r=ic.trace.getSpan(ic.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o={},{host:s,port:i}=this.options;n._dbSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_DB_SYSTEM]=jr.DB_SYSTEM_VALUE_REDIS,o[jr.ATTR_DB_STATEMENT]="connect",o[jr.ATTR_DB_CONNECTION_STRING]=`redis://${s}:${i}`),n._dbSemconvStability&kr.SemconvStability.STABLE&&(o[ac.ATTR_DB_SYSTEM_NAME]=jr.DB_SYSTEM_NAME_VALUE_REDIS,o[ac.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&kr.SemconvStability.OLD&&(o[jr.ATTR_NET_PEER_NAME]=s,o[jr.ATTR_NET_PEER_PORT]=i),n._netSemconvStability&kr.SemconvStability.STABLE&&(o[ac.ATTR_SERVER_ADDRESS]=s,o[ac.ATTR_SERVER_PORT]=i);let a=n.tracer.startSpan("connect",{kind:ic.SpanKind.CLIENT,attributes:o});try{let c=e.apply(this,arguments);return(0,Z_.endSpan)(a,null),c}catch(c){throw(0,Z_.endSpan)(a,c),c}}}};Ty.IORedisInstrumentation=xM});var tZ=y(Sy=>{"use strict";p();u();l();Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IORedisInstrumentation=void 0;var TBe=eZ();Object.defineProperty(Sy,"IORedisInstrumentation",{enumerable:!0,get:function(){return TBe.IORedisInstrumentation}})});var Ay=y(dd=>{"use strict";p();u();l();Object.defineProperty(dd,"__esModule",{value:!0});dd.PACKAGE_NAME=dd.PACKAGE_VERSION=void 0;dd.PACKAGE_VERSION="0.59.0";dd.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var nZ=y(cc=>{"use strict";p();u();l();Object.defineProperty(cc,"__esModule",{value:!0});cc.getTracedCreateStreamTrace=cc.getTracedCreateClient=cc.endSpan=void 0;var eh=(U(),D(J)),SBe=(t,e)=>{e&&t.setStatus({code:eh.SpanStatusCode.ERROR,message:e.message}),t.end()};cc.endSpan=SBe;var ABe=t=>function(){let n=t.apply(this,arguments);return eh.context.bind(eh.context.active(),n)};cc.getTracedCreateClient=ABe;var yBe=t=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){eh.context.bind(eh.context.active(),n),this._patched_redis_stream=n}}),t.apply(this,arguments)};cc.getTracedCreateStreamTrace=yBe});var yy=y(Wn=>{"use strict";p();u();l();Object.defineProperty(Wn,"__esModule",{value:!0});Wn.DB_SYSTEM_VALUE_REDIS=Wn.DB_SYSTEM_NAME_VALUE_REDIS=Wn.ATTR_NET_PEER_PORT=Wn.ATTR_NET_PEER_NAME=Wn.ATTR_DB_SYSTEM=Wn.ATTR_DB_STATEMENT=Wn.ATTR_DB_CONNECTION_STRING=void 0;Wn.ATTR_DB_CONNECTION_STRING="db.connection_string";Wn.ATTR_DB_STATEMENT="db.statement";Wn.ATTR_DB_SYSTEM="db.system";Wn.ATTR_NET_PEER_NAME="net.peer.name";Wn.ATTR_NET_PEER_PORT="net.peer.port";Wn.DB_SYSTEM_NAME_VALUE_REDIS="redis";Wn.DB_SYSTEM_VALUE_REDIS="redis"});var oZ=y(Iy=>{"use strict";p();u();l();Object.defineProperty(Iy,"__esModule",{value:!0});Iy.RedisInstrumentationV2_V3=void 0;var ao=he(),Ry=nZ(),rZ=Ay(),th=(U(),D(J)),nh=(Le(),D(Xe)),Gu=yy(),RBe=Ey(),vM=class t extends ao.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(rZ.PACKAGE_NAME,rZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,ao.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,ao.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ao.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],e=>((0,ao.isWrapped)(e.RedisClient.prototype.internal_send_command)&&this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._wrap(e.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,ao.isWrapped)(e.RedisClient.prototype.create_stream)&&this._unwrap(e.RedisClient.prototype,"create_stream"),this._wrap(e.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,ao.isWrapped)(e.createClient)&&this._unwrap(e,"createClient"),this._wrap(e,"createClient",this._getPatchCreateClient()),e),e=>{e!==void 0&&(this._unwrap(e.RedisClient.prototype,"internal_send_command"),this._unwrap(e.RedisClient.prototype,"create_stream"),this._unwrap(e,"createClient"))})]}_getPatchInternalSendCommand(){let e=this;return function(r){return function(s){if(arguments.length!==1||typeof s!="object")return r.apply(this,arguments);let i=e.getConfig(),a=th.trace.getSpan(th.context.active())===void 0;if(i.requireParentSpan===!0&&a)return r.apply(this,arguments);let c=i?.dbStatementSerializer||RBe.defaultDbStatementSerializer,d={};e._semconvStability&ao.SemconvStability.OLD&&Object.assign(d,{[Gu.ATTR_DB_SYSTEM]:Gu.DB_SYSTEM_VALUE_REDIS,[Gu.ATTR_DB_STATEMENT]:c(s.command,s.args)}),e._semconvStability&ao.SemconvStability.STABLE&&Object.assign(d,{[nh.ATTR_DB_SYSTEM_NAME]:Gu.DB_SYSTEM_NAME_VALUE_REDIS,[nh.ATTR_DB_OPERATION_NAME]:s.command,[nh.ATTR_DB_QUERY_TEXT]:c(s.command,s.args)});let f=e.tracer.startSpan(`${t.COMPONENT}-${s.command}`,{kind:th.SpanKind.CLIENT,attributes:d});if(this.connection_options){let _={};e._semconvStability&ao.SemconvStability.OLD&&Object.assign(_,{[Gu.ATTR_NET_PEER_NAME]:this.connection_options.host,[Gu.ATTR_NET_PEER_PORT]:this.connection_options.port}),e._semconvStability&ao.SemconvStability.STABLE&&Object.assign(_,{[nh.ATTR_SERVER_ADDRESS]:this.connection_options.host,[nh.ATTR_SERVER_PORT]:this.connection_options.port}),f.setAttributes(_)}this.address&&e._semconvStability&ao.SemconvStability.OLD&&f.setAttribute(Gu.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let m=arguments[0].callback;if(m){let _=th.context.active();arguments[0].callback=function(T,A){if(i?.responseHook){let R=i.responseHook;(0,ao.safeExecuteInTheMiddle)(()=>{R(f,s.command,s.args,A)},b=>{b&&e._diag.error("Error executing responseHook",b)},!0)}return(0,Ry.endSpan)(f,T),th.context.with(_,m,this,...arguments)}}try{return r.apply(this,arguments)}catch(_){throw(0,Ry.endSpan)(f,_),_}}}}_getPatchCreateClient(){return function(n){return(0,Ry.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,Ry.getTracedCreateStreamTrace)(n)}}};Iy.RedisInstrumentationV2_V3=vM});var iZ=y(Ny=>{"use strict";p();u();l();Object.defineProperty(Ny,"__esModule",{value:!0});Ny.getClientAttributes=void 0;var MM=(Le(),D(Xe)),fd=yy(),sZ=he();function IBe(t,e,n){let r={};return n&sZ.SemconvStability.OLD&&Object.assign(r,{[fd.ATTR_DB_SYSTEM]:fd.DB_SYSTEM_VALUE_REDIS,[fd.ATTR_NET_PEER_NAME]:e?.socket?.host,[fd.ATTR_NET_PEER_PORT]:e?.socket?.port,[fd.ATTR_DB_CONNECTION_STRING]:NBe(t,e?.url)}),n&sZ.SemconvStability.STABLE&&Object.assign(r,{[MM.ATTR_DB_SYSTEM_NAME]:fd.DB_SYSTEM_NAME_VALUE_REDIS,[MM.ATTR_SERVER_ADDRESS]:e?.socket?.host,[MM.ATTR_SERVER_PORT]:e?.socket?.port}),r}Ny.getClientAttributes=IBe;function NBe(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var lZ=y(by=>{"use strict";p();u();l();Object.defineProperty(by,"__esModule",{value:!0});by.RedisInstrumentationV4_V5=void 0;var Bo=(U(),D(J)),st=he(),aZ=iZ(),bBe=Ey(),cZ=Ay(),LM=(Le(),D(Xe)),OBe=yy(),rh=Symbol("opentelemetry.instrumentation.redis.open_spans"),uZ=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),wM=class t extends st.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(e={}){super(cZ.PACKAGE_NAME,cZ.PACKAGE_VERSION,e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig(e),this._semconvStability=e.semconvStability?e.semconvStability:(0,st.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,st.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,st.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,st.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),this._wrap(i,"exec",this._getPatchMultiCommandsExec(!1)),(0,st.isWrapped)(i?.execAsPipeline)&&this._unwrap(i,"execAsPipeline"),this._wrap(i,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand"),this._wrap(i,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.exec)&&this._unwrap(i,"exec"),(0,st.isWrapped)(i?.addCommand)&&this._unwrap(i,"addCommand")}),o=new st.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],s=>{let i=s?.default?.prototype;return i?.multi&&((0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),this._wrap(i,"multi",this._getPatchRedisClientMulti())),i?.MULTI&&((0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),this._wrap(i,"MULTI",this._getPatchRedisClientMulti())),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand"),this._wrap(i,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(i,"connect",this._getPatchedClientConnect()),s},s=>{let i=s?.default?.prototype;(0,st.isWrapped)(i?.multi)&&this._unwrap(i,"multi"),(0,st.isWrapped)(i?.MULTI)&&this._unwrap(i,"MULTI"),(0,st.isWrapped)(i?.sendCommand)&&this._unwrap(i,"sendCommand")});return new st.InstrumentationNodeModuleDefinition(e,["^1.0.0","^5.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){if(i?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let a=i.executor;return i.executor=function(c,d){let f=e(c,d).args;return n._traceClientCommand(a,this,arguments,f)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(e){let n=this;return function(o){return function(){let i=o.apply(this,arguments);return typeof i?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),i):i.then(a=>{let c=this[rh];return n._endSpansWithRedisReplies(c,a,e),a}).catch(a=>{let c=this[rh];if(!c)n._diag.error("cannot find open spans to end for multi/pipeline");else{let d=a.constructor.name==="MultiErrorReply"?a.replies:new Array(c.length).fill(a);n._endSpansWithRedisReplies(c,d,e)}return Promise.reject(a)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[uZ]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,aZ.getClientAttributes)(e._diag,s,e._semconvStability),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Bo.SpanKind.CLIENT,attributes:i});return Bo.context.with(Bo.trace.setSpan(Bo.context.active(),a),()=>r.apply(this)).then(d=>(a.end(),d)).catch(d=>(a.recordException(d),a.setStatus({code:Bo.SpanStatusCode.ERROR,message:d.message}),a.end(),Promise.reject(d)))}}}_traceClientCommand(e,n,r,o){if(Bo.trace.getSpan(Bo.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[uZ],a=o[0],c=o.slice(1),d=this.getConfig().dbStatementSerializer||bBe.defaultDbStatementSerializer,f=(0,aZ.getClientAttributes)(this._diag,i,this._semconvStability);this._semconvStability&st.SemconvStability.STABLE&&(f[LM.ATTR_DB_OPERATION_NAME]=a);try{let g=d(a,c);g!=null&&(this._semconvStability&st.SemconvStability.OLD&&(f[OBe.ATTR_DB_STATEMENT]=g),this._semconvStability&st.SemconvStability.STABLE&&(f[LM.ATTR_DB_QUERY_TEXT]=g))}catch(g){this._diag.error("dbStatementSerializer throw an exception",g,{commandName:a})}let m=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Bo.SpanKind.CLIENT,attributes:f}),_=Bo.context.with(Bo.trace.setSpan(Bo.context.active(),m),()=>e.apply(n,r));if(typeof _?.then=="function")_.then(g=>{this._endSpanWithResponse(m,a,c,g,void 0)},g=>{this._endSpanWithResponse(m,a,c,null,g)});else{let g=_;g[rh]=g[rh]||[],g[rh].push({span:m,commandName:a,commandArgs:c})}return _}_endSpansWithRedisReplies(e,n,r=!1){if(!e)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");let o=e.map(a=>a.commandName),i=o.every(a=>a===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let a=0;a<e.length;a++){let{span:c,commandArgs:d}=e[a],f=n[a],[m,_]=f instanceof Error?[null,f]:[f,void 0];this._semconvStability&st.SemconvStability.STABLE&&c.setAttribute(LM.ATTR_DB_OPERATION_NAME,i),this._endSpanWithResponse(c,o[a],d,m,_)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Bo.SpanStatusCode.ERROR,message:s?.message})),e.end()}};by.RedisInstrumentationV4_V5=wM});var fZ=y(Oy=>{"use strict";p();u();l();Object.defineProperty(Oy,"__esModule",{value:!0});Oy.RedisInstrumentation=void 0;var CBe=he(),pZ=Ay(),PBe=oZ(),xBe=lZ(),dZ={requireParentSpan:!1},DM=class extends CBe.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(e={}){let n={...dZ,...e};super(pZ.PACKAGE_NAME,pZ.PACKAGE_VERSION,n),this.instrumentationV2_V3=new PBe.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new xBe.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(e={}){let n={...dZ,...e};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(e){super.setTracerProvider(e),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(e),this.instrumentationV4_V5.setTracerProvider(e))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};Oy.RedisInstrumentation=DM});var mZ=y(Cy=>{"use strict";p();u();l();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.RedisInstrumentation=void 0;var vBe=fZ();Object.defineProperty(Cy,"RedisInstrumentation",{enumerable:!0,get:function(){return vBe.RedisInstrumentation}})});function oh(t,e){return t.includes(e.toLowerCase())}function kM(t){return oh(UM,t)?"cache.get":oh(LBe,t)?"cache.put":void 0}function wBe(t,e){return e.some(n=>t.startsWith(n))}function hZ(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?_Z(o.map(s=>n(s))):["<unknown>"],r=e[0];return oh(MBe,t)&&r!=null?n(r):_Z(e.map(o=>n(o)))}catch{return}}function gZ(t,e,n){if(!kM(t))return!1;for(let r of e)if(wBe(r,n))return!0;return!1}function EZ(t){let e=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function _Z(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var MBe,UM,LBe,TZ=S(()=>{p();u();l();MBe=["get","set","setex"],UM=["get","mget"],LBe=["set","setex"]});var SZ,AZ,Py,sh,yZ,DBe,UBe,RZ,kBe,IZ,NZ=S(()=>{p();u();l();SZ=B(tZ(),1),AZ=B(mZ(),1);ne();Be();TZ();Py="Redis",sh={},yZ=(t,e,n,r)=>{t.setAttribute(fe,"auto.db.otel.redis");let o=hZ(e,n),s=kM(e);if(!o||!s||!sh.cachePrefixes||!gZ(e,o,sh.cachePrefixes))return;let i=ae(t).data["net.peer.name"],a=ae(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=EZ(r);c&&t.setAttribute(MC,c),oh(UM,e)&&c!==void 0&&t.setAttribute(xC,c>0),t.setAttributes({[Ee]:s,[vC]:o});let d=o.join(", ");t.updateName(sh.maxCacheKeyLength?Ra(d,sh.maxCacheKeyLength):d)},DBe=Z(`${Py}.IORedis`,()=>new SZ.IORedisInstrumentation({responseHook:yZ})),UBe=Z(`${Py}.Redis`,()=>new AZ.RedisInstrumentation({responseHook:yZ})),RZ=Object.assign(()=>{DBe(),UBe()},{id:Py}),kBe=((t={})=>({name:Py,setupOnce(){sh=t,RZ()}})),IZ=kBe});var bZ=y(xy=>{"use strict";p();u();l();Object.defineProperty(xy,"__esModule",{value:!0});xy.EVENT_LISTENERS_SET=void 0;xy.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var jM=y(ih=>{"use strict";p();u();l();Object.defineProperty(ih,"__esModule",{value:!0});ih.AttributeNames=void 0;var jBe;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(jBe=ih.AttributeNames||(ih.AttributeNames={}))});var BM=y(He=>{"use strict";p();u();l();Object.defineProperty(He,"__esModule",{value:!0});He.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=He.METRIC_DB_CLIENT_CONNECTION_COUNT=He.DB_SYSTEM_VALUE_POSTGRESQL=He.DB_CLIENT_CONNECTION_STATE_VALUE_USED=He.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=He.ATTR_NET_PEER_PORT=He.ATTR_NET_PEER_NAME=He.ATTR_DB_USER=He.ATTR_DB_SYSTEM=He.ATTR_DB_STATEMENT=He.ATTR_DB_NAME=He.ATTR_DB_CONNECTION_STRING=He.ATTR_DB_CLIENT_CONNECTION_STATE=He.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;He.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";He.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";He.ATTR_DB_CONNECTION_STRING="db.connection_string";He.ATTR_DB_NAME="db.name";He.ATTR_DB_STATEMENT="db.statement";He.ATTR_DB_SYSTEM="db.system";He.ATTR_DB_USER="db.user";He.ATTR_NET_PEER_NAME="net.peer.name";He.ATTR_NET_PEER_PORT="net.peer.port";He.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";He.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";He.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";He.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";He.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var GM=y(ah=>{"use strict";p();u();l();Object.defineProperty(ah,"__esModule",{value:!0});ah.SpanNames=void 0;var BBe;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(BBe=ah.SpanNames||(ah.SpanNames={}))});var LZ=y(Ue=>{"use strict";p();u();l();Object.defineProperty(Ue,"__esModule",{value:!0});Ue.sanitizedErrorMessage=Ue.isObjectWithTextString=Ue.getErrorMessage=Ue.patchClientConnectCallback=Ue.patchCallbackPGPool=Ue.updateCounter=Ue.getPoolName=Ue.patchCallback=Ue.handleExecutionResult=Ue.handleConfigQuery=Ue.shouldSkipInstrumentation=Ue.getSemanticAttributesFromPoolConnection=Ue.getSemanticAttributesFromConnection=Ue.getConnectionString=Ue.parseAndMaskConnectionString=Ue.parseNormalizedOperationName=Ue.getQuerySpanName=void 0;var uc=(U(),D(J)),vy=jM(),Go=(Le(),D(Xe)),Ot=BM(),$u=he(),OZ=GM();function CZ(t,e){if(!e)return OZ.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:PZ(e.text);return`${OZ.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Ue.getQuerySpanName=CZ;function PZ(t){let e=t.trim(),n=e.indexOf(" "),r=n===-1?e:e.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}Ue.parseNormalizedOperationName=PZ;function xZ(t){try{let e=new URL(t);return e.username="",e.password="",e.toString()}catch{return"postgresql://localhost:5432/"}}Ue.parseAndMaskConnectionString=xZ;function $M(t){if("connectionString"in t&&t.connectionString)return xZ(t.connectionString);let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Ue.getConnectionString=$M;function My(t){if(Number.isInteger(t))return t}function vZ(t,e){let n={};return e&$u.SemconvStability.OLD&&(n={...n,[Ot.ATTR_DB_SYSTEM]:Ot.DB_SYSTEM_VALUE_POSTGRESQL,[Ot.ATTR_DB_NAME]:t.database,[Ot.ATTR_DB_CONNECTION_STRING]:$M(t),[Ot.ATTR_DB_USER]:t.user,[Ot.ATTR_NET_PEER_NAME]:t.host,[Ot.ATTR_NET_PEER_PORT]:My(t.port)}),e&$u.SemconvStability.STABLE&&(n={...n,[Go.ATTR_DB_SYSTEM_NAME]:Go.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Go.ATTR_DB_NAMESPACE]:t.namespace,[Go.ATTR_SERVER_ADDRESS]:t.host,[Go.ATTR_SERVER_PORT]:My(t.port)}),n}Ue.getSemanticAttributesFromConnection=vZ;function GBe(t,e){let n;try{n=t.connectionString?new URL(t.connectionString):void 0}catch{n=void 0}let r={[vy.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[vy.AttributeNames.MAX_CLIENT]:t.maxClient};return e&$u.SemconvStability.OLD&&(r={...r,[Ot.ATTR_DB_SYSTEM]:Ot.DB_SYSTEM_VALUE_POSTGRESQL,[Ot.ATTR_DB_NAME]:n?.pathname.slice(1)??t.database,[Ot.ATTR_DB_CONNECTION_STRING]:$M(t),[Ot.ATTR_NET_PEER_NAME]:n?.hostname??t.host,[Ot.ATTR_NET_PEER_PORT]:Number(n?.port)||My(t.port),[Ot.ATTR_DB_USER]:n?.username??t.user}),e&$u.SemconvStability.STABLE&&(r={...r,[Go.ATTR_DB_SYSTEM_NAME]:Go.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Go.ATTR_DB_NAMESPACE]:t.namespace,[Go.ATTR_SERVER_ADDRESS]:n?.hostname??t.host,[Go.ATTR_SERVER_PORT]:Number(n?.port)||My(t.port)}),r}Ue.getSemanticAttributesFromPoolConnection=GBe;function $Be(t){return t.requireParentSpan===!0&&uc.trace.getSpan(uc.context.active())===void 0}Ue.shouldSkipInstrumentation=$Be;function FBe(t,e,n,r){let{connectionParameters:o}=this,s=o.database,i=CZ(s,r),a=t.startSpan(i,{kind:uc.SpanKind.CLIENT,attributes:vZ(o,n)});if(!r)return a;if(r.text&&(n&$u.SemconvStability.OLD&&a.setAttribute(Ot.ATTR_DB_STATEMENT,r.text),n&$u.SemconvStability.STABLE&&a.setAttribute(Go.ATTR_DB_QUERY_TEXT,r.text)),e.enhancedDatabaseReporting&&Array.isArray(r.values))try{let c=r.values.map(d=>d==null?"null":d instanceof Buffer?d.toString():typeof d=="object"?typeof d.toPostgres=="function"?d.toPostgres():JSON.stringify(d):d.toString());a.setAttribute(vy.AttributeNames.PG_VALUES,c)}catch(c){uc.diag.error("failed to stringify ",r.values,c)}return typeof r.name=="string"&&a.setAttribute(vy.AttributeNames.PG_PLAN,r.name),a}Ue.handleConfigQuery=FBe;function MZ(t,e,n){typeof t.responseHook=="function"&&(0,$u.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&uc.diag.error("Error running response hook",r)},!0)}Ue.handleExecutionResult=MZ;function HBe(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Go.ATTR_ERROR_TYPE]=i.code),i instanceof Error&&e.recordException(Ly(i)),e.setStatus({code:uc.SpanStatusCode.ERROR,message:i.message})):MZ(t,e,a),o(),e.end(),n.call(this,i,a)}}Ue.patchCallback=HBe;function VBe(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Ue.getPoolName=VBe;function qBe(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[Ot.ATTR_DB_CLIENT_CONNECTION_STATE]:Ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[Ot.ATTR_DB_CLIENT_CONNECTION_STATE]:Ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[Ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Ue.updateCounter=qBe;function YBe(t,e){return function(r,o,s){r&&(r instanceof Error&&t.recordException(Ly(r)),t.setStatus({code:uc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.call(this,r,o,s)}}Ue.patchCallbackPGPool=YBe;function WBe(t,e){return function(r){r&&(r instanceof Error&&t.recordException(Ly(r)),t.setStatus({code:uc.SpanStatusCode.ERROR,message:r.message})),t.end(),e.apply(this,arguments)}}Ue.patchClientConnectCallback=WBe;function KBe(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Ue.getErrorMessage=KBe;function zBe(t){return typeof t=="object"&&typeof t?.text=="string"}Ue.isObjectWithTextString=zBe;function Ly(t){let e=t?.name??"PostgreSQLError",n=t?.code??"UNKNOWN";return`PostgreSQL error of type '${e}' occurred (code: ${n})`}Ue.sanitizedErrorMessage=Ly});var wZ=y(md=>{"use strict";p();u();l();Object.defineProperty(md,"__esModule",{value:!0});md.PACKAGE_NAME=md.PACKAGE_VERSION=void 0;md.PACKAGE_VERSION="0.63.0";md.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var GZ=y(Dy=>{"use strict";p();u();l();Object.defineProperty(Dy,"__esModule",{value:!0});Dy.PgInstrumentation=void 0;var Tr=he(),Ke=(U(),D(J)),DZ=bZ(),ht=LZ(),UZ=IM(),kZ=wZ(),jZ=GM(),wy=Ge(),_s=(Le(),D(Xe)),ch=BM();function _d(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var FM=class extends Tr.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(e={}){super(kZ.PACKAGE_NAME,kZ.PACKAGE_VERSION,e),this._semconvStability=(0,Tr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(_s.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Ke.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(ch.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(ch.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Tr.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),s=new Tr.InstrumentationNodeModuleDefinition("pg",e,a=>{let c=_d(a);return this._patchPgClient(c.Client),a},a=>{let c=_d(a);return this._unpatchPgClient(c.Client),a},[o,r]),i=new Tr.InstrumentationNodeModuleDefinition("pg-pool",n,a=>{let c=_d(a);return(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect"),this._wrap(c.prototype,"connect",this._getPoolConnectPatch()),c},a=>{let c=_d(a);(0,Tr.isWrapped)(c.prototype.connect)&&this._unwrap(c.prototype,"connect")});return[s,i]}_patchPgClient(e){if(!e)return;let n=_d(e);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()),e}_unpatchPgClient(e){let n=_d(e);return(0,Tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s)||s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(jZ.SpanNames.CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromConnection(this,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchClientConnectCallback(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return BZ(i,a)}}recordOperationDuration(e,n){let r={},o=[_s.ATTR_DB_NAMESPACE,_s.ATTR_ERROR_TYPE,_s.ATTR_SERVER_PORT,_s.ATTR_SERVER_ADDRESS,_s.ATTR_DB_OPERATION_NAME];this._semconvStability&Tr.SemconvStability.OLD&&o.push(ch.ATTR_DB_SYSTEM),this._semconvStability&Tr.SemconvStability.STABLE&&o.push(_s.ATTR_DB_SYSTEM_NAME),o.forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,wy.hrTimeToMilliseconds)((0,wy.hrTimeDuration)(n,(0,wy.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(ht.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,wy.hrTime)(),i=o[0],a=typeof i=="string",c=ht.isObjectWithTextString(i),d=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,f={[ch.ATTR_DB_SYSTEM]:ch.DB_SYSTEM_VALUE_POSTGRESQL,[_s.ATTR_DB_NAMESPACE]:this.database,[_s.ATTR_SERVER_PORT]:this.connectionParameters.port,[_s.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};d?.text&&(f[_s.ATTR_DB_OPERATION_NAME]=ht.parseNormalizedOperationName(d?.text));let m=()=>{e.recordOperationDuration(f,s)},_=e.getConfig(),g=ht.handleConfigQuery.call(this,e.tracer,_,e._semconvStability,d);if(_.addSqlCommenterCommentToQueries&&(a?o[0]=(0,UZ.addSqlCommenterComment)(g,i):c&&!("name"in i)&&(o[0]={...i,text:(0,UZ.addSqlCommenterComment)(g,i.text)})),o.length>0){let R=Ke.trace.getSpan(Ke.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=ht.patchCallback(_,g,o[o.length-1],f,m),R&&(o[o.length-1]=Ke.context.bind(Ke.context.active(),o[o.length-1]));else if(typeof d?.callback=="function"){let b=ht.patchCallback(e.getConfig(),g,d.callback,f,m);R&&(b=Ke.context.bind(Ke.context.active(),b)),o[0].callback=b}}let{requestHook:T}=_;typeof T=="function"&&d&&(0,Tr.safeExecuteInTheMiddle)(()=>{let{database:R,host:b,port:I,user:C}=this.connectionParameters;T(g,{connection:{database:R,host:b,port:I,user:C},query:{text:d.text,values:d.values,name:d.name}})},R=>{R&&e._diag.error("Error running query hook",R)},!0);let A;try{A=n.apply(this,o)}catch(R){throw R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(R)}),g.end(),R}return A instanceof Promise?A.then(R=>new Promise(b=>{ht.handleExecutionResult(e.getConfig(),g,R),m(),g.end(),b(R)})).catch(R=>new Promise((b,I)=>{R instanceof Error&&g.recordException(ht.sanitizedErrorMessage(R)),g.setStatus({code:Ke.SpanStatusCode.ERROR,message:R.message}),m(),g.end(),I(R)})):A})}_setPoolConnectEventListeners(e){if(e[DZ.EVENT_LISTENERS_SET])return;let n=ht.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=ht.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[DZ.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){let s=e.getConfig();if(ht.shouldSkipInstrumentation(s))return n.call(this,o);if(e._setPoolConnectEventListeners(this),s.ignoreConnectSpans)return n.call(this,o);let i=e.tracer.startSpan(jZ.SpanNames.POOL_CONNECT,{kind:Ke.SpanKind.CLIENT,attributes:ht.getSemanticAttributesFromPoolConnection(this.options,e._semconvStability)});if(o){let c=Ke.trace.getSpan(Ke.context.active());o=ht.patchCallbackPGPool(i,o),c&&(o=Ke.context.bind(Ke.context.active(),o))}let a=Ke.context.with(Ke.trace.setSpan(Ke.context.active(),i),()=>n.call(this,o));return BZ(i,a)}}};Dy.PgInstrumentation=FM;function BZ(t,e){if(!(e instanceof Promise))return e;let n=e;return Ke.context.bind(Ke.context.active(),n.then(r=>(t.end(),r)).catch(r=>(r instanceof Error&&t.recordException(ht.sanitizedErrorMessage(r)),t.setStatus({code:Ke.SpanStatusCode.ERROR,message:ht.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var $Z=y(hd=>{"use strict";p();u();l();Object.defineProperty(hd,"__esModule",{value:!0});hd.AttributeNames=hd.PgInstrumentation=void 0;var XBe=GZ();Object.defineProperty(hd,"PgInstrumentation",{enumerable:!0,get:function(){return XBe.PgInstrumentation}});var QBe=jM();Object.defineProperty(hd,"AttributeNames",{enumerable:!0,get:function(){return QBe.AttributeNames}})});var FZ,HZ,VZ,JBe,qZ,YZ=S(()=>{p();u();l();FZ=B($Z(),1);Be();HZ="Postgres",VZ=Z(HZ,()=>new FZ.PgInstrumentation({requireParentSpan:!0,requestHook(t){qe(t,"auto.db.otel.postgres")}})),JBe=(()=>({name:HZ,setupOnce(){VZ()}})),qZ=JBe});var zi,ky,WZ,ZBe,Uy,HM,KZ,zZ,VM,eGe,XZ,QZ=S(()=>{p();u();l();U();zi=B(he(),1);Le();ne();Be();Du();ky="PostgresJs",WZ=[">=3.0.0 <4"],ZBe=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,Uy=Symbol("sentryPostgresConnectionContext"),HM=Symbol.for("sentry.instrumented.postgresjs"),KZ=Symbol.for("sentry.query.from.instrumented.sql"),zZ=Z(ky,t=>new VM({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),VM=class extends zi.InstrumentationBase{constructor(e){super("sentry-postgres-js",Pe,e)}init(){let e=new zi.InstrumentationNodeModuleDefinition("postgres",WZ,n=>{try{return this._patchPostgres(n)}catch(r){return bt&&N.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new zi.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,WZ,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),e}_patchPostgres(e){let n=typeof e=="function",r=n?e:e.default;if(typeof r!="function")return bt&&N.warn("postgres module does not export a function. Skipping instrumentation."),e;let o=this,s=function(...i){let a=Reflect.construct(r,i);return!a||typeof a!="function"?(bt&&N.warn("postgres() did not return a valid instance"),a):o._instrumentSqlInstance(a)};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}return n?s:(p_(e,"default",s),e)}_wrapQueryMethod(e,n,r){let o=this;return function(...s){let i=Reflect.apply(e,n,s);return i&&typeof i=="object"&&"handle"in i&&o._wrapSingleQueryHandle(i,r),i}}_wrapCallbackMethod(e,n,r){let o=this;return function(...s){let i=r[Uy];if(!(typeof s[s.length-1]=="function")){let m=Reflect.apply(e,n,s);return m&&typeof m.then=="function"?m.then(_=>o._instrumentSqlInstance(_,i)):m}let c=s.length===1?s[0]:s[1],d=function(m){let _=o._instrumentSqlInstance(m,i);return c(_)},f=s.length===1?[d]:[s[0],d];return Reflect.apply(e,n,f)}}_setConnectionAttributes(e,n){if(n&&(n.ATTR_DB_NAMESPACE&&e.setAttribute(Wf,n.ATTR_DB_NAMESPACE),n.ATTR_SERVER_ADDRESS&&e.setAttribute(Kf,n.ATTR_SERVER_ADDRESS),n.ATTR_SERVER_PORT!==void 0)){let r=parseInt(n.ATTR_SERVER_PORT,10);isNaN(r)||e.setAttribute(zf,r)}}_setOperationName(e,n,r){if(r){e.setAttribute(Dl,r);return}let o=n?.match(ZBe);o?.[1]&&e.setAttribute(Dl,o[1].toUpperCase())}_attachConnectionContext(e,n){let r=e;if(!r.options||typeof r.options!="object")return;let o=r.options,s=o.host?.[0]||"localhost",i=o.port?.[0]||5432,a={ATTR_DB_NAMESPACE:typeof o.database=="string"&&o.database!==""?o.database:void 0,ATTR_SERVER_ADDRESS:s,ATTR_SERVER_PORT:String(i)};n[Uy]=a}_instrumentSqlInstance(e,n){if(e[HM])return e;let r=this,o=new Proxy(e,{apply(s,i,a){let c=Reflect.apply(s,i,a);return c&&typeof c=="object"&&"handle"in c&&r._wrapSingleQueryHandle(c,o),c},get(s,i){let a=s[i];return typeof i!="string"||typeof a!="function"?a:i==="unsafe"||i==="file"?r._wrapQueryMethod(a,s,o):i==="begin"||i==="reserve"?r._wrapCallbackMethod(a,s,o):a}});return n?o[Uy]=n:this._attachConnectionContext(e,o),e[HM]=!0,o[HM]=!0,o}_wrapSingleQueryHandle(e,n){if(e.handle?.__sentryWrapped)return;e[KZ]=!0;let r=e.handle,o=this,s=async function(...i){if(!o._shouldCreateSpans())return r.apply(this,i);let a=o._reconstructQuery(e.strings),c=o._sanitizeSqlQuery(a);return Rt({name:c||"postgresjs.query",op:"db"},d=>{qe(d,"auto.db.postgresjs"),d.setAttributes({[_a]:"postgres",[fE]:c});let f=n?n[Uy]:void 0;o._setConnectionAttributes(d,f);let m=o.getConfig(),{requestHook:_}=m;_&&(0,zi.safeExecuteInTheMiddle)(()=>_(d,c,f),T=>{T&&(d.setAttribute("sentry.hook.error","requestHook failed"),bt&&N.error(`Error in requestHook for ${ky} integration:`,T))},!0);let g=this;g.resolve=new Proxy(g.resolve,{apply:(T,A,R)=>{try{o._setOperationName(d,c,R?.[0]?.command),d.end()}catch(b){bt&&N.error("Error ending span in resolve callback:",b)}return Reflect.apply(T,A,R)}}),g.reject=new Proxy(g.reject,{apply:(T,A,R)=>{try{d.setStatus({code:2,message:R?.[0]?.message||"unknown_error"}),d.setAttribute(mE,R?.[0]?.code||"unknown"),d.setAttribute(_E,R?.[0]?.name||"unknown"),o._setOperationName(d,c),d.end()}catch(b){bt&&N.error("Error ending span in reject callback:",b)}return Reflect.apply(T,A,R)}});try{return r.apply(this,i)}catch(T){throw d.setStatus({code:2,message:T instanceof Error?T.message:"unknown_error"}),d.end(),T}})};s.__sentryWrapped=!0,e.handle=s}_shouldCreateSpans(){let e=this.getConfig();return de.getSpan(V.active())!==void 0||!e.requireParentSpan}_reconstructQuery(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(e){return e?e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(e){let n=this,r=e.Query.prototype.handle;return e.Query.prototype.handle=async function(...o){if(this[KZ])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let s=n._reconstructQuery(this.strings),i=n._sanitizeSqlQuery(s);return Rt({name:i||"postgresjs.query",op:"db"},a=>{qe(a,"auto.db.postgresjs"),a.setAttributes({[_a]:"postgres",[fE]:i});let c=n.getConfig(),{requestHook:d}=c;d&&(0,zi.safeExecuteInTheMiddle)(()=>d(a,i,void 0),_=>{_&&(a.setAttribute("sentry.hook.error","requestHook failed"),bt&&N.error(`Error in requestHook for ${ky} integration:`,_))},!0);let f=this.resolve;this.resolve=new Proxy(f,{apply:(_,g,T)=>{try{n._setOperationName(a,i,T?.[0]?.command),a.end()}catch(A){bt&&N.error("Error ending span in resolve callback:",A)}return Reflect.apply(_,g,T)}});let m=this.reject;this.reject=new Proxy(m,{apply:(_,g,T)=>{try{a.setStatus({code:2,message:T?.[0]?.message||"unknown_error"}),a.setAttribute(mE,T?.[0]?.code||"unknown"),a.setAttribute(_E,T?.[0]?.name||"unknown"),n._setOperationName(a,i),a.end()}catch(A){bt&&N.error("Error ending span in reject callback:",A)}return Reflect.apply(_,g,T)}});try{return r.apply(this,o)}catch(_){throw a.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),a.end(),_}})},e.Query.prototype.handle.__sentry_original__=r,e}_unpatchQueryPrototype(e){return e.Query.prototype.handle.__sentry_original__&&(e.Query.prototype.handle=e.Query.prototype.handle.__sentry_original__),e}},eGe=(t=>({name:ky,setupOnce(){zZ(t)}})),XZ=eGe});var JZ=y(uh=>{"use strict";p();u();l();Object.defineProperty(uh,"__esModule",{value:!0});uh.SeverityNumber=void 0;var tGe;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(tGe=uh.SeverityNumber||(uh.SeverityNumber={}))});var By=y(gd=>{"use strict";p();u();l();Object.defineProperty(gd,"__esModule",{value:!0});gd.NOOP_LOGGER=gd.NoopLogger=void 0;var jy=class{emit(e){}};gd.NoopLogger=jy;gd.NOOP_LOGGER=new jy});var $y=y(Ed=>{"use strict";p();u();l();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.NOOP_LOGGER_PROVIDER=Ed.NoopLoggerProvider=void 0;var nGe=By(),Gy=class{getLogger(e,n,r){return new nGe.NoopLogger}};Ed.NoopLoggerProvider=Gy;Ed.NOOP_LOGGER_PROVIDER=new Gy});var YM=y(Fy=>{"use strict";p();u();l();Object.defineProperty(Fy,"__esModule",{value:!0});Fy.ProxyLogger=void 0;var rGe=By(),qM=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):rGe.NOOP_LOGGER}};Fy.ProxyLogger=qM});var KM=y(Hy=>{"use strict";p();u();l();Object.defineProperty(Hy,"__esModule",{value:!0});Hy.ProxyLoggerProvider=void 0;var oGe=$y(),sGe=YM(),WM=class{getLogger(e,n,r){var o;return(o=this._getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new sGe.ProxyLogger(this,e,n,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:oGe.NOOP_LOGGER_PROVIDER}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};Hy.ProxyLoggerProvider=WM});var ZZ=y(Vy=>{"use strict";p();u();l();Object.defineProperty(Vy,"__esModule",{value:!0});Vy._globalThis=void 0;Vy._globalThis=typeof globalThis=="object"?globalThis:global});var e7=y(qy=>{"use strict";p();u();l();Object.defineProperty(qy,"__esModule",{value:!0});qy._globalThis=void 0;var iGe=ZZ();Object.defineProperty(qy,"_globalThis",{enumerable:!0,get:function(){return iGe._globalThis}})});var t7=y(Yy=>{"use strict";p();u();l();Object.defineProperty(Yy,"__esModule",{value:!0});Yy._globalThis=void 0;var aGe=e7();Object.defineProperty(Yy,"_globalThis",{enumerable:!0,get:function(){return aGe._globalThis}})});var n7=y(ei=>{"use strict";p();u();l();Object.defineProperty(ei,"__esModule",{value:!0});ei.API_BACKWARDS_COMPATIBILITY_VERSION=ei.makeGetter=ei._global=ei.GLOBAL_LOGS_API_KEY=void 0;var cGe=t7();ei.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");ei._global=cGe._globalThis;function uGe(t,e,n){return r=>r===t?e:n}ei.makeGetter=uGe;ei.API_BACKWARDS_COMPATIBILITY_VERSION=1});var o7=y(Wy=>{"use strict";p();u();l();Object.defineProperty(Wy,"__esModule",{value:!0});Wy.LogsAPI=void 0;var $o=n7(),lGe=$y(),r7=KM(),zM=class t{constructor(){this._proxyLoggerProvider=new r7.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return $o._global[$o.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():($o._global[$o.GLOBAL_LOGS_API_KEY]=(0,$o.makeGetter)($o.API_BACKWARDS_COMPATIBILITY_VERSION,e,lGe.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=$o._global[$o.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call($o._global,$o.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete $o._global[$o.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new r7.ProxyLoggerProvider}};Wy.LogsAPI=zM});var XM=y(mn=>{"use strict";p();u();l();Object.defineProperty(mn,"__esModule",{value:!0});mn.logs=mn.ProxyLoggerProvider=mn.ProxyLogger=mn.NoopLoggerProvider=mn.NOOP_LOGGER_PROVIDER=mn.NoopLogger=mn.NOOP_LOGGER=mn.SeverityNumber=void 0;var pGe=JZ();Object.defineProperty(mn,"SeverityNumber",{enumerable:!0,get:function(){return pGe.SeverityNumber}});var s7=By();Object.defineProperty(mn,"NOOP_LOGGER",{enumerable:!0,get:function(){return s7.NOOP_LOGGER}});Object.defineProperty(mn,"NoopLogger",{enumerable:!0,get:function(){return s7.NoopLogger}});var i7=$y();Object.defineProperty(mn,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return i7.NOOP_LOGGER_PROVIDER}});Object.defineProperty(mn,"NoopLoggerProvider",{enumerable:!0,get:function(){return i7.NoopLoggerProvider}});var dGe=YM();Object.defineProperty(mn,"ProxyLogger",{enumerable:!0,get:function(){return dGe.ProxyLogger}});var fGe=KM();Object.defineProperty(mn,"ProxyLoggerProvider",{enumerable:!0,get:function(){return fGe.ProxyLoggerProvider}});var mGe=o7();mn.logs=mGe.LogsAPI.getInstance()});var a7=y(Td=>{"use strict";p();u();l();Object.defineProperty(Td,"__esModule",{value:!0});Td.disableInstrumentations=Td.enableInstrumentations=void 0;function _Ge(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}Td.enableInstrumentations=_Ge;function hGe(t){t.forEach(e=>e.disable())}Td.disableInstrumentations=hGe});var l7=y(Ky=>{"use strict";p();u();l();Object.defineProperty(Ky,"__esModule",{value:!0});Ky.registerInstrumentations=void 0;var c7=(U(),D(J)),gGe=XM(),u7=a7();function EGe(t){let e=t.tracerProvider||c7.trace.getTracerProvider(),n=t.meterProvider||c7.metrics.getMeterProvider(),r=t.loggerProvider||gGe.logs.getLoggerProvider(),o=t.instrumentations?.flat()??[];return(0,u7.enableInstrumentations)(o,e,n,r),()=>{(0,u7.disableInstrumentations)(o)}}Ky.registerInstrumentations=EGe});var T7=y(zy=>{"use strict";p();u();l();Object.defineProperty(zy,"__esModule",{value:!0});zy.satisfies=void 0;var eL=(U(),D(J)),_7=/^(?: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-]+)*))?$/,TGe=/^(?<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-]+)*))?$/,SGe={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function AGe(t,e,n){if(!yGe(t))return eL.diag.error(`Invalid version: ${t}`),!1;if(!e)return!0;e=e.replace(/([<>=~^]+)\s+/g,"$1");let r=bGe(t);if(!r)return!1;let o=[],s=h7(r,e,o,n);return s&&!n?.includePrerelease?IGe(r,o):s}zy.satisfies=AGe;function yGe(t){return typeof t=="string"&&_7.test(t)}function h7(t,e,n,r){if(e.includes("||")){let o=e.trim().split("||");for(let s of o)if(QM(t,s,n,r))return!0;return!1}else if(e.includes(" - "))e=WGe(e,r);else if(e.includes(" ")){let o=e.trim().replace(/\s{2,}/g," ").split(" ");for(let s of o)if(!QM(t,s,n,r))return!1;return!0}return QM(t,e,n,r)}function QM(t,e,n,r){if(e=NGe(e,r),e.includes(" "))return h7(t,e,n,r);{let o=OGe(e);return n.push(o),RGe(t,o)}}function RGe(t,e){if(e.invalid)return!1;if(!e.version||ZM(e.version))return!0;let n=d7(t.versionSegments||[],e.versionSegments||[]);if(n===0){let r=t.prereleaseSegments||[],o=e.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=d7(r,o)}return SGe[e.op]?.includes(n)}function IGe(t,e){return t.prerelease?e.some(n=>n.prerelease&&n.version===t.version):!0}function NGe(t,e){return t=t.trim(),t=qGe(t,e),t=VGe(t),t=YGe(t,e),t=t.trim(),t}function Sr(t){return!t||t.toLowerCase()==="x"||t==="*"}function bGe(t){let e=t.match(_7);if(!e){eL.diag.error(`Invalid version: ${t}`);return}let n=e.groups.version,r=e.groups.prerelease,o=e.groups.build,s=n.split("."),i=r?.split(".");return{op:void 0,version:n,versionSegments:s,versionSegmentCount:s.length,prerelease:r,prereleaseSegments:i,prereleaseSegmentCount:i?i.length:0,build:o}}function OGe(t){if(!t)return{};let e=t.match(TGe);if(!e)return eL.diag.error(`Invalid range: ${t}`),{invalid:!0};let n=e.groups.op,r=e.groups.version,o=e.groups.prerelease,s=e.groups.build,i=r.split("."),a=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:i,versionSegmentCount:i.length,prerelease:o,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:s}}function ZM(t){return t==="*"||t==="x"||t==="X"}function p7(t){let e=parseInt(t,10);return isNaN(e)?t:e}function CGe(t,e){if(typeof t==typeof e){if(typeof t=="number")return[t,e];if(typeof t=="string")return[t,e];throw new Error("Version segments can only be strings or numbers")}else return[String(t),String(e)]}function PGe(t,e){if(ZM(t)||ZM(e))return 0;let[n,r]=CGe(p7(t),p7(e));return n>r?1:n<r?-1:0}function d7(t,e){for(let n=0;n<Math.max(t.length,e.length);n++){let r=PGe(t[n]||"0",e[n]||"0");if(r!==0)return r}return 0}var g7="[a-zA-Z0-9-]",E7="0|[1-9]\\d*",xGe=`\\d*[a-zA-Z-]${g7}*`,vGe="((?:<|>)?=?)",f7=`(?:${E7}|${xGe})`,MGe=`(?:-(${f7}(?:\\.${f7})*))`,m7=`${g7}+`,LGe=`(?:\\+(${m7}(?:\\.${m7})*))`,JM=`${E7}|x|X|\\*`,lh=`[v=\\s]*(${JM})(?:\\.(${JM})(?:\\.(${JM})(?:${MGe})?${LGe}?)?)?`,wGe=`^${vGe}\\s*${lh}$`,DGe=new RegExp(wGe),UGe=`^\\s*(${lh})\\s+-\\s+(${lh})\\s*$`,kGe=new RegExp(UGe),jGe="(?:~>?)",BGe=`^${jGe}${lh}$`,GGe=new RegExp(BGe),$Ge="(?:\\^)",FGe=`^${$Ge}${lh}$`,HGe=new RegExp(FGe);function VGe(t){let e=GGe;return t.replace(e,(n,r,o,s,i)=>{let a;return Sr(r)?a="":Sr(o)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:Sr(s)?a=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:i?a=`>=${r}.${o}.${s}-${i} <${r}.${+o+1}.0-0`:a=`>=${r}.${o}.${s} <${r}.${+o+1}.0-0`,a})}function qGe(t,e){let n=HGe,r=e?.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{let d;return Sr(s)?d="":Sr(i)?d=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Sr(a)?s==="0"?d=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?s==="0"?i==="0"?d=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`:s==="0"?i==="0"?d=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:d=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:d=`>=${s}.${i}.${a} <${+s+1}.0.0-0`,d})}function YGe(t,e){let n=DGe;return t.replace(n,(r,o,s,i,a,c)=>{let d=Sr(s),f=d||Sr(i),m=f||Sr(a),_=m;return o==="="&&_&&(o=""),c=e?.includePrerelease?"-0":"",d?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&_?(f&&(i=0),a=0,o===">"?(o=">=",f?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",f?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):f?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:m&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),r})}function WGe(t,e){let n=kGe;return t.replace(n,(r,o,s,i,a,c,d,f,m,_,g,T)=>(Sr(s)?o="":Sr(i)?o=`>=${s}.0.0${e?.includePrerelease?"-0":""}`:Sr(a)?o=`>=${s}.${i}.0${e?.includePrerelease?"-0":""}`:c?o=`>=${o}`:o=`>=${o}${e?.includePrerelease?"-0":""}`,Sr(m)?f="":Sr(_)?f=`<${+m+1}.0.0-0`:Sr(g)?f=`<${m}.${+_+1}.0-0`:T?f=`<=${m}.${_}.${g}-${T}`:e?.includePrerelease?f=`<${m}.${_}.${+g+1}-0`:f=`<=${f}`,`${o} ${f}`.trim()))}});var tL=y(bn=>{"use strict";p();u();l();Object.defineProperty(bn,"__esModule",{value:!0});bn.massUnwrap=bn.unwrap=bn.massWrap=bn.wrap=void 0;var Ar=console.error.bind(console);function ph(t,e,n){let r=!!t[e]&&Object.prototype.propertyIsEnumerable.call(t,e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}var KGe=(t,e,n)=>{if(!t||!t[e]){Ar("no original function "+String(e)+" to wrap");return}if(!n){Ar("no wrapper function"),Ar(new Error().stack);return}let r=t[e];if(typeof r!="function"||typeof n!="function"){Ar("original object and wrapper must be functions");return}let o=n(r,e);return ph(o,"__original",r),ph(o,"__unwrap",()=>{t[e]===o&&ph(t,e,r)}),ph(o,"__wrapped",!0),ph(t,e,o),o};bn.wrap=KGe;var zGe=(t,e,n)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to wrap on modules");return}t.forEach(r=>{e.forEach(o=>{(0,bn.wrap)(r,o,n)})})};bn.massWrap=zGe;var XGe=(t,e)=>{if(!t||!t[e]){Ar("no function to unwrap."),Ar(new Error().stack);return}let n=t[e];if(!n.__unwrap)Ar("no original to unwrap to -- has "+String(e)+" already been unwrapped?");else{n.__unwrap();return}};bn.unwrap=XGe;var QGe=(t,e)=>{if(t)Array.isArray(t)||(t=[t]);else{Ar("must provide one or more modules to patch"),Ar(new Error().stack);return}if(!(e&&Array.isArray(e))){Ar("must provide one or more functions to unwrap on modules");return}t.forEach(n=>{e.forEach(r=>{(0,bn.unwrap)(n,r)})})};bn.massUnwrap=QGe;function dh(t){t&&t.logger&&(typeof t.logger!="function"?Ar("new logger isn't a function, not replacing"):Ar=t.logger)}bn.default=dh;dh.wrap=bn.wrap;dh.massWrap=bn.massWrap;dh.unwrap=bn.unwrap;dh.massUnwrap=bn.massUnwrap});var S7=y(Qy=>{"use strict";p();u();l();Object.defineProperty(Qy,"__esModule",{value:!0});Qy.InstrumentationAbstract=void 0;var nL=(U(),D(J)),JGe=XM(),Xy=tL(),rL=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this.setConfig(r),this._diag=nL.diag.createComponentLogger({namespace:e}),this._tracer=nL.trace.getTracer(e,n),this._meter=nL.metrics.getMeter(e,n),this._logger=JGe.logs.getLogger(e,n),this._updateMetricInstruments()}_wrap=Xy.wrap;_unwrap=Xy.unwrap;_massWrap=Xy.massWrap;_massUnwrap=Xy.massUnwrap;get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};Qy.InstrumentationAbstract=rL});var A7=y(lc=>{"use strict";p();u();l();Object.defineProperty(lc,"__esModule",{value:!0});lc.ModuleNameTrie=lc.ModuleNameSeparator=void 0;lc.ModuleNameSeparator="/";var Jy=class{hooks=[];children=new Map},oL=class{_trie=new Jy;_counter=0;insert(e){let n=this._trie;for(let r of e.moduleName.split(lc.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new Jy,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(lc.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};lc.ModuleNameTrie=oL});var R7=y(Zy=>{"use strict";p();u();l();Object.defineProperty(Zy,"__esModule",{value:!0});Zy.RequireInTheMiddleSingleton=void 0;var ZGe=om(),y7=require("path"),sL=A7(),e$e=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),iL=class t{_moduleNameTrie=new sL.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new ZGe.Hook(null,{internals:!0},(e,n,r)=>{let o=t$e(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return e$e?new t:this._instance=this._instance??new t}};Zy.RequireInTheMiddleSingleton=iL;function t$e(t){return y7.sep!==sL.ModuleNameSeparator?t.split(y7.sep).join(sL.ModuleNameSeparator):t}});var P7=y(Fu=>{p();u();l();var I7=[],aL=new WeakMap,N7=new WeakMap,b7=new Map,O7=[],n$e={set(t,e,n){let r=aL.get(t),o=r&&r[e];return typeof o=="function"?o(n):!0},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=N7.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=aL.get(t),o=r&&r[e];return typeof o=="function"?o(n.value):!0}};function r$e(t,e,n,r,o){b7.set(t,o),aL.set(e,n),N7.set(e,r);let s=new Proxy(e,n$e);I7.forEach(i=>i(t,s,o)),O7.push([t,s,o])}var C7=!1;function o$e(){return C7}function s$e(t){C7=t}Fu.register=r$e;Fu.importHooks=I7;Fu.specifiers=b7;Fu.toHook=O7;Fu.getExperimentalPatchInternals=o$e;Fu.setExperimentalPatchInternals=s$e});var D7=y((hGt,Sd)=>{p();u();l();var x7=require("path"),i$e=JE(),{fileURLToPath:v7}=require("url"),{MessageChannel:a$e}=require("worker_threads"),{importHooks:cL,specifiers:c$e,toHook:u$e,getExperimentalPatchInternals:l$e}=P7();function L7(t){cL.push(t),u$e.forEach(([e,n,r])=>t(e,n,r))}function w7(t){let e=cL.indexOf(t);e>-1&&cL.splice(e,1)}function M7(t,e,n,r){let o=t(e,n,r);o&&o!==e&&"default"in e&&(e.default=o)}var uL;function p$e(){let{port1:t,port2:e}=new a$e,n=0,r;uL=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(d=>{r=d}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function fh(t,e,n){if(!(this instanceof fh))return new fh(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;uL&&Array.isArray(t)&&uL(t),this._iitmHook=(o,s,i)=>{let a=o,c=o.startsWith("node:"),d;if(c)o=o.replace(/^node:/,"");else{if(o.startsWith("file://")){let m=Error.stackTraceLimit;Error.stackTraceLimit=0;try{o=v7(o)}catch{}Error.stackTraceLimit=m}let f=i$e(o);f&&(o=f.name,d=f.basedir)}if(t)for(let f of t){let m=f===o,_=f===i;if(m||_){if(d){if(r)o=o+x7.sep+x7.relative(d,v7(a));else if(!l$e()&&!_&&!d.endsWith(c$e.get(a)))continue}M7(n,s,o,d)}}else M7(n,s,o,d)},L7(this._iitmHook)}fh.prototype.unhook=function(){w7(this._iitmHook)};Sd.exports=fh;Sd.exports.Hook=fh;Sd.exports.addHook=L7;Sd.exports.removeHook=w7;Sd.exports.createAddHookMessageChannel=p$e});var lL=y(pc=>{"use strict";p();u();l();Object.defineProperty(pc,"__esModule",{value:!0});pc.isWrapped=pc.safeExecuteInTheMiddleAsync=pc.safeExecuteInTheMiddle=void 0;function d$e(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}pc.safeExecuteInTheMiddle=d$e;async function f$e(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}pc.safeExecuteInTheMiddleAsync=f$e;function m$e(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}pc.isWrapped=m$e});var j7=y(eR=>{"use strict";p();u();l();Object.defineProperty(eR,"__esModule",{value:!0});eR.InstrumentationBase=void 0;var mh=require("path"),U7=require("util"),_$e=T7(),pL=tL(),h$e=S7(),g$e=R7(),E$e=D7(),_h=(U(),D(J)),T$e=om(),S$e=require("fs"),A$e=lL(),dL=class extends h$e.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=g$e.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(e,n,r){super(e,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(e,n,r)=>{if((0,A$e.isWrapped)(e[n])&&this._unwrap(e,n),U7.types.isProxy(e)){let o=(0,pL.wrap)(Object.assign({},e),n,r);return Object.defineProperty(e,n,{value:o}),o}else return(0,pL.wrap)(e,n,r)};_unwrap=(e,n)=>U7.types.isProxy(e)?Object.defineProperty(e,n,{value:e[n]}):(0,pL.unwrap)(e,n);_massWrap=(e,n,r)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(o=>{n.forEach(s=>{this._wrap(o,s,r)})})};_massUnwrap=(e,n)=>{if(e)Array.isArray(e)||(e=[e]);else{_h.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){_h.diag.error("must provide one or more functions to wrap on modules");return}e.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,S$e.readFileSync)(mh.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{_h.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let s=this._extractPackageVersion(o);if(e.moduleVersion=s,e.name===r)return k7(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let i=e.files??[],a=mh.normalize(r);return i.filter(d=>d.name===a).filter(d=>k7(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:o}),f.patch(d,e.moduleVersion)):d),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&mh.isAbsolute(a)){let d=mh.parse(a);a=d.name,c=d.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=mh.isAbsolute(e.name)?new T$e.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new E$e.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};eR.InstrumentationBase=dL;function k7(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,_$e.satisfies)(e,r,{includePrerelease:n}))}});var B7=y(tR=>{"use strict";p();u();l();Object.defineProperty(tR,"__esModule",{value:!0});tR.normalize=void 0;var y$e=require("path");Object.defineProperty(tR,"normalize",{enumerable:!0,get:function(){return y$e.normalize}})});var G7=y(Ad=>{"use strict";p();u();l();Object.defineProperty(Ad,"__esModule",{value:!0});Ad.normalize=Ad.InstrumentationBase=void 0;var R$e=j7();Object.defineProperty(Ad,"InstrumentationBase",{enumerable:!0,get:function(){return R$e.InstrumentationBase}});var I$e=B7();Object.defineProperty(Ad,"normalize",{enumerable:!0,get:function(){return I$e.normalize}})});var fL=y(yd=>{"use strict";p();u();l();Object.defineProperty(yd,"__esModule",{value:!0});yd.normalize=yd.InstrumentationBase=void 0;var $7=G7();Object.defineProperty(yd,"InstrumentationBase",{enumerable:!0,get:function(){return $7.InstrumentationBase}});Object.defineProperty(yd,"normalize",{enumerable:!0,get:function(){return $7.normalize}})});var F7=y(nR=>{"use strict";p();u();l();Object.defineProperty(nR,"__esModule",{value:!0});nR.InstrumentationNodeModuleDefinition=void 0;var mL=class{name;supportedVersions;patch;unpatch;files;constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};nR.InstrumentationNodeModuleDefinition=mL});var H7=y(rR=>{"use strict";p();u();l();Object.defineProperty(rR,"__esModule",{value:!0});rR.InstrumentationNodeModuleFile=void 0;var N$e=fL(),_L=class{supportedVersions;patch;unpatch;name;constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,N$e.normalize)(e)}};rR.InstrumentationNodeModuleFile=_L});var V7=y(Hu=>{"use strict";p();u();l();Object.defineProperty(Hu,"__esModule",{value:!0});Hu.semconvStabilityFromStr=Hu.SemconvStability=void 0;var oR;(function(t){t[t.STABLE=1]="STABLE",t[t.OLD=2]="OLD",t[t.DUPLICATE=3]="DUPLICATE"})(oR=Hu.SemconvStability||(Hu.SemconvStability={}));function b$e(t,e){let n=oR.OLD,r=e?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===t+"/dup"){n=oR.DUPLICATE;break}else o.toLowerCase()===t&&(n=oR.STABLE);return n}Hu.semconvStabilityFromStr=b$e});var Y7=y(Kt=>{"use strict";p();u();l();Object.defineProperty(Kt,"__esModule",{value:!0});Kt.semconvStabilityFromStr=Kt.SemconvStability=Kt.safeExecuteInTheMiddleAsync=Kt.safeExecuteInTheMiddle=Kt.isWrapped=Kt.InstrumentationNodeModuleFile=Kt.InstrumentationNodeModuleDefinition=Kt.InstrumentationBase=Kt.registerInstrumentations=void 0;var O$e=l7();Object.defineProperty(Kt,"registerInstrumentations",{enumerable:!0,get:function(){return O$e.registerInstrumentations}});var C$e=fL();Object.defineProperty(Kt,"InstrumentationBase",{enumerable:!0,get:function(){return C$e.InstrumentationBase}});var P$e=F7();Object.defineProperty(Kt,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return P$e.InstrumentationNodeModuleDefinition}});var x$e=H7();Object.defineProperty(Kt,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return x$e.InstrumentationNodeModuleFile}});var hL=lL();Object.defineProperty(Kt,"isWrapped",{enumerable:!0,get:function(){return hL.isWrapped}});Object.defineProperty(Kt,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return hL.safeExecuteInTheMiddle}});Object.defineProperty(Kt,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return hL.safeExecuteInTheMiddleAsync}});var q7=V7();Object.defineProperty(Kt,"SemconvStability",{enumerable:!0,get:function(){return q7.SemconvStability}});Object.defineProperty(Kt,"semconvStabilityFromStr",{enumerable:!0,get:function(){return q7.semconvStabilityFromStr}})});function L$e(){let t=Rd[EL];return t?.helper?t.helper:Rd[gL]?.helper}function w$e(t){let e={helper:t};Rd[EL]=e,Rd[gL]=e}function D$e(){delete Rd[EL],delete Rd[gL]}function j$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}function z7(t,e,n,r,o){if(X7(e.name,o))return;let s={attributes:e.attributes,kind:j$e(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let d=r.get(c);return d?{context:{spanId:d,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)z7(t,c,n,r,o);i.end(e.endTime)})}function W7(t,e){return G$e(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function G$e(t){return t!=null&&typeof t.then=="function"}function X7(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var sR,v$e,M$e,gL,EL,Rd,U$e,k$e,B$e,Q7,K7,$$e,F$e,J7,Z7=S(()=>{p();u();l();U();sR=B(Y7(),1);U();v$e={name:"@prisma/instrumentation-contract",version:"7.2.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"}},M$e=v$e.version.split(".")[0],gL="PRISMA_INSTRUMENTATION",EL=`V${M$e}_PRISMA_INSTRUMENTATION`,Rd=globalThis;U$e=process.env.PRISMA_SHOW_ALL_TRACES==="true",k$e="00-10-10-00";B$e=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:t,ignoreSpanTypes:e}){this.tracerProvider=t,this.ignoreSpanTypes=e}isEnabled(){return!0}getTraceParent(t){let e=de.getSpanContext(t??V.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:k$e}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)z7(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return V.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!U$e)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(X7(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return W7(s,e(s,r))}return n.startActiveSpan(o,t,s=>W7(s,e(s,r)))}};Q7={name:"@prisma/instrumentation",version:"7.2.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},K7=Q7.version,$$e=Q7.name,F$e="@prisma/client",J7=class extends sR.InstrumentationBase{tracerProvider;constructor(t={}){super($$e,K7,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new sR.InstrumentationNodeModuleDefinition(F$e,[K7])]}enable(){let t=this._config;w$e(new B$e({tracerProvider:this.tracerProvider??de.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]}))}disable(){D$e()}isEnabled(){return L$e()!==void 0}}});function H$e(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function tee(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}function V$e(t){switch(t){case"client":return Ze.CLIENT;case"internal":default:return Ze.INTERNAL}}var eee,TL,q$e,nee,ree=S(()=>{p();u();l();U();Z7();ne();Be();eee="Prisma";TL=class extends J7{constructor(e){super(e?.instrumentationConfig)}enable(){super.enable();let e=tee();H$e(e)&&(e.createEngineSpan=n=>{let r=de.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Ut(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(s=>{let i=V$e(s.kind),a=s.parent_span_id,c=s.span_id,d=s.trace_id,f=s.links?.map(_=>({context:{traceId:_.trace_id,spanId:_.span_id,traceFlags:rr.SAMPLED}})),m=de.setSpanContext(V.active(),{traceId:d,spanId:a,traceFlags:rr.SAMPLED});V.with(m,()=>{let _={generateTraceId:()=>d,generateSpanId:()=>c};r._idGenerator=_,r.startSpan(s.name,{kind:i,links:f,startTime:s.start_time,attributes:s.attributes}).end(s.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};q$e=Z(eee,t=>new TL(t)),nee=t=>({name:eee,setupOnce(){q$e(t)},setup(e){tee()&&e.on("spanStart",n=>{let r=ae(n);r.description?.startsWith("prisma:")&&n.setAttribute(fe,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var oee=y(Id=>{"use strict";p();u();l();Object.defineProperty(Id,"__esModule",{value:!0});Id.PACKAGE_NAME=Id.PACKAGE_VERSION=void 0;Id.PACKAGE_VERSION="0.57.0";Id.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var SL=y(ti=>{"use strict";p();u();l();Object.defineProperty(ti,"__esModule",{value:!0});ti.HapiLifecycleMethodNames=ti.HapiLayerType=ti.handlerPatched=ti.HapiComponentName=void 0;ti.HapiComponentName="@hapi/hapi";ti.handlerPatched=Symbol("hapi-handler-patched");ti.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ti.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var see=y(iR=>{"use strict";p();u();l();Object.defineProperty(iR,"__esModule",{value:!0});iR.ATTR_HTTP_METHOD=void 0;iR.ATTR_HTTP_METHOD="http.method"});var AL=y(hh=>{"use strict";p();u();l();Object.defineProperty(hh,"__esModule",{value:!0});hh.AttributeNames=void 0;var Y$e;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(Y$e=hh.AttributeNames||(hh.AttributeNames={}))});var cee=y(zt=>{"use strict";p();u();l();Object.defineProperty(zt,"__esModule",{value:!0});zt.getPluginFromInput=zt.getExtMetadata=zt.getRouteMetadata=zt.isPatchableExtMethod=zt.isDirectExtInput=zt.isLifecycleExtEventObj=zt.isLifecycleExtType=zt.getPluginName=void 0;var iee=(Le(),D(Xe)),W$e=see(),gh=SL(),dc=AL(),aee=he();function K$e(t){return t.name?t.name:t.pkg.name}zt.getPluginName=K$e;var z$e=t=>typeof t=="string"&&gh.HapiLifecycleMethodNames.has(t);zt.isLifecycleExtType=z$e;var X$e=t=>{let e=t?.type;return e!==void 0&&(0,zt.isLifecycleExtType)(e)};zt.isLifecycleExtEventObj=X$e;var Q$e=t=>Array.isArray(t)&&t.length<=3&&(0,zt.isLifecycleExtType)(t[0])&&typeof t[1]=="function";zt.isDirectExtInput=Q$e;var J$e=t=>!Array.isArray(t);zt.isPatchableExtMethod=J$e;var Z$e=(t,e,n)=>{let r={[iee.ATTR_HTTP_ROUTE]:t.path};e&aee.SemconvStability.OLD&&(r[W$e.ATTR_HTTP_METHOD]=t.method),e&aee.SemconvStability.STABLE&&(r[iee.ATTR_HTTP_REQUEST_METHOD]=t.method);let o;return n?(r[dc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.PLUGIN,r[dc.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${t.path}`):(r[dc.AttributeNames.HAPI_TYPE]=gh.HapiLayerType.ROUTER,o=`route - ${t.path}`),{attributes:r,name:o}};zt.getRouteMetadata=Z$e;var eFe=(t,e)=>e?{attributes:{[dc.AttributeNames.EXT_TYPE]:t,[dc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT,[dc.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[dc.AttributeNames.EXT_TYPE]:t,[dc.AttributeNames.HAPI_TYPE]:gh.HapiLayerType.EXT},name:`ext - ${t}`};zt.getExtMetadata=eFe;var tFe=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;zt.getPluginFromInput=tFe});var pee=y(aR=>{"use strict";p();u();l();Object.defineProperty(aR,"__esModule",{value:!0});aR.HapiInstrumentation=void 0;var co=(U(),D(J)),uee=Ge(),Eh=he(),lee=oee(),Th=SL(),Xi=cee(),yL=class extends Eh.InstrumentationBase{_semconvStability;constructor(e={}){super(lee.PACKAGE_NAME,lee.PACKAGE_VERSION,e),this._semconvStability=(0,Eh.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Eh.InstrumentationNodeModuleDefinition(Th.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,Eh.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,Eh.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Xi.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Xi.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Xi.isLifecycleExtType)(c.type)){let d=c,f=r._wrapExtMethods(d.method,c.type,n);d.method=f,i[a]=d}}return e.apply(this,s)}else if((0,Xi.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Xi.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Xi.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",d=>n._getServerRoutePatch.bind(n)(d,r)),s._wrap(a,"ext",d=>n._getServerExtPatch.bind(n)(d,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Xi.isPatchableExtMethod)(e))return e[Th.handlerPatched]===!0?e:(e[Th.handlerPatched]=!0,async function(...i){if(co.trace.getSpan(co.context.active())===void 0)return await e.apply(this,i);let a=(0,Xi.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await co.context.with(co.trace.setSpan(co.context.active(),c),e,void 0,...i)}catch(d){throw c.recordException(d),c.setStatus({code:co.SpanStatusCode.ERROR,message:d.message}),d}finally{c.end()}});return e}_wrapRouteHandler(e,n){let r=this;if(e[Th.handlerPatched]===!0)return e;e[Th.handlerPatched]=!0;let o=s=>async function(...i){if(co.trace.getSpan(co.context.active())===void 0)return await s.call(this,...i);let a=(0,uee.getRPCMetadata)(co.context.active());a?.type===uee.RPCType.HTTP&&(a.route=e.path);let c=(0,Xi.getRouteMetadata)(e,r._semconvStability,n),d=r.tracer.startSpan(c.name,{attributes:c.attributes});try{return await co.context.with(co.trace.setSpan(co.context.active(),d),()=>s.call(this,...i))}catch(f){throw d.recordException(f),d.setStatus({code:co.SpanStatusCode.ERROR,message:f.message}),f}finally{d.end()}};if(typeof e.handler=="function")e.handler=o(e.handler);else if(typeof e.options=="function"){let s=e.options;e.options=function(i){let a=s(i);return typeof a.handler=="function"&&(a.handler=o(a.handler)),a}}else typeof e.options?.handler=="function"&&(e.options.handler=o(e.options.handler));return e}};aR.HapiInstrumentation=yL});var dee=y(Nd=>{"use strict";p();u();l();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.AttributeNames=Nd.HapiInstrumentation=void 0;var nFe=pee();Object.defineProperty(Nd,"HapiInstrumentation",{enumerable:!0,get:function(){return nFe.HapiInstrumentation}});var rFe=AL();Object.defineProperty(Nd,"AttributeNames",{enumerable:!0,get:function(){return rFe.AttributeNames}})});var fee,mee,_ee,oFe,hee,gee=S(()=>{p();u();l();fee=B(dee(),1);Be();mee="Hapi",_ee=Z(mee,()=>new fee.HapiInstrumentation),oFe=(()=>({name:mee,setupOnce(){_ee()}})),hee=oFe});var fc,Sh,RL=S(()=>{p();u();l();fc={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Sh={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var uR,sFe,iFe,cR,Eee=S(()=>{p();u();l();U();uR=B(he(),1);ne();RL();sFe="@sentry/instrumentation-hono",iFe="0.0.1",cR=class extends uR.InstrumentationBase{constructor(e={}){super(sFe,iFe,e)}init(){return[new uR.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],e=>this._patch(e))]}_patch(e){let n=this;class r extends e.Hono{constructor(...s){super(...s),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{e.Hono=r}catch{return{...e,Hono:r}}return e}_patchHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_patchOnHandler(){let e=this;return function(n){return function(...o){let s=o.slice(2);return n.apply(this,[...o.slice(0,2),...s.map(i=>e._wrapHandler(i))])}}}_patchMiddlewareHandler(){let e=this;return function(n){return function(...o){if(typeof o[0]=="string"){let s=o[0];if(o.length===1)return n.apply(this,[s]);let i=o.slice(1);return n.apply(this,[s,...i.map(a=>e._wrapHandler(a))])}return n.apply(this,o.map(s=>e._wrapHandler(s)))}}}_wrapHandler(e){let n=this;return function(r,o){if(!n.isEnabled())return e.apply(this,[r,o]);let s=r.req.path,i=n.tracer.startSpan(s);return V.with(de.setSpan(V.active(),i),()=>n._safeExecute(()=>{let a=e.apply(this,[r,o]);if(ur(a))return a.then(c=>{let d=n._determineHandlerType(c);return i.setAttributes({[fc.HONO_TYPE]:d,[fc.HONO_NAME]:d===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),c});{let c=n._determineHandlerType(a);return i.setAttributes({[fc.HONO_TYPE]:c,[fc.HONO_NAME]:c===Sh.REQUEST_HANDLER?s:e.name||"anonymous"}),n.getConfig().responseHook?.(i),a}},()=>i.end(),a=>{n._handleError(i,a),i.end()}))}}_safeExecute(e,n,r){try{let o=e();return ur(o)?o.then(()=>n(),s=>r(s)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(e){return e===void 0?Sh.MIDDLEWARE:Sh.REQUEST_HANDLER}_handleError(e,n){n instanceof Error&&(e.setStatus({code:it.ERROR,message:n.message}),e.recordException(n))}}});function aFe(t){let e=ae(t).data,n=e[fc.HONO_TYPE];if(e[Ee]||!n)return;t.setAttributes({[fe]:"auto.http.otel.hono",[Ee]:`${n}.hono`});let r=e[fc.HONO_NAME];if(typeof r=="string"&&t.updateName(r),ge()===bo()){bt&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=e[br],s=e[Ri];typeof o=="string"&&typeof s=="string"&&ge().setTransactionName(`${s} ${o}`)}var Tee,See,cFe,Aee,yee=S(()=>{p();u();l();Le();ne();Be();Du();RL();Eee();Tee="Hono";See=Z(Tee,()=>new cR({responseHook:t=>{aFe(t)}})),cFe=(()=>({name:Tee,setupOnce(){See()}})),Aee=cFe});var lR=y(Ah=>{"use strict";p();u();l();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.KoaLayerType=void 0;var uFe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(uFe=Ah.KoaLayerType||(Ah.KoaLayerType={}))});var Ree=y(bd=>{"use strict";p();u();l();Object.defineProperty(bd,"__esModule",{value:!0});bd.PACKAGE_NAME=bd.PACKAGE_VERSION=void 0;bd.PACKAGE_VERSION="0.59.0";bd.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var IL=y(yh=>{"use strict";p();u();l();Object.defineProperty(yh,"__esModule",{value:!0});yh.AttributeNames=void 0;var lFe;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(lFe=yh.AttributeNames||(yh.AttributeNames={}))});var Nee=y(Od=>{"use strict";p();u();l();Object.defineProperty(Od,"__esModule",{value:!0});Od.isLayerIgnored=Od.getMiddlewareMetadata=void 0;var Iee=lR(),pR=IL(),pFe=(Le(),D(Xe)),dFe=(t,e,n,r)=>n?{attributes:{[pR.AttributeNames.KOA_NAME]:r?.toString(),[pR.AttributeNames.KOA_TYPE]:Iee.KoaLayerType.ROUTER,[pFe.ATTR_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[pR.AttributeNames.KOA_NAME]:e.name??"middleware",[pR.AttributeNames.KOA_TYPE]:Iee.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`};Od.getMiddlewareMetadata=dFe;var fFe=(t,e)=>!!(Array.isArray(e?.ignoreLayersType)&&e?.ignoreLayersType?.includes(t));Od.isLayerIgnored=fFe});var bee=y(dR=>{"use strict";p();u();l();Object.defineProperty(dR,"__esModule",{value:!0});dR.kLayerPatched=void 0;dR.kLayerPatched=Symbol("koa-layer-patched")});var Mee=y(fR=>{"use strict";p();u();l();Object.defineProperty(fR,"__esModule",{value:!0});fR.KoaInstrumentation=void 0;var ni=(U(),D(J)),Rh=he(),Oee=lR(),Cee=Ree(),Pee=Nee(),xee=Ge(),vee=bee(),NL=class extends Rh.InstrumentationBase{constructor(e={}){super(Cee.PACKAGE_NAME,Cee.PACKAGE_VERSION,e)}init(){return new Rh.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Rh.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){ni.diag.debug("Patching @koa/router dispatch");let r=e.router?.stack??[];for(let o of r){let s=o.path,i=o.stack;for(let a=0;a<i.length;a++){let c=i[a];i[a]=this._patchLayer(c,!0,s)}}return e}_patchLayer(e,n,r){let o=n?Oee.KoaLayerType.ROUTER:Oee.KoaLayerType.MIDDLEWARE;return e[vee.kLayerPatched]===!0||(0,Pee.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(ni.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[vee.kLayerPatched]=!0,ni.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(ni.trace.getSpan(ni.context.active())===void 0)return e(s,i);let c=(0,Pee.getMiddlewareMetadata)(s,e,n,r),d=this.tracer.startSpan(c.name,{attributes:c.attributes}),f=(0,xee.getRPCMetadata)(ni.context.active());f?.type===xee.RPCType.HTTP&&s._matchedRoute&&(f.route=s._matchedRoute.toString());let{requestHook:m}=this.getConfig();m&&(0,Rh.safeExecuteInTheMiddle)(()=>m(d,{context:s,middlewareLayer:e,layerType:o}),g=>{g&&ni.diag.error("koa instrumentation: request hook failed",g)},!0);let _=ni.trace.setSpan(ni.context.active(),d);return ni.context.with(_,async()=>{try{return await e(s,i)}catch(g){throw d.recordException(g),g}finally{d.end()}})})}};fR.KoaInstrumentation=NL});var Lee=y(mc=>{"use strict";p();u();l();Object.defineProperty(mc,"__esModule",{value:!0});mc.KoaLayerType=mc.AttributeNames=mc.KoaInstrumentation=void 0;var mFe=Mee();Object.defineProperty(mc,"KoaInstrumentation",{enumerable:!0,get:function(){return mFe.KoaInstrumentation}});var _Fe=IL();Object.defineProperty(mc,"AttributeNames",{enumerable:!0,get:function(){return _Fe.AttributeNames}});var hFe=lR();Object.defineProperty(mc,"KoaLayerType",{enumerable:!0,get:function(){return hFe.KoaLayerType}})});var wee,Dee,Uee,gFe,kee,jee=S(()=>{p();u();l();wee=B(Lee(),1);Le();ne();Be();Du();Dee="Koa",Uee=Z(Dee,wee.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){qe(e,"auto.http.otel.koa");let r=ae(e).data,o=r["koa.type"];o&&e.setAttribute(Ee,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),ge()===bo()){bt&&N.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[br],a=n.context?.request?.method?.toUpperCase()||"GET";i&&ge().setTransactionName(`${a} ${i}`)}})),gFe=((t={})=>({name:Dee,setupOnce(){Uee(t)}})),kee=gFe});var bL=y(hs=>{"use strict";p();u();l();Object.defineProperty(hs,"__esModule",{value:!0});hs.ConnectNames=hs.ConnectTypes=hs.AttributeNames=void 0;var EFe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(EFe=hs.AttributeNames||(hs.AttributeNames={}));var TFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(TFe=hs.ConnectTypes||(hs.ConnectTypes={}));var SFe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(SFe=hs.ConnectNames||(hs.ConnectNames={}))});var Bee=y(Cd=>{"use strict";p();u();l();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.PACKAGE_NAME=Cd.PACKAGE_VERSION=void 0;Cd.PACKAGE_VERSION="0.54.0";Cd.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Gee=y(mR=>{"use strict";p();u();l();Object.defineProperty(mR,"__esModule",{value:!0});mR._LAYERS_STORE_PROPERTY=void 0;mR._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var $ee=y(hc=>{"use strict";p();u();l();Object.defineProperty(hc,"__esModule",{value:!0});hc.generateRoute=hc.replaceCurrentStackRoute=hc.addNewStackLayer=void 0;var AFe=(U(),D(J)),_c=Gee(),yFe=t=>{Array.isArray(t[_c._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,_c._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[_c._LAYERS_STORE_PROPERTY].push("/");let e=t[_c._LAYERS_STORE_PROPERTY].length;return()=>{e===t[_c._LAYERS_STORE_PROPERTY].length?t[_c._LAYERS_STORE_PROPERTY].pop():AFe.diag.warn("Connect: Trying to pop the stack multiple time")}};hc.addNewStackLayer=yFe;var RFe=(t,e)=>{e&&t[_c._LAYERS_STORE_PROPERTY].splice(-1,1,e)};hc.replaceCurrentStackRoute=RFe;var IFe=t=>t[_c._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);hc.generateRoute=IFe});var Vee=y(gc=>{"use strict";p();u();l();Object.defineProperty(gc,"__esModule",{value:!0});gc.ConnectInstrumentation=gc.ANONYMOUS_NAME=void 0;var NFe=(U(),D(J)),Fee=Ge(),Pd=bL(),Hee=Bee(),_R=he(),bFe=(Le(),D(Xe)),OL=$ee();gc.ANONYMOUS_NAME="anonymous";var CL=class extends _R.InstrumentationBase{constructor(e={}){super(Hee.PACKAGE_NAME,Hee.PACKAGE_VERSION,e)}init(){return[new _R.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,_R.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,_R.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=Pd.ConnectTypes.REQUEST_HANDLER,s=Pd.ConnectNames.REQUEST_HANDLER,o=e):(r=Pd.ConnectTypes.MIDDLEWARE,s=Pd.ConnectNames.MIDDLEWARE,o=n.name||gc.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[bFe.ATTR_HTTP_ROUTE]:e.length>0?e:"/",[Pd.AttributeNames.CONNECT_TYPE]:r,[Pd.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],d=arguments[i],f=arguments[a],m=arguments[c];(0,OL.replaceCurrentStackRoute)(d,e);let _=(0,Fee.getRPCMetadata)(NFe.context.active());e&&_?.type===Fee.RPCType.HTTP&&(_.route=(0,OL.generateRoute)(d));let g="";e?g=`request handler - ${e}`:g=`middleware - ${n.name||gc.ANONYMOUS_NAME}`;let T=r._startSpan(e,n);r._diag.debug("start span",g);let A=!1;function R(){A?r._diag.debug(`span ${T.name} - already finished`):(A=!0,r._diag.debug(`finishing span ${T.name}`),T.end()),f.removeListener("close",R)}return f.addListener("close",R),arguments[c]=r._patchNext(m,R),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,OL.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};gc.ConnectInstrumentation=CL});var Yee=y(Fo=>{"use strict";p();u();l();Object.defineProperty(Fo,"__esModule",{value:!0});Fo.ConnectTypes=Fo.ConnectNames=Fo.AttributeNames=Fo.ANONYMOUS_NAME=Fo.ConnectInstrumentation=void 0;var qee=Vee();Object.defineProperty(Fo,"ConnectInstrumentation",{enumerable:!0,get:function(){return qee.ConnectInstrumentation}});Object.defineProperty(Fo,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return qee.ANONYMOUS_NAME}});var PL=bL();Object.defineProperty(Fo,"AttributeNames",{enumerable:!0,get:function(){return PL.AttributeNames}});Object.defineProperty(Fo,"ConnectNames",{enumerable:!0,get:function(){return PL.ConnectNames}});Object.defineProperty(Fo,"ConnectTypes",{enumerable:!0,get:function(){return PL.ConnectTypes}})});var Wee,Kee,zee,OFe,Xee,Qee=S(()=>{p();u();l();Wee=B(Yee(),1);Be();Kee="Connect",zee=Z(Kee,()=>new Wee.ConnectInstrumentation),OFe=(()=>({name:Kee,setupOnce(){zee()}})),Xee=OFe});var Jee=y(_n=>{"use strict";p();u();l();Object.defineProperty(_n,"__esModule",{value:!0});_n.DB_SYSTEM_VALUE_MSSQL=_n.ATTR_NET_PEER_PORT=_n.ATTR_NET_PEER_NAME=_n.ATTR_DB_USER=_n.ATTR_DB_SYSTEM=_n.ATTR_DB_STATEMENT=_n.ATTR_DB_SQL_TABLE=_n.ATTR_DB_NAME=void 0;_n.ATTR_DB_NAME="db.name";_n.ATTR_DB_SQL_TABLE="db.sql.table";_n.ATTR_DB_STATEMENT="db.statement";_n.ATTR_DB_SYSTEM="db.system";_n.ATTR_DB_USER="db.user";_n.ATTR_NET_PEER_NAME="net.peer.name";_n.ATTR_NET_PEER_PORT="net.peer.port";_n.DB_SYSTEM_VALUE_MSSQL="mssql"});var Zee=y(xd=>{"use strict";p();u();l();Object.defineProperty(xd,"__esModule",{value:!0});xd.once=xd.getSpanName=void 0;function CFe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}xd.getSpanName=CFe;var PFe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};xd.once=PFe});var ete=y(vd=>{"use strict";p();u();l();Object.defineProperty(vd,"__esModule",{value:!0});vd.PACKAGE_NAME=vd.PACKAGE_VERSION=void 0;vd.PACKAGE_VERSION="0.30.0";vd.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var ste=y(Tc=>{"use strict";p();u();l();Object.defineProperty(Tc,"__esModule",{value:!0});Tc.TediousInstrumentation=Tc.INJECTED_CTX=void 0;var Md=(U(),D(J)),xFe=require("events"),ri=he(),Vu=(Le(),D(Xe)),Ec=Jee(),tte=Zee(),nte=ete(),ote=Symbol("opentelemetry.instrumentation-tedious.current-database");Tc.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var rte=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function hR(t){Object.defineProperty(this,ote,{value:t,writable:!0})}var xL=class t extends ri.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(e={}){super(nte.PACKAGE_NAME,nte.PACKAGE_VERSION,e),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,ri.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,ri.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new ri.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of rte)(0,ri.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,e));return(0,ri.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of rte)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){return hR.call(this,this.config?.options?.database),this.removeListener("databaseChange",hR),this.on("databaseChange",hR),this.once("end",()=>{this.removeListener("databaseChange",hR)}),e.apply(this,arguments)}}_buildTraceparent(e){let n=e.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||Md.TraceFlags.NONE).toString(16)}`}_injectContextInfo(e,n,r){return new Promise(o=>{try{let s="set context_info @opentelemetry_traceparent",i=new n.Request(s,c=>{o()});Object.defineProperty(i,Tc.INJECTED_CTX,{value:!0});let a=Buffer.from(r,"utf8");i.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,a,{length:a.length}),e.execSql(i)}catch{o()}})}_shouldInjectFor(e){return e==="execSql"||e==="execSqlBatch"||e==="callProcedure"||e==="execute"}_patchQuery(e,n){return r=>{let o=this;function s(i){if(i?.[Tc.INJECTED_CTX])return r.apply(this,arguments);if(!(i instanceof xFe.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),r.apply(this,arguments);let a=0,c=0,d=()=>c++,f=()=>a++,m=this[ote],_=(O=>O.sqlTextOrProcedure==="sp_prepare"&&O.parametersByName?.stmt?.value?O.parametersByName.stmt.value:O.sqlTextOrProcedure)(i),g={};o._dbSemconvStability&ri.SemconvStability.OLD&&(g[Ec.ATTR_DB_SYSTEM]=Ec.DB_SYSTEM_VALUE_MSSQL,g[Ec.ATTR_DB_NAME]=m,g[Ec.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,g[Ec.ATTR_DB_STATEMENT]=_,g[Ec.ATTR_DB_SQL_TABLE]=i.table),o._dbSemconvStability&ri.SemconvStability.STABLE&&(g[Vu.ATTR_DB_NAMESPACE]=m,g[Vu.ATTR_DB_SYSTEM_NAME]=Vu.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,g[Vu.ATTR_DB_QUERY_TEXT]=_,g[Vu.ATTR_DB_COLLECTION_NAME]=i.table),o._netSemconvStability&ri.SemconvStability.OLD&&(g[Ec.ATTR_NET_PEER_NAME]=this.config?.server,g[Ec.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&ri.SemconvStability.STABLE&&(g[Vu.ATTR_SERVER_ADDRESS]=this.config?.server,g[Vu.ATTR_SERVER_PORT]=this.config?.options?.port);let T=o.tracer.startSpan((0,tte.getSpanName)(e,m,_,i.table),{kind:Md.SpanKind.CLIENT,attributes:g}),A=(0,tte.once)(O=>{i.removeListener("done",d),i.removeListener("doneInProc",d),i.removeListener("doneProc",f),i.removeListener("error",A),this.removeListener("end",A),T.setAttribute("tedious.procedure_count",a),T.setAttribute("tedious.statement_count",c),O&&T.setStatus({code:Md.SpanStatusCode.ERROR,message:O.message}),T.end()});i.on("done",d),i.on("doneInProc",d),i.on("doneProc",f),i.once("error",A),this.on("end",A),typeof i.callback=="function"?o._wrap(i,"callback",o._patchCallbackQuery(A)):o._diag.error("Expected request.callback to be a function");let R=()=>Md.context.with(Md.trace.setSpan(Md.context.active(),T),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(e)))return R();let C=o._buildTraceparent(T);o._injectContextInfo(this,n,C).finally(R)}return Object.defineProperty(s,"length",{value:r.length,writable:!1}),s}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};Tc.TediousInstrumentation=xL});var ite=y(gR=>{"use strict";p();u();l();Object.defineProperty(gR,"__esModule",{value:!0});gR.TediousInstrumentation=void 0;var vFe=ste();Object.defineProperty(gR,"TediousInstrumentation",{enumerable:!0,get:function(){return vFe.TediousInstrumentation}})});var ate,MFe,cte,ute,LFe,lte,pte=S(()=>{p();u();l();ate=B(ite(),1);ne();Be();MFe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),cte="Tedious",ute=Z(cte,()=>new ate.TediousInstrumentation({})),LFe=(()=>{let t;return{name:cte,setupOnce(){let e=ute();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=ae(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";MFe.has(s)&&n.setAttribute(fe,"auto.db.otel.tedious")}))}}}),lte=LFe});var dte=y(Ld=>{"use strict";p();u();l();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.PACKAGE_NAME=Ld.PACKAGE_VERSION=void 0;Ld.PACKAGE_VERSION="0.54.0";Ld.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var mte=y(ER=>{"use strict";p();u();l();Object.defineProperty(ER,"__esModule",{value:!0});ER.GenericPoolInstrumentation=void 0;var wd=(U(),D(J)),qu=he(),fte=dte(),vL="generic-pool",ML=class extends qu.InstrumentationBase{_isDisabled=!1;constructor(e={}){super(fte.PACKAGE_NAME,fte.PACKAGE_VERSION,e)}init(){return[new qu.InstrumentationNodeModuleDefinition(vL,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(vL,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,qu.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new qu.InstrumentationNodeModuleDefinition(vL,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,qu.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=wd.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return wd.context.with(wd.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=wd.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return wd.context.with(wd.trace.setSpan(i,a),()=>{e.call(this,(c,d)=>{if(a.end(),o)return o(c,d)},s)})}}};ER.GenericPoolInstrumentation=ML});var _te=y(TR=>{"use strict";p();u();l();Object.defineProperty(TR,"__esModule",{value:!0});TR.GenericPoolInstrumentation=void 0;var wFe=mte();Object.defineProperty(TR,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return wFe.GenericPoolInstrumentation}})});var hte,gte,Ete,DFe,Tte,Ste=S(()=>{p();u();l();hte=B(_te(),1);ne();Be();gte="GenericPool",Ete=Z(gte,()=>new hte.GenericPoolInstrumentation({})),DFe=(()=>{let t;return{name:gte,setupOnce(){let e=Ete();t=f_(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=ae(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(fe,"auto.db.otel.generic_pool")}))}}}),Tte=DFe});var LL=y(oi=>{"use strict";p();u();l();Object.defineProperty(oi,"__esModule",{value:!0});oi.ATTR_NET_PEER_PORT=oi.ATTR_NET_PEER_NAME=oi.ATTR_MESSAGING_SYSTEM=oi.ATTR_MESSAGING_OPERATION=void 0;oi.ATTR_MESSAGING_OPERATION="messaging.operation";oi.ATTR_MESSAGING_SYSTEM="messaging.system";oi.ATTR_NET_PEER_NAME="net.peer.name";oi.ATTR_NET_PEER_PORT="net.peer.port"});var wL=y(Ct=>{"use strict";p();u();l();Object.defineProperty(Ct,"__esModule",{value:!0});Ct.ATTR_MESSAGING_CONVERSATION_ID=Ct.OLD_ATTR_MESSAGING_MESSAGE_ID=Ct.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=Ct.ATTR_MESSAGING_URL=Ct.ATTR_MESSAGING_PROTOCOL_VERSION=Ct.ATTR_MESSAGING_PROTOCOL=Ct.MESSAGING_OPERATION_VALUE_PROCESS=Ct.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=Ct.ATTR_MESSAGING_DESTINATION_KIND=Ct.ATTR_MESSAGING_DESTINATION=void 0;Ct.ATTR_MESSAGING_DESTINATION="messaging.destination";Ct.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";Ct.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";Ct.MESSAGING_OPERATION_VALUE_PROCESS="process";Ct.ATTR_MESSAGING_PROTOCOL="messaging.protocol";Ct.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";Ct.ATTR_MESSAGING_URL="messaging.url";Ct.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";Ct.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";Ct.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var DL=y(Yu=>{"use strict";p();u();l();Object.defineProperty(Yu,"__esModule",{value:!0});Yu.DEFAULT_CONFIG=Yu.EndOperation=void 0;var UFe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(UFe=Yu.EndOperation||(Yu.EndOperation={}));Yu.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var Ite=y(Pt=>{"use strict";p();u();l();Object.defineProperty(Pt,"__esModule",{value:!0});Pt.isConfirmChannelTracing=Pt.unmarkConfirmChannelTracing=Pt.markConfirmChannelTracing=Pt.getConnectionAttributesFromUrl=Pt.getConnectionAttributesFromServer=Pt.normalizeExchange=Pt.CONNECTION_ATTRIBUTES=Pt.CHANNEL_CONSUME_TIMEOUT_TIMER=Pt.CHANNEL_SPANS_NOT_ENDED=Pt.MESSAGE_STORED_SPAN=void 0;var UL=(U(),D(J)),Sc=he(),SR=(Le(),D(Xe)),Ih=LL(),AR=wL();Pt.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Pt.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Pt.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Pt.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var kL=(0,UL.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),kFe=t=>t!==""?t:"<default>";Pt.normalizeExchange=kFe;var jFe=t=>t.replace(/:[^:@/]*@/,":***@"),Ate=(t,e)=>t||(e==="AMQP"?5672:5671),yte=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},Rte=t=>t||"localhost",si=(t,e,n,r)=>n?{[e]:n}:(UL.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),BFe=t=>{let e=t.serverProperties.product?.toLowerCase?.();return e?{[Ih.ATTR_MESSAGING_SYSTEM]:e}:{}};Pt.getConnectionAttributesFromServer=BFe;var GFe=(t,e)=>{let n={[AR.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let r=t,o=yte(r?.protocol);Object.assign(n,{...si(t,AR.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let s=Rte(r?.hostname);e&Sc.SemconvStability.OLD&&Object.assign(n,{...si(t,Ih.ATTR_NET_PEER_NAME,s,"hostname")}),e&Sc.SemconvStability.STABLE&&Object.assign(n,{...si(t,SR.ATTR_SERVER_ADDRESS,s,"hostname")});let i=Ate(r.port,o);e&Sc.SemconvStability.OLD&&Object.assign(n,si(t,Ih.ATTR_NET_PEER_PORT,i,"port")),e&Sc.SemconvStability.STABLE&&Object.assign(n,si(t,SR.ATTR_SERVER_PORT,i,"port"))}else{let r=jFe(t);n[AR.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),s=yte(o.protocol);Object.assign(n,{...si(r,AR.ATTR_MESSAGING_PROTOCOL,s,"protocol")});let i=Rte(o.hostname);e&Sc.SemconvStability.OLD&&Object.assign(n,{...si(r,Ih.ATTR_NET_PEER_NAME,i,"hostname")}),e&Sc.SemconvStability.STABLE&&Object.assign(n,{...si(r,SR.ATTR_SERVER_ADDRESS,i,"hostname")});let a=Ate(o.port?parseInt(o.port):void 0,s);e&Sc.SemconvStability.OLD&&Object.assign(n,si(r,Ih.ATTR_NET_PEER_PORT,a,"port")),e&Sc.SemconvStability.STABLE&&Object.assign(n,si(r,SR.ATTR_SERVER_PORT,a,"port"))}catch(o){UL.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Pt.getConnectionAttributesFromUrl=GFe;var $Fe=t=>t.setValue(kL,!0);Pt.markConfirmChannelTracing=$Fe;var FFe=t=>t.deleteValue(kL);Pt.unmarkConfirmChannelTracing=FFe;var HFe=t=>t.getValue(kL)===!0;Pt.isConfirmChannelTracing=HFe});var Nte=y(Dd=>{"use strict";p();u();l();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.PACKAGE_NAME=Dd.PACKAGE_VERSION=void 0;Dd.PACKAGE_VERSION="0.58.0";Dd.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Ote=y(IR=>{"use strict";p();u();l();Object.defineProperty(IR,"__esModule",{value:!0});IR.AmqplibInstrumentation=void 0;var gt=(U(),D(J)),yR=Ge(),$e=he(),VFe=LL(),uo=wL(),yr=DL(),xt=Ite(),bte=Nte(),RR=[">=0.5.5 <1"],jL=class extends $e.InstrumentationBase{_netSemconvStability;constructor(e={}){super(bte.PACKAGE_NAME,bte.PACKAGE_VERSION,{...yr.DEFAULT_CONFIG,...e}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$e.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(e={}){super.setConfig({...yr.DEFAULT_CONFIG,...e})}init(){let e=new $e.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",RR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new $e.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",RR,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new $e.InstrumentationNodeModuleFile("amqplib/lib/connect.js",RR,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new $e.InstrumentationNodeModuleDefinition("amqplib",RR,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,$e.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,$e.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,$e.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,$e.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,yr.EndOperation.Ack)),(0,$e.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,yr.EndOperation.Nack)),(0,$e.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,yr.EndOperation.Reject)),(0,$e.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,yr.EndOperation.AckAll)),(0,$e.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,yr.EndOperation.NackAll)),(0,$e.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,$e.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,$e.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,$e.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,$e.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,$e.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,$e.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,$e.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,$e.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,$e.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){let n=this;return function(o,s,i){return e.call(this,o,s,function(a,c){if(a==null){let d=(0,xt.getConnectionAttributesFromUrl)(o,n._netSemconvStability),f=(0,xt.getConnectionAttributesFromServer)(c);c[xt.CONNECTION_ATTRIBUTES]={...d,...f}}i.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelClosed,void 0);let s=this[xt.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[xt.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,yr.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){let d=this,f=n===yr.EndOperation.Reject?a:c,m=d[xt.CHANNEL_SPANS_NOT_ENDED]??[],_=m.findIndex(g=>g.msg===i);if(_<0)o.endConsumerSpan(i,e,n,f);else if(n!==yr.EndOperation.Reject&&a){for(let g=0;g<=_;g++)o.endConsumerSpan(m[g].msg,e,n,f);m.splice(0,_+1)}else o.endConsumerSpan(i,e,n,f),m.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,xt.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:f}=r.getConfig();if(f){let m=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},f);m.unref(),c[xt.CHANNEL_CONSUME_TIMEOUT_TIMER]=m}c[xt.CHANNEL_SPANS_NOT_ENDED]=[]}let d=function(f){if(!f)return i.call(this,f);let m=f.properties.headers??{},_=gt.propagation.extract(gt.ROOT_CONTEXT,m),g=f.fields?.exchange,T;if(r._config.useLinksForConsume){let I=_?gt.trace.getSpan(_)?.spanContext():void 0;_=void 0,I&&(T=[{context:I}])}let A=r.tracer.startSpan(`${s} process`,{kind:gt.SpanKind.CONSUMER,attributes:{...c?.connection?.[xt.CONNECTION_ATTRIBUTES],[uo.ATTR_MESSAGING_DESTINATION]:g,[uo.ATTR_MESSAGING_DESTINATION_KIND]:uo.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[uo.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:f.fields?.routingKey,[VFe.ATTR_MESSAGING_OPERATION]:uo.MESSAGING_OPERATION_VALUE_PROCESS,[uo.OLD_ATTR_MESSAGING_MESSAGE_ID]:f?.properties.messageId,[uo.ATTR_MESSAGING_CONVERSATION_ID]:f?.properties.correlationId},links:T},_),{consumeHook:R}=r.getConfig();R&&(0,$e.safeExecuteInTheMiddle)(()=>R(A,{moduleVersion:e,msg:f}),I=>{I&&gt.diag.error("amqplib instrumentation: consumerHook error",I)},!0),a?.noAck||(c[xt.CHANNEL_SPANS_NOT_ENDED].push({msg:f,timeOfConsume:(0,yR.hrTime)()}),f[xt.MESSAGE_STORED_SPAN]=A);let b=_||gt.ROOT_CONTEXT;gt.context.with(gt.trace.setSpan(b,A),()=>{i.call(this,f)}),a?.noAck&&(r.callConsumeEndHook(A,f,!1,yr.EndOperation.AutoAck),A.end())};return arguments[1]=d,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,d){let f=this,{span:m,modifiedOptions:_}=r.createPublishSpan(r,s,i,f,c),{publishHook:g}=r.getConfig();g&&(0,$e.safeExecuteInTheMiddle)(()=>g(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:_,isConfirmChannel:!0}),b=>{b&&gt.diag.error("amqplib instrumentation: publishHook error",b)},!0);let T=function(b,I){try{d?.call(this,b,I)}finally{let{publishConfirmHook:C}=r.getConfig();C&&(0,$e.safeExecuteInTheMiddle)(()=>C(m,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:b}),O=>{O&&gt.diag.error("amqplib instrumentation: publishConfirmHook error",O)},!0),b&&m.setStatus({code:gt.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),m.end()}},A=(0,xt.markConfirmChannelTracing)(gt.context.active()),R=[...arguments];return R[3]=_,R[4]=gt.context.bind((0,xt.unmarkConfirmChannelTracing)(gt.trace.setSpan(A,m)),T),gt.context.with(A,n.bind(this,...R))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,xt.isConfirmChannelTracing)(gt.context.active()))return n.apply(this,arguments);{let d=this,{span:f,modifiedOptions:m}=r.createPublishSpan(r,s,i,d,c),{publishHook:_}=r.getConfig();_&&(0,$e.safeExecuteInTheMiddle)(()=>_(f,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:m,isConfirmChannel:!1}),A=>{A&&gt.diag.error("amqplib instrumentation: publishHook error",A)},!0);let g=[...arguments];g[3]=m;let T=n.apply(this,g);return f.end(),T}}}createPublishSpan(e,n,r,o,s){let i=(0,xt.normalizeExchange)(n),a=e.tracer.startSpan(`publish ${i}`,{kind:gt.SpanKind.PRODUCER,attributes:{...o.connection[xt.CONNECTION_ATTRIBUTES],[uo.ATTR_MESSAGING_DESTINATION]:n,[uo.ATTR_MESSAGING_DESTINATION_KIND]:uo.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[uo.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[uo.OLD_ATTR_MESSAGING_MESSAGE_ID]:s?.messageId,[uo.ATTR_MESSAGING_CONVERSATION_ID]:s?.correlationId}}),c=s??{};return c.headers=c.headers??{},gt.propagation.inject(gt.trace.setSpan(gt.context.active(),a),c.headers),{span:a,modifiedOptions:c}}endConsumerSpan(e,n,r,o){let s=e[xt.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:gt.SpanStatusCode.ERROR,message:r!==yr.EndOperation.ChannelClosed&&r!==yr.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[xt.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){(e[xt.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(i=>{this.endConsumerSpan(i.msg,n,r,o)}),e[xt.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,$e.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&gt.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){let n=(0,yR.hrTime)(),r=e[xt.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:s}=this.getConfig();for(o=0;o<r.length;o++){let i=r[o],a=(0,yR.hrTimeDuration)(i.timeOfConsume,n);if((0,yR.hrTimeToMilliseconds)(a)<s)break;this.endConsumerSpan(i.msg,null,yr.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};IR.AmqplibInstrumentation=jL});var Pte=y(Ac=>{"use strict";p();u();l();Object.defineProperty(Ac,"__esModule",{value:!0});Ac.EndOperation=Ac.DEFAULT_CONFIG=Ac.AmqplibInstrumentation=void 0;var qFe=Ote();Object.defineProperty(Ac,"AmqplibInstrumentation",{enumerable:!0,get:function(){return qFe.AmqplibInstrumentation}});var Cte=DL();Object.defineProperty(Ac,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Cte.DEFAULT_CONFIG}});Object.defineProperty(Ac,"EndOperation",{enumerable:!0,get:function(){return Cte.EndOperation}})});var xte,vte,YFe,Mte,WFe,Lte,wte=S(()=>{p();u();l();xte=B(Pte(),1);Be();vte="Amqplib",YFe={consumeEndHook:t=>{qe(t,"auto.amqplib.otel.consumer")},publishHook:t=>{qe(t,"auto.amqplib.otel.publisher")}},Mte=Z(vte,()=>new xte.AmqplibInstrumentation(YFe)),WFe=(()=>({name:vte,setupOnce(){Mte()}})),Lte=WFe});var Nh,BL=S(()=>{p();u();l();Nh="VercelAI"});function zFe(t){if(typeof t!="object"||t===null)return!1;let e=t;return"type"in e&&"error"in e&&"toolName"in e&&"toolCallId"in e&&e.type==="tool-error"&&e.error instanceof Error}function XFe(t){if(typeof t!="object"||t===null||!("content"in t))return;let e=t;if(Array.isArray(e.content)){for(let n of e.content)if(zFe(n)){let r=qP(n.toolCallId);if(r){let o=r.spanContext();Xr(s=>{s.setContext("trace",{trace_id:o.traceId,span_id:o.spanId}),s.setTag("vercel.ai.tool.name",n.toolName),s.setTag("vercel.ai.tool.callId",n.toolCallId),s.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}),YP(n.toolCallId)}else Xr(o=>{o.setTag("vercel.ai.tool.name",n.toolName),o.setTag("vercel.ai.tool.callId",n.toolCallId),o.setLevel("error"),oe(n.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}}function QFe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var bR,KFe,Dte,NR,Ute=S(()=>{p();u();l();bR=B(he(),1);ne();BL();KFe=[">=3.0.0 <7"],Dte=["generateText","streamText","generateObject","streamObject","embed","embedMany"];NR=class t extends bR.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Pe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new bR.InstrumentationNodeModuleDefinition("ai",KFe,this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,s,i)=>{let a=i[0].experimental_telemetry||{},c=a.isEnabled,d=F(),f=d?.getIntegrationByName(Nh),m=f?.options,_=f?!!d?.getOptions().sendDefaultPii:!1,{recordInputs:g,recordOutputs:T}=QFe(m,a,c,_);return i[0].experimental_telemetry={...a,isEnabled:c!==void 0?c:!0,recordInputs:g,recordOutputs:T},eo(()=>Reflect.apply(o,s,i),A=>{A&&typeof A=="object"&&$t(A,"_sentry_active_span",cs())},()=>{},A=>{XFe(A)})}});if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of Dte)e[r]=n(e[r]);return e}else{let r=Dte.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}}});function JFe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var kte,ZFe,jte,Bte=S(()=>{p();u();l();ne();Be();BL();Ute();kte=Z(Nh,()=>new NR({}));ZFe=((t={})=>{let e;return{name:Nh,options:t,setupOnce(){e=kte()},afterAllSetup(n){t.force??JFe(n)?oS(n):e?.callWhenPatched(()=>oS(n))}}}),jte=ZFe});var CR,eHe,OR,Gte=S(()=>{p();u();l();CR=B(he(),1);ne();eHe=[">=4.0.0 <7"],OR=class extends CR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Pe,e)}init(){return new CR.InstrumentationNodeModuleDefinition("openai",eHe,this._patch.bind(this))}_patch(e){let n=e;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(e,n){let r=e[n];if(!r)return e;let o=this.getConfig(),s=function(...i){if(Su(qa))return Reflect.construct(r,i);let a=Reflect.construct(r,i),d=!!F()?.getOptions().sendDefaultPii,f=o.recordInputs??d,m=o.recordOutputs??d;return cS(a,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(s,r),Object.setPrototypeOf(s.prototype,r.prototype);for(let i of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(r,i);a&&Object.defineProperty(s,i,a)}try{e[n]=s}catch{Object.defineProperty(e,n,{value:s,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=s}catch{Object.defineProperty(e,"default",{value:s,writable:!0,configurable:!0,enumerable:!0})}return e}}});var $te,tHe,Fte,Hte=S(()=>{p();u();l();ne();Be();Gte();$te=Z(qa,t=>new OR(t)),tHe=((t={})=>({name:qa,setupOnce(){$te(t)}})),Fte=tHe});var xR,nHe,PR,Vte=S(()=>{p();u();l();xR=B(he(),1);ne();nHe=[">=0.19.2 <1.0.0"],PR=class extends xR.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-anthropic-ai",Pe,e)}init(){return new xR.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",nHe,this._patch.bind(this))}_patch(e){let n=e.Anthropic,r=this.getConfig(),o=function(...s){if(Su(Ya))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r.recordInputs??c,f=r.recordOutputs??c;return uS(i,{recordInputs:d,recordOutputs:f})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}try{e.Anthropic=o}catch{Object.defineProperty(e,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=o}catch{Object.defineProperty(e,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return e}}});var qte,rHe,Yte,Wte=S(()=>{p();u();l();ne();Be();Vte();qte=Z(Ya,t=>new PR(t)),rHe=((t={})=>({name:Ya,options:t,setupOnce(){qte(t)}})),Yte=rHe});var Ud,Kte,vR,zte=S(()=>{p();u();l();Ud=B(he(),1);ne();Kte=[">=0.10.0 <2"],vR=class extends Ud.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-google-genai",Pe,e)}init(){return new Ud.InstrumentationNodeModuleDefinition("@google/genai",Kte,n=>this._patch(n),n=>n,[new Ud.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",Kte,n=>this._patch(n),n=>n)])}_patch(e){let n=e.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return e;let o=function(...s){if(Su(Wa))return Reflect.construct(n,s);let i=Reflect.construct(n,s),c=!!F()?.getOptions().sendDefaultPii,d=r,f=d?.recordInputs??c,m=d?.recordOutputs??c;return pS(i,{recordInputs:f,recordOutputs:m})};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let s of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(s)){let i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(o,s,i)}return p_(e,"GoogleGenAI",o),e}}});var Xte,oHe,Qte,Jte=S(()=>{p();u();l();ne();Be();zte();Xte=Z(Wa,t=>new vR(t)),oHe=((t={})=>({name:Wa,setupOnce(){Xte(t)}})),Qte=oHe});function sHe(t,e){return t?Array.isArray(t)?t.includes(e)?t:[...t,e]:typeof t=="object"?[t,e]:t:[e]}function iHe(t,e,n){return new Proxy(t,{apply(r,o,s){let a=s[1];(!a||typeof a!="object"||Array.isArray(a))&&(a={},s[1]=a);let c=a.callbacks,d=sHe(c,e);return a.callbacks=d,Reflect.apply(r,o,s)}})}var yc,MR,LR,Zte=S(()=>{p();u();l();yc=B(he(),1);ne();MR=[">=0.1.0 <2.0.0"];LR=class extends yc.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langchain",Pe,e)}init(){let e=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)e.push(new yc.InstrumentationNodeModuleDefinition(r,MR,this._patch.bind(this),o=>o,[new yc.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,MR,this._patch.bind(this),o=>o)]));return e.push(new yc.InstrumentationNodeModuleDefinition("langchain",MR,this._patch.bind(this),r=>r,[new yc.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",MR,this._patch.bind(this),r=>r)])),e}_patch(e){TP([qa,Ya,Wa]);let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o?.recordInputs??r,i=o?.recordOutputs??r,a=_S({recordInputs:s,recordOutputs:i});return this._patchRunnableMethods(e,a),e}_patchRunnableMethods(e,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=e.universal_exports??e,s=Object.values(o).find(c=>typeof c=="function"&&r.includes(c.name));if(!s)return;let i=s.prototype,a=["invoke","stream","batch"];for(let c of a){let d=i[c];typeof d=="function"&&(i[c]=iHe(d,n))}}}});var ene,aHe,tne,nne=S(()=>{p();u();l();ne();Be();Zte();ene=Z(dS,t=>new LR(t)),aHe=((t={})=>({name:dS,setupOnce(){ene(t)}})),tne=aHe});var kd,rne,wR,one=S(()=>{p();u();l();kd=B(he(),1);ne();rne=[">=0.0.0 <2.0.0"],wR=class extends kd.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-langgraph",Pe,e)}init(){return new kd.InstrumentationNodeModuleDefinition("@langchain/langgraph",rne,this._patch.bind(this),n=>n,[new kd.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",rne,this._patch.bind(this),n=>n)])}_patch(e){let r=!!F()?.getOptions().sendDefaultPii,o=this.getConfig(),s=o.recordInputs??r,i=o.recordOutputs??r,a={recordInputs:s,recordOutputs:i};if(e.StateGraph&&typeof e.StateGraph=="function"){let c=e.StateGraph;c.prototype.compile=gS(c.prototype.compile,a)}return e}}});var sne,cHe,ine,ane=S(()=>{p();u();l();ne();Be();one();sne=Z(hS,t=>new wR(t)),cHe=((t={})=>({name:hS,setupOnce(){sne(t)}})),ine=cHe});function lne(t,e,n,r,o){let i=()=>{},a=o.firestoreSpanCreationHook;typeof a=="function"&&(i=f=>{(0,Qi.safeExecuteInTheMiddle)(()=>a(f),m=>{m&&or.error(m?.message)},!0)});let c=new Qi.InstrumentationNodeModuleDefinition("@firebase/firestore",e,f=>cne(f,n,r,t,i)),d=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let f of d)c.files.push(new Qi.InstrumentationNodeModuleFile(f,e,m=>cne(m,n,r,t,i),m=>pne(m,r)));return c}function cne(t,e,n,r,o){return pne(t,n),e(t,"addDoc",uHe(r,o)),e(t,"getDocs",pHe(r,o)),e(t,"setDoc",dHe(r,o)),e(t,"deleteDoc",lHe(r,o)),t}function pne(t,e){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Qi.isWrapped)(t[n])&&e(t,n);return t}function uHe(t,e){return function(r){return function(o,s){let i=UR(t,"addDoc",o);return e(i),DR(i,()=>r(o,s))}}}function lHe(t,e){return function(r){return function(o){let s=UR(t,"deleteDoc",o.parent||o);return e(s),DR(s,()=>r(o))}}}function pHe(t,e){return function(r){return function(o){let s=UR(t,"getDocs",o);return e(s),DR(s,()=>r(o))}}}function dHe(t,e){return function(r){return function(o,s,i){let a=UR(t,"setDoc",o.parent||o);return e(a),DR(a,()=>typeof i<"u"?r(o,s,i):r(o,s))}}}function DR(t,e){return V.with(de.setSpan(V.active(),t),()=>(0,Qi.safeExecuteInTheMiddle)(()=>e(),n=>{n&&t.recordException(n),t.end()},!0))}function UR(t,e,n){let r=t.startSpan(`${e} ${n.path}`,{kind:Ze.CLIENT});return mHe(r,n),r.setAttribute(Dl,e),r}function fHe(t){let e,n;if(typeof t.host=="string")if(t.host.startsWith("[")){if(t.host.endsWith("]"))e=t.host.replace(/^\[|\]$/g,"");else if(t.host.includes("]:")){let r=t.host.lastIndexOf(":");r!==-1&&(e=t.host.slice(1,r).replace(/^\[|\]$/g,""),n=t.host.slice(r+1))}}else if(une.isIPv6(t.host))e=t.host;else{let r=t.host.lastIndexOf(":");r!==-1?(e=t.host.slice(0,r),n=t.host.slice(r+1)):e=t.host}return{address:e,port:n?parseInt(n,10):void 0}}function mHe(t,e){let n=e.firestore.app,r=n.options,s=(e.firestore.toJSON()||{}).settings||{},i={[iO]:e.path,[Wf]:n.name,[_a]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:a,port:c}=fHe(s);a&&(i[Kf]=a),c&&(i[zf]=c),t.setAttributes(i)}var une,Qi,dne=S(()=>{p();u();l();une=B(require("node:net"),1);U();Qi=B(he(),1);Le()});function fne(t,e,n,r,o){let s=()=>{},i=()=>{},a=o.functions?.errorHook,c=o.functions?.requestHook,d=o.functions?.responseHook;typeof d=="function"&&(i=(_,g)=>{(0,Ji.safeExecuteInTheMiddle)(()=>d(_,g),T=>{T&&or.error(T?.message)},!0)}),typeof c=="function"&&(s=_=>{(0,Ji.safeExecuteInTheMiddle)(()=>c(_),g=>{g&&or.error(g?.message)},!0)});let f=new Ji.InstrumentationNodeModuleDefinition("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:_,triggerType:g})=>{f.files.push(new Ji.InstrumentationNodeModuleFile(_,e,T=>_He(T,n,r,t,{requestHook:s,responseHook:i,errorHook:a},g),T=>mne(T,r)))}),f}function Rr(t,e,n){return function(o){return function(...s){let i=typeof s[0]=="function"?s[0]:s[1],a=typeof s[0]=="function"?void 0:s[0];if(!i)return o.call(this,...s);let c=async function(...d){let f=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",m=t.startSpan(`firebase.function.${n}`,{kind:Ze.SERVER}),_={"faas.name":f,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(_["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(_["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),m.setAttributes(_),e?.requestHook?.(m),V.with(de.setSpan(V.active(),m),async()=>{let g,T;try{T=await i.apply(this,d)}catch(A){g=A}if(e?.responseHook?.(m,g),g&&m.recordException(g),m.end(),g)throw await e?.errorHook?.(m,g),g;return T})};return a?o.call(this,a,c):o.call(this,c)}}}function _He(t,e,n,r,o,s){switch(mne(t,n),s){case"function":e(t,"onRequest",Rr(r,o,"http.request")),e(t,"onCall",Rr(r,o,"http.call"));break;case"firestore":e(t,"onDocumentCreated",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdated",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeleted",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWritten",Rr(r,o,"firestore.document.written")),e(t,"onDocumentCreatedWithAuthContext",Rr(r,o,"firestore.document.created")),e(t,"onDocumentUpdatedWithAuthContext",Rr(r,o,"firestore.document.updated")),e(t,"onDocumentDeletedWithAuthContext",Rr(r,o,"firestore.document.deleted")),e(t,"onDocumentWrittenWithAuthContext",Rr(r,o,"firestore.document.written"));break;case"scheduler":e(t,"onSchedule",Rr(r,o,"scheduler.scheduled"));break;case"storage":e(t,"onObjectFinalized",Rr(r,o,"storage.object.finalized")),e(t,"onObjectArchived",Rr(r,o,"storage.object.archived")),e(t,"onObjectDeleted",Rr(r,o,"storage.object.deleted")),e(t,"onObjectMetadataUpdated",Rr(r,o,"storage.object.metadataUpdated"));break}return t}function mne(t,e){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ji.isWrapped)(t[r])&&e(t,r);return t}var Ji,_ne=S(()=>{p();u();l();U();Ji=B(he(),1)});var gne,hne,hHe,gHe,kR,Ene=S(()=>{p();u();l();gne=B(he(),1);ne();dne();_ne();hne={},hHe=[">=3.0.0 <5"],gHe=[">=6.0.0 <7"],kR=class extends gne.InstrumentationBase{constructor(e=hne){super("@sentry/instrumentation-firebase",Pe,e)}setConfig(e={}){super.setConfig({...hne,...e})}init(){let e=[];return e.push(lne(this.tracer,hHe,this._wrap,this._unwrap,this.getConfig())),e.push(fne(this.tracer,gHe,this._wrap,this._unwrap,this.getConfig())),e}}});var Tne,EHe,Sne,THe,Ane,yne=S(()=>{p();u();l();ne();Be();Ene();Tne="Firebase",EHe={firestoreSpanCreationHook:t=>{qe(t,"auto.firebase.otel.firestore"),t.setAttribute(Ee,"db.query")},functions:{requestHook:t=>{qe(t,"auto.firebase.otel.functions"),t.setAttribute(Ee,"http.request")},errorHook:async(t,e)=>{e&&(oe(e,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Eu(2e3))}}},Sne=Z(Tne,()=>new kR(EHe)),THe=(()=>({name:Tne,setupOnce(){Sne()}})),Ane=THe});function Rne(){return[eQ(),WQ(),S8(),Aee(),aJ(),yJ(),wJ(),YJ(),IZ(),qZ(),nee(),hee(),kee(),Xee(),lte(),Tte(),k8(),Lte(),K8(),tne(),ine(),jte(),Fte(),Yte(),Qte(),XZ(),Ane()]}var Ine=S(()=>{p();u();l();wte();Wte();Qee();tQ();XQ();yne();Ste();Jte();y8();gee();yee();j8();jee();nne();ane();z8();cJ();RJ();DJ();WJ();Hte();YZ();QZ();ree();NZ();pte();Bte()});function bne(t,e={}){t.getOptions().debug&&kv();let[n,r]=SHe(t,e);t.traceProvider=n,t.asyncLocalStorageLookup=r}function SHe(t,e={}){let n=new Nne.BasicTracerProvider({sampler:new pA(t),resource:(0,jR.defaultResource)().merge((0,jR.resourceFromAttributes)({[zr]:"node",[sO]:"sentry",[aO]:Pe})),forceFlushTimeoutMillis:500,spanProcessors:[new lA({timeout:AHe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});de.setGlobalTracerProvider(n),sr.setGlobalPropagator(new uA);let r=new yA;return V.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function AHe(t){if(t!=null){if(t>GL)return bt&&N.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${GL}`),GL;if(t<=0||Number.isNaN(t)){bt&&N.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}var jR,Nne,GL,One=S(()=>{p();u();l();U();jR=B(Rx(),1),Nne=B(Kx(),1);Le();ne();Be();Xa();Du();GL=1e6});function Cne(){return CA().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(xX(),BX())}function Pne(t){return[...Cne(),...jt(t)?Rne():[]]}function $L(t={}){return yHe(t,Pne)}function yHe(t={},e){Au(t,"node");let n=qv({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(bne(n,{spanProcessors:t.openTelemetrySpanProcessors}),PA()),n}var xne=S(()=>{p();u();l();ne();Be();vX();GX();Ine();One()});var Zi=S(()=>{p();u();l();xne();ne();Be()});var Wu,FL=S(()=>{p();u();l();Wu=class extends Error{response;request;options;constructor(e,n,r){let o=e.status||e.status===0?e.status:"",s=e.statusText??"",i=`${o} ${s}`.trim(),a=i?`status code ${i}`:"an unknown error";super(`Request failed with ${a}: ${n.method} ${n.url}`),this.name="HTTPError",this.response=e,this.request=n,this.options=r}}});var jd,HL=S(()=>{p();u();l();jd=class extends Error{name="NonError";value;constructor(e){let n="Non-error value was thrown";try{typeof e=="string"?n=e:e&&typeof e=="object"&&"message"in e&&typeof e.message=="string"&&(n=e.message)}catch{}super(n),this.value=e}}});var Bd,vne=S(()=>{p();u();l();HL();Bd=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){let n=e?.cause?e.cause instanceof Error?e.cause:new jd(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",n?{cause:n}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}}});var VL,Mne,BR,Lne,wne,GR,RHe,Dne,$R,Une,FR,bh,kne,jne,Bne,Gne,Ku=S(()=>{p();u();l();VL=(()=>{let t=!1,e=!1,n=typeof globalThis.ReadableStream=="function",r=typeof globalThis.Request=="function";if(n&&r)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&o.message==="unsupported BodyInit type")return!1;throw o}return t&&!e})(),Mne=typeof globalThis.AbortController=="function",BR=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Lne=typeof globalThis.ReadableStream=="function",wne=typeof globalThis.FormData=="function",GR=["get","post","put","patch","head","delete"],RHe=()=>{};RHe();Dne={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},$R=2147483647,Une=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,FR=Symbol("stop"),bh=class{options;constructor(e){this.options=e}},kne=t=>new bh(t),jne={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},Bne={next:!0},Gne={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0}});var IHe,$ne,Fne,Hne,Vne=S(()=>{p();u();l();Ku();IHe=t=>{if(!t)return 0;if(t instanceof FormData){let e=0;for(let[n,r]of t)e+=Une,e+=new TextEncoder().encode(`Content-Disposition: form-data; name="${n}"`).length,e+=typeof r=="string"?new TextEncoder().encode(r).length:r.size;return e}if(t instanceof Blob)return t.size;if(t instanceof ArrayBuffer)return t.byteLength;if(typeof t=="string")return new TextEncoder().encode(t).length;if(t instanceof URLSearchParams)return new TextEncoder().encode(t.toString()).length;if("byteLength"in t)return t.byteLength;if(typeof t=="object"&&t!==null)try{let e=JSON.stringify(t);return new TextEncoder().encode(e).length}catch{return 0}return 0},$ne=(t,e,n)=>{let r,o=0;return t.pipeThrough(new TransformStream({transform(s,i){if(i.enqueue(s),r){o+=r.byteLength;let a=e===0?0:o/e;a>=1&&(a=1-Number.EPSILON),n?.({percent:a,totalBytes:Math.max(e,o),transferredBytes:o},r)}r=s},flush(){r&&(o+=r.byteLength,n?.({percent:1,totalBytes:Math.max(e,o),transferredBytes:o},r))}}))},Fne=(t,e)=>{if(!t.body)return t;if(t.status===204)return new Response(null,{status:t.status,statusText:t.statusText,headers:t.headers});let n=Math.max(0,Number(t.headers.get("content-length"))||0);return new Response($ne(t.body,n,e),{status:t.status,statusText:t.statusText,headers:t.headers})},Hne=(t,e,n)=>{if(!t.body)return t;let r=IHe(n??t.body);return new Request(t,{duplex:"half",body:$ne(t.body,r,e)})}});var Ic,qne=S(()=>{p();u();l();Ic=t=>t!==null&&typeof t=="object"});function HR(t,e,n){return Object.hasOwn(e,n)&&e[n]===void 0?[]:WL(t[n]??[],e[n]??[])}var Oh,qL,YL,NHe,WL,KL=S(()=>{p();u();l();Ku();qne();Oh=(...t)=>{for(let e of t)if((!Ic(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return WL({},...t)},qL=(t={},e={})=>{let n=new globalThis.Headers(t),r=e instanceof globalThis.Headers,o=new globalThis.Headers(e);for(let[s,i]of o.entries())r&&i==="undefined"||i===void 0?n.delete(s):n.set(s,i);return n};YL=(t={},e={})=>({beforeRequest:HR(t,e,"beforeRequest"),beforeRetry:HR(t,e,"beforeRetry"),afterResponse:HR(t,e,"afterResponse"),beforeError:HR(t,e,"beforeError")}),NHe=(t,e)=>{let n=new URLSearchParams;for(let r of[t,e])if(r!==void 0)if(r instanceof URLSearchParams)for(let[o,s]of r.entries())n.append(o,s);else if(Array.isArray(r))for(let o of r){if(!Array.isArray(o)||o.length!==2)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");n.append(String(o[0]),String(o[1]))}else if(Ic(r))for(let[o,s]of Object.entries(r))s!==void 0&&n.append(o,String(s));else{let o=new URLSearchParams(r);for(let[s,i]of o.entries())n.append(s,i)}return n},WL=(...t)=>{let e={},n={},r={},o,s=[];for(let i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(Ic(i)){for(let[a,c]of Object.entries(i)){if(a==="signal"&&c instanceof globalThis.AbortSignal){s.push(c);continue}if(a==="context"){if(c!=null&&(!Ic(c)||Array.isArray(c)))throw new TypeError("The `context` option must be an object");e={...e,context:c==null?{}:{...e.context,...c}};continue}if(a==="searchParams"){c==null?o=void 0:o=o===void 0?c:NHe(o,c);continue}Ic(c)&&a in e&&(c=WL(e[a],c)),e={...e,[a]:c}}Ic(i.hooks)&&(r=YL(r,i.hooks),e.hooks=r),Ic(i.headers)&&(n=qL(n,i.headers),e.headers=n)}return o!==void 0&&(e.searchParams=o),s.length>0&&(s.length===1?e.signal=s[0]:BR?e.signal=AbortSignal.any(s):e.signal=s.at(-1)),e.context===void 0&&(e.context={}),e}});var Wne,bHe,OHe,CHe,Yne,Kne,zne=S(()=>{p();u();l();Ku();Wne=t=>GR.includes(t)?t.toUpperCase():t,bHe=["get","put","head","delete","options","trace"],OHe=[408,413,429,500,502,503,504],CHe=[413,429,503],Yne={limit:2,methods:bHe,statusCodes:OHe,afterStatusCodes:CHe,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3,jitter:void 0,retryOnTimeout:!1},Kne=(t={})=>{if(typeof t=="number")return{...Yne,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.methods&&=t.methods.map(n=>n.toLowerCase()),t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");let e=Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0));return{...Yne,...e}}});var zu,zL=S(()=>{p();u();l();zu=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}});async function XL(t,e,n,r){return new Promise((o,s)=>{let i=setTimeout(()=>{n&&n.abort(),s(new zu(t))},r.timeout);r.fetch(t,e).then(o).catch(s).then(()=>{clearTimeout(i)})})}var Xne=S(()=>{p();u();l();zL()});async function QL(t,{signal:e}){return new Promise((n,r)=>{e&&(e.throwIfAborted(),e.addEventListener("abort",o,{once:!0}));function o(){clearTimeout(s),r(e.reason)}let s=setTimeout(()=>{e?.removeEventListener("abort",o),n()},t)})}var Qne=S(()=>{p();u();l()});var Jne,Zne,ere=S(()=>{p();u();l();Ku();Jne=(t,e)=>{let n={};for(let r in e)Object.hasOwn(e,r)&&!(r in Gne)&&!(r in jne)&&(!(r in t)||r in Bne)&&(n[r]=e[r]);return n},Zne=t=>t===void 0?!1:Array.isArray(t)?t.length>0:t instanceof URLSearchParams?t.size>0:typeof t=="object"?Object.keys(t).length>0:typeof t=="string"?t.trim().length>0:!!t});function tre(t){return t instanceof Wu||t?.name===Wu.name}function nre(t){return t instanceof zu||t?.name===zu.name}var rre=S(()=>{p();u();l();FL();zL()});var Ch,ore=S(()=>{p();u();l();FL();HL();vne();Vne();KL();zne();Xne();Qne();ere();rre();Ku();Ch=class t{static create(e,n){let r=new t(e,n),o=async()=>{if(typeof r.#e.timeout=="number"&&r.#e.timeout>$R)throw new RangeError(`The \`timeout\` option cannot be greater than ${$R}`);await Promise.resolve();let i=await r.#_();for(let a of r.#e.hooks.afterResponse){let c=r.#p(i.clone()),d;try{d=await a(r.request,r.#m(),c,{retryCount:r.#o})}catch(m){throw r.#c(c),r.#c(i),m}if(d instanceof bh)throw r.#c(c),r.#c(i),new Bd(d.options);let f=d instanceof globalThis.Response?d:i;c!==f&&r.#c(c),i!==f&&r.#c(i),i=f}if(r.#p(i),!i.ok&&(typeof r.#e.throwHttpErrors=="function"?r.#e.throwHttpErrors(i.status):r.#e.throwHttpErrors)){let a=new Wu(i,r.request,r.#m());for(let c of r.#e.hooks.beforeError)a=await c(a,{retryCount:r.#o});throw a}if(r.#e.onDownloadProgress){if(typeof r.#e.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Lne)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");let a=i.clone();return r.#c(i),Fne(a,r.#e.onDownloadProgress)}return i},s=r.#f(o).finally(()=>{let i=r.#i;r.#d(i?.body??void 0),r.#d(r.request.body??void 0)});for(let[i,a]of Object.entries(Dne))i==="bytes"&&typeof globalThis.Response?.prototype?.bytes!="function"||(s[i]=async()=>{r.request.headers.set("accept",r.request.headers.get("accept")||a);let c=await s;if(i==="json"){if(c.status===204)return"";let d=await c.text();return d===""?"":n.parseJson?n.parseJson(d):JSON.parse(d)}return c[i]()});return s}static#n(e){return e&&typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)?Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)):e}request;#r;#o=0;#t;#e;#i;#s;#u;constructor(e,n={}){if(this.#t=e,this.#e={...n,headers:qL(this.#t.headers,n.headers),hooks:YL({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},n.hooks),method:Wne(n.method??this.#t.method??"GET"),prefixUrl:String(n.prefixUrl||""),retry:Kne(n.retry),throwHttpErrors:n.throwHttpErrors??!0,timeout:n.timeout??1e4,fetch:n.fetch??globalThis.fetch.bind(globalThis),context:n.context??{}},typeof this.#t!="string"&&!(this.#t instanceof URL||this.#t instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#e.prefixUrl&&typeof this.#t=="string"){if(this.#t.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#e.prefixUrl.endsWith("/")||(this.#e.prefixUrl+="/"),this.#t=this.#e.prefixUrl+this.#t}Mne&&BR&&(this.#s=this.#e.signal??this.#t.signal,this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal),VL&&(this.#e.duplex="half"),this.#e.json!==void 0&&(this.#e.body=this.#e.stringifyJson?.(this.#e.json)??JSON.stringify(this.#e.json),this.#e.headers.set("content-type",this.#e.headers.get("content-type")??"application/json"));let r=n.headers&&new globalThis.Headers(n.headers).has("content-type");if(this.#t instanceof globalThis.Request&&(wne&&this.#e.body instanceof globalThis.FormData||this.#e.body instanceof URLSearchParams)&&!r&&this.#e.headers.delete("content-type"),this.request=new globalThis.Request(this.#t,this.#e),Zne(this.#e.searchParams)){let s="?"+(typeof this.#e.searchParams=="string"?this.#e.searchParams.replace(/^\?/,""):new URLSearchParams(t.#n(this.#e.searchParams)).toString()),i=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,s);this.request=new globalThis.Request(i,this.#e)}if(this.#e.onUploadProgress){if(typeof this.#e.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!VL)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#g(this.request,this.#e.body??void 0)}}#a(){let e=this.#e.retry.delay(this.#o),n=e;this.#e.retry.jitter===!0?n=Math.random()*e:typeof this.#e.retry.jitter=="function"&&(n=this.#e.retry.jitter(e),(!Number.isFinite(n)||n<0)&&(n=e));let r=this.#e.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,n)}async#l(e){if(this.#o++,this.#o>this.#e.retry.limit)throw e;let n=e instanceof Error?e:new jd(e);if(n instanceof Bd)return n.customDelay??this.#a();if(!this.#e.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(this.#e.retry.shouldRetry!==void 0){let r=await this.#e.retry.shouldRetry({error:n,retryCount:this.#o});if(r===!1)throw e;if(r===!0)return this.#a()}if(nre(e)&&!this.#e.retry.retryOnTimeout)throw e;if(tre(e)){if(!this.#e.retry.statusCodes.includes(e.response.status))throw e;let r=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(r&&this.#e.retry.afterStatusCodes.includes(e.response.status)){let o=Number(r)*1e3;Number.isNaN(o)?o=Date.parse(r)-Date.now():o>=Date.parse("2024-01-01")&&(o-=Date.now());let s=this.#e.retry.maxRetryAfter??o;return o<s?o:s}if(e.response.status===413)throw e}return this.#a()}#p(e){return this.#e.parseJson&&(e.json=async()=>this.#e.parseJson(await e.text())),e}#d(e){e&&e.cancel().catch(()=>{})}#c(e){this.#d(e.body??void 0)}async#f(e){try{return await e()}catch(n){let r=Math.min(await this.#l(n),$R);if(this.#o<1)throw n;if(await QL(r,this.#s?{signal:this.#s}:{}),n instanceof Bd&&n.customRequest){let o=this.#e.signal?new globalThis.Request(n.customRequest,{signal:this.#e.signal}):new globalThis.Request(n.customRequest);this.#h(o)}for(let o of this.#e.hooks.beforeRetry){let s=await o({request:this.request,options:this.#m(),error:n,retryCount:this.#o});if(s instanceof globalThis.Request){this.#h(s);break}if(s instanceof globalThis.Response)return s;if(s===FR)return}return this.#f(e)}}async#_(){this.#r?.signal.aborted&&(this.#r=new globalThis.AbortController,this.#e.signal=this.#s?AbortSignal.any([this.#s,this.#r.signal]):this.#r.signal,this.request=new globalThis.Request(this.request,{signal:this.#e.signal}));for(let n of this.#e.hooks.beforeRequest){let r=await n(this.request,this.#m(),{retryCount:this.#o});if(r instanceof Response)return r;if(r instanceof globalThis.Request){this.#h(r);break}}let e=Jne(this.request,this.#e);return this.#i=this.request,this.request=this.#i.clone(),this.#e.timeout===!1?this.#e.fetch(this.#i,e):XL(this.#i,e,this.#r,this.#e)}#m(){if(!this.#u){let{hooks:e,...n}=this.#e;this.#u=Object.freeze(n)}return this.#u}#h(e){this.#u=void 0,this.request=this.#g(e)}#g(e,n){return!this.#e.onUploadProgress||!e.body?e:Hne(e,this.#e.onUploadProgress,n??this.#e.body??void 0)}}});var JL,PHe,Ph,sre=S(()=>{p();u();l();ore();Ku();KL();JL=t=>{let e=(n,r)=>Ch.create(n,Oh(t,r));for(let n of GR)e[n]=(r,o)=>Ch.create(r,Oh(t,o,{method:n}));return e.create=n=>JL(Oh(n)),e.extend=n=>(typeof n=="function"&&(n=n(t??{})),JL(Oh(t,n))),e.stop=FR,e.retry=kne,e},PHe=JL(),Ph=PHe});var ve,ZL,Y,ii,xh=S(()=>{p();u();l();(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ve||(ve={}));(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ZL||(ZL={}));Y=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ii=t=>{switch(typeof t){case"undefined":return Y.undefined;case"string":return Y.string;case"number":return Number.isNaN(t)?Y.nan:Y.number;case"boolean":return Y.boolean;case"function":return Y.function;case"bigint":return Y.bigint;case"symbol":return Y.symbol;case"object":return Array.isArray(t)?Y.array:t===null?Y.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Y.promise:typeof Map<"u"&&t instanceof Map?Y.map:typeof Set<"u"&&t instanceof Set?Y.set:typeof Date<"u"&&t instanceof Date?Y.date:Y.object;default:return Y.unknown}}});var w,xHe,Br,VR=S(()=>{p();u();l();xh();w=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),xHe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Br=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let d=i.path[c];c===i.path.length-1?(a[d]=a[d]||{_errors:[]},a[d]._errors.push(n(i))):a[d]=a[d]||{_errors:[]},a=a[d],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Br.create=t=>new Br(t)});var vHe,ea,ew=S(()=>{p();u();l();VR();xh();vHe=(t,e)=>{let n;switch(t.code){case w.invalid_type:t.received===Y.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case w.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:n=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case w.invalid_union:n="Invalid input";break;case w.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case w.invalid_enum_value:n=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case w.invalid_arguments:n="Invalid function arguments";break;case w.invalid_return_type:n="Invalid function return type";break;case w.invalid_date:n="Invalid date";break;case w.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case w.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case w.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case w.custom:n="Invalid input";break;case w.invalid_intersection_types:n="Intersection results could not be merged";break;case w.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case w.not_finite:n="Number must be finite";break;default:n=e.defaultError,ve.assertNever(t)}return{message:n}},ea=vHe});function MHe(t){ire=t}function Gd(){return ire}var ire,qR=S(()=>{p();u();l();ew();ire=ea});function H(t,e){let n=Gd(),r=vh({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===ea?void 0:ea].filter(o=>!!o)});t.common.issues.push(r)}var vh,LHe,On,pe,Xu,Kn,YR,WR,Nc,$d,tw=S(()=>{p();u();l();qR();ew();vh=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(d=>!!d).slice().reverse();for(let d of c)a=d(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},LHe=[];On=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return pe;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return pe;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},pe=Object.freeze({status:"aborted"}),Xu=t=>({status:"dirty",value:t}),Kn=t=>({status:"valid",value:t}),YR=t=>t.status==="aborted",WR=t=>t.status==="dirty",Nc=t=>t.status==="valid",$d=t=>typeof Promise<"u"&&t instanceof Promise});var are=S(()=>{p();u();l()});var re,cre=S(()=>{p();u();l();(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(re||(re={}))});function Re(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}function dre(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function XHe(t){return new RegExp(`^${dre(t)}$`)}function fre(t){let e=`${pre}T${dre(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function QHe(t,e){return!!((e==="v4"||!e)&&HHe.test(t)||(e==="v6"||!e)&&qHe.test(t))}function JHe(t,e){if(!BHe.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function ZHe(t,e){return!!((e==="v4"||!e)&&VHe.test(t)||(e==="v6"||!e)&&YHe.test(t))}function eVe(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}function Fd(t){if(t instanceof Gr){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Ho.create(Fd(r))}return new Gr({...t._def,shape:()=>e})}else return t instanceof ra?new ra({...t._def,type:Fd(t.element)}):t instanceof Ho?Ho.create(Fd(t.unwrap())):t instanceof ci?ci.create(Fd(t.unwrap())):t instanceof ai?ai.create(t.items.map(e=>Fd(e))):t}function rw(t,e){let n=ii(t),r=ii(e);if(t===e)return{valid:!0,data:t};if(n===Y.object&&r===Y.object){let o=ve.objectKeys(e),s=ve.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=rw(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===Y.array&&r===Y.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=rw(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===Y.date&&r===Y.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function mre(t,e){return new al({values:t,typeName:me.ZodEnum,...Re(e)})}function lre(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function _re(t,e={},n){return t?Oc.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=lre(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=lre(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Oc.create()}var Vo,ure,be,wHe,DHe,UHe,kHe,jHe,BHe,GHe,$He,FHe,nw,HHe,VHe,qHe,YHe,WHe,KHe,pre,zHe,bc,Qu,Ju,Zu,el,Hd,tl,nl,Oc,na,gs,Vd,ra,Gr,rl,ta,KR,ol,ai,zR,qd,Yd,XR,sl,il,al,cl,Cc,qo,Ho,ci,ul,ll,Wd,tVe,Mh,Lh,pl,nVe,me,rVe,hre,gre,oVe,sVe,Ere,iVe,aVe,cVe,uVe,lVe,pVe,dVe,fVe,mVe,_Ve,hVe,gVe,EVe,TVe,SVe,AVe,yVe,RVe,IVe,NVe,bVe,OVe,CVe,PVe,xVe,vVe,MVe,LVe,wVe,DVe,UVe,kVe,jVe,BVe,Tre=S(()=>{p();u();l();VR();qR();cre();tw();xh();Vo=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ure=(t,e)=>{if(Nc(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Br(t.common.issues);return this._error=n,this._error}}};be=class{get description(){return this._def.description}_getType(e){return ii(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:ii(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new On,ctx:{common:e.parent.common,data:e.data,parsedType:ii(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if($d(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)},o=this._parseSync({data:e,path:r.path,parent:r});return ure(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Nc(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Nc(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ii(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await($d(o)?o:Promise.resolve(o));return ure(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:w.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new qo({schema:this,typeName:me.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Ho.create(this,this._def)}nullable(){return ci.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ra.create(this)}promise(){return Cc.create(this,this._def)}or(e){return rl.create([this,e],this._def)}and(e){return ol.create(this,e,this._def)}transform(e){return new qo({...Re(this._def),schema:this,typeName:me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new ul({...Re(this._def),innerType:this,defaultValue:n,typeName:me.ZodDefault})}brand(){return new Mh({typeName:me.ZodBranded,type:this,...Re(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new ll({...Re(this._def),innerType:this,catchValue:n,typeName:me.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Lh.create(this,e)}readonly(){return pl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wHe=/^c[^\s-]{8,}$/i,DHe=/^[0-9a-z]+$/,UHe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kHe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jHe=/^[a-z0-9_-]{21}$/i,BHe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,GHe=/^[-+]?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)?)??$/,$He=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,FHe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",HHe=/^(?:(?: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])$/,VHe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,qHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,YHe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WHe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,KHe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,pre="((\\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])))",zHe=new RegExp(`^${pre}$`);bc=class t extends be{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Y.string){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.string,received:s.parsedType}),pe}let r=new On,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?H(o,{code:w.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&H(o,{code:w.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")$He.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"email",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")nw||(nw=new RegExp(FHe,"u")),nw.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"emoji",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")kHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"uuid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")jHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"nanoid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")wHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")DHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cuid2",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")UHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ulid",code:w.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),H(o,{validation:"url",code:w.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"regex",code:w.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?fre(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?zHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?XHe(s).test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{code:w.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?GHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"duration",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?QHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"ip",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?JHe(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"jwt",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?ZHe(e.data,s.version)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"cidr",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?WHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64",code:w.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?KHe.test(e.data)||(o=this._getOrReturnCtx(e,o),H(o,{validation:"base64url",code:w.invalid_string,message:s.message}),r.dirty()):ve.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:w.invalid_string,...re.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...re.errToObj(e)})}url(e){return this._addCheck({kind:"url",...re.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...re.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...re.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...re.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...re.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...re.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...re.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...re.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...re.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...re.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...re.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...re.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...re.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...re.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...re.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...re.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...re.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...re.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...re.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...re.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...re.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...re.errToObj(n)})}nonempty(e){return this.min(1,re.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};bc.create=t=>new bc({checks:[],typeName:me.ZodString,coerce:t?.coerce??!1,...Re(t)});Qu=class t extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Y.number){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.number,received:s.parsedType}),pe}let r,o=new On;for(let s of this._def.checks)s.kind==="int"?ve.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:w.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?eVe(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_finite,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:re.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:re.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:re.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:re.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Qu.create=t=>new Qu({checks:[],typeName:me.ZodNumber,coerce:t?.coerce||!1,...Re(t)});Ju=class t extends be{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==Y.bigint)return this._getInvalidInput(e);let r,o=new On;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),H(r,{code:w.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ve.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return H(n,{code:w.invalid_type,expected:Y.bigint,received:n.parsedType}),pe}gte(e,n){return this.setLimit("min",e,!0,re.toString(n))}gt(e,n){return this.setLimit("min",e,!1,re.toString(n))}lte(e,n){return this.setLimit("max",e,!0,re.toString(n))}lt(e,n){return this.setLimit("max",e,!1,re.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:re.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:re.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:re.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:re.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:re.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:re.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Ju.create=t=>new Ju({checks:[],typeName:me.ZodBigInt,coerce:t?.coerce??!1,...Re(t)});Zu=class extends be{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Y.boolean){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.boolean,received:r.parsedType}),pe}return Kn(e.data)}};Zu.create=t=>new Zu({typeName:me.ZodBoolean,coerce:t?.coerce||!1,...Re(t)});el=class t extends be{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Y.date){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_type,expected:Y.date,received:s.parsedType}),pe}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return H(s,{code:w.invalid_date}),pe}let r=new On,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),H(o,{code:w.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ve.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:re.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:re.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};el.create=t=>new el({checks:[],coerce:t?.coerce||!1,typeName:me.ZodDate,...Re(t)});Hd=class extends be{_parse(e){if(this._getType(e)!==Y.symbol){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.symbol,received:r.parsedType}),pe}return Kn(e.data)}};Hd.create=t=>new Hd({typeName:me.ZodSymbol,...Re(t)});tl=class extends be{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.undefined,received:r.parsedType}),pe}return Kn(e.data)}};tl.create=t=>new tl({typeName:me.ZodUndefined,...Re(t)});nl=class extends be{_parse(e){if(this._getType(e)!==Y.null){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.null,received:r.parsedType}),pe}return Kn(e.data)}};nl.create=t=>new nl({typeName:me.ZodNull,...Re(t)});Oc=class extends be{constructor(){super(...arguments),this._any=!0}_parse(e){return Kn(e.data)}};Oc.create=t=>new Oc({typeName:me.ZodAny,...Re(t)});na=class extends be{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Kn(e.data)}};na.create=t=>new na({typeName:me.ZodUnknown,...Re(t)});gs=class extends be{_parse(e){let n=this._getOrReturnCtx(e);return H(n,{code:w.invalid_type,expected:Y.never,received:n.parsedType}),pe}};gs.create=t=>new gs({typeName:me.ZodNever,...Re(t)});Vd=class extends be{_parse(e){if(this._getType(e)!==Y.undefined){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.void,received:r.parsedType}),pe}return Kn(e.data)}};Vd.create=t=>new Vd({typeName:me.ZodVoid,...Re(t)});ra=class t extends be{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==Y.array)return H(n,{code:w.invalid_type,expected:Y.array,received:n.parsedType}),pe;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(H(n,{code:i?w.too_big:w.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(H(n,{code:w.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(H(n,{code:w.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Vo(n,i,n.path,a)))).then(i=>On.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Vo(n,i,n.path,a)));return On.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:re.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:re.toString(n)}})}nonempty(e){return this.min(1,e)}};ra.create=(t,e)=>new ra({type:t,minLength:null,maxLength:null,exactLength:null,typeName:me.ZodArray,...Re(e)});Gr=class t extends be{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ve.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==Y.object){let d=this._getOrReturnCtx(e);return H(d,{code:w.invalid_type,expected:Y.object,received:d.parsedType}),pe}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gs&&this._def.unknownKeys==="strip"))for(let d in o.data)i.includes(d)||a.push(d);let c=[];for(let d of i){let f=s[d],m=o.data[d];c.push({key:{status:"valid",value:d},value:f._parse(new Vo(o,m,o.path,d)),alwaysSet:d in o.data})}if(this._def.catchall instanceof gs){let d=this._def.unknownKeys;if(d==="passthrough")for(let f of a)c.push({key:{status:"valid",value:f},value:{status:"valid",value:o.data[f]}});else if(d==="strict")a.length>0&&(H(o,{code:w.unrecognized_keys,keys:a}),r.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let f of a){let m=o.data[f];c.push({key:{status:"valid",value:f},value:d._parse(new Vo(o,m,o.path,f)),alwaysSet:f in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let d=[];for(let f of c){let m=await f.key,_=await f.value;d.push({key:m,value:_,alwaysSet:f.alwaysSet})}return d}).then(d=>On.mergeObjectSync(r,d)):On.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return re.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:re.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:me.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ve.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ve.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Fd(this)}partial(e){let n={};for(let r of ve.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ve.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Ho;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return mre(ve.objectKeys(this.shape))}};Gr.create=(t,e)=>new Gr({shape:()=>t,unknownKeys:"strip",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});Gr.strictCreate=(t,e)=>new Gr({shape:()=>t,unknownKeys:"strict",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});Gr.lazycreate=(t,e)=>new Gr({shape:t,unknownKeys:"strip",catchall:gs.create(),typeName:me.ZodObject,...Re(e)});rl=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Br(a.ctx.common.issues));return H(n,{code:w.invalid_union,unionErrors:i}),pe}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let d={...n,common:{...n.common,issues:[]},parent:null},f=c._parseSync({data:n.data,path:n.path,parent:d});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Br(c));return H(n,{code:w.invalid_union,unionErrors:a}),pe}}get options(){return this._def.options}};rl.create=(t,e)=>new rl({options:t,typeName:me.ZodUnion,...Re(e)});ta=t=>t instanceof sl?ta(t.schema):t instanceof qo?ta(t.innerType()):t instanceof il?[t.value]:t instanceof al?t.options:t instanceof cl?ve.objectValues(t.enum):t instanceof ul?ta(t._def.innerType):t instanceof tl?[void 0]:t instanceof nl?[null]:t instanceof Ho?[void 0,...ta(t.unwrap())]:t instanceof ci?[null,...ta(t.unwrap())]:t instanceof Mh||t instanceof pl?ta(t.unwrap()):t instanceof ll?ta(t._def.innerType):[],KR=class t extends be{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.object)return H(n,{code:w.invalid_type,expected:Y.object,received:n.parsedType}),pe;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(H(n,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),pe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=ta(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:me.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...Re(r)})}};ol=class extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(YR(s)||YR(i))return pe;let a=rw(s.value,i.value);return a.valid?((WR(s)||WR(i))&&n.dirty(),{status:n.value,value:a.data}):(H(r,{code:w.invalid_intersection_types}),pe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ol.create=(t,e,n)=>new ol({left:t,right:e,typeName:me.ZodIntersection,...Re(n)});ai=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.array)return H(r,{code:w.invalid_type,expected:Y.array,received:r.parsedType}),pe;if(r.data.length<this._def.items.length)return H(r,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pe;!this._def.rest&&r.data.length>this._def.items.length&&(H(r,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Vo(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>On.mergeArray(n,i)):On.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};ai.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ai({items:t,typeName:me.ZodTuple,rest:null,...Re(e)})};zR=class t extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.object)return H(r,{code:w.invalid_type,expected:Y.object,received:r.parsedType}),pe;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Vo(r,a,r.path,a)),value:i._parse(new Vo(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?On.mergeObjectAsync(n,o):On.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof be?new t({keyType:e,valueType:n,typeName:me.ZodRecord,...Re(r)}):new t({keyType:bc.create(),valueType:e,typeName:me.ZodRecord,...Re(n)})}},qd=class extends be{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.map)return H(r,{code:w.invalid_type,expected:Y.map,received:r.parsedType}),pe;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],d)=>({key:o._parse(new Vo(r,a,r.path,[d,"key"])),value:s._parse(new Vo(r,c,r.path,[d,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let d=await c.key,f=await c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let d=c.key,f=c.value;if(d.status==="aborted"||f.status==="aborted")return pe;(d.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(d.value,f.value)}return{status:n.value,value:a}}}};qd.create=(t,e,n)=>new qd({valueType:e,keyType:t,typeName:me.ZodMap,...Re(n)});Yd=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==Y.set)return H(r,{code:w.invalid_type,expected:Y.set,received:r.parsedType}),pe;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(H(r,{code:w.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(H(r,{code:w.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let d=new Set;for(let f of c){if(f.status==="aborted")return pe;f.status==="dirty"&&n.dirty(),d.add(f.value)}return{status:n.value,value:d}}let a=[...r.data.values()].map((c,d)=>s._parse(new Vo(r,c,r.path,d)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:re.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:re.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Yd.create=(t,e)=>new Yd({valueType:t,minSize:null,maxSize:null,typeName:me.ZodSet,...Re(e)});XR=class t extends be{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.function)return H(n,{code:w.invalid_type,expected:Y.function,received:n.parsedType}),pe;function r(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Gd(),ea].filter(d=>!!d),issueData:{code:w.invalid_arguments,argumentsError:c}})}function o(a,c){return vh({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Gd(),ea].filter(d=>!!d),issueData:{code:w.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Cc){let a=this;return Kn(async function(...c){let d=new Br([]),f=await a._def.args.parseAsync(c,s).catch(g=>{throw d.addIssue(r(c,g)),d}),m=await Reflect.apply(i,this,f);return await a._def.returns._def.type.parseAsync(m,s).catch(g=>{throw d.addIssue(o(m,g)),d})})}else{let a=this;return Kn(function(...c){let d=a._def.args.safeParse(c,s);if(!d.success)throw new Br([r(c,d.error)]);let f=Reflect.apply(i,this,d.data),m=a._def.returns.safeParse(f,s);if(!m.success)throw new Br([o(f,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:ai.create(e).rest(na.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||ai.create([]).rest(na.create()),returns:n||na.create(),typeName:me.ZodFunction,...Re(r)})}},sl=class extends be{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};sl.create=(t,e)=>new sl({getter:t,typeName:me.ZodLazy,...Re(e)});il=class extends be{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return H(n,{received:n.data,code:w.invalid_literal,expected:this._def.value}),pe}return{status:"valid",value:e.data}}get value(){return this._def.value}};il.create=(t,e)=>new il({value:t,typeName:me.ZodLiteral,...Re(e)});al=class t extends be{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{expected:ve.joinValues(r),received:n.parsedType,code:w.invalid_type}),pe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return H(n,{received:n.data,code:w.invalid_enum_value,options:r}),pe}return Kn(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};al.create=mre;cl=class extends be{_parse(e){let n=ve.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==Y.string&&r.parsedType!==Y.number){let o=ve.objectValues(n);return H(r,{expected:ve.joinValues(o),received:r.parsedType,code:w.invalid_type}),pe}if(this._cache||(this._cache=new Set(ve.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ve.objectValues(n);return H(r,{received:r.data,code:w.invalid_enum_value,options:o}),pe}return Kn(e.data)}get enum(){return this._def.values}};cl.create=(t,e)=>new cl({values:t,typeName:me.ZodNativeEnum,...Re(e)});Cc=class extends be{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==Y.promise&&n.common.async===!1)return H(n,{code:w.invalid_type,expected:Y.promise,received:n.parsedType}),pe;let r=n.parsedType===Y.promise?n.data:Promise.resolve(n.data);return Kn(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Cc.create=(t,e)=>new Cc({type:t,typeName:me.ZodPromise,...Re(e)});qo=class extends be{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{H(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return pe;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?pe:c.status==="dirty"?Xu(c.value):n.value==="dirty"?Xu(c.value):c});{if(n.value==="aborted")return pe;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?pe:a.status==="dirty"?Xu(a.value):n.value==="dirty"?Xu(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?pe:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Nc(i))return pe;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Nc(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):pe);ve.assertNever(o)}};qo.create=(t,e,n)=>new qo({schema:t,typeName:me.ZodEffects,effect:e,...Re(n)});qo.createWithPreprocess=(t,e,n)=>new qo({schema:e,effect:{type:"preprocess",transform:t},typeName:me.ZodEffects,...Re(n)});Ho=class extends be{_parse(e){return this._getType(e)===Y.undefined?Kn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ho.create=(t,e)=>new Ho({innerType:t,typeName:me.ZodOptional,...Re(e)});ci=class extends be{_parse(e){return this._getType(e)===Y.null?Kn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ci.create=(t,e)=>new ci({innerType:t,typeName:me.ZodNullable,...Re(e)});ul=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===Y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};ul.create=(t,e)=>new ul({innerType:t,typeName:me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Re(e)});ll=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $d(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Br(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Br(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};ll.create=(t,e)=>new ll({innerType:t,typeName:me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Re(e)});Wd=class extends be{_parse(e){if(this._getType(e)!==Y.nan){let r=this._getOrReturnCtx(e);return H(r,{code:w.invalid_type,expected:Y.nan,received:r.parsedType}),pe}return{status:"valid",value:e.data}}};Wd.create=t=>new Wd({typeName:me.ZodNaN,...Re(t)});tVe=Symbol("zod_brand"),Mh=class extends be{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Lh=class t extends be{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?pe:s.status==="dirty"?(n.dirty(),Xu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?pe:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:me.ZodPipeline})}},pl=class extends be{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Nc(o)&&(o.value=Object.freeze(o.value)),o);return $d(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};pl.create=(t,e)=>new pl({innerType:t,typeName:me.ZodReadonly,...Re(e)});nVe={object:Gr.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(me||(me={}));rVe=(t,e={message:`Input not instance of ${t.name}`})=>_re(n=>n instanceof t,e),hre=bc.create,gre=Qu.create,oVe=Wd.create,sVe=Ju.create,Ere=Zu.create,iVe=el.create,aVe=Hd.create,cVe=tl.create,uVe=nl.create,lVe=Oc.create,pVe=na.create,dVe=gs.create,fVe=Vd.create,mVe=ra.create,_Ve=Gr.create,hVe=Gr.strictCreate,gVe=rl.create,EVe=KR.create,TVe=ol.create,SVe=ai.create,AVe=zR.create,yVe=qd.create,RVe=Yd.create,IVe=XR.create,NVe=sl.create,bVe=il.create,OVe=al.create,CVe=cl.create,PVe=Cc.create,xVe=qo.create,vVe=Ho.create,MVe=ci.create,LVe=qo.createWithPreprocess,wVe=Lh.create,DVe=()=>hre().optional(),UVe=()=>gre().optional(),kVe=()=>Ere().optional(),jVe={string:(t=>bc.create({...t,coerce:!0})),number:(t=>Qu.create({...t,coerce:!0})),boolean:(t=>Zu.create({...t,coerce:!0})),bigint:(t=>Ju.create({...t,coerce:!0})),date:(t=>el.create({...t,coerce:!0}))},BVe=pe});var E={};Mn(E,{BRAND:()=>tVe,DIRTY:()=>Xu,EMPTY_PATH:()=>LHe,INVALID:()=>pe,NEVER:()=>BVe,OK:()=>Kn,ParseStatus:()=>On,Schema:()=>be,ZodAny:()=>Oc,ZodArray:()=>ra,ZodBigInt:()=>Ju,ZodBoolean:()=>Zu,ZodBranded:()=>Mh,ZodCatch:()=>ll,ZodDate:()=>el,ZodDefault:()=>ul,ZodDiscriminatedUnion:()=>KR,ZodEffects:()=>qo,ZodEnum:()=>al,ZodError:()=>Br,ZodFirstPartyTypeKind:()=>me,ZodFunction:()=>XR,ZodIntersection:()=>ol,ZodIssueCode:()=>w,ZodLazy:()=>sl,ZodLiteral:()=>il,ZodMap:()=>qd,ZodNaN:()=>Wd,ZodNativeEnum:()=>cl,ZodNever:()=>gs,ZodNull:()=>nl,ZodNullable:()=>ci,ZodNumber:()=>Qu,ZodObject:()=>Gr,ZodOptional:()=>Ho,ZodParsedType:()=>Y,ZodPipeline:()=>Lh,ZodPromise:()=>Cc,ZodReadonly:()=>pl,ZodRecord:()=>zR,ZodSchema:()=>be,ZodSet:()=>Yd,ZodString:()=>bc,ZodSymbol:()=>Hd,ZodTransformer:()=>qo,ZodTuple:()=>ai,ZodType:()=>be,ZodUndefined:()=>tl,ZodUnion:()=>rl,ZodUnknown:()=>na,ZodVoid:()=>Vd,addIssueToContext:()=>H,any:()=>lVe,array:()=>mVe,bigint:()=>sVe,boolean:()=>Ere,coerce:()=>jVe,custom:()=>_re,date:()=>iVe,datetimeRegex:()=>fre,defaultErrorMap:()=>ea,discriminatedUnion:()=>EVe,effect:()=>xVe,enum:()=>OVe,function:()=>IVe,getErrorMap:()=>Gd,getParsedType:()=>ii,instanceof:()=>rVe,intersection:()=>TVe,isAborted:()=>YR,isAsync:()=>$d,isDirty:()=>WR,isValid:()=>Nc,late:()=>nVe,lazy:()=>NVe,literal:()=>bVe,makeIssue:()=>vh,map:()=>yVe,nan:()=>oVe,nativeEnum:()=>CVe,never:()=>dVe,null:()=>uVe,nullable:()=>MVe,number:()=>gre,object:()=>_Ve,objectUtil:()=>ZL,oboolean:()=>kVe,onumber:()=>UVe,optional:()=>vVe,ostring:()=>DVe,pipeline:()=>wVe,preprocess:()=>LVe,promise:()=>PVe,quotelessJson:()=>xHe,record:()=>AVe,set:()=>RVe,setErrorMap:()=>MHe,strictObject:()=>hVe,string:()=>hre,symbol:()=>aVe,transformer:()=>xVe,tuple:()=>SVe,undefined:()=>cVe,union:()=>gVe,unknown:()=>pVe,util:()=>ve,void:()=>fVe});var ow=S(()=>{p();u();l();qR();tw();are();xh();Tre();VR()});var Pc=S(()=>{p();u();l();ow();ow()});var Sre,Are,QR,JR=S(()=>{"use strict";p();u();l();Pc();Sre=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string()}),Are=E.object({dsn:E.string(),projectId:E.string(),orgId:E.string().optional(),source:E.enum(["env","env_file","config","code","inferred"]),sourcePath:E.string().optional(),resolved:Sre.optional(),allResolved:E.array(Sre).optional(),cachedAt:E.number()}),QR=["packages","apps","libs","services","modules"]});var GVe,yre,Rre,$Ve,FVe,HVe,Ire=S(()=>{"use strict";p();u();l();Pc();JR();GVe=E.object({orgSlug:E.string(),orgName:E.string(),projectSlug:E.string(),projectName:E.string(),cachedAt:E.number()}),yre=E.object({orgSlug:E.string(),projectSlug:E.string()}),Rre=E.object({aliases:E.record(yre),cachedAt:E.number(),dsnFingerprint:E.string().optional()}),$Ve=E.object({token:E.string().optional(),refreshToken:E.string().optional(),expiresAt:E.number().optional(),issuedAt:E.number().optional()}),FVe=E.object({organization:E.string().optional(),project:E.string().optional()}),HVe=E.object({auth:$Ve.optional(),defaults:FVe.optional(),projectCache:E.record(GVe).optional(),dsnCache:E.record(Are).optional(),projectAliases:Rre.optional()})});var sw,ZR,eI,Nre=S(()=>{"use strict";p();u();l();Pc();sw=E.object({device_code:E.string(),user_code:E.string(),verification_uri:E.string(),verification_uri_complete:E.string().optional(),expires_in:E.number(),interval:E.number()}).passthrough(),ZR=E.object({access_token:E.string(),token_type:E.string(),expires_in:E.number(),expires_at:E.string().optional(),refresh_token:E.string().optional(),scope:E.string().optional(),user:E.object({id:E.string(),name:E.string(),email:E.string()}).passthrough().optional()}).passthrough(),eI=E.object({error:E.string(),error_description:E.string().optional()}).passthrough()});function iw(t){return Ore.includes(t)}function wh(t){if(!t.steps)return[];for(let e of t.steps)if(e.key==="root_cause_analysis"&&e.causes)return e.causes;return[]}function tqe(t){for(let e of t)if(e.key==="solution"){let n=Cre.safeParse(e);if(n.success)return n.data}return null}function bre(t){for(let e of t)if(e.artifacts){let n=tqe(e.artifacts);if(n)return n}return null}function tI(t){let e=t;if(e.blocks){let n=bre(e.blocks);if(n)return n}if(e.steps){let n=bre(e.steps);if(n)return n}return null}var Ore,VVe,qVe,YVe,WVe,KVe,zVe,XVe,QVe,Q4t,JVe,ZVe,Cre,eqe,J4t,Z4t,ezt,tzt,Dh=S(()=>{"use strict";p();u();l();Pc();Ore=["COMPLETED","ERROR","CANCELLED"],VVe=E.object({message:E.string(),timestamp:E.string(),type:E.string().optional()}),qVe=E.object({file_path:E.string(),repo_name:E.string()}),YVe=E.object({title:E.string(),code_snippet_and_analysis:E.string(),is_most_important_event:E.boolean().optional(),relevant_code_file:qVe.optional(),timeline_item_type:E.string().optional()}),WVe=E.object({id:E.number(),description:E.string(),relevant_repos:E.array(E.string()).optional(),reproduction_urls:E.array(E.string()).optional(),root_cause_reproduction:E.array(YVe).optional()}),KVe=E.object({cause_id:E.number(),instruction:E.string().nullable().optional()}),zVe=E.object({id:E.string(),key:E.string(),status:E.string(),title:E.string(),progress:E.array(VVe).optional(),causes:E.array(WVe).optional(),selection:KVe.optional()}).passthrough(),XVe=E.object({integration_id:E.number().optional(),url:E.string().optional(),external_id:E.string(),name:E.string(),provider:E.string().optional(),default_branch:E.string().optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),QVe=E.object({repo_external_id:E.string(),file_changes:E.array(E.unknown()).optional(),is_readable:E.boolean().optional(),is_writeable:E.boolean().optional()}),Q4t=E.object({pr_number:E.number().optional(),pr_url:E.string().optional(),repo_name:E.string().optional()}),JVe=E.object({title:E.string(),description:E.string()}),ZVe=E.object({one_line_summary:E.string(),steps:E.array(JVe)}),Cre=E.object({key:E.literal("solution"),data:ZVe,reason:E.string().optional()}),eqe=E.object({run_id:E.number(),status:E.string(),updated_at:E.string().optional(),request:E.object({organization_id:E.number().optional(),project_id:E.number().optional(),repos:E.array(E.unknown()).optional()}).optional(),codebases:E.record(E.string(),QVe).optional(),steps:E.array(zVe).optional(),repositories:E.array(XVe).optional(),coding_agents:E.record(E.string(),E.unknown()).optional(),created_at:E.string().optional(),completed_at:E.string().optional()}).passthrough(),J4t=E.object({autofix:eqe.nullable()}),Z4t=E.object({type:E.literal("select_root_cause"),cause_id:E.number(),stopping_point:E.enum(["solution","code_changes","open_pr"]).optional()}),ezt=E.object({type:E.literal("select_solution")}),tzt=E.object({type:E.literal("create_pr")})});var kre={};Mn(kre,{BreadcrumbSchema:()=>mw,BreadcrumbsEntrySchema:()=>Lre,BrowserContextSchema:()=>_w,DetailedLogsResponseSchema:()=>cI,DetailedSentryLogSchema:()=>Sw,DeviceContextSchema:()=>gw,ExceptionEntrySchema:()=>Mre,ExceptionValueSchema:()=>fw,ISSUE_LEVELS:()=>Pre,ISSUE_PRIORITIES:()=>xre,ISSUE_STATUSES:()=>uw,ISSUE_SUBSTATUSES:()=>nqe,LOG_SEVERITIES:()=>Ure,LogsResponseSchema:()=>aI,MechanismSchema:()=>dw,OrganizationLinksSchema:()=>cw,OsContextSchema:()=>hw,ProjectKeyDsnSchema:()=>Dre,ProjectKeySchema:()=>iI,RegionSchema:()=>aw,ReleaseSchema:()=>Uh,RepositoryProviderSchema:()=>yw,RequestEntrySchema:()=>wre,SentryEventSchema:()=>sI,SentryIssueSchema:()=>fl,SentryLogSchema:()=>Tw,SentryOrganizationSchema:()=>Kd,SentryProjectSchema:()=>dl,SentryRepositorySchema:()=>lI,SentryTeamSchema:()=>pI,SentryUserSchema:()=>oI,SpanSchema:()=>vre,StackFrameSchema:()=>pw,StacktraceSchema:()=>nI,TraceContextSchema:()=>lw,TransactionListItemSchema:()=>Aw,TransactionsResponseSchema:()=>uI,UserGeoSchema:()=>Ew,UserRegionsResponseSchema:()=>rI});var aw,rI,cw,Kd,oI,dl,uw,Pre,xre,nqe,Uh,fl,lw,vre,pw,nI,dw,fw,Mre,mw,Lre,wre,_w,hw,gw,Ew,sI,Dre,iI,Ure,Tw,aI,Sw,cI,Aw,uI,yw,lI,pI,Rw=S(()=>{"use strict";p();u();l();Pc();aw=E.object({name:E.string(),url:E.string().url()}),rI=E.object({regions:E.array(aw)}),cw=E.object({organizationUrl:E.string(),regionUrl:E.string()}),Kd=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isEarlyAdopter:E.boolean().optional(),require2FA:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),features:E.array(E.string()).optional(),links:cw.optional()}).passthrough(),oI=E.object({id:E.string(),email:E.string().optional(),username:E.string().optional(),name:E.string().optional()}).passthrough(),dl=E.object({id:E.string(),slug:E.string(),name:E.string(),platform:E.string().nullable().optional(),dateCreated:E.string().optional(),isBookmarked:E.boolean().optional(),isMember:E.boolean().optional(),features:E.array(E.string()).optional(),firstEvent:E.string().nullable().optional(),firstTransactionEvent:E.boolean().optional(),access:E.array(E.string()).optional(),hasAccess:E.boolean().optional(),hasMinifiedStackTrace:E.boolean().optional(),hasMonitors:E.boolean().optional(),hasProfiles:E.boolean().optional(),hasReplays:E.boolean().optional(),hasSessions:E.boolean().optional(),isInternal:E.boolean().optional(),isPublic:E.boolean().optional(),avatar:E.object({avatarType:E.string(),avatarUuid:E.string().nullable()}).passthrough().optional(),color:E.string().optional(),status:E.string().optional(),organization:E.object({id:E.string(),slug:E.string(),name:E.string()}).passthrough().optional()}).passthrough(),uw=["resolved","unresolved","ignored"],Pre=["fatal","error","warning","info","debug"],xre=["high","medium","low"],nqe=["ongoing","escalating","regressed","new","archived_until_escalating","archived_until_condition_met","archived_forever"],Uh=E.object({id:E.number().optional(),version:E.string(),shortVersion:E.string().optional(),status:E.string().optional(),dateCreated:E.string().optional(),dateReleased:E.string().nullable().optional(),ref:E.string().nullable().optional(),url:E.string().nullable().optional(),commitCount:E.number().optional(),deployCount:E.number().optional(),authors:E.array(E.unknown()).optional(),projects:E.array(E.object({id:E.union([E.string(),E.number()]),slug:E.string(),name:E.string()}).passthrough()).optional()}).passthrough(),fl=E.object({id:E.string(),shortId:E.string(),title:E.string(),culprit:E.string().optional(),permalink:E.string().optional(),logger:E.string().nullable().optional(),level:E.string().optional(),status:E.enum(uw).optional(),statusDetails:E.record(E.unknown()).optional(),substatus:E.string().optional().nullable(),priority:E.string().optional(),isPublic:E.boolean().optional(),platform:E.string().optional(),project:E.object({id:E.string(),name:E.string(),slug:E.string(),platform:E.string().nullable().optional()}).passthrough().optional(),type:E.string().optional(),metadata:E.object({value:E.string().optional(),type:E.string().optional(),filename:E.string().optional(),function:E.string().optional(),display_title_with_tree_label:E.boolean().optional()}).passthrough().optional(),numComments:E.number().optional(),assignedTo:E.object({id:E.string(),name:E.string(),type:E.string()}).passthrough().nullable().optional(),isBookmarked:E.boolean().optional(),isSubscribed:E.boolean().optional(),subscriptionDetails:E.object({reason:E.string().optional()}).passthrough().nullable().optional(),hasSeen:E.boolean().optional(),annotations:E.array(E.object({displayName:E.string(),url:E.string()}).passthrough()).optional(),isUnhandled:E.boolean().optional(),count:E.string().optional(),userCount:E.number().optional(),firstSeen:E.string().datetime({offset:!0}).optional(),lastSeen:E.string().datetime({offset:!0}).optional(),firstRelease:Uh.nullable().optional(),lastRelease:Uh.nullable().optional(),seerFixabilityScore:E.number().nullable().optional()}).passthrough(),lw=E.object({trace_id:E.string().optional(),span_id:E.string().optional(),parent_span_id:E.string().nullable().optional(),op:E.string().optional(),status:E.string().optional(),description:E.string().nullable().optional()}).passthrough(),vre=E.object({span_id:E.string(),parent_span_id:E.string().nullable().optional(),trace_id:E.string().optional(),op:E.string().optional(),description:E.string().nullable().optional(),start_timestamp:E.number(),timestamp:E.number(),status:E.string().optional(),data:E.record(E.unknown()).optional(),tags:E.record(E.string()).optional()}).passthrough(),pw=E.object({filename:E.string().nullable().optional(),absPath:E.string().nullable().optional(),module:E.string().nullable().optional(),package:E.string().nullable().optional(),platform:E.string().nullable().optional(),function:E.string().nullable().optional(),rawFunction:E.string().nullable().optional(),symbol:E.string().nullable().optional(),lineNo:E.number().nullable().optional(),colNo:E.number().nullable().optional(),inApp:E.boolean().nullable().optional(),context:E.array(E.tuple([E.number(),E.string()])).nullable().optional(),vars:E.record(E.unknown()).nullable().optional(),instructionAddr:E.string().nullable().optional(),symbolAddr:E.string().nullable().optional(),trust:E.string().nullable().optional(),errors:E.array(E.unknown()).nullable().optional()}).passthrough(),nI=E.object({frames:E.array(pw).optional(),framesOmitted:E.array(E.number()).nullable().optional(),registers:E.record(E.string()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough(),dw=E.object({type:E.string().optional(),handled:E.boolean().optional(),synthetic:E.boolean().optional(),description:E.string().nullable().optional(),data:E.record(E.unknown()).optional()}).passthrough(),fw=E.object({type:E.string().nullable().optional(),value:E.string().nullable().optional(),module:E.string().nullable().optional(),threadId:E.union([E.string(),E.number()]).nullable().optional(),mechanism:dw.nullable().optional(),stacktrace:nI.nullable().optional(),rawStacktrace:nI.nullable().optional()}).passthrough(),Mre=E.object({type:E.literal("exception"),data:E.object({values:E.array(fw).optional(),excOmitted:E.array(E.number()).nullable().optional(),hasSystemFrames:E.boolean().optional()}).passthrough()}),mw=E.object({type:E.string().optional(),category:E.string().nullable().optional(),level:E.string().optional(),message:E.string().nullable().optional(),timestamp:E.string().optional(),event_id:E.string().nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough(),Lre=E.object({type:E.literal("breadcrumbs"),data:E.object({values:E.array(mw).optional()}).passthrough()}),wre=E.object({type:E.literal("request"),data:E.object({url:E.string().nullable().optional(),method:E.string().nullable().optional(),fragment:E.string().nullable().optional(),query:E.union([E.array(E.tuple([E.string(),E.string()])),E.string(),E.record(E.string())]).nullable().optional(),data:E.unknown().nullable().optional(),headers:E.array(E.tuple([E.string(),E.string()])).nullable().optional(),cookies:E.union([E.array(E.tuple([E.string(),E.string()])),E.record(E.string())]).nullable().optional(),env:E.record(E.string()).nullable().optional(),inferredContentType:E.string().nullable().optional(),apiTarget:E.string().nullable().optional()}).passthrough()}),_w=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("browser").optional()}).passthrough(),hw=E.object({name:E.string().optional(),version:E.string().optional(),type:E.literal("os").optional()}).passthrough(),gw=E.object({family:E.string().optional(),model:E.string().optional(),brand:E.string().optional(),type:E.literal("device").optional()}).passthrough(),Ew=E.object({country_code:E.string().optional(),city:E.string().optional(),region:E.string().optional()}).passthrough(),sI=E.object({eventID:E.string(),id:E.string().optional(),projectID:E.string().optional(),context:E.record(E.unknown()).optional(),contexts:E.object({trace:lw.optional(),browser:_w.optional(),os:hw.optional(),device:gw.optional()}).passthrough().optional(),dateCreated:E.string().optional(),dateReceived:E.string().optional(),entries:E.array(E.unknown()).optional(),errors:E.array(E.unknown()).optional(),fingerprints:E.array(E.string()).optional(),groupID:E.string().optional(),message:E.string().optional(),metadata:E.record(E.unknown()).optional(),platform:E.string().optional(),location:E.string().nullable().optional(),culprit:E.string().nullable().optional(),sdk:E.object({name:E.string().nullable().optional(),version:E.string().nullable().optional()}).passthrough().nullable().optional(),tags:E.array(E.object({key:E.string(),value:E.string()})).optional(),title:E.string().optional(),type:E.string().optional(),user:E.object({id:E.string().nullable().optional(),email:E.string().nullable().optional(),username:E.string().nullable().optional(),ip_address:E.string().nullable().optional(),name:E.string().nullable().optional(),geo:Ew.nullable().optional(),data:E.record(E.unknown()).nullable().optional()}).passthrough().nullable().optional(),release:Uh.nullable().optional(),sdkUpdates:E.array(E.object({type:E.string().optional(),sdkName:E.string().optional(),newSdkVersion:E.string().optional(),sdkUrl:E.string().optional()}).passthrough()).optional()}).passthrough(),Dre=E.object({public:E.string(),secret:E.string().optional()}),iI=E.object({id:E.string(),name:E.string(),dsn:Dre,isActive:E.boolean(),dateCreated:E.string().optional()}).passthrough(),Ure=["fatal","error","warning","warn","info","debug","trace"],Tw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional()}).passthrough(),aI=E.object({data:E.array(Tw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Sw=E.object({"sentry.item_id":E.string(),timestamp:E.string(),timestamp_precise:E.number(),message:E.string().nullable().optional(),severity:E.string().nullable().optional(),trace:E.string().nullable().optional(),project:E.string().nullable().optional(),environment:E.string().nullable().optional(),release:E.string().nullable().optional(),"sdk.name":E.string().nullable().optional(),"sdk.version":E.string().nullable().optional(),span_id:E.string().nullable().optional(),"code.function":E.string().nullable().optional(),"code.file.path":E.string().nullable().optional(),"code.line.number":E.string().nullable().optional(),"sentry.otel.kind":E.string().nullable().optional(),"sentry.otel.status_code":E.string().nullable().optional(),"sentry.otel.instrumentation_scope.name":E.string().nullable().optional()}).passthrough(),cI=E.object({data:E.array(Sw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),Aw=E.object({trace:E.string(),id:E.string(),transaction:E.string(),timestamp:E.string(),"transaction.duration":E.number(),project:E.string()}).passthrough(),uI=E.object({data:E.array(Aw),meta:E.object({fields:E.record(E.string()).optional()}).passthrough().optional()}),yw=E.object({id:E.string(),name:E.string()}),lI=E.object({id:E.string(),name:E.string(),url:E.string().nullable(),provider:yw,status:E.string(),dateCreated:E.string().optional(),integrationId:E.string().optional(),externalSlug:E.string().nullable().optional(),externalId:E.string().nullable().optional()}).passthrough(),pI=E.object({id:E.string(),slug:E.string(),name:E.string(),dateCreated:E.string().optional(),isMember:E.boolean().optional(),teamRole:E.string().nullable().optional(),memberCount:E.number().optional()}).passthrough()});var Iw=S(()=>{"use strict";p();u();l();Ire();Nre();Dh();Rw()});function ml(){let t=typeof process.versions.bun<"u"?`bun/${process.versions.bun}`:`node/${process.versions.node}`;return`sentry-cli/${hn} (${process.platform}-${process.arch}) ${t}`}var oa,kh,hn,jre,lo=S(()=>{"use strict";p();u();l();oa="sentry.io",kh=`https://${oa}`,hn="0.10.2";jre="https://1188a86f3f8168f089450587b00bca66@o1.ingest.us.sentry.io/4510776311808000"});var rqe,Bre,Gre=S(()=>{p();u();l();rqe=globalThis.__bun_sqlite_polyfill,Bre=rqe.Database});function oqe(t){return t.query("SELECT value FROM metadata WHERE key = ?").get(Fre)?.value==="true"}function Nw(t){t.query("INSERT OR REPLACE INTO metadata (key, value) VALUES (?, ?)").run(Fre,"true")}function sqe(){let t=(0,dI.join)(sa(),bw),{existsSync:e}=require("node:fs");return e(t)}function iqe(){let t=(0,dI.join)(sa(),bw);try{let{readFileSync:e}=require("node:fs"),n=e(t,"utf-8");return JSON.parse(n)}catch{return null}}function aqe(){let t=(0,dI.join)(sa(),bw);try{return(0,$re.rmSync)(t),!0}catch(e){return e instanceof Error&&"code"in e&&e.code==="ENOENT"?!0:(console.error("Warning: Could not delete old config.json:",e),!1)}}function Hre(t){if(oqe(t))return;if(!sqe()){Nw(t);return}let e=iqe();if(!e){Nw(t);return}console.error("Migrating config to SQLite..."),t.exec("BEGIN TRANSACTION");try{if(e.auth?.token&&t.query(`
65
65
  INSERT OR REPLACE INTO auth (id, token, refresh_token, expires_at, issued_at, updated_at)
66
66
  VALUES (1, ?, ?, ?, ?, ?)
67
67
  `).run(e.auth.token,e.auth.refreshToken??null,e.auth.expiresAt??null,e.auth.issuedAt??null,Date.now()),(e.defaults?.organization||e.defaults?.project)&&t.query(`
@@ -344,7 +344,7 @@ ${r}
344
344
  `)?`${r}${t}
345
345
  `:`${r}
346
346
  ${t}
347
- `;await Bun.write(e.GITHUB_PATH,o)}return!0}catch{return!1}}var Sie,Jt,Nie=S(()=>{"use strict";p();u();l();Sie=require("node:fs"),Jt=require("node:path")});function qI(){let t=LD();if(t?.path&&t.method==="curl")return sg(t.path);for(let n of Pie)if(process.execPath.startsWith(n))return sg(process.execPath);let e=(0,ug.join)((0,kD.homedir)(),".sentry","bin",vD());return sg(e)}function xie(){let{oldPath:t}=qI();die(t)}function o2e(t,e){return new Promise((n,r)=>{let o=(0,UD.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),s="";o.stdout.on("data",i=>{s+=i.toString()}),o.stderr.resume(),o.on("close",i=>{n({stdout:s.trim(),exitCode:i??1})}),o.on("error",r)})}async function s2e(t){try{let e=t==="yarn"?["global","list","--depth=0"]:["list","-g","sentry"],{stdout:n,exitCode:r}=await o2e(t,e);return r===0&&n.includes("sentry@")}catch{return!1}}async function i2e(){for(let e of Pie)if(process.execPath.startsWith(e))return"curl";let t=["npm","pnpm","bun","yarn"];for(let e of t)if(await s2e(e))return e;return"unknown"}async function vie(){let t=LD();if(t?.method)return t.method;let e=await i2e();return e!=="unknown"&&HI({method:e,path:process.execPath,version:hn}),e}async function BD(t){let e=await lf(`${Oie}/latest`,{headers:$I(),signal:t},"GitHub");if(!e.ok)throw new an("network_error",`Failed to fetch from GitHub: ${e.status}`);let n=await e.json();if(!n.tag_name)throw new an("network_error","No version found in GitHub release");return n.tag_name.replace(jD,"")}async function a2e(){let t=await lf(`${Cie}/latest`,{headers:{Accept:"application/json"}},"npm registry");if(!t.ok)throw new an("network_error",`Failed to fetch from npm: ${t.status}`);let e=await t.json();if(!e.version)throw new an("network_error","No version found in npm registry");return e.version}function Mie(t){return t==="curl"?BD():a2e()}async function Lie(t,e){return t==="curl"?(await lf(`${Oie}/tags/${e}`,{method:"HEAD",headers:$I()},"GitHub")).ok:(await lf(`${Cie}/${e}`,{method:"HEAD"},"npm registry")).ok}async function c2e(t){let e=lie(t),{tempPath:n,lockPath:r}=qI();og(r);try{try{(0,VI.unlinkSync)(n)}catch{}let o=await lf(e,{headers:$I()},"GitHub");if(!o.ok)throw new an("execution_failed",`Failed to download binary: HTTP ${o.status}`);return await Bun.write(n,o),process.platform!=="win32"&&(0,VI.chmodSync)(n,493),{tempBinaryPath:n,lockPath:r}}catch(o){throw ig(r),o}}function u2e(t,e){return new Promise((n,r)=>{let o=t==="yarn"?["global","add",`sentry@${e}`]:["install","-g",`sentry@${e}`],s=(0,UD.spawn)(t,o,{stdio:"inherit"});s.on("close",i=>{i===0?n():r(new an("execution_failed",`${t} install failed with exit code ${i}`))}),s.on("error",i=>{r(new an("execution_failed",`${t} failed: ${i.message}`))})})}async function wie(t,e){switch(t){case"curl":return c2e(e);case"npm":case"pnpm":case"bun":case"yarn":return await u2e(t,e),null;default:throw new an("unknown_method")}}function YI(t){let e=t.toLowerCase();if(!bie.includes(e))throw new Error(`Invalid method: ${t}. Must be one of: ${bie.join(", ")}`);return e}var UD,VI,kD,ug,Oie,Cie,jD,Pie,bie,lg=S(()=>{"use strict";p();u();l();UD=require("node:child_process"),VI=require("node:fs"),kD=require("node:os"),ug=require("node:path");FI();lo();wD();ke();Oie="https://api.github.com/repos/getsentry/cli/releases",Cie="https://registry.npmjs.org/sentry",jD=/^v/,Pie=uie.map(t=>(0,ug.join)((0,kD.homedir)(),t)+ug.sep);bie=["curl","npm","pnpm","bun","yarn"]});async function l2e(t,e,n,r){let o=pie(e,n),s=await fie(t,o),i=(0,WI.dirname)(s);if(r(`Binary: Installed to ${s}`),process.platform!=="win32")try{(0,Die.unlinkSync)(t)}catch{}return{binaryPath:s,binaryDir:i}}async function p2e(t,e,n,r){if(yie(t,n.PATH)){r(`PATH: ${t} is already in PATH`);return}if(e.configFile){let i=await Rie(e.configFile,t,e.type);i.modified?(r(`PATH: ${i.message}`),r(` Restart your shell or run: source ${e.configFile}`)):i.manualCommand?(r(`PATH: ${i.message}`),r(` Add manually: ${i.manualCommand}`)):r(`PATH: ${i.message}`)}else{let i=DD(e.type,t);r("PATH: No shell config file found"),r(` Add manually to your shell config: ${i}`)}await Iie(t,n)&&r("PATH: Added to $GITHUB_PATH")}async function d2e(t,e,n,r){let o=await mie(t.type,e,n);if(o){let s=o.created?"Installed to":"Updated";if(r(`Completions: ${s} ${o.path}`),t.type==="zsh"){let i=(0,WI.dirname)(o.path);r(` You may need to add to .zshrc: fpath=(${i} $fpath)`)}}else t.type!=="sh"&&t.type!=="ash"&&r(`Completions: Not supported for ${t.type} shell`)}async function f2e(t,e){let n=await aie(t,hn);if(n){let r=n.created?"Installed to":"Updated";e(`Agent skills: ${r} ${n.path}`)}}function m2e(t,e,n){t(""),t(`Installed sentry v${e} to ${n}`),t(""),t("Get started:"),t(" sentry auth login Authenticate with Sentry"),t(" sentry --help See all available commands"),t(""),t("https://cli.sentry.dev")}var Die,WI,Uie,kie=S(()=>{"use strict";p();u();l();Die=require("node:fs"),WI=require("node:path");cie();FI();vt();_ie();lo();wD();Nie();lg();Uie=Ie({docs:{brief:"Configure shell integration",fullDescription:`Sets up shell integration for the Sentry CLI:
347
+ `;await Bun.write(e.GITHUB_PATH,o)}return!0}catch{return!1}}var Sie,Jt,Nie=S(()=>{"use strict";p();u();l();Sie=require("node:fs"),Jt=require("node:path")});function qI(){let t=LD();if(t?.path&&t.method==="curl")return sg(t.path);for(let n of Pie)if(process.execPath.startsWith(n))return sg(process.execPath);let e=(0,ug.join)((0,kD.homedir)(),".sentry","bin",vD());return sg(e)}function xie(){let{oldPath:t}=qI();die(t)}function o2e(t,e){return new Promise((n,r)=>{let o=(0,UD.spawn)(t,e,{stdio:["ignore","pipe","pipe"]}),s="";o.stdout.on("data",i=>{s+=i.toString()}),o.stderr.resume(),o.on("close",i=>{n({stdout:s.trim(),exitCode:i??1})}),o.on("error",r)})}async function s2e(t){try{let e=t==="yarn"?["global","list","--depth=0"]:["list","-g","sentry"],{stdout:n,exitCode:r}=await o2e(t,e);return r===0&&n.includes("sentry@")}catch{return!1}}async function i2e(){for(let e of Pie)if(process.execPath.startsWith(e))return"curl";let t=["npm","pnpm","bun","yarn"];for(let e of t)if(await s2e(e))return e;return"unknown"}async function vie(){let t=LD();if(t?.method)return t.method;let e=await i2e();return e!=="unknown"&&HI({method:e,path:process.execPath,version:hn}),e}async function BD(t){let e=await lf(`${Oie}/latest`,{headers:$I(),signal:t},"GitHub");if(!e.ok)throw new an("network_error",`Failed to fetch from GitHub: ${e.status}`);let n=await e.json();if(!n.tag_name)throw new an("network_error","No version found in GitHub release");return n.tag_name.replace(jD,"")}async function a2e(){let t=await lf(`${Cie}/latest`,{headers:{Accept:"application/json"}},"npm registry");if(!t.ok)throw new an("network_error",`Failed to fetch from npm: ${t.status}`);let e=await t.json();if(!e.version)throw new an("network_error","No version found in npm registry");return e.version}function Mie(t){return t==="curl"?BD():a2e()}async function Lie(t,e){return t==="curl"?(await lf(`${Oie}/tags/${e}`,{method:"HEAD",headers:$I()},"GitHub")).ok:(await lf(`${Cie}/${e}`,{method:"HEAD"},"npm registry")).ok}async function c2e(t){let e=lie(t),{tempPath:n,lockPath:r}=qI();og(r);try{try{(0,VI.unlinkSync)(n)}catch{}let o=await lf(e,{headers:$I()},"GitHub");if(!o.ok)throw new an("execution_failed",`Failed to download binary: HTTP ${o.status}`);let s=await o.arrayBuffer();return await Bun.write(n,s),process.platform!=="win32"&&(0,VI.chmodSync)(n,493),{tempBinaryPath:n,lockPath:r}}catch(o){throw ig(r),o}}function u2e(t,e){return new Promise((n,r)=>{let o=t==="yarn"?["global","add",`sentry@${e}`]:["install","-g",`sentry@${e}`],s=(0,UD.spawn)(t,o,{stdio:"inherit"});s.on("close",i=>{i===0?n():r(new an("execution_failed",`${t} install failed with exit code ${i}`))}),s.on("error",i=>{r(new an("execution_failed",`${t} failed: ${i.message}`))})})}async function wie(t,e){switch(t){case"curl":return c2e(e);case"npm":case"pnpm":case"bun":case"yarn":return await u2e(t,e),null;default:throw new an("unknown_method")}}function YI(t){let e=t.toLowerCase();if(!bie.includes(e))throw new Error(`Invalid method: ${t}. Must be one of: ${bie.join(", ")}`);return e}var UD,VI,kD,ug,Oie,Cie,jD,Pie,bie,lg=S(()=>{"use strict";p();u();l();UD=require("node:child_process"),VI=require("node:fs"),kD=require("node:os"),ug=require("node:path");FI();lo();wD();ke();Oie="https://api.github.com/repos/getsentry/cli/releases",Cie="https://registry.npmjs.org/sentry",jD=/^v/,Pie=uie.map(t=>(0,ug.join)((0,kD.homedir)(),t)+ug.sep);bie=["curl","npm","pnpm","bun","yarn"]});async function l2e(t,e,n,r){let o=pie(e,n),s=await fie(t,o),i=(0,WI.dirname)(s);if(r(`Binary: Installed to ${s}`),process.platform!=="win32")try{(0,Die.unlinkSync)(t)}catch{}return{binaryPath:s,binaryDir:i}}async function p2e(t,e,n,r){if(yie(t,n.PATH)){r(`PATH: ${t} is already in PATH`);return}if(e.configFile){let i=await Rie(e.configFile,t,e.type);i.modified?(r(`PATH: ${i.message}`),r(` Restart your shell or run: source ${e.configFile}`)):i.manualCommand?(r(`PATH: ${i.message}`),r(` Add manually: ${i.manualCommand}`)):r(`PATH: ${i.message}`)}else{let i=DD(e.type,t);r("PATH: No shell config file found"),r(` Add manually to your shell config: ${i}`)}await Iie(t,n)&&r("PATH: Added to $GITHUB_PATH")}async function d2e(t,e,n,r){let o=await mie(t.type,e,n);if(o){let s=o.created?"Installed to":"Updated";if(r(`Completions: ${s} ${o.path}`),t.type==="zsh"){let i=(0,WI.dirname)(o.path);r(` You may need to add to .zshrc: fpath=(${i} $fpath)`)}}else t.type!=="sh"&&t.type!=="ash"&&r(`Completions: Not supported for ${t.type} shell`)}async function f2e(t,e){let n=await aie(t,hn);if(n){let r=n.created?"Installed to":"Updated";e(`Agent skills: ${r} ${n.path}`)}}function m2e(t,e,n){t(""),t(`Installed sentry v${e} to ${n}`),t(""),t("Get started:"),t(" sentry auth login Authenticate with Sentry"),t(" sentry --help See all available commands"),t(""),t("https://cli.sentry.dev")}var Die,WI,Uie,kie=S(()=>{"use strict";p();u();l();Die=require("node:fs"),WI=require("node:path");cie();FI();vt();_ie();lo();wD();Nie();lg();Uie=Ie({docs:{brief:"Configure shell integration",fullDescription:`Sets up shell integration for the Sentry CLI:
348
348
 
349
349
  - Adds binary directory to PATH (if not already in PATH)
350
350
  - Installs shell completions (bash, zsh, fish)
@@ -709,7 +709,7 @@ Make sure the trace ID is correct and the trace was sent recently.`);let m=fae(s
709
709
 
710
710
  Commands:
711
711
  list List recent traces in a project
712
- view View details of a specific trace`,hideRoute:{}}})});var Ace={};Mn(Ace,{app:()=>M0,routes:()=>pf});var pf,jze,M0,cg=S(()=>{"use strict";p();u();l();Zi();en();Uoe();tie();Hie();mce();Sce();$ce();T0();nue();I0();iue();N0();due();b0();_ue();O0();Eue();C0();Iue();v0();lo();ke();En();pf=St({routes:{help:Tce,auth:eie,cli:Fie,org:sue,project:pue,repo:mue,team:gue,issue:Gce,event:fce,log:tue,trace:Rue,api:Doe,issues:_N,orgs:EN,projects:TN,repos:SN,teams:AN,logs:gN,traces:yN},defaultCommand:"help",docs:{brief:"A gh-like CLI for Sentry",fullDescription:"sentry is a command-line interface for interacting with Sentry. It provides commands for authentication, viewing issues, and making API calls."}}),jze={...fb,exceptionWhileRunningCommand:(t,e)=>{if(t instanceof Te&&t.reason==="not_authenticated")throw t;return oe(t),t instanceof Ir?`${e?wc("Error:"):"Error:"} ${t.format()}`:t instanceof Error?`Unexpected error: ${t.stack??t.message}`:`Unexpected error: ${String(t)}`}},M0=O1(pf,{name:"sentry",versionInfo:{currentVersion:hn},scanner:{caseStyle:"allow-kebab-for-camel"},determineExitCode:Bh,localization:{loadText:()=>jze}})});var Fze={};Mn(Fze,{default:()=>$ze});module.exports=D(Fze);p();u();l();p();u();l();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b05106b9-35b2-4fbe-a182-e00a1ff1ee7c",t._sentryDebugIdIdentifier="sentry-dbid-b05106b9-35b2-4fbe-a182-e00a1ff1ee7c")}catch{}})();p();u();l();var bue=require("node:tty");en();cg();d0();ke();En();PD();Ts();lg();A0();async function Nue(t){await uoe(async e=>Wg(M0,t,p0(process,e)))}async function Bze(t){try{await Nue(t)}catch(e){if(e instanceof Te&&e.reason==="not_authenticated"&&!e.skipAutoAuth&&(0,bue.isatty)(0)){if(process.stderr.write(`Authentication required. Starting login flow...
712
+ view View details of a specific trace`,hideRoute:{}}})});var Ace={};Mn(Ace,{app:()=>M0,routes:()=>pf});var pf,jze,M0,cg=S(()=>{"use strict";p();u();l();Zi();en();Uoe();tie();Hie();mce();Sce();$ce();T0();nue();I0();iue();N0();due();b0();_ue();O0();Eue();C0();Iue();v0();lo();ke();En();pf=St({routes:{help:Tce,auth:eie,cli:Fie,org:sue,project:pue,repo:mue,team:gue,issue:Gce,event:fce,log:tue,trace:Rue,api:Doe,issues:_N,orgs:EN,projects:TN,repos:SN,teams:AN,logs:gN,traces:yN},defaultCommand:"help",docs:{brief:"A gh-like CLI for Sentry",fullDescription:"sentry is a command-line interface for interacting with Sentry. It provides commands for authentication, viewing issues, and making API calls."}}),jze={...fb,exceptionWhileRunningCommand:(t,e)=>{if(t instanceof Te&&t.reason==="not_authenticated")throw t;return oe(t),t instanceof Ir?`${e?wc("Error:"):"Error:"} ${t.format()}`:t instanceof Error?`Unexpected error: ${t.stack??t.message}`:`Unexpected error: ${String(t)}`}},M0=O1(pf,{name:"sentry",versionInfo:{currentVersion:hn},scanner:{caseStyle:"allow-kebab-for-camel"},determineExitCode:Bh,localization:{loadText:()=>jze}})});var Fze={};Mn(Fze,{default:()=>$ze});module.exports=D(Fze);p();u();l();p();u();l();(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="a7181361-9810-416c-b72b-1ff09dfdb9d3",t._sentryDebugIdIdentifier="sentry-dbid-a7181361-9810-416c-b72b-1ff09dfdb9d3")}catch{}})();p();u();l();var bue=require("node:tty");en();cg();d0();ke();En();PD();Ts();lg();A0();async function Nue(t){await uoe(async e=>Wg(M0,t,p0(process,e)))}async function Bze(t){try{await Nue(t)}catch(e){if(e instanceof Te&&e.reason==="not_authenticated"&&!e.skipAutoAuth&&(0,bue.isatty)(0)){if(process.stderr.write(`Authentication required. Starting login flow...
713
713
 
714
714
  `),await GI(process.stdout,process.stderr,process.stdin)){process.stderr.write(`
715
715
  Retrying command...