@eui/mcp 23.0.0-alpha.11 → 23.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.js CHANGED
@@ -1,39 +1,39 @@
1
1
  #!/usr/bin/env node
2
- var fx=Object.create;var Aa=Object.defineProperty;var px=Object.getOwnPropertyDescriptor;var mx=Object.getOwnPropertyNames;var hx=Object.getPrototypeOf,gx=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},sf=(t,e)=>{for(var r in e)Aa(t,r,{get:e[r],enumerable:!0})},yx=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of mx(e))!gx.call(t,o)&&o!==r&&Aa(t,o,{get:()=>e[o],enumerable:!(n=px(e,o))||n.enumerable});return t};var mt=(t,e,r)=>(r=t!=null?fx(hx(t)):{},yx(e||!t||!t.__esModule?Aa(r,"default",{value:t,enumerable:!0}):r,t));var tc=$((qj,Uf)=>{"use strict";var so=t=>t&&typeof t.message=="string",ec=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return so(r)?r:void 0}else return so(e)?e:void 0},qf=(t,e)=>{if(!so(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
- causes have become circular...`;let n=ec(t);return n?(e.add(t),r+`
4
- caused by: `+qf(n,e)):r},eS=t=>qf(t,new Set),Ff=(t,e,r)=>{if(!so(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=ec(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+Ff(o,e,s)}else return n},tS=t=>Ff(t,new Set);Uf.exports={isErrorLike:so,getErrorCause:ec,stackWithCauses:eS,messageWithCauses:tS}});var rc=$((Fj,Bf)=>{"use strict";var rS=Symbol("circular-ref-tag"),Zs=Symbol("pino-raw-err-ref"),Vf=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[Zs]},set:function(t){this[Zs]=t}}});Object.defineProperty(Vf,Zs,{writable:!0,value:{}});Bf.exports={pinoErrProto:Vf,pinoErrorSymbols:{seen:rS,rawSymbol:Zs}}});var Gf=$((Uj,Wf)=>{"use strict";Wf.exports=oc;var{messageWithCauses:nS,stackWithCauses:oS,isErrorLike:Hf}=tc(),{pinoErrProto:sS,pinoErrorSymbols:iS}=rc(),{seen:nc}=iS,{toString:aS}=Object.prototype;function oc(t){if(!Hf(t))return t;t[nc]=void 0;let e=Object.create(sS);e.type=aS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=nS(t),e.stack=oS(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>oc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Hf(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,nc)&&(e[r]=oc(n)):e[r]=n}return delete t[nc],e.raw=t,e}});var Kf=$((Vj,Jf)=>{"use strict";Jf.exports=qs;var{isErrorLike:sc}=tc(),{pinoErrProto:cS,pinoErrorSymbols:uS}=rc(),{seen:Ls}=uS,{toString:lS}=Object.prototype;function qs(t){if(!sc(t))return t;t[Ls]=void 0;let e=Object.create(cS);e.type=lS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>qs(r))),sc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Ls)&&(e.cause=qs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];sc(n)?Object.prototype.hasOwnProperty.call(n,Ls)||(e[r]=qs(n)):e[r]=n}return delete t[Ls],e.raw=t,e}});var ep=$((Bj,Xf)=>{"use strict";Xf.exports={mapHttpRequest:dS,reqSerializer:Qf};var ic=Symbol("pino-raw-req-ref"),Yf=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ic]},set:function(t){this[ic]=t}}});Object.defineProperty(Yf,ic,{writable:!0,value:{}});function Qf(t){let e=t.info||t.socket,r=Object.create(Yf);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function dS(t){return{req:Qf(t)}}});var op=$((Hj,np)=>{"use strict";np.exports={mapHttpResponse:fS,resSerializer:rp};var ac=Symbol("pino-raw-res-ref"),tp=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[ac]},set:function(t){this[ac]=t}}});Object.defineProperty(tp,ac,{writable:!0,value:{}});function rp(t){let e=Object.create(tp);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function fS(t){return{res:rp(t)}}});var uc=$((Wj,sp)=>{"use strict";var cc=Gf(),pS=Kf(),Fs=ep(),Us=op();sp.exports={err:cc,errWithCause:pS,mapHttpRequest:Fs.mapHttpRequest,mapHttpResponse:Us.mapHttpResponse,req:Fs.reqSerializer,res:Us.resSerializer,wrapErrorSerializer:function(e){return e===cc?e:function(n){return e(cc(n))}},wrapRequestSerializer:function(e){return e===Fs.reqSerializer?e:function(n){return e(Fs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Us.resSerializer?e:function(n){return e(Us.resSerializer(n))}}}});var lc=$((Gj,ip)=>{"use strict";function mS(t,e){return e}ip.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=mS;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),o=[];for(let s of n)s&&o.push(s.getFileName());return o}});var fp=$((Jj,dp)=>{"use strict";function dc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=dc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=dc(t[r]));return e}return t}function ap(t){let e=[],r="",n=!1,o=!1,s="";for(let i=0;i<t.length;i++){let a=t[i];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,o=!1):(a==='"'||a==="'")&&n?o?a===s?(o=!1,s=""):r+=a:(o=!0,s=a):r+=a}return r&&e.push(r),e}function cp(t,e,r){let n=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof n!="object"||n===null||!(i in n)||typeof n[i]!="object"||n[i]===null)return!1;n=n[i]}let o=e[e.length-1];if(o==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&o in n&&Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r);return!0}function up(t,e){let r=t;for(let o=0;o<e.length-1;o++){let s=e[o];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let o=0;o<r.length;o++)r[o]=void 0;else if(typeof r=="object"&&r!==null)for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var Vs=Symbol("PATH_NOT_FOUND");function hS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return Vs;r=r[n]}return r}function gS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function yS(t,e,r,n=!1){for(let o of e){let s=ap(o);if(s.includes("*"))lp(t,s,r,o,n);else if(n)up(t,s);else{let i=hS(t,s);if(i===Vs)continue;let a=typeof r=="function"?r(i,s):r;cp(t,s,a)}}}function lp(t,e,r,n,o=!1){let s=e.indexOf("*");if(s===e.length-1){let i=e.slice(0,-1),a=t;for(let c of i){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(o)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let u=[...i,c.toString()],l=typeof r=="function"?r(a[c],u):r;a[c]=l}else if(typeof a=="object"&&a!==null)if(o){let c=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&c.push(u);for(let u of c)delete a[u]}else for(let c in a){let u=[...i,c],l=typeof r=="function"?r(a[c],u):r;a[c]=l}}else _S(t,e,r,s,n,o)}function _S(t,e,r,n,o,s=!1){let i=e.slice(0,n),a=e.slice(n+1),c=[];function u(l,d){if(d===i.length){if(Array.isArray(l))for(let m=0;m<l.length;m++)c[d]=m.toString(),u(l[m],d+1);else if(typeof l=="object"&&l!==null)for(let m in l)c[d]=m,u(l[m],d+1)}else if(d<i.length){let m=i[d];l&&typeof l=="object"&&l!==null&&m in l&&(c[d]=m,u(l[m],d+1))}else if(a.includes("*"))lp(l,a,typeof r=="function"?(p,f)=>{let h=[...c.slice(0,d),...f];return r(p,h)}:r,o,s);else if(s)up(l,a);else{let m=typeof r=="function"?r(gS(l,a),[...c.slice(0,d),...a]):r;cp(l,a,m)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let m=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[m],c[d]=m}l!=null&&u(l,i.length)}}function vS(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=ap(r),o=e;for(let s=0;s<n.length;s++){let i=n[s];o.has(i)||o.set(i,new Map),o=o.get(i)}}return e}function bS(t,e){if(!e)return t;function r(n,o,s=0){if(!o||o.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let c=0;c<n.length;c++){let u=c.toString();o.has(u)||o.has("*")?a[c]=r(n[c],o.get(u)||o.get("*")):a[c]=n[c]}return a}let i=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o.has(a)||o.has("*")?i[a]=r(n[a],o.get(a)||o.get("*")):i[a]=n[a]);return i}return r(t,e)}function wS(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let o=0;o<t.length;o++){let s=t[o];if((s==='"'||s==="'")&&e>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)e++;else if(s==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function xS(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)wS(e)}function SS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;xS(e);let i=vS(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=bS(c,i),l=c,d=r;return typeof r=="function"&&(d=r),yS(u,e,d,s),n===!1?(u.restore=function(){return dc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}dp.exports=SS});var cn=$((Kj,pp)=>{"use strict";var $S=Symbol("pino.setLevel"),kS=Symbol("pino.getLevel"),ES=Symbol("pino.levelVal"),zS=Symbol("pino.levelComp"),PS=Symbol("pino.useLevelLabels"),TS=Symbol("pino.useOnlyCustomLevels"),CS=Symbol("pino.mixin"),OS=Symbol("pino.lsCache"),IS=Symbol("pino.chindings"),RS=Symbol("pino.asJson"),NS=Symbol("pino.write"),AS=Symbol("pino.redactFmt"),DS=Symbol("pino.time"),jS=Symbol("pino.timeSliceIndex"),MS=Symbol("pino.stream"),ZS=Symbol("pino.stringify"),LS=Symbol("pino.stringifySafe"),qS=Symbol("pino.stringifiers"),FS=Symbol("pino.end"),US=Symbol("pino.formatOpts"),VS=Symbol("pino.messageKey"),BS=Symbol("pino.errorKey"),HS=Symbol("pino.nestedKey"),WS=Symbol("pino.nestedKeyStr"),GS=Symbol("pino.mixinMergeStrategy"),JS=Symbol("pino.msgPrefix"),KS=Symbol("pino.wildcardFirst"),YS=Symbol.for("pino.serializers"),QS=Symbol.for("pino.formatters"),XS=Symbol.for("pino.hooks"),e$=Symbol.for("pino.metadata");pp.exports={setLevelSym:$S,getLevelSym:kS,levelValSym:ES,levelCompSym:zS,useLevelLabelsSym:PS,mixinSym:CS,lsCacheSym:OS,chindingsSym:IS,asJsonSym:RS,writeSym:NS,serializersSym:YS,redactFmtSym:AS,timeSym:DS,timeSliceIndexSym:jS,streamSym:MS,stringifySym:ZS,stringifySafeSym:LS,stringifiersSym:qS,endSym:FS,formatOptsSym:US,messageKeySym:VS,errorKeySym:BS,nestedKeySym:HS,wildcardFirstSym:KS,needsMetadataGsym:e$,useOnlyCustomLevelsSym:TS,formattersSym:QS,hooksSym:XS,nestedKeyStrSym:WS,mixinMergeStrategySym:GS,msgPrefixSym:JS}});var pc=$((Yj,yp)=>{"use strict";var mp=fp(),{redactFmtSym:t$,wildcardFirstSym:Bs}=cn(),fc=/[^.[\]]+|\[([^[\]]*?)\]/g,hp="[Redacted]",gp=!1;function r$(t,e){let{paths:r,censor:n,remove:o}=n$(t),s=r.reduce((c,u)=>{fc.lastIndex=0;let l=fc.exec(u),d=fc.exec(u),m=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(m==="*"&&(m=Bs),d===null)return c[m]=null,c;if(c[m]===null)return c;let{index:p}=d,f=`${u.substr(p,u.length-1)}`;return c[m]=c[m]||[],m!==Bs&&c[m].length===0&&c[m].push(...c[Bs]||[]),m===Bs&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[m].push(f),c},{}),i={[t$]:mp({paths:r,censor:n,serialize:e,strict:gp,remove:o})},a=(...c)=>e(typeof n=="function"?n(...c):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((c,u)=>{if(s[u]===null)c[u]=l=>a(l,[u]);else{let l=typeof n=="function"?(d,m)=>n(d,[u,...m]):n;c[u]=mp({paths:s[u],censor:l,serialize:e,strict:gp,remove:o})}return c},i)}function n$(t){if(Array.isArray(t))return t={paths:t,censor:hp},t;let{paths:e,censor:r=hp,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}yp.exports=r$});var bp=$((Qj,vp)=>{"use strict";var o$=()=>"",s$=()=>`,"time":${Date.now()}`,i$=()=>`,"time":${Math.round(Date.now()/1e3)}`,a$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,c$=1000000n,_p=1000000000n,u$=BigInt(Date.now())*c$,l$=process.hrtime.bigint(),d$=()=>{let t=process.hrtime.bigint()-l$,e=u$+t,r=e/_p,n=e%_p,o=Number(r*1000n+n/1000000n),s=new Date(o),i=s.getUTCFullYear(),a=(s.getUTCMonth()+1).toString().padStart(2,"0"),c=s.getUTCDate().toString().padStart(2,"0"),u=s.getUTCHours().toString().padStart(2,"0"),l=s.getUTCMinutes().toString().padStart(2,"0"),d=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${i}-${a}-${c}T${u}:${l}:${d}.${n.toString().padStart(9,"0")}Z"`};vp.exports={nullTime:o$,epochTime:s$,unixTime:i$,isoTime:a$,isoTimeNano:d$}});var xp=$((Xj,wp)=>{"use strict";function f$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}wp.exports=p$;function p$(t,e,r){var n=r&&r.stringify||f$,o=1;if(typeof t=="object"&&t!==null){var s=e.length+o;if(s===1)return t;var i=new Array(s);i[0]=n(t);for(var a=1;a<s;a++)i[a]=n(e[a]);return i.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-o,d=-1,m=t&&t.length||0,p=0;p<m;){if(t.charCodeAt(p)===37&&p+1<m){switch(d=d>-1?d:0,t.charCodeAt(p+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Number(e[l]),d=p+2,p++;break;case 105:if(l>=c||e[l]==null)break;d<p&&(u+=t.slice(d,p)),u+=Math.floor(Number(e[l])),d=p+2,p++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<p&&(u+=t.slice(d,p));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=p+2,p++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=p+2,p++;break}u+=n(e[l]),d=p+2,p++;break;case 115:if(l>=c)break;d<p&&(u+=t.slice(d,p)),u+=String(e[l]),d=p+2,p++;break;case 37:d<p&&(u+=t.slice(d,p)),u+="%",d=p+2,p++,l--;break}++l}++p}return d===-1?t:(d<m&&(u+=t.slice(d)),u)}});var hc=$((e1,mc)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));mc.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};mc.exports=t}});var Cp=$((t1,Tp)=>{"use strict";var ue=require("fs"),m$=require("events"),h$=require("util").inherits,Sp=require("path"),yc=hc(),g$=require("assert"),Hs=100,Ws=Buffer.allocUnsafe(0),y$=16*1024,$p="buffer",kp="utf8",[_$,v$]=(process.versions.node||"0.0").split(".").map(Number),b$=_$>=22&&v$>=7;function Ep(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(s,i){if(s){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",s)}):e.emit("error",s);return}let a=e._reopening;e.fd=i,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",o=e.mode;if(e.sync)try{e.mkdir&&ue.mkdirSync(Sp.dirname(t),{recursive:!0});let s=ue.openSync(t,n,o);r(null,s)}catch(s){throw r(s),s}else e.mkdir?ue.mkdir(Sp.dirname(t),{recursive:!0},s=>{if(s)return r(s);ue.open(t,n,o,r)}):ue.open(t,n,o,r)}function vt(t){if(!(this instanceof vt))return new vt(t);let{fd:e,dest:r,minLength:n,maxLength:o,maxWrite:s,periodicFlush:i,sync:a,append:c=!0,mkdir:u,retryEAGAIN:l,fsync:d,contentMode:m,mode:p}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=o||0,this.maxWrite=s||y$,this._periodicFlush=i||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=d||!1,this.append=c||!1,this.mode=p,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(m===$p)this._writingBuf=Ws,this.write=S$,this.flush=k$,this.flushSync=z$,this._actualWrite=T$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(m===void 0||m===kp)this._writingBuf="",this.write=x$,this.flush=$$,this.flushSync=E$,this._actualWrite=P$,f=()=>Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8"),h=()=>Buffer.isBuffer(this._writingBuf)?ue.write(this.fd,this._writingBuf,this.release):ue.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${kp}" and "${$p}", but passed ${m}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Ep(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,_)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{yc(Hs),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,Hs);else this._writing=!1,this.emit("error",g);return}this.emit("write",_);let x=gc(this._writingBuf,this._len,_);if(this._len=x.len,this._writingBuf=x.writingBuf,this._writingBuf.length){if(!this.sync){h();return}try{do{let S=f(),k=gc(this._writingBuf,this._len,S);this._len=k.len,this._writingBuf=k.writingBuf}while(this._writingBuf.length)}catch(S){this.release(S);return}}this._fsync&&ue.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?this._actualWrite():this._ending?w>0?this._actualWrite():(this._writing=!1,Gs(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(w$,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function gc(t,e,r){return typeof t=="string"&&(t=Buffer.from(t)),e=Math.max(e-r,0),t=t.subarray(r),{writingBuf:t,len:e}}function w$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}h$(vt,m$);function zp(t,e){return t.length===0?Ws:t.length===1?t[0]:Buffer.concat(t,e)}function x$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");t=""+t;let e=Buffer.byteLength(t),r=this._len+e,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+e>this.maxWrite?n.push(t):n[n.length-1]+=t,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function S$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Pp(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{ue.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function $$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function k$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Pp.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}vt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&ue.close(e,r=>{if(r)return this.emit("error",r)})}),Ep(this.file,this)};vt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Gs(this)))};function E$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?ue.writeSync(this.fd,t):ue.writeSync(this.fd,t,"utf8"),r=gc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;yc(Hs)}}try{ue.fsyncSync(this.fd)}catch{}}function z$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Ws);let t=Ws;for(;this._bufs.length||t.length;){t.length<=0&&(t=zp(this._bufs[0],this._lens[0]));try{let e=ue.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;yc(Hs)}}}vt.prototype.destroy=function(){this.destroyed||Gs(this)};function P$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let e=Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else ue.write(this.fd,this._writingBuf,t)}function T$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:zp(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=ue.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else b$&&(this._writingBuf=Buffer.from(this._writingBuf)),ue.write(this.fd,this._writingBuf,t)}function Gs(t){if(t.fd===-1){t.once("ready",Gs.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],g$(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{ue.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?ue.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}vt.SonicBoom=vt;vt.default=vt;Tp.exports=vt});var _c=$((r1,Ap)=>{"use strict";var bt={exit:[],beforeExit:[]},Op={exit:I$,beforeExit:R$},un;function C$(){un===void 0&&(un=new FinalizationRegistry(N$))}function O$(t){bt[t].length>0||process.on(t,Op[t])}function Ip(t){bt[t].length>0||(process.removeListener(t,Op[t]),bt.exit.length===0&&bt.beforeExit.length===0&&(un=void 0))}function I$(){Rp("exit")}function R$(){Rp("beforeExit")}function Rp(t){for(let e of bt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}bt[t]=[]}function N$(t){for(let e of["exit","beforeExit"]){let r=bt[e].indexOf(t);bt[e].splice(r,r+1),Ip(e)}}function Np(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");O$(t);let n=new WeakRef(e);n.fn=r,C$(),un.register(e,n),bt[t].push(n)}function A$(t,e){Np("exit",t,e)}function D$(t,e){Np("beforeExit",t,e)}function j$(t){if(un!==void 0){un.unregister(t);for(let e of["exit","beforeExit"])bt[e]=bt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Ip(e)}}Ap.exports={register:A$,registerBeforeExit:D$,unregister:j$}});var Dp=$((n1,M$)=>{M$.exports={name:"thread-stream",version:"4.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^1.0.0"},devDependencies:{"@types/node":"^25.0.2","@yao-pkg/pkg":"^6.0.0",borp:"^1.0.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",neostandard:"^0.13.0","pino-elasticsearch":"^9.0.0","sonic-boom":"^5.0.0","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:'npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:ci":'npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:yarn":'npm run transpile && borp --pattern "test/*.test.js"',transpile:"sh ./test/ts/transpile.sh"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Mp=$((o1,jp)=>{"use strict";function Z$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{let a=Atomics.load(t,e);if(a===r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,a,c);u.async?u.value.then(i):setImmediate(i)};i()}function L$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{if(Atomics.load(t,e)!==r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,r,c);u.async?u.value.then(l=>{if(l==="ok"){o(null,"ok");return}i()}):setImmediate(i)};i()}jp.exports={wait:Z$,waitDiff:L$}});var Lp=$((s1,Zp)=>{"use strict";Zp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var Qp=$((i1,Yp)=>{"use strict";var{version:q$}=Dp(),{EventEmitter:F$}=require("events"),{Worker:U$}=require("worker_threads"),{join:V$}=require("path"),{pathToFileURL:B$}=require("url"),{wait:H$}=Mp(),{WRITE_INDEX:Lt,READ_INDEX:Rr,SEQ_INDEX:vc}=Lp(),W$=require("buffer"),G$=require("assert"),b=Symbol("kImpl"),J$=W$.constants.MAX_STRING_LENGTH;function qp(){}function Sc(t,e){Atomics.add(t[b].state,vc,1),e(),Atomics.add(t[b].state,vc,1),Atomics.notify(t[b].state,vc)}function Fp(t){Sc(t,()=>{Atomics.store(t[b].state,Rr,0),Atomics.store(t[b].state,Lt,0)})}var io=class{constructor(e){this._value=e}deref(){return this._value}},Js=class{register(){}unregister(){}},K$=process.env.NODE_V8_COVERAGE?Js:global.FinalizationRegistry||Js,Y$=process.env.NODE_V8_COVERAGE?io:global.WeakRef||io,Up=new K$(t=>{t.exited||t.terminate()});function Q$(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||V$(__dirname,"lib","worker.js"),i=new U$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:B$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:q$},...n}}});return i.stream=new io(t),i.on("message",X$),i.on("exit",Hp),Up.register(t,i),i}function Vp(t){G$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Bp(t){for(;;){let e=Atomics.load(t[b].state,Lt),r=t[b].data.length-e;if(r>0){if(t[b].bufLen===0){t[b].flushing=!1,t[b].ending?$c(t):t[b].needDrain&&process.nextTick(Vp,t);return}Jp(t,r,qp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Ks(t,()=>{t.destroyed||(Fp(t),Bp(t))});return}st(t,new Error("overwritten"));return}}function X$(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}if(t?.code!=null)switch(t.code){case"READY":this.stream=new Y$(e),Ks(e,()=>{e[b].ready=!0,e.emit("ready")});break;case"ERROR":st(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"FLUSHED":{if(t.context!=="thread-stream"){st(e,new Error("this should not happen: "+t.code));break}let r=e[b].flushCallbacks.get(t.id);r&&(e[b].flushCallbacks.delete(t.id),process.nextTick(r));break}case"WARNING":process.emitWarning(t.err);break;default:st(e,new Error("this should not happen: "+t.code))}}function Hp(t){let e=this.stream.deref();e!==void 0&&(Up.unregister(e),e.worker.exited=!0,e.worker.off("exit",Hp),st(e,t!==0?new Error("the worker thread exited"):null))}var wc=class extends F${constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[b]={},this[b].stateBuf=new SharedArrayBuffer(128),this[b].state=new Int32Array(this[b].stateBuf),this[b].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[b].data=Buffer.from(this[b].dataBuf),this[b].sync=e.sync||!1,this[b].ending=!1,this[b].ended=!1,this[b].needDrain=!1,this[b].destroyed=!1,this[b].flushing=!1,this[b].ready=!1,this[b].finished=!1,this[b].errored=null,this[b].closed=!1,this[b].buf=[],this[b].bufHead=0,this[b].bufLen=0,this[b].flushCallbacks=new Map,this[b].nextFlushId=0,this.worker=Q$(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){let r=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[b].destroyed)return xc(this,new Error("the worker has exited")),!1;if(this[b].ending)return xc(this,new Error("the worker is ending")),!1;if(this[b].flushing&&this[b].bufLen+r.length>=J$)try{bc(this),this[b].flushing=!0}catch(n){return st(this,n),!1}if(this[b].buf.push(r),this[b].bufLen+=r.length,this[b].sync)try{return bc(this),!0}catch(n){return st(this,n),!1}return this[b].flushing||(this[b].flushing=!0,setImmediate(Bp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,Lt)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,$c(this))}flush(e){e=typeof e=="function"?e:qp,Wp(this,r=>{if(r){process.nextTick(e,r);return}Gp(this,e)})}flushSync(){this[b].destroyed||(bc(this),Kp(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[b].ready}get destroyed(){return this[b].destroyed}get closed(){return this[b].closed}get writable(){return!this[b].destroyed&&!this[b].ending}get writableEnded(){return this[b].ending}get writableFinished(){return this[b].finished}get writableNeedDrain(){return this[b].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[b].errored}};function Wp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].sync&&(t[b].flushing||t[b].bufLen>0)){setImmediate(Wp,t,e);return}Ks(t,e)}function Ks(t,e){let r=Atomics.load(t[b].state,Lt);H$(t[b].state,Rr,r,1/0,(n,o)=>{if(n){st(t,n),e(n);return}if(o!=="ok"){Ks(t,e);return}e()})}function Gp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),Gp(t,e)},o=()=>{s(),process.nextTick(e,new Error("the worker has exited"))},s=()=>{t.off("ready",n),t.off("close",o)};t.once("ready",n),t.once("close",o);return}let r=++t[b].nextFlushId;t[b].flushCallbacks.set(r,e);try{t.worker.postMessage({code:"FLUSH",context:"thread-stream",id:r})}catch(n){t[b].flushCallbacks.delete(r),st(t,n),process.nextTick(e,n)}}function ek(t,e){let r=t[b].flushCallbacks;if(r.size===0)return;let n=e||new Error("the worker has exited");for(let o of r.values())process.nextTick(o,n);r.clear()}function xc(t,e){setImmediate(()=>{t.emit("error",e)})}function st(t,e){t[b].destroyed||(t[b].destroyed=!0,ek(t,e),e&&(t[b].errored=e,xc(t,e)),t.worker.exited?setImmediate(()=>{t[b].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[b].closed=!0,t.emit("close")}))}function Jp(t,e,r){let o=Atomics.load(t[b].state,Lt),s=e;for(;s>0&&t[b].bufLen!==0;){let i=t[b].bufHead,a=t[b].buf[i];if(a.length<=s){a.copy(t[b].data,o),o+=a.length,s-=a.length,t[b].bufLen-=a.length,t[b].bufHead=i+1,t[b].bufHead===t[b].buf.length?(t[b].buf.length=0,t[b].bufHead=0):t[b].bufHead>=1024&&t[b].bufHead*2>=t[b].buf.length&&(t[b].buf.splice(0,t[b].bufHead),t[b].bufHead=0);continue}a.copy(t[b].data,o,0,s),t[b].buf[i]=a.subarray(s),t[b].bufLen-=s,o+=s,s=0}return Sc(t,()=>{Atomics.store(t[b].state,Lt,o)}),r(),!0}function $c(t){if(!(t[b].ended||!t[b].ending||t[b].flushing)){t[b].ended=!0;try{t.flushSync();let e=Atomics.load(t[b].state,Rr);Sc(t,()=>{Atomics.store(t[b].state,Lt,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Rr,e,1e3),e=Atomics.load(t[b].state,Rr),e===-2){st(t,new Error("end() failed"));return}if(++r===10){st(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[b].finished=!0,t.emit("finish")})}catch(e){st(t,e)}}}function bc(t){let e=()=>{t[b].ending?$c(t):t[b].needDrain&&process.nextTick(Vp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,Lt),n=t[b].data.length-r;if(n===0){Kp(t),Fp(t);continue}else if(n<0)throw new Error("overwritten");Jp(t,n,e)}}function Kp(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,Lt),r=0;for(;;){let n=Atomics.load(t[b].state,Rr);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Rr,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}Yp.exports=wc});var zc=$((a1,tm)=>{"use strict";var{createRequire:tk}=require("module"),{existsSync:rk}=require("node:fs"),nk=lc(),{join:kc,isAbsolute:em,sep:ok}=require("node:path"),{fileURLToPath:sk}=require("node:url"),ik=hc(),Ec=_c(),ak=Qp();function ck(t){Ec.register(t,pk),Ec.registerBeforeExit(t,mk),t.on("close",function(){Ec.unregister(t)})}function uk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function lk(t){let e=t.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!e)return t;let r=[],n=!1;for(let o=0;o<e.length;o++){let s=e[o];if(s==="--require"||s==="-r"||s==="--import"){let i=e[o+1];if(i&&Xp(i)){n=!0,o++;continue}r.push(s),i&&(r.push(i),o++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let i=s.slice(s.indexOf("=")+1);if(Xp(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function Xp(t){let e=dk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=sk(r)}catch{return!1}return em(r)&&!rk(r)}function dk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function fk(t,e,r,n,o){if(!r.execArgv&&uk()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=lk(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new ak({filename:t,workerData:e,workerOpts:r,sync:n});s.on("ready",i),s.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function i(){process.removeListener("exit",a),s.unref(),r.autoEnd!==!1&&ck(s)}function a(){s.closed||(s.flushSync(),ik(100),s.end())}return s}function pk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function mk(t){t.flushSync()}function hk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=nk(),sync:a=!1}=t,c={...t.options},u=typeof i=="string"?[i]:i,l=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),d=t.target;if(d&&r)throw new Error("only one of target or targets can be specified");r?(d=l["pino-worker"]||kc(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:p(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:p(h.target)})))):e&&(d=l["pino-worker"]||kc(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:p(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let m=r||e?"pino.transport":d;return fk(p(d),c,s,a,m);function p(f){if(f=l[f]||f,em(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return kc(__dirname,"..","file.js");let h;for(let g of u)try{let _=g==="node:repl"?process.cwd()+ok:g;h=tk(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}tm.exports=hk});var Xs=$((c1,mm)=>{"use strict";var gk=require("node:diagnostics_channel"),rm=xp(),{mapHttpRequest:yk,mapHttpResponse:_k}=uc(),Tc=Cp(),nm=_c(),{lsCacheSym:vk,chindingsSym:cm,writeSym:om,serializersSym:um,formatOptsSym:sm,endSym:bk,stringifiersSym:lm,stringifySym:dm,stringifySafeSym:Cc,wildcardFirstSym:fm,nestedKeySym:wk,formattersSym:pm,messageKeySym:xk,errorKeySym:Sk,nestedKeyStrSym:$k,msgPrefixSym:Ys}=cn(),{isMainThread:kk}=require("worker_threads"),Ek=zc(),[zk]=process.versions.node.split(".").map(t=>Number(t)),im=gk.tracingChannel("pino_asJson"),Pc=zk>=25?t=>JSON.stringify(t):Tk;function ln(){}function Pk(t,e){if(!e)return r;return function(...o){e.call(this,o,r,t)};function r(n,...o){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=yk(n):typeof n.setHeader=="function"&&(n=_k(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[Ys]=="string"&&s!==void 0&&s!==null&&(s=this[Ys]+s),this[om](n,rm(s,i,this[sm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Ys]=="string"&&s!==void 0&&s!==null&&(s=this[Ys]+s),this[om](null,rm(s,o,this[sm]),t)}}}function Tk(t){let e="",r=0,n=!1,o=255,s=t.length;if(s>100)return JSON.stringify(t);for(var i=0;i<s&&o>=32;i++)o=t.charCodeAt(i),(o===34||o===92)&&(e+=t.slice(r,i)+"\\",r=i,n=!0);return n?e+=t.slice(r):e=t,o<32?JSON.stringify(t):'"'+e+'"'}function Ck(t,e,r,n){if(im.hasSubscribers===!1)return am.call(this,t,e,r,n);let o={instance:this,arguments};return im.traceSync(am,o,this,t,e,r,n)}function am(t,e,r,n){let o=this[dm],s=this[Cc],i=this[lm],a=this[bk],c=this[cm],u=this[um],l=this[pm],d=this[xk],m=this[Sk],p=this[vk][r]+n;p=p+c;let f;l.log&&(t=l.log(t));let h=i[fm],g="";for(let x in t)if(f=t[x],Object.prototype.hasOwnProperty.call(t,x)&&f!==void 0){u[x]?f=u[x](f):x===m&&u.err&&(f=u.err(f));let w=i[x]||h;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":w&&(f=w(f));break;case"string":f=(w||Pc)(f);break;default:f=(w||o)(f,s)}if(f===void 0)continue;let S=Pc(x);g+=","+S+":"+f}let _="";if(e!==void 0){f=u[d]?u[d](e):e;let x=i[d]||h;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":x&&(f=x(f)),_=',"'+d+'":'+f;break;case"string":f=(x||Pc)(f),_=',"'+d+'":'+f;break;default:f=(x||o)(f,s),_=',"'+d+'":'+f}}return this[wk]&&g?p+this[$k]+g.slice(1)+"}"+_+a:p+g+_+a}function Ok(t,e){let r,n=t[cm],o=t[dm],s=t[Cc],i=t[lm],a=i[fm],c=t[um],u=t[pm].bindings;e=u(e);for(let l in e)if(r=e[l],((l.length<5||l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels")&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(i[l]||a||o)(r,s),r===void 0)continue;n+=',"'+l+'":'+r}return n}function Ik(t){return t.write!==t.constructor.prototype.write}function Qs(t){let e=new Tc(t);return e.on("error",r),!t.sync&&kk&&(nm.register(e,Rk),e.on("close",function(){nm.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=ln,e.end=ln,e.flushSync=ln,e.destroy=ln;return}e.removeListener("error",r),e.emit("error",n)}}function Rk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Nk(t){return function(r,n,o={},s){if(typeof o=="string")s=Qs({dest:o}),o={};else if(typeof s=="string"){if(o&&o.transport)throw Error("only one of option.transport or stream can be specified");s=Qs({dest:s})}else if(o instanceof Tc||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Tc||o.transport.writable||o.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(o.transport.targets&&o.transport.targets.length&&o.formatters&&typeof o.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;o.customLevels&&(c=o.useOnlyCustomLevels?o.customLevels:Object.assign({},o.levels,o.customLevels)),s=Ek({caller:n,...o.transport,levels:c})}if(o=Object.assign({},t,o),o.serializers=Object.assign({},t.serializers,o.serializers),o.formatters=Object.assign({},t.formatters,o.formatters),o.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:i,onChild:a}=o;return i===!1&&(o.level="silent"),a||(o.onChild=ln),s||(Ik(process.stdout)?s=process.stdout:s=Qs({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function Ak(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Cc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Dk(t,e,r){return{level:t,bindings:e,log:r}}function jk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}mm.exports={noop:ln,buildSafeSonicBoom:Qs,asChindings:Ok,asJson:Ck,genLog:Pk,createArgsNormalizer:Nk,stringify:Ak,buildFormatters:Dk,normalizeDestFileDescriptor:jk}});var ei=$((u1,hm)=>{var Mk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Zk={ASC:"ASC",DESC:"DESC"};hm.exports={DEFAULT_LEVELS:Mk,SORTING_ORDER:Zk}});var Rc=$((l1,vm)=>{"use strict";var{lsCacheSym:Lk,levelValSym:Oc,useOnlyCustomLevelsSym:qk,streamSym:Fk,formattersSym:Uk,hooksSym:Vk,levelCompSym:gm}=cn(),{noop:Bk,genLog:Nr}=Xs(),{DEFAULT_LEVELS:Pt,SORTING_ORDER:ym}=ei(),_m={fatal:t=>{let e=Nr(Pt.fatal,t);return function(...r){let n=this[Fk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Nr(Pt.error,t),warn:t=>Nr(Pt.warn,t),info:t=>Nr(Pt.info,t),debug:t=>Nr(Pt.debug,t),trace:t=>Nr(Pt.trace,t)},Ic=Object.keys(Pt).reduce((t,e)=>(t[Pt[e]]=e,t),{}),Hk=Object.keys(Ic).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Wk(t){let e=t[Uk].level,{labels:r}=t.levels,n={};for(let o in r){let s=e(r[o],Number(o));n[o]=JSON.stringify(s).slice(0,-1)}return t[Lk]=n,t}function Gk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Jk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Oc],o=this[Oc]=r[t],s=this[qk],i=this[gm],a=this[Vk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Bk;continue}this[c]=Gk(c,s)?_m[c](a):Nr(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function Kk(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function Yk(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[gm](r,this[Oc])}function Qk(t,e,r){return t===ym.DESC?e<=r:e>=r}function Xk(t){return typeof t=="string"?Qk.bind(null,t):t}function eE(t=null,e=!1){let r=t?Object.keys(t).reduce((s,i)=>(s[t[i]]=i,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Ic,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Pt,t);return{labels:n,values:o}}function tE(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Ic).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Pt,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function rE(t,e){let{labels:r,values:n}=t;for(let o in e){if(o in n)throw Error("levels cannot be overridden");if(e[o]in r)throw Error("pre-existing level values cannot be used for new levels")}}function nE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(ym).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}vm.exports={initialLsCache:Hk,genLsCache:Wk,levelMethods:_m,getLevel:Kk,setLevel:Jk,isLevelEnabled:Yk,mappings:eE,assertNoLevelCollisions:rE,assertDefaultLevelFound:tE,genLevelComparison:Xk,assertLevelComparison:nE}});var Nc=$((d1,bm)=>{"use strict";bm.exports={version:"10.3.1"}});var Pm=$((p1,zm)=>{"use strict";var{EventEmitter:oE}=require("node:events"),{lsCacheSym:sE,levelValSym:iE,setLevelSym:Dc,getLevelSym:wm,chindingsSym:ri,mixinSym:aE,asJsonSym:Sm,writeSym:cE,mixinMergeStrategySym:uE,timeSym:lE,timeSliceIndexSym:dE,streamSym:$m,serializersSym:Ar,formattersSym:ao,errorKeySym:fE,messageKeySym:pE,useOnlyCustomLevelsSym:mE,needsMetadataGsym:hE,redactFmtSym:gE,stringifySym:yE,formatOptsSym:_E,stringifiersSym:vE,msgPrefixSym:jc,hooksSym:bE}=cn(),{getLevel:wE,setLevel:xE,isLevelEnabled:SE,mappings:$E,initialLsCache:kE,genLsCache:EE,assertNoLevelCollisions:zE}=Rc(),{asChindings:Mc,asJson:PE,buildFormatters:Ac,stringify:xm,noop:km}=Xs(),{version:TE}=Nc(),CE=pc(),OE=class{},Em={constructor:OE,child:IE,bindings:RE,setBindings:NE,flush:jE,isLevelEnabled:SE,version:TE,get level(){return this[wm]()},set level(t){this[Dc](t)},get levelVal(){return this[iE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[jc]},get[Symbol.toStringTag](){return"Pino"},[sE]:kE,[cE]:DE,[Sm]:PE,[wm]:wE,[Dc]:xE};Object.setPrototypeOf(Em,oE.prototype);zm.exports=function(){return Object.create(Em)};var ti=t=>t;function IE(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[Ar],n=this[ao],o=Object.create(this);if(e==null)return o[ao].bindings!==ti&&(o[ao]=Ac(n.level,ti,n.log)),o[ri]=Mc(o,t),this.onChild!==km&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[Ar]=Object.create(null);for(let u in r)o[Ar][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[Ar][u]=r[u]}for(let u in e.serializers)o[Ar][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[Ar][u]=e.serializers[u]}}else o[Ar]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[ao]=Ac(a||n.level,c||ti,u||n.log)}else o[ao]=Ac(n.level,ti,n.log);if(e.hasOwnProperty("customLevels")===!0&&(zE(this.levels,e.customLevels),o.levels=$E(e.customLevels,o[mE]),EE(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=CE(o.redact,xm),c={stringify:a[gE]};o[yE]=xm,o[vE]=a,o[_E]=c}if(typeof e.msgPrefix=="string"&&(o[jc]=(this[jc]||"")+e.msgPrefix),o[ri]=Mc(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Dc](a)}return this.onChild(o),o}function RE(){let e=`{${this[ri].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function NE(t){let e=Mc(this,t);this[ri]=e}function AE(t,e){return Object.assign(e,t)}function DE(t,e,r){let n=this[lE](),o=this[aE],s=this[fE],i=this[pE],a=this[uE]||AE,c,u=this[bE].streamWrite;t==null?c={}:t instanceof Error?(c={[s]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[i]===void 0&&t[s]&&(e=t[s].message)),o&&(c=a(c,o(c,r,this)));let l=this[Sm](c,e,r,n),d=this[$m];d[hE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[dE]),d.lastLogger=this),d.write(u?u(l):l)}function jE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[$m];typeof e.flush=="function"?e.flush(t||km):t&&t()}});var Im=$((Fc,Om)=>{"use strict";var{hasOwnProperty:co}=Object.prototype,jr=qc();jr.configure=qc;jr.stringify=jr;jr.default=jr;Fc.stringify=jr;Fc.configure=qc;Om.exports=jr;var ME=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function er(t){return t.length<5e3&&!ME.test(t)?`"${t}"`:JSON.stringify(t)}function Zc(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],o=r;for(;o!==0&&t[o-1]>n;)t[o]=t[o-1],o--;t[o]=n}return t}var ZE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Lc(t){return ZE.call(t)!==void 0&&t.length!==0}function Tm(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",o=`"0":${n}${t[0]}`;for(let s=1;s<r;s++)o+=`${e}"${s}":${n}${t[s]}`;return o}function LE(t){if(co.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function qE(t){let e;if(co.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function FE(t,e){let r;if(co.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Cm(t,e){let r;if(co.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Dr(t){return t===1?"1 item":`${t} items`}function UE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function VE(t){if(co.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function qc(t){t={...t};let e=VE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=LE(t),n=FE(t,"bigint"),o=qE(t),s=typeof o=="function"?o:void 0,i=Cm(t,"maximumDepth"),a=Cm(t,"maximumBreadth");function c(p,f,h,g,_,x){let w=f[p];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(p)),w=g.call(f,p,w),typeof w){case"string":return er(w);case"object":{if(w===null)return"null";if(h.indexOf(w)!==-1)return r;let S="",k=",",W=x;if(Array.isArray(w)){if(w.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(w),_!==""&&(x+=_,S+=`
2
+ var gx=Object.create;var La=Object.defineProperty;var yx=Object.getOwnPropertyDescriptor;var _x=Object.getOwnPropertyNames;var vx=Object.getPrototypeOf,bx=Object.prototype.hasOwnProperty;var $=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},df=(t,e)=>{for(var r in e)La(t,r,{get:e[r],enumerable:!0})},wx=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of _x(e))!bx.call(t,o)&&o!==r&&La(t,o,{get:()=>e[o],enumerable:!(n=yx(e,o))||n.enumerable});return t};var gt=(t,e,r)=>(r=t!=null?gx(vx(t)):{},wx(e||!t||!t.__esModule?La(r,"default",{value:t,enumerable:!0}):r,t));var sc=$((J1,Gf)=>{"use strict";var ao=t=>t&&typeof t.message=="string",oc=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return ao(r)?r:void 0}else return ao(e)?e:void 0},Hf=(t,e)=>{if(!ao(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
+ causes have become circular...`;let n=oc(t);return n?(e.add(t),r+`
4
+ caused by: `+Hf(n,e)):r},oS=t=>Hf(t,new Set),Wf=(t,e,r)=>{if(!ao(t))return"";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let o=oc(t);if(o){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+Wf(o,e,s)}else return n},sS=t=>Wf(t,new Set);Gf.exports={isErrorLike:ao,getErrorCause:oc,stackWithCauses:oS,messageWithCauses:sS}});var ic=$((K1,Kf)=>{"use strict";var iS=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Jf=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[qs]},set:function(t){this[qs]=t}}});Object.defineProperty(Jf,qs,{writable:!0,value:{}});Kf.exports={pinoErrProto:Jf,pinoErrorSymbols:{seen:iS,rawSymbol:qs}}});var Xf=$((Y1,Qf)=>{"use strict";Qf.exports=cc;var{messageWithCauses:aS,stackWithCauses:cS,isErrorLike:Yf}=sc(),{pinoErrProto:uS,pinoErrorSymbols:lS}=ic(),{seen:ac}=lS,{toString:dS}=Object.prototype;function cc(t){if(!Yf(t))return t;t[ac]=void 0;let e=Object.create(uS);e.type=dS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=aS(t),e.stack=cS(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>cc(r)));for(let r in t)if(e[r]===void 0){let n=t[r];Yf(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,ac)&&(e[r]=cc(n)):e[r]=n}return delete t[ac],e.raw=t,e}});var tp=$((Q1,ep)=>{"use strict";ep.exports=Us;var{isErrorLike:uc}=sc(),{pinoErrProto:fS,pinoErrorSymbols:pS}=ic(),{seen:Fs}=pS,{toString:mS}=Object.prototype;function Us(t){if(!uc(t))return t;t[Fs]=void 0;let e=Object.create(fS);e.type=mS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Us(r))),uc(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,Fs)&&(e.cause=Us(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];uc(n)?Object.prototype.hasOwnProperty.call(n,Fs)||(e[r]=Us(n)):e[r]=n}return delete t[Fs],e.raw=t,e}});var sp=$((X1,op)=>{"use strict";op.exports={mapHttpRequest:hS,reqSerializer:np};var lc=Symbol("pino-raw-req-ref"),rp=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[lc]},set:function(t){this[lc]=t}}});Object.defineProperty(rp,lc,{writable:!0,value:{}});function np(t){let e=t.info||t.socket,r=Object.create(rp);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else{let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function hS(t){return{req:np(t)}}});var up=$((ej,cp)=>{"use strict";cp.exports={mapHttpResponse:gS,resSerializer:ap};var dc=Symbol("pino-raw-res-ref"),ip=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[dc]},set:function(t){this[dc]=t}}});Object.defineProperty(ip,dc,{writable:!0,value:{}});function ap(t){let e=Object.create(ip);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function gS(t){return{res:ap(t)}}});var pc=$((tj,lp)=>{"use strict";var fc=Xf(),yS=tp(),Vs=sp(),Bs=up();lp.exports={err:fc,errWithCause:yS,mapHttpRequest:Vs.mapHttpRequest,mapHttpResponse:Bs.mapHttpResponse,req:Vs.reqSerializer,res:Bs.resSerializer,wrapErrorSerializer:function(e){return e===fc?e:function(n){return e(fc(n))}},wrapRequestSerializer:function(e){return e===Vs.reqSerializer?e:function(n){return e(Vs.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===Bs.resSerializer?e:function(n){return e(Bs.resSerializer(n))}}}});var mc=$((rj,dp)=>{"use strict";function _S(t,e){return e}dp.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=_S;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),o=[];for(let s of n)s&&o.push(s.getFileName());return o}});var yp=$((nj,gp)=>{"use strict";function hc(t){if(t===null||typeof t!="object")return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array){let e=[];for(let r=0;r<t.length;r++)e[r]=hc(t[r]);return e}if(typeof t=="object"){let e=Object.create(Object.getPrototypeOf(t));for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=hc(t[r]));return e}return t}function fp(t){let e=[],r="",n=!1,o=!1,s="";for(let i=0;i<t.length;i++){let a=t[i];!n&&a==="."?r&&(e.push(r),r=""):a==="["?(r&&(e.push(r),r=""),n=!0):a==="]"&&n?(e.push(r),r="",n=!1,o=!1):(a==='"'||a==="'")&&n?o?a===s?(o=!1,s=""):r+=a:(o=!0,s=a):r+=a}return r&&e.push(r),e}function pp(t,e,r){let n=t;for(let s=0;s<e.length-1;s++){let i=e[s];if(typeof n!="object"||n===null||!(i in n)||typeof n[i]!="object"||n[i]===null)return!1;n=n[i]}let o=e[e.length-1];if(o==="*"){if(Array.isArray(n))for(let s=0;s<n.length;s++)n[s]=r;else if(typeof n=="object"&&n!==null)for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&(n[s]=r)}else typeof n=="object"&&n!==null&&o in n&&Object.prototype.hasOwnProperty.call(n,o)&&(n[o]=r);return!0}function mp(t,e){let r=t;for(let o=0;o<e.length-1;o++){let s=e[o];if(typeof r!="object"||r===null||!(s in r)||typeof r[s]!="object"||r[s]===null)return!1;r=r[s]}let n=e[e.length-1];if(n==="*"){if(Array.isArray(r))for(let o=0;o<r.length;o++)r[o]=void 0;else if(typeof r=="object"&&r!==null)for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&delete r[o]}else typeof r=="object"&&r!==null&&n in r&&Object.prototype.hasOwnProperty.call(r,n)&&delete r[n];return!0}var Hs=Symbol("PATH_NOT_FOUND");function vS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null||!(n in r))return Hs;r=r[n]}return r}function bS(t,e){let r=t;for(let n of e){if(r==null||typeof r!="object"||r===null)return;r=r[n]}return r}function wS(t,e,r,n=!1){for(let o of e){let s=fp(o);if(s.includes("*"))hp(t,s,r,o,n);else if(n)mp(t,s);else{let i=vS(t,s);if(i===Hs)continue;let a=typeof r=="function"?r(i,s):r;pp(t,s,a)}}}function hp(t,e,r,n,o=!1){let s=e.indexOf("*");if(s===e.length-1){let i=e.slice(0,-1),a=t;for(let c of i){if(a==null||typeof a!="object"||a===null)return;a=a[c]}if(Array.isArray(a))if(o)for(let c=0;c<a.length;c++)a[c]=void 0;else for(let c=0;c<a.length;c++){let u=[...i,c.toString()],l=typeof r=="function"?r(a[c],u):r;a[c]=l}else if(typeof a=="object"&&a!==null)if(o){let c=[];for(let u in a)Object.prototype.hasOwnProperty.call(a,u)&&c.push(u);for(let u of c)delete a[u]}else for(let c in a){let u=[...i,c],l=typeof r=="function"?r(a[c],u):r;a[c]=l}}else xS(t,e,r,s,n,o)}function xS(t,e,r,n,o,s=!1){let i=e.slice(0,n),a=e.slice(n+1),c=[];function u(l,d){if(d===i.length){if(Array.isArray(l))for(let p=0;p<l.length;p++)c[d]=p.toString(),u(l[p],d+1);else if(typeof l=="object"&&l!==null)for(let p in l)c[d]=p,u(l[p],d+1)}else if(d<i.length){let p=i[d];l&&typeof l=="object"&&l!==null&&p in l&&(c[d]=p,u(l[p],d+1))}else if(a.includes("*"))hp(l,a,typeof r=="function"?(m,f)=>{let h=[...c.slice(0,d),...f];return r(m,h)}:r,o,s);else if(s)mp(l,a);else{let p=typeof r=="function"?r(bS(l,a),[...c.slice(0,d),...a]):r;pp(l,a,p)}}if(i.length===0)u(t,0);else{let l=t;for(let d=0;d<i.length;d++){let p=i[d];if(l==null||typeof l!="object"||l===null)return;l=l[p],c[d]=p}l!=null&&u(l,i.length)}}function SS(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=fp(r),o=e;for(let s=0;s<n.length;s++){let i=n[s];o.has(i)||o.set(i,new Map),o=o.get(i)}}return e}function $S(t,e){if(!e)return t;function r(n,o,s=0){if(!o||o.size===0||n===null||typeof n!="object")return n;if(n instanceof Date)return new Date(n.getTime());if(Array.isArray(n)){let a=[];for(let c=0;c<n.length;c++){let u=c.toString();o.has(u)||o.has("*")?a[c]=r(n[c],o.get(u)||o.get("*")):a[c]=n[c]}return a}let i=Object.create(Object.getPrototypeOf(n));for(let a in n)Object.prototype.hasOwnProperty.call(n,a)&&(o.has(a)||o.has("*")?i[a]=r(n[a],o.get(a)||o.get("*")):i[a]=n[a]);return i}return r(t,e)}function kS(t){if(typeof t!="string")throw new Error("Paths must be (non-empty) strings");if(t==="")throw new Error("Invalid redaction path ()");if(t.includes(".."))throw new Error(`Invalid redaction path (${t})`);if(t.includes(","))throw new Error(`Invalid redaction path (${t})`);let e=0,r=!1,n="";for(let o=0;o<t.length;o++){let s=t[o];if((s==='"'||s==="'")&&e>0)r?s===n&&(r=!1,n=""):(r=!0,n=s);else if(s==="["&&!r)e++;else if(s==="]"&&!r&&(e--,e<0))throw new Error(`Invalid redaction path (${t})`)}if(e!==0)throw new Error(`Invalid redaction path (${t})`)}function ES(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)kS(e)}function zS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;ES(e);let i=SS(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=$S(c,i),l=c,d=r;return typeof r=="function"&&(d=r),wS(u,e,d,s),n===!1?(u.restore=function(){return hc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}gp.exports=zS});var dn=$((oj,_p)=>{"use strict";var PS=Symbol("pino.setLevel"),TS=Symbol("pino.getLevel"),CS=Symbol("pino.levelVal"),OS=Symbol("pino.levelComp"),IS=Symbol("pino.useLevelLabels"),RS=Symbol("pino.useOnlyCustomLevels"),DS=Symbol("pino.mixin"),NS=Symbol("pino.lsCache"),AS=Symbol("pino.chindings"),jS=Symbol("pino.asJson"),MS=Symbol("pino.write"),ZS=Symbol("pino.redactFmt"),LS=Symbol("pino.time"),qS=Symbol("pino.timeSliceIndex"),FS=Symbol("pino.stream"),US=Symbol("pino.stringify"),VS=Symbol("pino.stringifySafe"),BS=Symbol("pino.stringifiers"),HS=Symbol("pino.end"),WS=Symbol("pino.formatOpts"),GS=Symbol("pino.messageKey"),JS=Symbol("pino.errorKey"),KS=Symbol("pino.nestedKey"),YS=Symbol("pino.nestedKeyStr"),QS=Symbol("pino.mixinMergeStrategy"),XS=Symbol("pino.msgPrefix"),e$=Symbol("pino.wildcardFirst"),t$=Symbol.for("pino.serializers"),r$=Symbol.for("pino.formatters"),n$=Symbol.for("pino.hooks"),o$=Symbol.for("pino.metadata");_p.exports={setLevelSym:PS,getLevelSym:TS,levelValSym:CS,levelCompSym:OS,useLevelLabelsSym:IS,mixinSym:DS,lsCacheSym:NS,chindingsSym:AS,asJsonSym:jS,writeSym:MS,serializersSym:t$,redactFmtSym:ZS,timeSym:LS,timeSliceIndexSym:qS,streamSym:FS,stringifySym:US,stringifySafeSym:VS,stringifiersSym:BS,endSym:HS,formatOptsSym:WS,messageKeySym:GS,errorKeySym:JS,nestedKeySym:KS,wildcardFirstSym:e$,needsMetadataGsym:o$,useOnlyCustomLevelsSym:RS,formattersSym:r$,hooksSym:n$,nestedKeyStrSym:YS,mixinMergeStrategySym:QS,msgPrefixSym:XS}});var yc=$((sj,xp)=>{"use strict";var vp=yp(),{redactFmtSym:s$,wildcardFirstSym:Ws}=dn(),gc=/[^.[\]]+|\[([^[\]]*?)\]/g,bp="[Redacted]",wp=!1;function i$(t,e){let{paths:r,censor:n,remove:o}=a$(t),s=r.reduce((c,u)=>{gc.lastIndex=0;let l=gc.exec(u),d=gc.exec(u),p=l[1]!==void 0?l[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):l[0];if(p==="*"&&(p=Ws),d===null)return c[p]=null,c;if(c[p]===null)return c;let{index:m}=d,f=`${u.substr(m,u.length-1)}`;return c[p]=c[p]||[],p!==Ws&&c[p].length===0&&c[p].push(...c[Ws]||[]),p===Ws&&Object.keys(c).forEach(function(h){c[h]&&c[h].push(f)}),c[p].push(f),c},{}),i={[s$]:vp({paths:r,censor:n,serialize:e,strict:wp,remove:o})},a=(...c)=>e(typeof n=="function"?n(...c):n);return[...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((c,u)=>{if(s[u]===null)c[u]=l=>a(l,[u]);else{let l=typeof n=="function"?(d,p)=>n(d,[u,...p]):n;c[u]=vp({paths:s[u],censor:l,serialize:e,strict:wp,remove:o})}return c},i)}function a$(t){if(Array.isArray(t))return t={paths:t,censor:bp},t;let{paths:e,censor:r=bp,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),{paths:e,censor:r,remove:n}}xp.exports=i$});var kp=$((ij,$p)=>{"use strict";var c$=()=>"",u$=()=>`,"time":${Date.now()}`,l$=()=>`,"time":${Math.round(Date.now()/1e3)}`,d$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,f$=1000000n,Sp=1000000000n,p$=BigInt(Date.now())*f$,m$=process.hrtime.bigint(),h$=()=>{let t=process.hrtime.bigint()-m$,e=p$+t,r=e/Sp,n=e%Sp,o=Number(r*1000n+n/1000000n),s=new Date(o),i=s.getUTCFullYear(),a=(s.getUTCMonth()+1).toString().padStart(2,"0"),c=s.getUTCDate().toString().padStart(2,"0"),u=s.getUTCHours().toString().padStart(2,"0"),l=s.getUTCMinutes().toString().padStart(2,"0"),d=s.getUTCSeconds().toString().padStart(2,"0");return`,"time":"${i}-${a}-${c}T${u}:${l}:${d}.${n.toString().padStart(9,"0")}Z"`};$p.exports={nullTime:c$,epochTime:u$,unixTime:l$,isoTime:d$,isoTimeNano:h$}});var zp=$((aj,Ep)=>{"use strict";function g$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}Ep.exports=y$;function y$(t,e,r){var n=r&&r.stringify||g$,o=1;if(typeof t=="object"&&t!==null){var s=e.length+o;if(s===1)return t;var i=new Array(s);i[0]=n(t);for(var a=1;a<s;a++)i[a]=n(e[a]);return i.join(" ")}if(typeof t!="string")return t;var c=e.length;if(c===0)return t;for(var u="",l=1-o,d=-1,p=t&&t.length||0,m=0;m<p;){if(t.charCodeAt(m)===37&&m+1<p){switch(d=d>-1?d:0,t.charCodeAt(m+1)){case 100:case 102:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Number(e[l]),d=m+2,m++;break;case 105:if(l>=c||e[l]==null)break;d<m&&(u+=t.slice(d,m)),u+=Math.floor(Number(e[l])),d=m+2,m++;break;case 79:case 111:case 106:if(l>=c||e[l]===void 0)break;d<m&&(u+=t.slice(d,m));var f=typeof e[l];if(f==="string"){u+="'"+e[l]+"'",d=m+2,m++;break}if(f==="function"){u+=e[l].name||"<anonymous>",d=m+2,m++;break}u+=n(e[l]),d=m+2,m++;break;case 115:if(l>=c)break;d<m&&(u+=t.slice(d,m)),u+=String(e[l]),d=m+2,m++;break;case 37:d<m&&(u+=t.slice(d,m)),u+="%",d=m+2,m++,l--;break}++l}++m}return d===-1?t:(d<p&&(u+=t.slice(d)),u)}});var vc=$((cj,_c)=>{"use strict";if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r))},t=new Int32Array(new SharedArrayBuffer(4));_c.exports=e}else{let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");let n=Date.now()+Number(e);for(;n>Date.now(););};_c.exports=t}});var Np=$((uj,Dp)=>{"use strict";var ue=require("fs"),_$=require("events"),v$=require("util").inherits,Pp=require("path"),wc=vc(),b$=require("assert"),Gs=100,Js=Buffer.allocUnsafe(0),w$=16*1024,Tp="buffer",Cp="utf8",[x$,S$]=(process.versions.node||"0.0").split(".").map(Number),$$=x$>=22&&S$>=7;function Op(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(s,i){if(s){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",s)}):e.emit("error",s);return}let a=e._reopening;e.fd=i,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!e.destroyed&&(!e._writing&&e._len>e.minLength||e._flushPending?e._actualWrite():a&&process.nextTick(()=>e.emit("drain")))}let n=e.append?"a":"w",o=e.mode;if(e.sync)try{e.mkdir&&ue.mkdirSync(Pp.dirname(t),{recursive:!0});let s=ue.openSync(t,n,o);r(null,s)}catch(s){throw r(s),s}else e.mkdir?ue.mkdir(Pp.dirname(t),{recursive:!0},s=>{if(s)return r(s);ue.open(t,n,o,r)}):ue.open(t,n,o,r)}function wt(t){if(!(this instanceof wt))return new wt(t);let{fd:e,dest:r,minLength:n,maxLength:o,maxWrite:s,periodicFlush:i,sync:a,append:c=!0,mkdir:u,retryEAGAIN:l,fsync:d,contentMode:p,mode:m}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=o||0,this.maxWrite=s||w$,this._periodicFlush=i||0,this._periodicFlushTimer=void 0,this.sync=a||!1,this.writable=!0,this._fsync=d||!1,this.append=c||!1,this.mode=m,this.retryEAGAIN=l||(()=>!0),this.mkdir=u||!1;let f,h;if(p===Tp)this._writingBuf=Js,this.write=z$,this.flush=T$,this.flushSync=O$,this._actualWrite=R$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===Cp)this._writingBuf="",this.write=E$,this.flush=P$,this.flushSync=C$,this._actualWrite=I$,f=()=>Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8"),h=()=>Buffer.isBuffer(this._writingBuf)?ue.write(this.fd,this._writingBuf,this.release):ue.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Cp}" and "${Tp}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Op(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(g,_)=>{if(g){if((g.code==="EAGAIN"||g.code==="EBUSY")&&this.retryEAGAIN(g,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{wc(Gs),this.release(void 0,0)}catch(S){this.release(S)}else setTimeout(h,Gs);else this._writing=!1,this.emit("error",g);return}this.emit("write",_);let x=bc(this._writingBuf,this._len,_);if(this._len=x.len,this._writingBuf=x.writingBuf,this._writingBuf.length){if(!this.sync){h();return}try{do{let S=f(),k=bc(this._writingBuf,this._len,S);this._len=k.len,this._writingBuf=k.writingBuf}while(this._writingBuf.length)}catch(S){this.release(S);return}}this._fsync&&ue.fsyncSync(this.fd);let w=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):w>this.minLength?this._actualWrite():this._ending?w>0?this._actualWrite():(this._writing=!1,Ks(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(k$,this)):this.emit("drain"))},this.on("newListener",function(g){g==="drain"&&(this._asyncDrainScheduled=!1)}),this._periodicFlush!==0&&(this._periodicFlushTimer=setInterval(()=>this.flush(null),this._periodicFlush),this._periodicFlushTimer.unref())}function bc(t,e,r){return typeof t=="string"&&(t=Buffer.from(t)),e=Math.max(e-r,0),t=t.subarray(r),{writingBuf:t,len:e}}function k$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}v$(wt,_$);function Ip(t,e){return t.length===0?Js:t.length===1?t[0]:Buffer.concat(t,e)}function E$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");t=""+t;let e=Buffer.byteLength(t),r=this._len+e,n=this._bufs;return this.maxLength&&r>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(n.length===0||Buffer.byteLength(n[n.length-1])+e>this.maxWrite?n.push(t):n[n.length-1]+=t,this._len=r,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function z$(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs,n=this._lens;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._len<this._hwm):(r.length===0||n[n.length-1]+t.length>this.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len<this._hwm)}function Rp(t){this._flushPending=!0;let e=()=>{if(this._fsync)this._flushPending=!1,t();else try{ue.fsync(this.fd,n=>{this._flushPending=!1,t(n)})}catch(n){t(n)}this.off("error",r)},r=n=>{this._flushPending=!1,t(n),this.off("drain",e)};this.once("drain",e),this.once("error",r)}function P$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Rp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function T$(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&Rp.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite())}wt.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t)});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(t&&(this.file=t),this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&ue.close(e,r=>{if(r)return this.emit("error",r)})}),Op(this.file,this)};wt.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end()});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Ks(this)))};function C$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t.length;){t.length<=0&&(t=this._bufs[0]);try{let e=Buffer.isBuffer(t)?ue.writeSync(this.fd,t):ue.writeSync(this.fd,t,"utf8"),r=bc(t,this._len,e);t=r.writingBuf,this._len=r.len,t.length<=0&&this._bufs.shift()}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;wc(Gs)}}try{ue.fsyncSync(this.fd)}catch{}}function O$(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Js);let t=Js;for(;this._bufs.length||t.length;){t.length<=0&&(t=Ip(this._bufs[0],this._lens[0]));try{let e=ue.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift())}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;wc(Gs)}}}wt.prototype.destroy=function(){this.destroyed||Ks(this)};function I$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:this._bufs.shift()||"",this.sync)try{let e=Buffer.isBuffer(this._writingBuf)?ue.writeSync(this.fd,this._writingBuf):ue.writeSync(this.fd,this._writingBuf,"utf8");t(null,e)}catch(e){t(e)}else ue.write(this.fd,this._writingBuf,t)}function R$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Ip(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=ue.writeSync(this.fd,this._writingBuf);t(null,e)}catch(e){t(e)}else $$&&(this._writingBuf=Buffer.from(this._writingBuf)),ue.write(this.fd,this._writingBuf,t)}function Ks(t){if(t.fd===-1){t.once("ready",Ks.bind(null,t));return}t._periodicFlushTimer!==void 0&&clearInterval(t._periodicFlushTimer),t.destroyed=!0,t._bufs=[],t._lens=[],b$(typeof t.fd=="number",`sonic.fd must be a number, got ${typeof t.fd}`);try{ue.fsync(t.fd,e)}catch{}function e(){t.fd!==1&&t.fd!==2?ue.close(t.fd,r):r()}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close")}}wt.SonicBoom=wt;wt.default=wt;Dp.exports=wt});var xc=$((lj,Lp)=>{"use strict";var xt={exit:[],beforeExit:[]},Ap={exit:A$,beforeExit:j$},fn;function D$(){fn===void 0&&(fn=new FinalizationRegistry(M$))}function N$(t){xt[t].length>0||process.on(t,Ap[t])}function jp(t){xt[t].length>0||(process.removeListener(t,Ap[t]),xt.exit.length===0&&xt.beforeExit.length===0&&(fn=void 0))}function A$(){Mp("exit")}function j$(){Mp("beforeExit")}function Mp(t){for(let e of xt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}xt[t]=[]}function M$(t){for(let e of["exit","beforeExit"]){let r=xt[e].indexOf(t);xt[e].splice(r,r+1),jp(e)}}function Zp(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");N$(t);let n=new WeakRef(e);n.fn=r,D$(),fn.register(e,n),xt[t].push(n)}function Z$(t,e){Zp("exit",t,e)}function L$(t,e){Zp("beforeExit",t,e)}function q$(t){if(fn!==void 0){fn.unregister(t);for(let e of["exit","beforeExit"])xt[e]=xt[e].filter(r=>{let n=r.deref();return n&&n!==t}),jp(e)}}Lp.exports={register:Z$,registerBeforeExit:L$,unregister:q$}});var qp=$((dj,F$)=>{F$.exports={name:"thread-stream",version:"4.2.0",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",engines:{node:">=20"},dependencies:{"real-require":"^1.0.0"},devDependencies:{"@types/node":"^25.0.2","@yao-pkg/pkg":"^6.0.0",borp:"^1.0.0",desm:"^1.3.0",eslint:"^9.39.1",fastbench:"^1.0.1",neostandard:"^0.13.0","pino-elasticsearch":"^9.0.0","sonic-boom":"^5.0.0","ts-node":"^10.8.0",typescript:"~5.7.3"},scripts:{build:"tsc --noEmit",lint:"eslint",test:'npm run lint && npm run build && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:ci":'npm run lint && npm run transpile && borp --pattern "test/*.test.{js,mjs}"',"test:yarn":'npm run transpile && borp --pattern "test/*.test.js"',transpile:"sh ./test/ts/transpile.sh"},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina <hello@matteocollina.com>",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"}});var Up=$((fj,Fp)=>{"use strict";function U$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{let a=Atomics.load(t,e);if(a===r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,a,c);u.async?u.value.then(i):setImmediate(i)};i()}function V$(t,e,r,n,o){let s=n===1/0?1/0:Date.now()+n,i=()=>{if(Atomics.load(t,e)!==r){o(null,"ok");return}if(s!==1/0&&Date.now()>s){o(null,"timed-out");return}let c=s===1/0?1e4:Math.min(1e4,Math.max(1,s-Date.now())),u=Atomics.waitAsync(t,e,r,c);u.async?u.value.then(l=>{if(l==="ok"){o(null,"ok");return}i()}):setImmediate(i)};i()}Fp.exports={wait:U$,waitDiff:V$}});var Bp=$((pj,Vp)=>{"use strict";Vp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var nm=$((mj,rm)=>{"use strict";var{version:B$}=qp(),{EventEmitter:H$}=require("events"),{Worker:W$}=require("worker_threads"),{join:G$}=require("path"),{pathToFileURL:J$}=require("url"),{wait:K$}=Up(),{WRITE_INDEX:qt,READ_INDEX:Nr,SEQ_INDEX:Sc}=Bp(),Y$=require("buffer"),Q$=require("assert"),b=Symbol("kImpl"),X$=Y$.constants.MAX_STRING_LENGTH;function Hp(){}function zc(t,e){Atomics.add(t[b].state,Sc,1),e(),Atomics.add(t[b].state,Sc,1),Atomics.notify(t[b].state,Sc)}function Wp(t){zc(t,()=>{Atomics.store(t[b].state,Nr,0),Atomics.store(t[b].state,qt,0)})}var co=class{constructor(e){this._value=e}deref(){return this._value}},Ys=class{register(){}unregister(){}},ek=process.env.NODE_V8_COVERAGE?Ys:global.FinalizationRegistry||Ys,tk=process.env.NODE_V8_COVERAGE?co:global.WeakRef||co,Gp=new ek(t=>{t.exited||t.terminate()});function rk(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||G$(__dirname,"lib","worker.js"),i=new W$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:J$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:B$},...n}}});return i.stream=new co(t),i.on("message",nk),i.on("exit",Yp),Gp.register(t,i),i}function Jp(t){Q$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Kp(t){for(;;){let e=Atomics.load(t[b].state,qt),r=t[b].data.length-e;if(r>0){if(t[b].bufLen===0){t[b].flushing=!1,t[b].ending?Pc(t):t[b].needDrain&&process.nextTick(Jp,t);return}em(t,r,Hp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Qs(t,()=>{t.destroyed||(Wp(t),Kp(t))});return}it(t,new Error("overwritten"));return}}function nk(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}if(t?.code!=null)switch(t.code){case"READY":this.stream=new tk(e),Qs(e,()=>{e[b].ready=!0,e.emit("ready")});break;case"ERROR":it(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"FLUSHED":{if(t.context!=="thread-stream"){it(e,new Error("this should not happen: "+t.code));break}let r=e[b].flushCallbacks.get(t.id);r&&(e[b].flushCallbacks.delete(t.id),process.nextTick(r));break}case"WARNING":process.emitWarning(t.err);break;default:it(e,new Error("this should not happen: "+t.code))}}function Yp(t){let e=this.stream.deref();e!==void 0&&(Gp.unregister(e),e.worker.exited=!0,e.worker.off("exit",Yp),it(e,t!==0?new Error("the worker thread exited"):null))}var kc=class extends H${constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[b]={},this[b].stateBuf=new SharedArrayBuffer(128),this[b].state=new Int32Array(this[b].stateBuf),this[b].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[b].data=Buffer.from(this[b].dataBuf),this[b].sync=e.sync||!1,this[b].ending=!1,this[b].ended=!1,this[b].needDrain=!1,this[b].destroyed=!1,this[b].flushing=!1,this[b].ready=!1,this[b].finished=!1,this[b].errored=null,this[b].closed=!1,this[b].buf=[],this[b].bufHead=0,this[b].bufLen=0,this[b].flushCallbacks=new Map,this[b].nextFlushId=0,this.worker=rk(this,e),this.on("message",(r,n)=>{this.worker.postMessage(r,n)})}write(e){let r=Buffer.isBuffer(e)?e:Buffer.from(e);if(this[b].destroyed)return Ec(this,new Error("the worker has exited")),!1;if(this[b].ending)return Ec(this,new Error("the worker is ending")),!1;if(this[b].flushing&&this[b].bufLen+r.length>=X$)try{$c(this),this[b].flushing=!0}catch(n){return it(this,n),!1}if(this[b].buf.push(r),this[b].bufLen+=r.length,this[b].sync)try{return $c(this),!0}catch(n){return it(this,n),!1}return this[b].flushing||(this[b].flushing=!0,setImmediate(Kp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,qt)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,Pc(this))}flush(e){e=typeof e=="function"?e:Hp,Qp(this,r=>{if(r){process.nextTick(e,r);return}Xp(this,e)})}flushSync(){this[b].destroyed||($c(this),tm(this))}unref(){this.worker.unref()}ref(){this.worker.ref()}get ready(){return this[b].ready}get destroyed(){return this[b].destroyed}get closed(){return this[b].closed}get writable(){return!this[b].destroyed&&!this[b].ending}get writableEnded(){return this[b].ending}get writableFinished(){return this[b].finished}get writableNeedDrain(){return this[b].needDrain}get writableObjectMode(){return!1}get writableErrored(){return this[b].errored}};function Qp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].sync&&(t[b].flushing||t[b].bufLen>0)){setImmediate(Qp,t,e);return}Qs(t,e)}function Qs(t,e){let r=Atomics.load(t[b].state,qt);K$(t[b].state,Nr,r,1/0,(n,o)=>{if(n){it(t,n),e(n);return}if(o!=="ok"){Qs(t,e);return}e()})}function Xp(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),Xp(t,e)},o=()=>{s(),process.nextTick(e,new Error("the worker has exited"))},s=()=>{t.off("ready",n),t.off("close",o)};t.once("ready",n),t.once("close",o);return}let r=++t[b].nextFlushId;t[b].flushCallbacks.set(r,e);try{t.worker.postMessage({code:"FLUSH",context:"thread-stream",id:r})}catch(n){t[b].flushCallbacks.delete(r),it(t,n),process.nextTick(e,n)}}function ok(t,e){let r=t[b].flushCallbacks;if(r.size===0)return;let n=e||new Error("the worker has exited");for(let o of r.values())process.nextTick(o,n);r.clear()}function Ec(t,e){setImmediate(()=>{t.emit("error",e)})}function it(t,e){t[b].destroyed||(t[b].destroyed=!0,ok(t,e),e&&(t[b].errored=e,Ec(t,e)),t.worker.exited?setImmediate(()=>{t[b].closed=!0,t.emit("close")}):t.worker.terminate().catch(()=>{}).then(()=>{t[b].closed=!0,t.emit("close")}))}function em(t,e,r){let o=Atomics.load(t[b].state,qt),s=e;for(;s>0&&t[b].bufLen!==0;){let i=t[b].bufHead,a=t[b].buf[i];if(a.length<=s){a.copy(t[b].data,o),o+=a.length,s-=a.length,t[b].bufLen-=a.length,t[b].bufHead=i+1,t[b].bufHead===t[b].buf.length?(t[b].buf.length=0,t[b].bufHead=0):t[b].bufHead>=1024&&t[b].bufHead*2>=t[b].buf.length&&(t[b].buf.splice(0,t[b].bufHead),t[b].bufHead=0);continue}a.copy(t[b].data,o,0,s),t[b].buf[i]=a.subarray(s),t[b].bufLen-=s,o+=s,s=0}return zc(t,()=>{Atomics.store(t[b].state,qt,o)}),r(),!0}function Pc(t){if(!(t[b].ended||!t[b].ending||t[b].flushing)){t[b].ended=!0;try{t.flushSync();let e=Atomics.load(t[b].state,Nr);zc(t,()=>{Atomics.store(t[b].state,qt,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Nr,e,1e3),e=Atomics.load(t[b].state,Nr),e===-2){it(t,new Error("end() failed"));return}if(++r===10){it(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[b].finished=!0,t.emit("finish")})}catch(e){it(t,e)}}}function $c(t){let e=()=>{t[b].ending?Pc(t):t[b].needDrain&&process.nextTick(Jp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,qt),n=t[b].data.length-r;if(n===0){tm(t),Wp(t);continue}else if(n<0)throw new Error("overwritten");em(t,n,e)}}function tm(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,qt),r=0;for(;;){let n=Atomics.load(t[b].state,Nr);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Nr,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}rm.exports=kc});var Oc=$((hj,im)=>{"use strict";var{createRequire:sk}=require("module"),{existsSync:ik}=require("node:fs"),ak=mc(),{join:Tc,isAbsolute:sm,sep:ck}=require("node:path"),{fileURLToPath:uk}=require("node:url"),lk=vc(),Cc=xc(),dk=nm();function fk(t){Cc.register(t,yk),Cc.registerBeforeExit(t,_k),t.on("close",function(){Cc.unregister(t)})}function pk(){let t=process.execArgv;for(let e=0;e<t.length;e++){let r=t[e];if(r==="--import"||r==="--require"||r==="-r"||r.startsWith("--import=")||r.startsWith("--require=")||r.startsWith("-r="))return!0}return!1}function mk(t){let e=t.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g);if(!e)return t;let r=[],n=!1;for(let o=0;o<e.length;o++){let s=e[o];if(s==="--require"||s==="-r"||s==="--import"){let i=e[o+1];if(i&&om(i)){n=!0,o++;continue}r.push(s),i&&(r.push(i),o++);continue}if(s.startsWith("--require=")||s.startsWith("-r=")||s.startsWith("--import=")){let i=s.slice(s.indexOf("=")+1);if(om(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function om(t){let e=hk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=uk(r)}catch{return!1}return sm(r)&&!ik(r)}function hk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function gk(t,e,r,n,o){if(!r.execArgv&&pk()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=mk(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new dk({filename:t,workerData:e,workerOpts:r,sync:n});s.on("ready",i),s.on("close",function(){process.removeListener("exit",a)}),process.on("exit",a);function i(){process.removeListener("exit",a),s.unref(),r.autoEnd!==!1&&fk(s)}function a(){s.closed||(s.flushSync(),lk(100),s.end())}return s}function yk(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function _k(t){t.flushSync()}function vk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=ak(),sync:a=!1}=t,c={...t.options},u=typeof i=="string"?[i]:i,l=typeof globalThis=="object"&&Object.prototype.hasOwnProperty.call(globalThis,"__bundlerPathsOverrides")&&globalThis.__bundlerPathsOverrides&&typeof globalThis.__bundlerPathsOverrides=="object"?globalThis.__bundlerPathsOverrides:Object.create(null),d=t.target;if(d&&r)throw new Error("only one of target or targets can be specified");r?(d=l["pino-worker"]||Tc(__dirname,"worker.js"),c.targets=r.filter(f=>f.target).map(f=>({...f,target:m(f.target)})),c.pipelines=r.filter(f=>f.pipeline).map(f=>f.pipeline.map(h=>({...h,level:f.level,target:m(h.target)})))):e&&(d=l["pino-worker"]||Tc(__dirname,"worker.js"),c.pipelines=[e.map(f=>({...f,target:m(f.target)}))]),n&&(c.levels=n),o&&(c.dedupe=o),c.pinoWillSendConfig=!0;let p=r||e?"pino.transport":d;return gk(m(d),c,s,a,p);function m(f){if(f=l[f]||f,sm(f)||f.indexOf("file://")===0)return f;if(f==="pino/file")return Tc(__dirname,"..","file.js");let h;for(let g of u)try{let _=g==="node:repl"?process.cwd()+ck:g;h=sk(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}im.exports=vk});var ti=$((gj,vm)=>{"use strict";var bk=require("node:diagnostics_channel"),am=zp(),{mapHttpRequest:wk,mapHttpResponse:xk}=pc(),Rc=Np(),cm=xc(),{lsCacheSym:Sk,chindingsSym:pm,writeSym:um,serializersSym:mm,formatOptsSym:lm,endSym:$k,stringifiersSym:hm,stringifySym:gm,stringifySafeSym:Dc,wildcardFirstSym:ym,nestedKeySym:kk,formattersSym:_m,messageKeySym:Ek,errorKeySym:zk,nestedKeyStrSym:Pk,msgPrefixSym:Xs}=dn(),{isMainThread:Tk}=require("worker_threads"),Ck=Oc(),[Ok]=process.versions.node.split(".").map(t=>Number(t)),dm=bk.tracingChannel("pino_asJson"),Ic=Ok>=25?t=>JSON.stringify(t):Rk;function pn(){}function Ik(t,e){if(!e)return r;return function(...o){e.call(this,o,r,t)};function r(n,...o){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=wk(n):typeof n.setHeader=="function"&&(n=xk(n)));let i;s===null&&o.length===0?i=[null]:(s=o.shift(),i=o),typeof this[Xs]=="string"&&s!==void 0&&s!==null&&(s=this[Xs]+s),this[um](n,am(s,i,this[lm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Xs]=="string"&&s!==void 0&&s!==null&&(s=this[Xs]+s),this[um](null,am(s,o,this[lm]),t)}}}function Rk(t){let e="",r=0,n=!1,o=255,s=t.length;if(s>100)return JSON.stringify(t);for(var i=0;i<s&&o>=32;i++)o=t.charCodeAt(i),(o===34||o===92)&&(e+=t.slice(r,i)+"\\",r=i,n=!0);return n?e+=t.slice(r):e=t,o<32?JSON.stringify(t):'"'+e+'"'}function Dk(t,e,r,n){if(dm.hasSubscribers===!1)return fm.call(this,t,e,r,n);let o={instance:this,arguments};return dm.traceSync(fm,o,this,t,e,r,n)}function fm(t,e,r,n){let o=this[gm],s=this[Dc],i=this[hm],a=this[$k],c=this[pm],u=this[mm],l=this[_m],d=this[Ek],p=this[zk],m=this[Sk][r]+n;m=m+c;let f;l.log&&(t=l.log(t));let h=i[ym],g="";for(let x in t)if(f=t[x],Object.prototype.hasOwnProperty.call(t,x)&&f!==void 0){u[x]?f=u[x](f):x===p&&u.err&&(f=u.err(f));let w=i[x]||h;switch(typeof f){case"undefined":case"function":continue;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":w&&(f=w(f));break;case"string":f=(w||Ic)(f);break;default:f=(w||o)(f,s)}if(f===void 0)continue;let S=Ic(x);g+=","+S+":"+f}let _="";if(e!==void 0){f=u[d]?u[d](e):e;let x=i[d]||h;switch(typeof f){case"function":break;case"number":Number.isFinite(f)===!1&&(f=null);case"boolean":x&&(f=x(f)),_=',"'+d+'":'+f;break;case"string":f=(x||Ic)(f),_=',"'+d+'":'+f;break;default:f=(x||o)(f,s),_=',"'+d+'":'+f}}return this[kk]&&g?m+this[Pk]+g.slice(1)+"}"+_+a:m+g+_+a}function Nk(t,e){let r,n=t[pm],o=t[gm],s=t[Dc],i=t[hm],a=i[ym],c=t[mm],u=t[_m].bindings;e=u(e);for(let l in e)if(r=e[l],((l.length<5||l!=="level"&&l!=="serializers"&&l!=="formatters"&&l!=="customLevels")&&e.hasOwnProperty(l)&&r!==void 0)===!0){if(r=c[l]?c[l](r):r,r=(i[l]||a||o)(r,s),r===void 0)continue;n+=',"'+l+'":'+r}return n}function Ak(t){return t.write!==t.constructor.prototype.write}function ei(t){let e=new Rc(t);return e.on("error",r),!t.sync&&Tk&&(cm.register(e,jk),e.on("close",function(){cm.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=pn,e.end=pn,e.flushSync=pn,e.destroy=pn;return}e.removeListener("error",r),e.emit("error",n)}}function jk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Mk(t){return function(r,n,o={},s){if(typeof o=="string")s=ei({dest:o}),o={};else if(typeof s=="string"){if(o&&o.transport)throw Error("only one of option.transport or stream can be specified");s=ei({dest:s})}else if(o instanceof Rc||o.writable||o._writableState)s=o,o={};else if(o.transport){if(o.transport instanceof Rc||o.transport.writable||o.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(o.transport.targets&&o.transport.targets.length&&o.formatters&&typeof o.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let c;o.customLevels&&(c=o.useOnlyCustomLevels?o.customLevels:Object.assign({},o.levels,o.customLevels)),s=Ck({caller:n,...o.transport,levels:c})}if(o=Object.assign({},t,o),o.serializers=Object.assign({},t.serializers,o.serializers),o.formatters=Object.assign({},t.formatters,o.formatters),o.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:i,onChild:a}=o;return i===!1&&(o.level="silent"),a||(o.onChild=pn),s||(Ak(process.stdout)?s=process.stdout:s=ei({fd:process.stdout.fd||1})),{opts:o,stream:s}}}function Zk(t,e){try{return JSON.stringify(t)}catch{try{return(e||this[Dc])(t)}catch{return'"[unable to serialize, circular reference is too complex to analyze]"'}}}function Lk(t,e,r){return{level:t,bindings:e,log:r}}function qk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}vm.exports={noop:pn,buildSafeSonicBoom:ei,asChindings:Nk,asJson:Dk,genLog:Ik,createArgsNormalizer:Mk,stringify:Zk,buildFormatters:Lk,normalizeDestFileDescriptor:qk}});var ri=$((yj,bm)=>{var Fk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Uk={ASC:"ASC",DESC:"DESC"};bm.exports={DEFAULT_LEVELS:Fk,SORTING_ORDER:Uk}});var jc=$((_j,$m)=>{"use strict";var{lsCacheSym:Vk,levelValSym:Nc,useOnlyCustomLevelsSym:Bk,streamSym:Hk,formattersSym:Wk,hooksSym:Gk,levelCompSym:wm}=dn(),{noop:Jk,genLog:Ar}=ti(),{DEFAULT_LEVELS:Ct,SORTING_ORDER:xm}=ri(),Sm={fatal:t=>{let e=Ar(Ct.fatal,t);return function(...r){let n=this[Hk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Ar(Ct.error,t),warn:t=>Ar(Ct.warn,t),info:t=>Ar(Ct.info,t),debug:t=>Ar(Ct.debug,t),trace:t=>Ar(Ct.trace,t)},Ac=Object.keys(Ct).reduce((t,e)=>(t[Ct[e]]=e,t),{}),Kk=Object.keys(Ac).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Yk(t){let e=t[Wk].level,{labels:r}=t.levels,n={};for(let o in r){let s=e(r[o],Number(o));n[o]=JSON.stringify(s).slice(0,-1)}return t[Vk]=n,t}function Qk(t,e){if(e)return!1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return!0;default:return!1}}function Xk(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t]}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Nc],o=this[Nc]=r[t],s=this[Bk],i=this[wm],a=this[Gk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Jk;continue}this[c]=Qk(c,s)?Sm[c](a):Ar(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function eE(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function tE(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[wm](r,this[Nc])}function rE(t,e,r){return t===xm.DESC?e<=r:e>=r}function nE(t){return typeof t=="string"?rE.bind(null,t):t}function oE(t=null,e=!1){let r=t?Object.keys(t).reduce((s,i)=>(s[t[i]]=i,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Ac,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Ct,t);return{labels:n,values:o}}function sE(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Ac).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Ct,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function iE(t,e){let{labels:r,values:n}=t;for(let o in e){if(o in n)throw Error("levels cannot be overridden");if(e[o]in r)throw Error("pre-existing level values cannot be used for new levels")}}function aE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(xm).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}$m.exports={initialLsCache:Kk,genLsCache:Yk,levelMethods:Sm,getLevel:eE,setLevel:Xk,isLevelEnabled:tE,mappings:oE,assertNoLevelCollisions:iE,assertDefaultLevelFound:sE,genLevelComparison:nE,assertLevelComparison:aE}});var Mc=$((vj,km)=>{"use strict";km.exports={version:"10.3.1"}});var Rm=$((wj,Im)=>{"use strict";var{EventEmitter:cE}=require("node:events"),{lsCacheSym:uE,levelValSym:lE,setLevelSym:Lc,getLevelSym:Em,chindingsSym:oi,mixinSym:dE,asJsonSym:Pm,writeSym:fE,mixinMergeStrategySym:pE,timeSym:mE,timeSliceIndexSym:hE,streamSym:Tm,serializersSym:jr,formattersSym:uo,errorKeySym:gE,messageKeySym:yE,useOnlyCustomLevelsSym:_E,needsMetadataGsym:vE,redactFmtSym:bE,stringifySym:wE,formatOptsSym:xE,stringifiersSym:SE,msgPrefixSym:qc,hooksSym:$E}=dn(),{getLevel:kE,setLevel:EE,isLevelEnabled:zE,mappings:PE,initialLsCache:TE,genLsCache:CE,assertNoLevelCollisions:OE}=jc(),{asChindings:Fc,asJson:IE,buildFormatters:Zc,stringify:zm,noop:Cm}=ti(),{version:RE}=Mc(),DE=yc(),NE=class{},Om={constructor:NE,child:AE,bindings:jE,setBindings:ME,flush:qE,isLevelEnabled:zE,version:RE,get level(){return this[Em]()},set level(t){this[Lc](t)},get levelVal(){return this[lE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[qc]},get[Symbol.toStringTag](){return"Pino"},[uE]:TE,[fE]:LE,[Pm]:IE,[Em]:kE,[Lc]:EE};Object.setPrototypeOf(Om,cE.prototype);Im.exports=function(){return Object.create(Om)};var ni=t=>t;function AE(t,e){if(!t)throw Error("missing bindings for child Pino");let r=this[jr],n=this[uo],o=Object.create(this);if(e==null)return o[uo].bindings!==ni&&(o[uo]=Zc(n.level,ni,n.log)),o[oi]=Fc(o,t),this.onChild!==Cm&&this.onChild(o),o;if(e.hasOwnProperty("serializers")===!0){o[jr]=Object.create(null);for(let u in r)o[jr][u]=r[u];let a=Object.getOwnPropertySymbols(r);for(var s=0;s<a.length;s++){let u=a[s];o[jr][u]=r[u]}for(let u in e.serializers)o[jr][u]=e.serializers[u];let c=Object.getOwnPropertySymbols(e.serializers);for(var i=0;i<c.length;i++){let u=c[i];o[jr][u]=e.serializers[u]}}else o[jr]=r;if(e.hasOwnProperty("formatters")){let{level:a,bindings:c,log:u}=e.formatters;o[uo]=Zc(a||n.level,c||ni,u||n.log)}else o[uo]=Zc(n.level,ni,n.log);if(e.hasOwnProperty("customLevels")===!0&&(OE(this.levels,e.customLevels),o.levels=PE(e.customLevels,o[_E]),CE(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=DE(o.redact,zm),c={stringify:a[bE]};o[wE]=zm,o[SE]=a,o[xE]=c}if(typeof e.msgPrefix=="string"&&(o[qc]=(this[qc]||"")+e.msgPrefix),o[oi]=Fc(o,t),e.level!==void 0&&e.level!==this.level||e.hasOwnProperty("customLevels")){let a=e.level||this.level;o[Lc](a)}return this.onChild(o),o}function jE(){let e=`{${this[oi].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function ME(t){let e=Fc(this,t);this[oi]=e}function ZE(t,e){return Object.assign(e,t)}function LE(t,e,r){let n=this[mE](),o=this[dE],s=this[gE],i=this[yE],a=this[pE]||ZE,c,u=this[$E].streamWrite;t==null?c={}:t instanceof Error?(c={[s]:t},e===void 0&&(e=t.message)):(c=t,e===void 0&&t[i]===void 0&&t[s]&&(e=t[s].message)),o&&(c=a(c,o(c,r,this)));let l=this[Pm](c,e,r,n),d=this[Tm];d[vE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[hE]),d.lastLogger=this),d.write(u?u(l):l)}function qE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[Tm];typeof e.flush=="function"?e.flush(t||Cm):t&&t()}});var jm=$((Hc,Am)=>{"use strict";var{hasOwnProperty:lo}=Object.prototype,Zr=Bc();Zr.configure=Bc;Zr.stringify=Zr;Zr.default=Zr;Hc.stringify=Zr;Hc.configure=Bc;Am.exports=Zr;var FE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function tr(t){return t.length<5e3&&!FE.test(t)?`"${t}"`:JSON.stringify(t)}function Uc(t,e){if(t.length>200||e)return t.sort(e);for(let r=1;r<t.length;r++){let n=t[r],o=r;for(;o!==0&&t[o-1]>n;)t[o]=t[o-1],o--;t[o]=n}return t}var UE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Vc(t){return UE.call(t)!==void 0&&t.length!==0}function Dm(t,e,r){t.length<r&&(r=t.length);let n=e===","?"":" ",o=`"0":${n}${t[0]}`;for(let s=1;s<r;s++)o+=`${e}"${s}":${n}${t[s]}`;return o}function VE(t){if(lo.call(t,"circularValue")){let e=t.circularValue;if(typeof e=="string")return`"${e}"`;if(e==null)return e;if(e===Error||e===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function BE(t){let e;if(lo.call(t,"deterministic")&&(e=t.deterministic,typeof e!="boolean"&&typeof e!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return e===void 0?!0:e}function HE(t,e){let r;if(lo.call(t,e)&&(r=t[e],typeof r!="boolean"))throw new TypeError(`The "${e}" argument must be of type boolean`);return r===void 0?!0:r}function Nm(t,e){let r;if(lo.call(t,e)){if(r=t[e],typeof r!="number")throw new TypeError(`The "${e}" argument must be of type number`);if(!Number.isInteger(r))throw new TypeError(`The "${e}" argument must be an integer`);if(r<1)throw new RangeError(`The "${e}" argument must be >= 1`)}return r===void 0?1/0:r}function Mr(t){return t===1?"1 item":`${t} items`}function WE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function GE(t){if(lo.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Bc(t){t={...t};let e=GE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=VE(t),n=HE(t,"bigint"),o=BE(t),s=typeof o=="function"?o:void 0,i=Nm(t,"maximumDepth"),a=Nm(t,"maximumBreadth");function c(m,f,h,g,_,x){let w=f[m];switch(typeof w=="object"&&w!==null&&typeof w.toJSON=="function"&&(w=w.toJSON(m)),w=g.call(f,m,w),typeof w){case"string":return tr(w);case"object":{if(w===null)return"null";if(h.indexOf(w)!==-1)return r;let S="",k=",",W=x;if(Array.isArray(w)){if(w.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(w),_!==""&&(x+=_,S+=`
5
5
  ${x}`,k=`,
6
- ${x}`);let xe=Math.min(w.length,a),Ze=0;for(;Ze<xe-1;Ze++){let yr=c(String(Ze),w,h,g,_,x);S+=yr!==void 0?yr:"null",S+=k}let Be=c(String(Ze),w,h,g,_,x);if(S+=Be!==void 0?Be:"null",w.length-1>a){let yr=w.length-a-1;S+=`${k}"... ${Dr(yr)} not stringified"`}return _!==""&&(S+=`
6
+ ${x}`);let xe=Math.min(w.length,a),Ze=0;for(;Ze<xe-1;Ze++){let _r=c(String(Ze),w,h,g,_,x);S+=_r!==void 0?_r:"null",S+=k}let Be=c(String(Ze),w,h,g,_,x);if(S+=Be!==void 0?Be:"null",w.length-1>a){let _r=w.length-a-1;S+=`${k}"... ${Mr(_r)} not stringified"`}return _!==""&&(S+=`
7
7
  ${W}`),h.pop(),`[${S}]`}let Z=Object.keys(w),re=Z.length;if(re===0)return"{}";if(i<h.length+1)return'"[Object]"';let U="",me="";_!==""&&(x+=_,k=`,
8
- ${x}`,U=" ");let Ee=Math.min(re,a);o&&!Lc(w)&&(Z=Zc(Z,s)),h.push(w);for(let xe=0;xe<Ee;xe++){let Ze=Z[xe],Be=c(Ze,w,h,g,_,x);Be!==void 0&&(S+=`${me}${er(Ze)}:${U}${Be}`,me=k)}if(re>a){let xe=re-a;S+=`${me}"...":${U}"${Dr(xe)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
8
+ ${x}`,U=" ");let Ee=Math.min(re,a);o&&!Vc(w)&&(Z=Uc(Z,s)),h.push(w);for(let xe=0;xe<Ee;xe++){let Ze=Z[xe],Be=c(Ze,w,h,g,_,x);Be!==void 0&&(S+=`${me}${tr(Ze)}:${U}${Be}`,me=k)}if(re>a){let xe=re-a;S+=`${me}"...":${U}"${Mr(xe)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
9
9
  ${x}${S}
10
- ${W}`),h.pop(),`{${S}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return e?e(w):void 0}}function u(p,f,h,g,_,x){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(p)),typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(h.indexOf(f)!==-1)return r;let w=x,S="",k=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_!==""&&(x+=_,S+=`
10
+ ${W}`),h.pop(),`{${S}}`}case"number":return isFinite(w)?String(w):e?e(w):"null";case"boolean":return w===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(w);default:return e?e(w):void 0}}function u(m,f,h,g,_,x){switch(typeof f=="object"&&f!==null&&typeof f.toJSON=="function"&&(f=f.toJSON(m)),typeof f){case"string":return tr(f);case"object":{if(f===null)return"null";if(h.indexOf(f)!==-1)return r;let w=x,S="",k=",";if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_!==""&&(x+=_,S+=`
11
11
  ${x}`,k=`,
12
- ${x}`);let re=Math.min(f.length,a),U=0;for(;U<re-1;U++){let Ee=u(String(U),f[U],h,g,_,x);S+=Ee!==void 0?Ee:"null",S+=k}let me=u(String(U),f[U],h,g,_,x);if(S+=me!==void 0?me:"null",f.length-1>a){let Ee=f.length-a-1;S+=`${k}"... ${Dr(Ee)} not stringified"`}return _!==""&&(S+=`
12
+ ${x}`);let re=Math.min(f.length,a),U=0;for(;U<re-1;U++){let Ee=u(String(U),f[U],h,g,_,x);S+=Ee!==void 0?Ee:"null",S+=k}let me=u(String(U),f[U],h,g,_,x);if(S+=me!==void 0?me:"null",f.length-1>a){let Ee=f.length-a-1;S+=`${k}"... ${Mr(Ee)} not stringified"`}return _!==""&&(S+=`
13
13
  ${w}`),h.pop(),`[${S}]`}h.push(f);let W="";_!==""&&(x+=_,k=`,
14
- ${x}`,W=" ");let Z="";for(let re of g){let U=u(re,f[re],h,g,_,x);U!==void 0&&(S+=`${Z}${er(re)}:${W}${U}`,Z=k)}return _!==""&&Z.length>1&&(S=`
14
+ ${x}`,W=" ");let Z="";for(let re of g){let U=u(re,f[re],h,g,_,x);U!==void 0&&(S+=`${Z}${tr(re)}:${W}${U}`,Z=k)}return _!==""&&Z.length>1&&(S=`
15
15
  ${x}${S}
16
- ${w}`),h.pop(),`{${S}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function l(p,f,h,g,_){switch(typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(p),typeof f!="object")return l(p,f,h,g,_);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let x=_;if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_+=g;let U=`
16
+ ${w}`),h.pop(),`{${S}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function l(m,f,h,g,_){switch(typeof f){case"string":return tr(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return l(m,f,h,g,_);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let x=_;if(Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f),_+=g;let U=`
17
17
  ${_}`,me=`,
18
- ${_}`,Ee=Math.min(f.length,a),xe=0;for(;xe<Ee-1;xe++){let Be=l(String(xe),f[xe],h,g,_);U+=Be!==void 0?Be:"null",U+=me}let Ze=l(String(xe),f[xe],h,g,_);if(U+=Ze!==void 0?Ze:"null",f.length-1>a){let Be=f.length-a-1;U+=`${me}"... ${Dr(Be)} not stringified"`}return U+=`
18
+ ${_}`,Ee=Math.min(f.length,a),xe=0;for(;xe<Ee-1;xe++){let Be=l(String(xe),f[xe],h,g,_);U+=Be!==void 0?Be:"null",U+=me}let Ze=l(String(xe),f[xe],h,g,_);if(U+=Ze!==void 0?Ze:"null",f.length-1>a){let Be=f.length-a-1;U+=`${me}"... ${Mr(Be)} not stringified"`}return U+=`
19
19
  ${x}`,h.pop(),`[${U}]`}let w=Object.keys(f),S=w.length;if(S===0)return"{}";if(i<h.length+1)return'"[Object]"';_+=g;let k=`,
20
- ${_}`,W="",Z="",re=Math.min(S,a);Lc(f)&&(W+=Tm(f,k,a),w=w.slice(f.length),re-=f.length,Z=k),o&&(w=Zc(w,s)),h.push(f);for(let U=0;U<re;U++){let me=w[U],Ee=l(me,f[me],h,g,_);Ee!==void 0&&(W+=`${Z}${er(me)}: ${Ee}`,Z=k)}if(S>a){let U=S-a;W+=`${Z}"...": "${Dr(U)} not stringified"`,Z=k}return Z!==""&&(W=`
20
+ ${_}`,W="",Z="",re=Math.min(S,a);Vc(f)&&(W+=Dm(f,k,a),w=w.slice(f.length),re-=f.length,Z=k),o&&(w=Uc(w,s)),h.push(f);for(let U=0;U<re;U++){let me=w[U],Ee=l(me,f[me],h,g,_);Ee!==void 0&&(W+=`${Z}${tr(me)}: ${Ee}`,Z=k)}if(S>a){let U=S-a;W+=`${Z}"...": "${Mr(U)} not stringified"`,Z=k}return Z!==""&&(W=`
21
21
  ${_}${W}
22
- ${x}`),h.pop(),`{${W}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function d(p,f,h){switch(typeof f){case"string":return er(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(p),typeof f!="object")return d(p,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let g="",_=f.length!==void 0;if(_&&Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f);let W=Math.min(f.length,a),Z=0;for(;Z<W-1;Z++){let U=d(String(Z),f[Z],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(Z),f[Z],h);if(g+=re!==void 0?re:"null",f.length-1>a){let U=f.length-a-1;g+=`,"... ${Dr(U)} not stringified"`}return h.pop(),`[${g}]`}let x=Object.keys(f),w=x.length;if(w===0)return"{}";if(i<h.length+1)return'"[Object]"';let S="",k=Math.min(w,a);_&&Lc(f)&&(g+=Tm(f,",",a),x=x.slice(f.length),k-=f.length,S=","),o&&(x=Zc(x,s)),h.push(f);for(let W=0;W<k;W++){let Z=x[W],re=d(Z,f[Z],h);re!==void 0&&(g+=`${S}${er(Z)}:${re}`,S=",")}if(w>a){let W=w-a;g+=`${S}"...":"${Dr(W)} not stringified"`}return h.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function m(p,f,h){if(arguments.length>1){let g="";if(typeof h=="number"?g=" ".repeat(Math.min(h,10)):typeof h=="string"&&(g=h.slice(0,10)),f!=null){if(typeof f=="function")return c("",{"":p},[],f,g,"");if(Array.isArray(f))return u("",p,[],UE(f),g,"")}if(g.length!==0)return l("",p,[],g,"")}return d("",p,[])}return m}});var Dm=$((m1,Am)=>{"use strict";var Uc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Nm}=ei(),BE=Nm.info;function HE(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Nm);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(d=>{r[d]=e.levels[d]});let n={write:o,add:a,remove:c,emit:s,flushSync:i,end:u,minLevel:0,lastId:0,streams:[],clone:l,[Uc]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let m,p=this.lastLevel,{streams:f}=this,h=0,g;for(let _=WE(f.length,e.dedupe);JE(_,f.length,e.dedupe);_=GE(_,e.dedupe))if(m=f[_],m.level<=p){if(h!==0&&h!==m.level)break;if(g=m.stream,g[Uc]){let{lastTime:x,lastMsg:w,lastObj:S,lastLogger:k}=this;g.lastLevel=p,g.lastTime=x,g.lastMsg=w,g.lastObj=S,g.lastLogger=k}g.write(d),e.dedupe&&(h=m.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:m}of this.streams)typeof m.emit=="function"&&m.emit(...d)}function i(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function a(d){if(!d)return n;let m=typeof d.write=="function"||d.stream,p=d.write?d:d.stream;if(!m)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:h}=this,g;typeof d.levelVal=="number"?g=d.levelVal:typeof d.level=="string"?g=h[d.level]:typeof d.level=="number"?g=d.level:g=BE;let _={stream:p,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Rm),this.minLevel=f[0].level,n}function c(d){let{streams:m}=this,p=m.findIndex(f=>f.id===d);return p>=0&&(m.splice(p,1),m.sort(Rm),this.minLevel=m.length>0?m[0].level:-1),n}function u(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function l(d){let m=new Array(this.streams.length);for(let p=0;p<m.length;p++)m[p]={level:d,stream:this.streams[p].stream};return{write:o,add:a,remove:c,minLevel:d,streams:m,clone:l,emit:s,flushSync:i,[Uc]:!0}}}function Rm(t,e){return t.level-e.level}function WE(t,e){return e?t-1:0}function GE(t,e){return e?t-1:t+1}function JE(t,e,r){return r?t>=0:t<e}Am.exports=HE});var Km=$((h1,it)=>{"use strict";var KE=require("node:os"),Vm=uc(),YE=lc(),QE=pc(),Bm=bp(),XE=Pm(),Hm=cn(),{configure:ez}=Im(),{assertDefaultLevelFound:tz,mappings:Wm,genLsCache:rz,genLevelComparison:nz,assertLevelComparison:oz}=Rc(),{DEFAULT_LEVELS:Gm,SORTING_ORDER:sz}=ei(),{createArgsNormalizer:iz,asChindings:az,buildSafeSonicBoom:jm,buildFormatters:cz,stringify:Vc,normalizeDestFileDescriptor:Mm,noop:uz}=Xs(),{version:lz}=Nc(),{chindingsSym:Zm,redactFmtSym:dz,serializersSym:Lm,timeSym:fz,timeSliceIndexSym:pz,streamSym:mz,stringifySym:qm,stringifySafeSym:Bc,stringifiersSym:Fm,setLevelSym:hz,endSym:gz,formatOptsSym:yz,messageKeySym:_z,errorKeySym:vz,nestedKeySym:bz,mixinSym:wz,levelCompSym:xz,useOnlyCustomLevelsSym:Sz,formattersSym:Um,hooksSym:$z,nestedKeyStrSym:kz,mixinMergeStrategySym:Ez,msgPrefixSym:zz}=Hm,{epochTime:Jm,nullTime:Pz}=Bm,{pid:Tz}=process,Cz=KE.hostname(),Oz=Vm.err,Iz={level:"info",levelComparison:sz.ASC,levels:Gm,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Tz,hostname:Cz},serializers:Object.assign(Object.create(null),{err:Oz}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:Jm,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Rz=iz(Iz),Nz=Object.assign(Object.create(null),Vm);function Hc(...t){let e={},{opts:r,stream:n}=Rz(e,YE(),...t);r.level&&typeof r.level=="string"&&Gm[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:o,crlf:s,serializers:i,timestamp:a,messageKey:c,errorKey:u,nestedKey:l,base:d,name:m,level:p,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:w,hooks:S,depthLimit:k,edgeLimit:W,onChild:Z,msgPrefix:re}=r,U=ez({maximumDepth:k,maximumBreadth:W}),me=cz(w.level,w.bindings,w.log),Ee=Vc.bind({[Bc]:U}),xe=o?QE(o,Ee):{},Ze=o?{stringify:xe[dz]}:{stringify:Ee},Be="}"+(s?`\r
22
+ ${x}`),h.pop(),`{${W}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function d(m,f,h){switch(typeof f){case"string":return tr(f);case"object":{if(f===null)return"null";if(typeof f.toJSON=="function"){if(f=f.toJSON(m),typeof f!="object")return d(m,f,h);if(f===null)return"null"}if(h.indexOf(f)!==-1)return r;let g="",_=f.length!==void 0;if(_&&Array.isArray(f)){if(f.length===0)return"[]";if(i<h.length+1)return'"[Array]"';h.push(f);let W=Math.min(f.length,a),Z=0;for(;Z<W-1;Z++){let U=d(String(Z),f[Z],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(Z),f[Z],h);if(g+=re!==void 0?re:"null",f.length-1>a){let U=f.length-a-1;g+=`,"... ${Mr(U)} not stringified"`}return h.pop(),`[${g}]`}let x=Object.keys(f),w=x.length;if(w===0)return"{}";if(i<h.length+1)return'"[Object]"';let S="",k=Math.min(w,a);_&&Vc(f)&&(g+=Dm(f,",",a),x=x.slice(f.length),k-=f.length,S=","),o&&(x=Uc(x,s)),h.push(f);for(let W=0;W<k;W++){let Z=x[W],re=d(Z,f[Z],h);re!==void 0&&(g+=`${S}${tr(Z)}:${re}`,S=",")}if(w>a){let W=w-a;g+=`${S}"...":"${Mr(W)} not stringified"`}return h.pop(),`{${g}}`}case"number":return isFinite(f)?String(f):e?e(f):"null";case"boolean":return f===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(f);default:return e?e(f):void 0}}function p(m,f,h){if(arguments.length>1){let g="";if(typeof h=="number"?g=" ".repeat(Math.min(h,10)):typeof h=="string"&&(g=h.slice(0,10)),f!=null){if(typeof f=="function")return c("",{"":m},[],f,g,"");if(Array.isArray(f))return u("",m,[],WE(f),g,"")}if(g.length!==0)return l("",m,[],g,"")}return d("",m,[])}return p}});var qm=$((xj,Lm)=>{"use strict";var Wc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Zm}=ri(),JE=Zm.info;function KE(t,e){t=t||[],e=e||{dedupe:!1};let r=Object.create(Zm);r.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(d=>{r[d]=e.levels[d]});let n={write:o,add:a,remove:c,emit:s,flushSync:i,end:u,minLevel:0,lastId:0,streams:[],clone:l,[Wc]:!0,streamLevels:r};return Array.isArray(t)?t.forEach(a,n):a.call(n,t),t=null,n;function o(d){let p,m=this.lastLevel,{streams:f}=this,h=0,g;for(let _=YE(f.length,e.dedupe);XE(_,f.length,e.dedupe);_=QE(_,e.dedupe))if(p=f[_],p.level<=m){if(h!==0&&h!==p.level)break;if(g=p.stream,g[Wc]){let{lastTime:x,lastMsg:w,lastObj:S,lastLogger:k}=this;g.lastLevel=m,g.lastTime=x,g.lastMsg=w,g.lastObj=S,g.lastLogger=k}g.write(d),e.dedupe&&(h=p.level)}else if(!e.dedupe)break}function s(...d){for(let{stream:p}of this.streams)typeof p.emit=="function"&&p.emit(...d)}function i(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync()}function a(d){if(!d)return n;let p=typeof d.write=="function"||d.stream,m=d.write?d:d.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:f,streamLevels:h}=this,g;typeof d.levelVal=="number"?g=d.levelVal:typeof d.level=="string"?g=h[d.level]:typeof d.level=="number"?g=d.level:g=JE;let _={stream:m,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Mm),this.minLevel=f[0].level,n}function c(d){let{streams:p}=this,m=p.findIndex(f=>f.id===d);return m>=0&&(p.splice(m,1),p.sort(Mm),this.minLevel=p.length>0?p[0].level:-1),n}function u(){for(let{stream:d}of this.streams)typeof d.flushSync=="function"&&d.flushSync(),d.end()}function l(d){let p=new Array(this.streams.length);for(let m=0;m<p.length;m++)p[m]={level:d,stream:this.streams[m].stream};return{write:o,add:a,remove:c,minLevel:d,streams:p,clone:l,emit:s,flushSync:i,[Wc]:!0}}}function Mm(t,e){return t.level-e.level}function YE(t,e){return e?t-1:0}function QE(t,e){return e?t-1:t+1}function XE(t,e,r){return r?t>=0:t<e}Lm.exports=KE});var th=$((Sj,at)=>{"use strict";var ez=require("node:os"),Jm=pc(),tz=mc(),rz=yc(),Km=kp(),nz=Rm(),Ym=dn(),{configure:oz}=jm(),{assertDefaultLevelFound:sz,mappings:Qm,genLsCache:iz,genLevelComparison:az,assertLevelComparison:cz}=jc(),{DEFAULT_LEVELS:Xm,SORTING_ORDER:uz}=ri(),{createArgsNormalizer:lz,asChindings:dz,buildSafeSonicBoom:Fm,buildFormatters:fz,stringify:Gc,normalizeDestFileDescriptor:Um,noop:pz}=ti(),{version:mz}=Mc(),{chindingsSym:Vm,redactFmtSym:hz,serializersSym:Bm,timeSym:gz,timeSliceIndexSym:yz,streamSym:_z,stringifySym:Hm,stringifySafeSym:Jc,stringifiersSym:Wm,setLevelSym:vz,endSym:bz,formatOptsSym:wz,messageKeySym:xz,errorKeySym:Sz,nestedKeySym:$z,mixinSym:kz,levelCompSym:Ez,useOnlyCustomLevelsSym:zz,formattersSym:Gm,hooksSym:Pz,nestedKeyStrSym:Tz,mixinMergeStrategySym:Cz,msgPrefixSym:Oz}=Ym,{epochTime:eh,nullTime:Iz}=Km,{pid:Rz}=process,Dz=ez.hostname(),Nz=Jm.err,Az={level:"info",levelComparison:uz.ASC,levels:Xm,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Rz,hostname:Dz},serializers:Object.assign(Object.create(null),{err:Nz}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return{level:e}}}),hooks:{logMethod:void 0,streamWrite:void 0},timestamp:eh,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},jz=lz(Az),Mz=Object.assign(Object.create(null),Jm);function Kc(...t){let e={},{opts:r,stream:n}=jz(e,tz(),...t);r.level&&typeof r.level=="string"&&Xm[r.level.toLowerCase()]!==void 0&&(r.level=r.level.toLowerCase());let{redact:o,crlf:s,serializers:i,timestamp:a,messageKey:c,errorKey:u,nestedKey:l,base:d,name:p,level:m,customLevels:f,levelComparison:h,mixin:g,mixinMergeStrategy:_,useOnlyCustomLevels:x,formatters:w,hooks:S,depthLimit:k,edgeLimit:W,onChild:Z,msgPrefix:re}=r,U=oz({maximumDepth:k,maximumBreadth:W}),me=fz(w.level,w.bindings,w.log),Ee=Gc.bind({[Jc]:U}),xe=o?rz(o,Ee):{},Ze=o?{stringify:xe[hz]}:{stringify:Ee},Be="}"+(s?`\r
23
23
  `:`
24
- `),yr=az.bind(null,{[Zm]:"",[Lm]:i,[Fm]:xe,[qm]:Vc,[Bc]:U,[Um]:me}),Na="";d!==null&&(m===void 0?Na=yr(d):Na=yr(Object.assign({},d,{name:m})));let nf=a instanceof Function?a:a?Jm:Pz,lx=nf().indexOf(":")+1;if(x&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(re&&typeof re!="string")throw Error(`Unknown msgPrefix type "${typeof re}" - expected "string"`);tz(p,f,x);let of=Wm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:of,messageKey:c,errorKey:u}}),oz(h);let dx=nz(h);return Object.assign(e,{levels:of,[xz]:dx,[Sz]:x,[mz]:n,[fz]:nf,[pz]:lx,[qm]:Vc,[Bc]:U,[Fm]:xe,[gz]:Be,[yz]:Ze,[_z]:c,[vz]:u,[bz]:l,[kz]:l?`,${JSON.stringify(l)}:{`:"",[Lm]:i,[wz]:g,[Ez]:_,[Zm]:Na,[Um]:me,[$z]:S,silent:uz,onChild:Z,[zz]:re}),Object.setPrototypeOf(e,XE()),rz(e),e[hz](p),e}it.exports=Hc;it.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Mm(t.dest||process.stdout.fd),jm(t)):jm({dest:Mm(t),minLength:0});it.exports.transport=zc();it.exports.multistream=Dm();it.exports.levels=Wm();it.exports.stdSerializers=Nz;it.exports.stdTimeFunctions=Object.assign({},Bm);it.exports.symbols=Hm;it.exports.version=lz;it.exports.default=Hc;it.exports.pino=Hc});var Bo=$(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.regexpCode=ee.getEsmExportName=ee.getProperty=ee.safeStringify=ee.stringify=ee.strConcat=ee.addCodeArg=ee.str=ee._=ee.nil=ee._Code=ee.Name=ee.IDENTIFIER=ee._CodeOrName=void 0;var Uo=class{};ee._CodeOrName=Uo;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Lr=class extends Uo{constructor(e){if(super(),!ee.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ee.Name=Lr;var lt=class extends Uo{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Lr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=lt;ee.nil=new lt("");function pv(t,...e){let r=[t[0]],n=0;for(;n<e.length;)ll(r,e[n]),r.push(t[++n]);return new lt(r)}ee._=pv;var ul=new lt("+");function mv(t,...e){let r=[Vo(t[0])],n=0;for(;n<e.length;)r.push(ul),ll(r,e[n]),r.push(ul,Vo(t[++n]));return sO(r),new lt(r)}ee.str=mv;function ll(t,e){e instanceof lt?t.push(...e._items):e instanceof Lr?t.push(e):t.push(cO(e))}ee.addCodeArg=ll;function sO(t){let e=1;for(;e<t.length-1;){if(t[e]===ul){let r=iO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function iO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Lr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Lr))return`"${t}${e.slice(1)}`}function aO(t,e){return e.emptyStr()?t:t.emptyStr()?e:mv`${t}${e}`}ee.strConcat=aO;function cO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Vo(Array.isArray(t)?t.join(","):t)}function uO(t){return new lt(Vo(t))}ee.stringify=uO;function Vo(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Vo;function lO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new lt(`.${t}`):pv`[${t}]`}ee.getProperty=lO;function dO(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new lt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=dO;function fO(t){return new lt(t.toString())}ee.regexpCode=fO});var pl=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var Ge=Bo(),dl=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Bi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Bi||(Je.UsedValueState=Bi={}));Je.varKinds={const:new Ge.Name("const"),let:new Ge.Name("let"),var:new Ge.Name("var")};var Hi=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ge.Name?e:this.name(e)}name(e){return new Ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Je.Scope=Hi;var Wi=class extends Ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ge._)`.${new Ge.Name(r)}[${n}]`}};Je.ValueScopeName=Wi;var pO=(0,Ge._)`\n`,fl=class extends Hi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?pO:Ge.nil}}get(){return this._scope}name(e){return new Wi(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ge.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Bi.Started);let l=r(u);if(l){let d=this.opts.es5?Je.varKinds.var:Je.varKinds.const;s=(0,Ge._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,Ge._)`${s}${l}${this.opts._n}`;else throw new dl(u);c.set(u,Bi.Completed)})}return s}};Je.ValueScope=fl});var F=$(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var K=Bo(),xt=pl(),cr=Bo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return cr._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return cr.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return cr.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return cr.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return cr.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return cr.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return cr.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return cr.Name}});var Yi=pl();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Yi.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Yi.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Yi.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Yi.varKinds}});V.operators={GT:new K._Code(">"),GTE:new K._Code(">="),LT:new K._Code("<"),LTE:new K._Code("<="),EQ:new K._Code("==="),NEQ:new K._Code("!=="),NOT:new K._Code("!"),OR:new K._Code("||"),AND:new K._Code("&&"),ADD:new K._Code("+")};var Bt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ml=class extends Bt{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?xt.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=Sn(this.rhs,e,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Gi=class extends Bt{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof K.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=Sn(this.rhs,e,r),this}get names(){let e=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Ki(e,this.rhs)}},hl=class extends Gi{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},gl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},yl=class extends Bt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},_l=class extends Bt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},vl=class extends Bt{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=Sn(this.code,e,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},Ho=class extends Bt{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(mO(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ur(e,r.names),{})}},Ht=class extends Ho{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},bl=class extends Ho{},xn=class extends Ht{};xn.kind="else";var qr=class t extends Ht{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new xn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(hv(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=Sn(this.condition,e,r),this}get names(){let e=super.names;return Ki(e,this.condition),this.else&&Ur(e,this.else.names),e}};qr.kind="if";var Fr=class extends Ht{};Fr.kind="for";var wl=class extends Fr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=Sn(this.iteration,e,r),this}get names(){return Ur(super.names,this.iteration.names)}},xl=class extends Fr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?xt.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Ki(super.names,this.from);return Ki(e,this.to)}},Ji=class extends Fr{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=Sn(this.iterable,e,r),this}get names(){return Ur(super.names,this.iterable.names)}},Wo=class extends Ht{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Wo.kind="func";var Go=class extends Ho{render(e){return"return "+super.render(e)}};Go.kind="return";var Sl=class extends Ht{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ur(e,this.catch.names),this.finally&&Ur(e,this.finally.names),e}},Jo=class extends Ht{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Jo.kind="catch";var Ko=class extends Ht{render(e){return"finally"+super.render(e)}};Ko.kind="finally";var $l=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
- `:""},this._extScope=e,this._scope=new xt.Scope({parent:e}),this._nodes=[new bl]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new ml(e,s,n)),s}const(e,r,n){return this._def(xt.varKinds.const,e,r,n)}let(e,r,n){return this._def(xt.varKinds.let,e,r,n)}var(e,r,n){return this._def(xt.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Gi(e,r,n))}add(e,r){return this._leafNode(new hl(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==K.nil&&this._leafNode(new vl(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,K.addCodeArg)(r,o));return r.push("}"),new K._Code(r)}if(e,r,n){if(this._blockNode(new qr(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new qr(e))}else(){return this._elseNode(new xn)}endIf(){return this._endBlockNode(qr,xn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new wl(e),r)}forRange(e,r,n,o,s=this.opts.es5?xt.varKinds.var:xt.varKinds.let){let i=this._scope.toName(e);return this._for(new xl(s,i,r,n),()=>o(i))}forOf(e,r,n,o=xt.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof K.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,K._)`${i}.length`,a=>{this.var(s,(0,K._)`${i}[${a}]`),n(s)})}return this._for(new Ji("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?xt.varKinds.var:xt.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,K._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Ji("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Fr)}label(e){return this._leafNode(new gl(e))}break(e){return this._leafNode(new yl(e))}return(e){let r=new Go;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Go)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new Sl;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Jo(s),r(s)}return n&&(this._currNode=o.finally=new Ko,this.code(n)),this._endBlockNode(Jo,Ko)}throw(e){return this._leafNode(new _l(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=K.nil,n,o){return this._blockNode(new Wo(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Wo)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof qr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=$l;function Ur(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Ki(t,e){return e instanceof K._CodeOrName?Ur(t,e.names):t}function Sn(t,e,r){if(t instanceof K.Name)return n(t);if(!o(t))return t;return new K._Code(t._items.reduce((s,i)=>(i instanceof K.Name&&(i=n(i)),i instanceof K._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof K._Code&&s._items.some(i=>i instanceof K.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function mO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function hv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${kl(t)}`}V.not=hv;var hO=gv(V.operators.AND);function gO(...t){return t.reduce(hO)}V.and=gO;var yO=gv(V.operators.OR);function _O(...t){return t.reduce(yO)}V.or=_O;function gv(t){return(e,r)=>e===K.nil?r:r===K.nil?e:(0,K._)`${kl(e)} ${t} ${kl(r)}`}function kl(t){return t instanceof K.Name?t:(0,K._)`(${t})`}});var Q=$(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var ae=F(),vO=Bo();function bO(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=bO;function wO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(vv(t,e),!bv(e,t.self.RULES.all))}B.alwaysValidSchema=wO;function vv(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Sv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=vv;function bv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=bv;function xO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}B.schemaHasRulesButRef=xO;function SO({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ae._)`${r}`}return(0,ae._)`${t}${e}${(0,ae.getProperty)(n)}`}B.schemaRefOrVal=SO;function $O(t){return wv(decodeURIComponent(t))}B.unescapeFragment=$O;function kO(t){return encodeURIComponent(zl(t))}B.escapeFragment=kO;function zl(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=zl;function wv(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=wv;function EO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=EO;function yv({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof ae.Name?(s instanceof ae.Name?t(o,s,i):e(o,s,i),i):s instanceof ae.Name?(e(o,i,s),s):r(s,i);return a===ae.Name&&!(c instanceof ae.Name)?n(o,c):c}}B.mergeEvaluated={props:yv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ae._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ae._)`${r} || {}`).code((0,ae._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ae._)`${r} || {}`),Pl(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:xv}),items:yv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ae._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ae._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function xv(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ae._)`{}`);return e!==void 0&&Pl(t,r,e),r}B.evaluatedPropsToName=xv;function Pl(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=Pl;var _v={};function zO(t,e){return t.scopeValue("func",{ref:e,code:_v[e.code]||(_v[e.code]=new vO._Code(e.code))})}B.useFunc=zO;var El;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(El||(B.Type=El={}));function PO(t,e,r){if(t instanceof ae.Name){let n=e===El.Num;return r?n?(0,ae._)`"[" + ${t} + "]"`:(0,ae._)`"['" + ${t} + "']"`:n?(0,ae._)`"/" + ${t}`:(0,ae._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ae.getProperty)(t).toString():"/"+zl(t)}B.getErrorPath=PO;function Sv(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}B.checkStrictMode=Sv});var Wt=$(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});var De=F(),TO={data:new De.Name("data"),valCxt:new De.Name("valCxt"),instancePath:new De.Name("instancePath"),parentData:new De.Name("parentData"),parentDataProperty:new De.Name("parentDataProperty"),rootData:new De.Name("rootData"),dynamicAnchors:new De.Name("dynamicAnchors"),vErrors:new De.Name("vErrors"),errors:new De.Name("errors"),this:new De.Name("this"),self:new De.Name("self"),scope:new De.Name("scope"),json:new De.Name("json"),jsonPos:new De.Name("jsonPos"),jsonLen:new De.Name("jsonLen"),jsonPart:new De.Name("jsonPart")};Tl.default=TO});var Yo=$(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.extendErrors=je.resetErrorsCount=je.reportExtraError=je.reportError=je.keyword$DataError=je.keywordError=void 0;var X=F(),Qi=Q(),Ue=Wt();je.keywordError={message:({keyword:t})=>(0,X.str)`must pass "${t}" keyword validation`};je.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,X.str)`"${t}" keyword must be ${e} ($data)`:(0,X.str)`"${t}" keyword is invalid ($data)`};function CO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Ev(t,e,r);n??(i||a)?$v(s,c):kv(o,(0,X._)`[${c}]`)}je.reportError=CO;function OO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Ev(t,e,r);$v(o,a),s||i||kv(n,Ue.default.vErrors)}je.reportExtraError=OO;function IO(t,e){t.assign(Ue.default.errors,e),t.if((0,X._)`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,X._)`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}je.resetErrorsCount=IO;function RO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Ue.default.errors,a=>{t.const(i,(0,X._)`${Ue.default.vErrors}[${a}]`),t.if((0,X._)`${i}.instancePath === undefined`,()=>t.assign((0,X._)`${i}.instancePath`,(0,X.strConcat)(Ue.default.instancePath,s.errorPath))),t.assign((0,X._)`${i}.schemaPath`,(0,X.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,X._)`${i}.schema`,r),t.assign((0,X._)`${i}.data`,n))})}je.extendErrors=RO;function $v(t,e){let r=t.const("err",e);t.if((0,X._)`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,(0,X._)`[${r}]`),(0,X._)`${Ue.default.vErrors}.push(${r})`),t.code((0,X._)`${Ue.default.errors}++`)}function kv(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,X._)`new ${t.ValidationError}(${e})`):(r.assign((0,X._)`${n}.errors`,e),r.return(!1))}var Vr={keyword:new X.Name("keyword"),schemaPath:new X.Name("schemaPath"),params:new X.Name("params"),propertyName:new X.Name("propertyName"),message:new X.Name("message"),schema:new X.Name("schema"),parentSchema:new X.Name("parentSchema")};function Ev(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:NO(t,e,r)}function NO(t,e,r={}){let{gen:n,it:o}=t,s=[AO(o,r),DO(t,r)];return jO(t,e,s),n.object(...s)}function AO({errorPath:t},{instancePath:e}){let r=e?(0,X.str)`${t}${(0,Qi.getErrorPath)(e,Qi.Type.Str)}`:t;return[Ue.default.instancePath,(0,X.strConcat)(Ue.default.instancePath,r)]}function DO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,X.str)`${e}/${t}`;return r&&(o=(0,X.str)`${o}${(0,Qi.getErrorPath)(r,Qi.Type.Str)}`),[Vr.schemaPath,o]}function jO(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([Vr.keyword,o],[Vr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Vr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Vr.schema,i],[Vr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Vr.propertyName,u])}});var Pv=$($n=>{"use strict";Object.defineProperty($n,"__esModule",{value:!0});$n.boolOrEmptySchema=$n.topBoolOrEmptySchema=void 0;var MO=Yo(),ZO=F(),LO=Wt(),qO={message:"boolean schema is false"};function FO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?zv(t,!1):typeof r=="object"&&r.$async===!0?e.return(LO.default.data):(e.assign((0,ZO._)`${n}.errors`,null),e.return(!0))}$n.topBoolOrEmptySchema=FO;function UO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),zv(t)):r.var(e,!0)}$n.boolOrEmptySchema=UO;function zv(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,MO.reportError)(o,qO,void 0,e)}});var Cl=$(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.getRules=kn.isJSONType=void 0;var VO=["string","number","integer","boolean","null","object","array"],BO=new Set(VO);function HO(t){return typeof t=="string"&&BO.has(t)}kn.isJSONType=HO;function WO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}kn.getRules=WO});var Ol=$(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.shouldUseRule=ur.shouldUseGroup=ur.schemaHasRulesForType=void 0;function GO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Tv(t,n)}ur.schemaHasRulesForType=GO;function Tv(t,e){return e.rules.some(r=>Cv(t,r))}ur.shouldUseGroup=Tv;function Cv(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}ur.shouldUseRule=Cv});var Qo=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.reportTypeError=Me.checkDataTypes=Me.checkDataType=Me.coerceAndCheckDataType=Me.getJSONTypes=Me.getSchemaTypes=Me.DataType=void 0;var JO=Cl(),KO=Ol(),YO=Yo(),q=F(),Ov=Q(),En;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(En||(Me.DataType=En={}));function QO(t){let e=Iv(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Me.getSchemaTypes=QO;function Iv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(JO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=Iv;function XO(t,e){let{gen:r,data:n,opts:o}=t,s=eI(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,KO.schemaHasRulesForType)(t,e[0]));if(i){let a=Rl(e,n,o.strictNumbers,En.Wrong);r.if(a,()=>{s.length?tI(t,e,s):Nl(t)})}return i}Me.coerceAndCheckDataType=XO;var Rv=new Set(["string","number","integer","boolean","null"]);function eI(t,e){return e?t.filter(r=>Rv.has(r)||e==="array"&&r==="array"):[]}function tI(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(Rl(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(Rv.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Nl(t),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),rI(t,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
24
+ `),_r=dz.bind(null,{[Vm]:"",[Bm]:i,[Wm]:xe,[Hm]:Gc,[Jc]:U,[Gm]:me}),Za="";d!==null&&(p===void 0?Za=_r(d):Za=_r(Object.assign({},d,{name:p})));let uf=a instanceof Function?a:a?eh:Iz,mx=uf().indexOf(":")+1;if(x&&!f)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(g&&typeof g!="function")throw Error(`Unknown mixin type "${typeof g}" - expected "function"`);if(re&&typeof re!="string")throw Error(`Unknown msgPrefix type "${typeof re}" - expected "string"`);sz(m,f,x);let lf=Qm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:lf,messageKey:c,errorKey:u}}),cz(h);let hx=az(h);return Object.assign(e,{levels:lf,[Ez]:hx,[zz]:x,[_z]:n,[gz]:uf,[yz]:mx,[Hm]:Gc,[Jc]:U,[Wm]:xe,[bz]:Be,[wz]:Ze,[xz]:c,[Sz]:u,[$z]:l,[Tz]:l?`,${JSON.stringify(l)}:{`:"",[Bm]:i,[kz]:g,[Cz]:_,[Vm]:Za,[Gm]:me,[Pz]:S,silent:pz,onChild:Z,[Oz]:re}),Object.setPrototypeOf(e,nz()),iz(e),e[vz](m),e}at.exports=Kc;at.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Um(t.dest||process.stdout.fd),Fm(t)):Fm({dest:Um(t),minLength:0});at.exports.transport=Oc();at.exports.multistream=qm();at.exports.levels=Qm();at.exports.stdSerializers=Mz;at.exports.stdTimeFunctions=Object.assign({},Km);at.exports.symbols=Ym;at.exports.version=mz;at.exports.default=Kc;at.exports.pino=Kc});var Wo=$(ee=>{"use strict";Object.defineProperty(ee,"__esModule",{value:!0});ee.regexpCode=ee.getEsmExportName=ee.getProperty=ee.safeStringify=ee.stringify=ee.strConcat=ee.addCodeArg=ee.str=ee._=ee.nil=ee._Code=ee.Name=ee.IDENTIFIER=ee._CodeOrName=void 0;var Bo=class{};ee._CodeOrName=Bo;ee.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Fr=class extends Bo{constructor(e){if(super(),!ee.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};ee.Name=Fr;var dt=class extends Bo{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Fr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=dt;ee.nil=new dt("");function _v(t,...e){let r=[t[0]],n=0;for(;n<e.length;)ml(r,e[n]),r.push(t[++n]);return new dt(r)}ee._=_v;var pl=new dt("+");function vv(t,...e){let r=[Ho(t[0])],n=0;for(;n<e.length;)r.push(pl),ml(r,e[n]),r.push(pl,Ho(t[++n]));return uO(r),new dt(r)}ee.str=vv;function ml(t,e){e instanceof dt?t.push(...e._items):e instanceof Fr?t.push(e):t.push(fO(e))}ee.addCodeArg=ml;function uO(t){let e=1;for(;e<t.length-1;){if(t[e]===pl){let r=lO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function lO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Fr||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Fr))return`"${t}${e.slice(1)}`}function dO(t,e){return e.emptyStr()?t:t.emptyStr()?e:vv`${t}${e}`}ee.strConcat=dO;function fO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ho(Array.isArray(t)?t.join(","):t)}function pO(t){return new dt(Ho(t))}ee.stringify=pO;function Ho(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Ho;function mO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new dt(`.${t}`):_v`[${t}]`}ee.getProperty=mO;function hO(t){if(typeof t=="string"&&ee.IDENTIFIER.test(t))return new dt(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}ee.getEsmExportName=hO;function gO(t){return new dt(t.toString())}ee.regexpCode=gO});var yl=$(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.ValueScope=Je.ValueScopeName=Je.Scope=Je.varKinds=Je.UsedValueState=void 0;var Ge=Wo(),hl=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},Wi;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(Wi||(Je.UsedValueState=Wi={}));Je.varKinds={const:new Ge.Name("const"),let:new Ge.Name("let"),var:new Ge.Name("var")};var Gi=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Ge.Name?e:this.name(e)}name(e){return new Ge.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Je.Scope=Gi;var Ji=class extends Ge.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,Ge._)`.${new Ge.Name(r)}[${n}]`}};Je.ValueScopeName=Ji;var yO=(0,Ge._)`\n`,gl=class extends Gi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?yO:Ge.nil}}get(){return this._scope}name(e){return new Ji(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(e),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let l=a.get(i);if(l)return l}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ge._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(e,r,n={},o){let s=Ge.nil;for(let i in e){let a=e[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Wi.Started);let l=r(u);if(l){let d=this.opts.es5?Je.varKinds.var:Je.varKinds.const;s=(0,Ge._)`${s}${d} ${u} = ${l};${this.opts._n}`}else if(l=o?.(u))s=(0,Ge._)`${s}${l}${this.opts._n}`;else throw new hl(u);c.set(u,Wi.Completed)})}return s}};Je.ValueScope=gl});var F=$(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var K=Wo(),$t=yl(),ur=Wo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return ur._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return ur.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return ur.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return ur.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return ur.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return ur.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return ur.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return ur.Name}});var Xi=yl();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Xi.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Xi.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Xi.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Xi.varKinds}});V.operators={GT:new K._Code(">"),GTE:new K._Code(">="),LT:new K._Code("<"),LTE:new K._Code("<="),EQ:new K._Code("==="),NEQ:new K._Code("!=="),NOT:new K._Code("!"),OR:new K._Code("||"),AND:new K._Code("&&"),ADD:new K._Code("+")};var Ht=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_l=class extends Ht{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?$t.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=En(this.rhs,e,r)),this}get names(){return this.rhs instanceof K._CodeOrName?this.rhs.names:{}}},Ki=class extends Ht{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof K.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=En(this.rhs,e,r),this}get names(){let e=this.lhs instanceof K.Name?{}:{...this.lhs.names};return Qi(e,this.rhs)}},vl=class extends Ki{constructor(e,r,n,o){super(e,n,o),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},bl=class extends Ht{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},wl=class extends Ht{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},xl=class extends Ht{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Sl=class extends Ht{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=En(this.code,e,r),this}get names(){return this.code instanceof K._CodeOrName?this.code.names:{}}},Go=class extends Ht{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(e,r)||(_O(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Br(e,r.names),{})}},Wt=class extends Go{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},$l=class extends Go{},kn=class extends Wt{};kn.kind="else";var Ur=class t extends Wt{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new kn(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(bv(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=En(this.condition,e,r),this}get names(){let e=super.names;return Qi(e,this.condition),this.else&&Br(e,this.else.names),e}};Ur.kind="if";var Vr=class extends Wt{};Vr.kind="for";var kl=class extends Vr{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=En(this.iteration,e,r),this}get names(){return Br(super.names,this.iteration.names)}},El=class extends Vr{constructor(e,r,n,o){super(),this.varKind=e,this.name=r,this.from=n,this.to=o}render(e){let r=e.es5?$t.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(e)}get names(){let e=Qi(super.names,this.from);return Qi(e,this.to)}},Yi=class extends Vr{constructor(e,r,n,o){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=o}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=En(this.iterable,e,r),this}get names(){return Br(super.names,this.iterable.names)}},Jo=class extends Wt{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Jo.kind="func";var Ko=class extends Go{render(e){return"return "+super.render(e)}};Ko.kind="return";var zl=class extends Wt{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,o;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(o=this.finally)===null||o===void 0||o.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Br(e,this.catch.names),this.finally&&Br(e,this.finally.names),e}},Yo=class extends Wt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yo.kind="catch";var Qo=class extends Wt{render(e){return"finally"+super.render(e)}};Qo.kind="finally";var Pl=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
25
+ `:""},this._extScope=e,this._scope=new $t.Scope({parent:e}),this._nodes=[new $l]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new _l(e,s,n)),s}const(e,r,n){return this._def($t.varKinds.const,e,r,n)}let(e,r,n){return this._def($t.varKinds.let,e,r,n)}var(e,r,n){return this._def($t.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new Ki(e,r,n))}add(e,r){return this._leafNode(new vl(e,V.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==K.nil&&this._leafNode(new Sl(e)),this}object(...e){let r=["{"];for(let[n,o]of e)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,K.addCodeArg)(r,o));return r.push("}"),new K._Code(r)}if(e,r,n){if(this._blockNode(new Ur(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ur(e))}else(){return this._elseNode(new kn)}endIf(){return this._endBlockNode(Ur,kn)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new kl(e),r)}forRange(e,r,n,o,s=this.opts.es5?$t.varKinds.var:$t.varKinds.let){let i=this._scope.toName(e);return this._for(new El(s,i,r,n),()=>o(i))}forOf(e,r,n,o=$t.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let i=r instanceof K.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,K._)`${i}.length`,a=>{this.var(s,(0,K._)`${i}[${a}]`),n(s)})}return this._for(new Yi("of",o,s,r),()=>n(s))}forIn(e,r,n,o=this.opts.es5?$t.varKinds.var:$t.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,K._)`Object.keys(${r})`,n);let s=this._scope.toName(e);return this._for(new Yi("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Vr)}label(e){return this._leafNode(new bl(e))}break(e){return this._leafNode(new wl(e))}return(e){let r=new Ko;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ko)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zl;if(this._blockNode(o),this.code(e),r){let s=this.name("e");this._currNode=o.catch=new Yo(s),r(s)}return n&&(this._currNode=o.finally=new Qo,this.code(n)),this._endBlockNode(Yo,Qo)}throw(e){return this._leafNode(new xl(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=K.nil,n,o){return this._blockNode(new Jo(e,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(Jo)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ur))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};V.CodeGen=Pl;function Br(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function Qi(t,e){return e instanceof K._CodeOrName?Br(t,e.names):t}function En(t,e,r){if(t instanceof K.Name)return n(t);if(!o(t))return t;return new K._Code(t._items.reduce((s,i)=>(i instanceof K.Name&&(i=n(i)),i instanceof K._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||e[s.str]!==1?s:(delete e[s.str],i)}function o(s){return s instanceof K._Code&&s._items.some(i=>i instanceof K.Name&&e[i.str]===1&&r[i.str]!==void 0)}}function _O(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function bv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${Tl(t)}`}V.not=bv;var vO=wv(V.operators.AND);function bO(...t){return t.reduce(vO)}V.and=bO;var wO=wv(V.operators.OR);function xO(...t){return t.reduce(wO)}V.or=xO;function wv(t){return(e,r)=>e===K.nil?r:r===K.nil?e:(0,K._)`${Tl(e)} ${t} ${Tl(r)}`}function Tl(t){return t instanceof K.Name?t:(0,K._)`(${t})`}});var Q=$(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var ae=F(),SO=Wo();function $O(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=$O;function kO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:($v(t,e),!kv(e,t.self.RULES.all))}B.alwaysValidSchema=kO;function $v(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let o=n.RULES.keywords;for(let s in e)o[s]||Pv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=$v;function kv(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=kv;function EO(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}B.schemaHasRulesButRef=EO;function zO({topSchemaRef:t,schemaPath:e},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ae._)`${r}`}return(0,ae._)`${t}${e}${(0,ae.getProperty)(n)}`}B.schemaRefOrVal=zO;function PO(t){return Ev(decodeURIComponent(t))}B.unescapeFragment=PO;function TO(t){return encodeURIComponent(Ol(t))}B.escapeFragment=TO;function Ol(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Ol;function Ev(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=Ev;function CO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=CO;function xv({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof ae.Name?(s instanceof ae.Name?t(o,s,i):e(o,s,i),i):s instanceof ae.Name?(e(o,i,s),s):r(s,i);return a===ae.Name&&!(c instanceof ae.Name)?n(o,c):c}}B.mergeEvaluated={props:xv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,ae._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,ae._)`${r} || {}`).code((0,ae._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,ae._)`${r} || {}`),Il(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:zv}),items:xv({mergeNames:(t,e,r)=>t.if((0,ae._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,ae._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,ae._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,ae._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function zv(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,ae._)`{}`);return e!==void 0&&Il(t,r,e),r}B.evaluatedPropsToName=zv;function Il(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=Il;var Sv={};function OO(t,e){return t.scopeValue("func",{ref:e,code:Sv[e.code]||(Sv[e.code]=new SO._Code(e.code))})}B.useFunc=OO;var Cl;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Cl||(B.Type=Cl={}));function IO(t,e,r){if(t instanceof ae.Name){let n=e===Cl.Num;return r?n?(0,ae._)`"[" + ${t} + "]"`:(0,ae._)`"['" + ${t} + "']"`:n?(0,ae._)`"/" + ${t}`:(0,ae._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ae.getProperty)(t).toString():"/"+Ol(t)}B.getErrorPath=IO;function Pv(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}B.checkStrictMode=Pv});var Gt=$(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var Ae=F(),RO={data:new Ae.Name("data"),valCxt:new Ae.Name("valCxt"),instancePath:new Ae.Name("instancePath"),parentData:new Ae.Name("parentData"),parentDataProperty:new Ae.Name("parentDataProperty"),rootData:new Ae.Name("rootData"),dynamicAnchors:new Ae.Name("dynamicAnchors"),vErrors:new Ae.Name("vErrors"),errors:new Ae.Name("errors"),this:new Ae.Name("this"),self:new Ae.Name("self"),scope:new Ae.Name("scope"),json:new Ae.Name("json"),jsonPos:new Ae.Name("jsonPos"),jsonLen:new Ae.Name("jsonLen"),jsonPart:new Ae.Name("jsonPart")};Rl.default=RO});var Xo=$(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.extendErrors=je.resetErrorsCount=je.reportExtraError=je.reportError=je.keyword$DataError=je.keywordError=void 0;var X=F(),ea=Q(),Ue=Gt();je.keywordError={message:({keyword:t})=>(0,X.str)`must pass "${t}" keyword validation`};je.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,X.str)`"${t}" keyword must be ${e} ($data)`:(0,X.str)`"${t}" keyword is invalid ($data)`};function DO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Ov(t,e,r);n??(i||a)?Tv(s,c):Cv(o,(0,X._)`[${c}]`)}je.reportError=DO;function NO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Ov(t,e,r);Tv(o,a),s||i||Cv(n,Ue.default.vErrors)}je.reportExtraError=NO;function AO(t,e){t.assign(Ue.default.errors,e),t.if((0,X._)`${Ue.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,X._)`${Ue.default.vErrors}.length`,e),()=>t.assign(Ue.default.vErrors,null)))}je.resetErrorsCount=AO;function jO({gen:t,keyword:e,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=t.name("err");t.forRange("i",o,Ue.default.errors,a=>{t.const(i,(0,X._)`${Ue.default.vErrors}[${a}]`),t.if((0,X._)`${i}.instancePath === undefined`,()=>t.assign((0,X._)`${i}.instancePath`,(0,X.strConcat)(Ue.default.instancePath,s.errorPath))),t.assign((0,X._)`${i}.schemaPath`,(0,X.str)`${s.errSchemaPath}/${e}`),s.opts.verbose&&(t.assign((0,X._)`${i}.schema`,r),t.assign((0,X._)`${i}.data`,n))})}je.extendErrors=jO;function Tv(t,e){let r=t.const("err",e);t.if((0,X._)`${Ue.default.vErrors} === null`,()=>t.assign(Ue.default.vErrors,(0,X._)`[${r}]`),(0,X._)`${Ue.default.vErrors}.push(${r})`),t.code((0,X._)`${Ue.default.errors}++`)}function Cv(t,e){let{gen:r,validateName:n,schemaEnv:o}=t;o.$async?r.throw((0,X._)`new ${t.ValidationError}(${e})`):(r.assign((0,X._)`${n}.errors`,e),r.return(!1))}var Hr={keyword:new X.Name("keyword"),schemaPath:new X.Name("schemaPath"),params:new X.Name("params"),propertyName:new X.Name("propertyName"),message:new X.Name("message"),schema:new X.Name("schema"),parentSchema:new X.Name("parentSchema")};function Ov(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:MO(t,e,r)}function MO(t,e,r={}){let{gen:n,it:o}=t,s=[ZO(o,r),LO(t,r)];return qO(t,e,s),n.object(...s)}function ZO({errorPath:t},{instancePath:e}){let r=e?(0,X.str)`${t}${(0,ea.getErrorPath)(e,ea.Type.Str)}`:t;return[Ue.default.instancePath,(0,X.strConcat)(Ue.default.instancePath,r)]}function LO({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let o=n?e:(0,X.str)`${e}/${t}`;return r&&(o=(0,X.str)`${o}${(0,ea.getErrorPath)(r,ea.Type.Str)}`),[Hr.schemaPath,o]}function qO(t,{params:e,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=t,{opts:c,propertyName:u,topSchemaRef:l,schemaPath:d}=a;n.push([Hr.keyword,o],[Hr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Hr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Hr.schema,i],[Hr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Hr.propertyName,u])}});var Rv=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.boolOrEmptySchema=zn.topBoolOrEmptySchema=void 0;var FO=Xo(),UO=F(),VO=Gt(),BO={message:"boolean schema is false"};function HO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Iv(t,!1):typeof r=="object"&&r.$async===!0?e.return(VO.default.data):(e.assign((0,UO._)`${n}.errors`,null),e.return(!0))}zn.topBoolOrEmptySchema=HO;function WO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Iv(t)):r.var(e,!0)}zn.boolOrEmptySchema=WO;function Iv(t,e){let{gen:r,data:n}=t,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,FO.reportError)(o,BO,void 0,e)}});var Dl=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.getRules=Pn.isJSONType=void 0;var GO=["string","number","integer","boolean","null","object","array"],JO=new Set(GO);function KO(t){return typeof t=="string"&&JO.has(t)}Pn.isJSONType=KO;function YO(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Pn.getRules=YO});var Nl=$(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.shouldUseRule=lr.shouldUseGroup=lr.schemaHasRulesForType=void 0;function QO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Dv(t,n)}lr.schemaHasRulesForType=QO;function Dv(t,e){return e.rules.some(r=>Nv(t,r))}lr.shouldUseGroup=Dv;function Nv(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}lr.shouldUseRule=Nv});var es=$(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.reportTypeError=Me.checkDataTypes=Me.checkDataType=Me.coerceAndCheckDataType=Me.getJSONTypes=Me.getSchemaTypes=Me.DataType=void 0;var XO=Dl(),eI=Nl(),tI=Xo(),q=F(),Av=Q(),Tn;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Tn||(Me.DataType=Tn={}));function rI(t){let e=jv(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Me.getSchemaTypes=rI;function jv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(XO.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=jv;function nI(t,e){let{gen:r,data:n,opts:o}=t,s=oI(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,eI.schemaHasRulesForType)(t,e[0]));if(i){let a=jl(e,n,o.strictNumbers,Tn.Wrong);r.if(a,()=>{s.length?sI(t,e,s):Ml(t)})}return i}Me.coerceAndCheckDataType=nI;var Mv=new Set(["string","number","integer","boolean","null"]);function oI(t,e){return e?t.filter(r=>Mv.has(r)||e==="array"&&r==="array"):[]}function sI(t,e,r){let{gen:n,data:o,opts:s}=t,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(jl(e,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(Mv.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Ml(t),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),iI(t,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
26
26
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,q._)`+${o}`);return;case"integer":n.elseIf((0,q._)`${i} === "boolean" || ${o} === null
27
27
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,(0,q._)`+${o}`);return;case"boolean":n.elseIf((0,q._)`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf((0,q._)`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":n.elseIf((0,q._)`${o} === "" || ${o} === 0 || ${o} === false`),n.assign(a,null);return;case"array":n.elseIf((0,q._)`${i} === "string" || ${i} === "number"
28
- || ${i} === "boolean" || ${o} === null`).assign(a,(0,q._)`[${o}]`)}}}function rI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Il(t,e,r,n=En.Correct){let o=n===En.Correct?q.operators.EQ:q.operators.NEQ,s;switch(t){case"null":return(0,q._)`${e} ${o} null`;case"array":s=(0,q._)`Array.isArray(${e})`;break;case"object":s=(0,q._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,q._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,q._)`typeof ${e} ${o} ${t}`}return n===En.Correct?s:(0,q.not)(s);function i(a=q.nil){return(0,q.and)((0,q._)`typeof ${e} == "number"`,a,r?(0,q._)`isFinite(${e})`:q.nil)}}Me.checkDataType=Il;function Rl(t,e,r,n){if(t.length===1)return Il(t[0],e,r,n);let o,s=(0,Ov.toHash)(t);if(s.array&&s.object){let i=(0,q._)`typeof ${e} != "object"`;o=s.null?i:(0,q._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=q.nil;s.number&&delete s.integer;for(let i in s)o=(0,q.and)(o,Il(i,e,r,n));return o}Me.checkDataTypes=Rl;var nI={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,q._)`{type: ${t}}`:(0,q._)`{type: ${e}}`};function Nl(t){let e=oI(t);(0,YO.reportError)(e,nI)}Me.reportTypeError=Nl;function oI(t){let{gen:e,data:r,schema:n}=t,o=(0,Ov.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Av=$(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.assignDefaults=void 0;var zn=F(),sI=Q();function iI(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Nv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Nv(t,s,o.default))}Xi.assignDefaults=iI;function Nv(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,zn._)`${s}${(0,zn.getProperty)(e)}`;if(o){(0,sI.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,zn._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,zn._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,zn._)`${a} = ${(0,zn.stringify)(r)}`)}});var dt=$(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.validateUnion=ie.validateArray=ie.usePattern=ie.callValidateCode=ie.schemaProperties=ie.allSchemaProperties=ie.noPropertyInData=ie.propertyInData=ie.isOwnProperty=ie.hasPropFunc=ie.reportMissingProp=ie.checkMissingProp=ie.checkReportMissingProp=void 0;var fe=F(),Al=Q(),lr=Wt(),aI=Q();function cI(t,e){let{gen:r,data:n,it:o}=t;r.if(jl(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fe._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=cI;function uI({gen:t,data:e,it:{opts:r}},n,o){return(0,fe.or)(...n.map(s=>(0,fe.and)(jl(t,e,s,r.ownProperties),(0,fe._)`${o} = ${s}`)))}ie.checkMissingProp=uI;function lI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=lI;function Dv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Dv;function Dl(t,e,r){return(0,fe._)`${Dv(t)}.call(${e}, ${r})`}ie.isOwnProperty=Dl;function dI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Dl(t,e,r)}`:o}ie.propertyInData=dI;function jl(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(o,(0,fe.not)(Dl(t,e,r))):o}ie.noPropertyInData=jl;function jv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=jv;function fI(t,e){return jv(e).filter(r=>!(0,Al.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=fI;function pI({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,fe._)`${t}, ${e}, ${n}${o}`:e,d=[[lr.default.instancePath,(0,fe.strConcat)(lr.default.instancePath,s)],[lr.default.parentData,i.parentData],[lr.default.parentDataProperty,i.parentDataProperty],[lr.default.rootData,lr.default.rootData]];i.opts.dynamicRef&&d.push([lr.default.dynamicAnchors,lr.default.dynamicAnchors]);let m=(0,fe._)`${l}, ${r.object(...d)}`;return c!==fe.nil?(0,fe._)`${a}.call(${c}, ${m})`:(0,fe._)`${a}(${m})`}ie.callValidateCode=pI;var mI=(0,fe._)`new RegExp`;function hI({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,fe._)`${o.code==="new RegExp"?mI:(0,aI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=hI;function gI(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,fe._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Al.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=gI;function yI(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Al.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,fe._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,fe.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}ie.validateUnion=yI});var Lv=$(Ct=>{"use strict";Object.defineProperty(Ct,"__esModule",{value:!0});Ct.validateKeywordUsage=Ct.validSchemaType=Ct.funcKeywordCode=Ct.macroKeywordCode=void 0;var Ve=F(),Br=Wt(),_I=dt(),vI=Yo();function bI(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Zv(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:Ve.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Ct.macroKeywordCode=bI;function wI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;SI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Zv(n,o,u),d=n.let("valid");t.block$data(d,m),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function m(){if(e.errors===!1)h(),e.modifying&&Mv(t),g(()=>t.error());else{let _=e.async?p():f();e.modifying&&Mv(t),g(()=>xI(t,_))}}function p(){let _=n.let("ruleErrs",null);return n.try(()=>h((0,Ve._)`await `),x=>n.assign(d,!1).if((0,Ve._)`${x} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ve._)`${x}.errors`),()=>n.throw(x))),_}function f(){let _=(0,Ve._)`${l}.errors`;return n.assign(_,null),h(Ve.nil),_}function h(_=e.async?(0,Ve._)`await `:Ve.nil){let x=c.opts.passContext?Br.default.this:Br.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,_I.callValidateCode)(t,l,x,w)}`,e.modifying)}function g(_){var x;n.if((0,Ve.not)((x=e.valid)!==null&&x!==void 0?x:d),_)}}Ct.funcKeywordCode=wI;function Mv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function xI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Br.default.vErrors,(0,Ve._)`${Br.default.vErrors} === null ? ${e} : ${Br.default.vErrors}.concat(${e})`).assign(Br.default.errors,(0,Ve._)`${Br.default.vErrors}.length`),(0,vI.extendErrors)(t)},()=>t.error())}function SI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Zv(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ve.stringify)(r)})}function $I(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}Ct.validSchemaType=$I;function kI({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}Ct.validateKeywordUsage=kI});var Fv=$(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});dr.extendSubschemaMode=dr.extendSubschemaData=dr.getSubschema=void 0;var Ot=F(),qv=Q();function EI(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Ot._)`${t.schemaPath}${(0,Ot.getProperty)(e)}${(0,Ot.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,qv.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}dr.getSubschema=EI;function zI(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,m=a.let("data",(0,Ot._)`${e.data}${(0,Ot.getProperty)(r)}`,!0);c(m),t.errorPath=(0,Ot.str)`${u}${(0,qv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Ot._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Ot.Name?o:a.let("data",o,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}dr.extendSubschemaData=zI;function PI(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}dr.extendSubschemaMode=PI});var Ml=$((p9,Uv)=>{"use strict";Uv.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Bv=$((m9,Vv)=>{"use strict";var fr=Vv.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};ea(e,n,o,t,"",t)};fr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};fr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};fr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};fr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ea(t,e,r,n,o,s,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in fr.arrayKeywords)for(var m=0;m<d.length;m++)ea(t,e,r,d[m],o+"/"+l+"/"+m,s,o,l,n,m)}else if(l in fr.propsKeywords){if(d&&typeof d=="object")for(var p in d)ea(t,e,r,d[p],o+"/"+l+"/"+TI(p),s,o,l,n,p)}else(l in fr.keywords||t.allKeys&&!(l in fr.skipKeywords))&&ea(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function TI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var Xo=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;var CI=Q(),OI=Ml(),II=Bv(),RI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function NI(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Zl(t):e?Hv(t)<=e:!1}Ke.inlineRef=NI;var AI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Zl(t){for(let e in t){if(AI.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Zl)||typeof r=="object"&&Zl(r))return!0}return!1}function Hv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!RI.has(r)&&(typeof t[r]=="object"&&(0,CI.eachItem)(t[r],n=>e+=Hv(n)),e===1/0))return 1/0}return e}function Wv(t,e="",r){r!==!1&&(e=Pn(e));let n=t.parse(e);return Gv(t,n)}Ke.getFullPath=Wv;function Gv(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=Gv;var DI=/#\/?$/;function Pn(t){return t?t.replace(DI,""):""}Ke.normalizeId=Pn;function jI(t,e,r){return r=Pn(r),t.resolve(e,r)}Ke.resolveUrl=jI;var MI=/^[a-z_][-a-z0-9._]*$/i;function ZI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=Pn(t[r]||e),s={"":o},i=Wv(n,o,!1),a={},c=new Set;return II(t,{allKeys:!0},(d,m,p,f)=>{if(f===void 0)return;let h=i+m,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),x.call(this,d.$anchor),x.call(this,d.$dynamicAnchor),s[m]=g;function _(w){let S=this.opts.uriResolver.resolve;if(w=Pn(g?S(g,w):w),c.has(w))throw l(w);c.add(w);let k=this.refs[w];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?u(d,k.schema,w):w!==Pn(h)&&(w[0]==="#"?(u(d,a[w],w),a[w]=d):this.refs[w]=h),w}function x(w){if(typeof w=="string"){if(!MI.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function u(d,m,p){if(m!==void 0&&!OI(d,m))throw l(p)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ke.getSchemaRefs=ZI});var rs=$(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.getData=pr.KeywordCxt=pr.validateFunctionCode=void 0;var Xv=Pv(),Jv=Qo(),ql=Ol(),ta=Qo(),LI=Av(),ts=Lv(),Ll=Fv(),O=F(),A=Wt(),qI=Xo(),Gt=Q(),es=Yo();function FI(t){if(rb(t)&&(nb(t),tb(t))){BI(t);return}eb(t,()=>(0,Xv.topBoolOrEmptySchema)(t))}pr.validateFunctionCode=FI;function eb({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,O._)`${A.default.data}, ${A.default.valCxt}`,n.$async,()=>{t.code((0,O._)`"use strict"; ${Kv(r,o)}`),VI(t,o),t.code(s)}):t.func(e,(0,O._)`${A.default.data}, ${UI(o)}`,n.$async,()=>t.code(Kv(r,o)).code(s))}function UI(t){return(0,O._)`{${A.default.instancePath}="", ${A.default.parentData}, ${A.default.parentDataProperty}, ${A.default.rootData}=${A.default.data}${t.dynamicRef?(0,O._)`, ${A.default.dynamicAnchors}={}`:O.nil}}={}`}function VI(t,e){t.if(A.default.valCxt,()=>{t.var(A.default.instancePath,(0,O._)`${A.default.valCxt}.${A.default.instancePath}`),t.var(A.default.parentData,(0,O._)`${A.default.valCxt}.${A.default.parentData}`),t.var(A.default.parentDataProperty,(0,O._)`${A.default.valCxt}.${A.default.parentDataProperty}`),t.var(A.default.rootData,(0,O._)`${A.default.valCxt}.${A.default.rootData}`),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`${A.default.valCxt}.${A.default.dynamicAnchors}`)},()=>{t.var(A.default.instancePath,(0,O._)`""`),t.var(A.default.parentData,(0,O._)`undefined`),t.var(A.default.parentDataProperty,(0,O._)`undefined`),t.var(A.default.rootData,A.default.data),e.dynamicRef&&t.var(A.default.dynamicAnchors,(0,O._)`{}`)})}function BI(t){let{schema:e,opts:r,gen:n}=t;eb(t,()=>{r.$comment&&e.$comment&&sb(t),KI(t),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&HI(t),ob(t),XI(t)})}function HI(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,O._)`${r}.evaluated`),e.if((0,O._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,O._)`${t.evaluated}.props`,(0,O._)`undefined`)),e.if((0,O._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,O._)`${t.evaluated}.items`,(0,O._)`undefined`))}function Kv(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function WI(t,e){if(rb(t)&&(nb(t),tb(t))){GI(t,e);return}(0,Xv.boolOrEmptySchema)(t,e)}function tb({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function rb(t){return typeof t.schema!="boolean"}function GI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&sb(t),YI(t),QI(t);let s=n.const("_errs",A.default.errors);ob(t,s),n.var(e,(0,O._)`${s} === ${A.default.errors}`)}function nb(t){(0,Gt.checkUnknownRules)(t),JI(t)}function ob(t,e){if(t.opts.jtd)return Yv(t,[],!1,e);let r=(0,Jv.getSchemaTypes)(t.schema),n=(0,Jv.coerceAndCheckDataType)(t,r);Yv(t,r,!n,e)}function JI(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Gt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function KI(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Gt.checkStrictMode)(t,"default is ignored in the schema root")}function YI(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,qI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function QI(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function sb({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,O._)`${A.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,O.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,O._)`${A.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function XI(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,O._)`${A.default.errors} === 0`,()=>e.return(A.default.data),()=>e.throw((0,O._)`new ${o}(${A.default.vErrors})`)):(e.assign((0,O._)`${n}.errors`,A.default.vErrors),s.unevaluated&&eR(t),e.return((0,O._)`${A.default.errors} === 0`))}function eR({gen:t,evaluated:e,props:r,items:n}){r instanceof O.Name&&t.assign((0,O._)`${e}.props`,r),n instanceof O.Name&&t.assign((0,O._)`${e}.items`,n)}function Yv(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Gt.schemaHasRulesButRef)(s,l))){o.block(()=>ab(t,"$ref",l.all.$ref.definition));return}c.jtd||tR(t,e),o.block(()=>{for(let m of l.rules)d(m);d(l.post)});function d(m){(0,ql.shouldUseGroup)(s,m)&&(m.type?(o.if((0,ta.checkDataType)(m.type,i,c.strictNumbers)),Qv(t,m),e.length===1&&e[0]===m.type&&r&&(o.else(),(0,ta.reportTypeError)(t)),o.endIf()):Qv(t,m),a||o.if((0,O._)`${A.default.errors} === ${n||0}`))}}function Qv(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,LI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,ql.shouldUseRule)(n,s)&&ab(t,s.keyword,s.definition,e.type)})}function tR(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(rR(t,e),t.opts.allowUnionTypes||nR(t,e),oR(t,t.dataTypes))}function rR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{ib(t.dataTypes,r)||Fl(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),iR(t,e)}}function nR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Fl(t,"use allowUnionTypes to allow union type keyword")}function oR(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,ql.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>sR(e,i))&&Fl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function sR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function ib(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function iR(t,e){let r=[];for(let n of t.dataTypes)ib(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Fl(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Gt.checkStrictMode)(t,e,t.opts.strictTypes)}var ra=class{constructor(e,r,n){if((0,ts.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Gt.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",cb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ts.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",A.default.errors))}result(e,r,n){this.failResult((0,O.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,O.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?es.reportExtraError:es.reportError)(this,this.def.error,r)}$dataError(){(0,es.reportError)(this,this.def.$dataError||es.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,es.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=O.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),e!==O.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==O.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,O.or)(i(),a());function i(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,ta.checkDataTypes)(c,r,s.opts.strictNumbers,ta.DataType.Wrong)}`}return O.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(e,r){let n=(0,Ll.getSubschema)(this.it,e);(0,Ll.extendSubschemaData)(n,this.it,e),(0,Ll.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return WI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Gt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Gt.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,O.Name)),!0}};pr.KeywordCxt=ra;function ab(t,e,r,n){let o=new ra(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ts.funcKeywordCode)(o,r):"macro"in r?(0,ts.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ts.funcKeywordCode)(o,r)}var aR=/^\/(?:[^~]|~0|~1)*$/,cR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function cb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return A.default.rootData;if(t[0]==="/"){if(!aR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=A.default.rootData}else{let u=cR.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let i=s,a=o.split("/");for(let u of a)u&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Gt.unescapeJsonPointer)(u))}`,i=(0,O._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}pr.getData=cb});var na=$(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});var Ul=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Vl.default=Ul});var ns=$(Wl=>{"use strict";Object.defineProperty(Wl,"__esModule",{value:!0});var Bl=Xo(),Hl=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Bl.resolveUrl)(e,r,n),this.missingSchema=(0,Bl.normalizeId)((0,Bl.getFullPath)(e,this.missingRef))}};Wl.default=Hl});var sa=$(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.resolveSchema=ft.getCompilingSchema=ft.resolveRef=ft.compileSchema=ft.SchemaEnv=void 0;var St=F(),uR=na(),Hr=Wt(),$t=Xo(),ub=Q(),lR=rs(),Tn=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,$t.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};ft.SchemaEnv=Tn;function Jl(t){let e=lb.call(this,t);if(e)return e;let r=(0,$t.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new St.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:uR.default,code:(0,St._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Hr.default.data,parentData:Hr.default.parentData,parentDataProperty:Hr.default.parentDataProperty,dataNames:[Hr.default.data],dataPathArr:[St.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,St.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:St.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,St._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,lR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Hr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let p=new Function(`${Hr.default.self}`,`${Hr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:p}),p.errors=null,p.schema=t.schema,p.schemaEnv=t,t.$async&&(p.$async=!0),this.opts.code.source===!0&&(p.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;p.evaluated={props:f instanceof St.Name?void 0:f,items:h instanceof St.Name?void 0:h,dynamicProps:f instanceof St.Name,dynamicItems:h instanceof St.Name},p.source&&(p.source.evaluated=(0,St.stringify)(p.evaluated))}return t.validate=p,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}ft.compileSchema=Jl;function dR(t,e,r){var n;r=(0,$t.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=mR.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new Tn({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=fR.call(this,s)}ft.resolveRef=dR;function fR(t){return(0,$t.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Jl.call(this,t)}function lb(t){for(let e of this._compilations)if(pR(e,t))return e}ft.getCompilingSchema=lb;function pR(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function mR(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||oa.call(this,t,e)}function oa(t,e){let r=this.opts.uriResolver.parse(e),n=(0,$t._getFullPath)(this.opts.uriResolver,r),o=(0,$t.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Gl.call(this,r,t);let s=(0,$t.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=oa.call(this,t,i);return typeof a?.schema!="object"?void 0:Gl.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Jl.call(this,i),s===(0,$t.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,$t.resolveUrl)(this.opts.uriResolver,o,u)),new Tn({schema:a,schemaId:c,root:t,baseId:o})}return Gl.call(this,r,i)}}ft.resolveSchema=oa;var hR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Gl(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,ub.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!hR.has(a)&&u&&(e=(0,$t.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,ub.schemaHasRulesButRef)(r,this.RULES)){let a=(0,$t.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=oa.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new Tn({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var db=$((b9,gR)=>{gR.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Ql=$((w9,yb)=>{"use strict";var yR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),pb=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Kl=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),mb=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),_R=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Yl(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var vR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function fb(t){return t.length=0,!0}function bR(t,e,r){if(t.length){let n=Yl(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function wR(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=bR;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(o,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=fb}else{o.push(u);continue}}return o.length&&(a===fb?r.zone=o.join(""):i?n.push(o.join("")):n.push(Yl(o))),r.address=n.join(""),r}function hb(t){if(xR(t,":")<2)return{host:t,isIPV6:!1};let e=wR(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function xR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function SR(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&(e[1]==="."||e[1]==="/")){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var $R={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},kR=/[@/?#:]/g,ER=/[@/?#]/g;function gb(t,e){let r=e?ER:kR;return r.lastIndex=0,t.replace(r,n=>$R[n])}function zR(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(Kl(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&mb(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}function PR(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Kl(n)){let o=n.toUpperCase(),s=String.fromCharCode(parseInt(o,16));s!=="."&&mb(s)?e+=s:e+="%"+o,r+=2;continue}}_R(t[r])?e+=t[r]:e+=escape(t[r])}return e}function TR(t){let e="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let n=t.slice(r+1,r+3);if(Kl(n)){e+="%"+n.toUpperCase(),r+=2;continue}}e+=escape(t[r])}return e}function CR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!pb(r)){let n=hb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=gb(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}yb.exports={nonSimpleDomain:vR,recomposeAuthority:CR,reescapeHostDelimiters:gb,normalizePercentEncoding:zR,normalizePathEncoding:PR,escapePreservingEscapes:TR,removeDotSegments:SR,isIPv4:pb,isUUID:yR,normalizeIPv6:hb,stringArrayToHexStripped:Yl}});var xb=$((x9,wb)=>{"use strict";var{isUUID:OR}=Ql(),IR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,RR=["http","https","ws","wss","urn","urn:uuid"];function NR(t){return RR.indexOf(t)!==-1}function Xl(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function _b(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function vb(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function AR(t){return t.secure=Xl(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function DR(t){if((t.port===(Xl(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function jR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(IR);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=ed(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function MR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=ed(o);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function ZR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!OR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function LR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var bb={scheme:"http",domainHost:!0,parse:_b,serialize:vb},qR={scheme:"https",domainHost:bb.domainHost,parse:_b,serialize:vb},ia={scheme:"ws",domainHost:!0,parse:AR,serialize:DR},FR={scheme:"wss",domainHost:ia.domainHost,parse:ia.parse,serialize:ia.serialize},UR={scheme:"urn",parse:jR,serialize:MR,skipNormalize:!0},VR={scheme:"urn:uuid",parse:ZR,serialize:LR,skipNormalize:!0},aa={http:bb,https:qR,ws:ia,wss:FR,urn:UR,"urn:uuid":VR};Object.setPrototypeOf(aa,null);function ed(t){return t&&(aa[t]||aa[t.toLowerCase()])||void 0}wb.exports={wsIsSecure:Xl,SCHEMES:aa,isValidSchemeName:NR,getSchemeHandler:ed}});var Pb=$((S9,ca)=>{"use strict";var{normalizeIPv6:BR,removeDotSegments:os,recomposeAuthority:HR,normalizePercentEncoding:WR,normalizePathEncoding:GR,escapePreservingEscapes:JR,reescapeHostDelimiters:KR,isIPv4:YR,nonSimpleDomain:QR}=Ql(),{SCHEMES:XR,getSchemeHandler:$b}=xb();function eN(t,e){return typeof t=="string"?t=sN(t,e):typeof t=="object"&&(t=Cn(Wr(t,e),e)),t}function tN(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=kb(Cn(t,n),Cn(e,n),n,!0);return n.skipEscape=!0,Wr(o,n)}function kb(t,e,r,n){let o={};return n||(t=Cn(Wr(t,r),r),e=Cn(Wr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=os(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=os(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=os(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=os(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function rN(t,e,r){let n=Sb(t,r),o=Sb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Wr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=$b(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=WR(r.path):(r.path=JR(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=HR(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=os(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var nN=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function oN(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function Eb(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(nN);if(i){n.scheme=i[1],n.userinfo=i[3],n.host=i[4],n.port=parseInt(i[5],10),n.path=i[6]||"",n.query=i[7],n.fragment=i[8],isNaN(n.port)&&(n.port=i[5]);let a=oN(n,i);if(a!==void 0&&(n.error=n.error||a,o=!0),n.host)if(YR(n.host)===!1){let l=BR(n.host);n.host=l.host.toLowerCase(),s=l.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let c=$b(r.scheme||n.scheme);if(!r.unicodeSupport&&(!c||!c.unicodeSupport)&&n.host&&(r.domainHost||c&&c.domainHost)&&s===!1&&QR(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(u){n.error=n.error||"Host's domain name can not be converted to ASCII: "+u}if((!c||c&&!c.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=KR(unescape(n.host),s))),n.path&&(n.path=GR(n.path)),n.fragment))try{n.fragment=encodeURI(decodeURIComponent(n.fragment))}catch{n.error=n.error||"URI malformed"}c&&c.parse&&c.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function Cn(t,e){return Eb(t,e).parsed}function sN(t,e){return zb(t,e).normalized}function zb(t,e){let{parsed:r,malformedAuthorityOrPort:n}=Eb(t,e);return{normalized:n?t:Wr(r,e),malformedAuthorityOrPort:n}}function Sb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=zb(t,e);return n?void 0:r}if(typeof t=="object")return Wr(t,e)}var td={SCHEMES:XR,normalize:eN,resolve:tN,resolveComponent:kb,equal:rN,serialize:Wr,parse:Cn};ca.exports=td;ca.exports.default=td;ca.exports.fastUri=td});var Cb=$(rd=>{"use strict";Object.defineProperty(rd,"__esModule",{value:!0});var Tb=Pb();Tb.code='require("ajv/dist/runtime/uri").default';rd.default=Tb});var Mb=$(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.CodeGen=Re.Name=Re.nil=Re.stringify=Re.str=Re._=Re.KeywordCxt=void 0;var iN=rs();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return iN.KeywordCxt}});var On=F();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return On._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return On.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return On.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return On.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return On.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return On.CodeGen}});var aN=na(),Ab=ns(),cN=Cl(),ss=sa(),uN=F(),is=Xo(),ua=Qo(),od=Q(),Ob=db(),lN=Cb(),Db=(t,e)=>new RegExp(t,e);Db.code="new RegExp";var dN=["removeAdditional","useDefaults","coerceTypes"],fN=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),pN={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},mN={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ib=200;function hN(t){var e,r,n,o,s,i,a,c,u,l,d,m,p,f,h,g,_,x,w,S,k,W,Z,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=Ee===!0||Ee===void 0?1:Ee||0,Ze=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Db,Be=(o=t.uriResolver)!==null&&o!==void 0?o:lN.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:me)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:me)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:me)!==null&&l!==void 0?l:"log",strictTuples:(m=(d=t.strictTuples)!==null&&d!==void 0?d:me)!==null&&m!==void 0?m:"log",strictRequired:(f=(p=t.strictRequired)!==null&&p!==void 0?p:me)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:xe,regExp:Ze}:{optimize:xe,regExp:Ze},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ib,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Ib,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(x=t.messages)!==null&&x!==void 0?x:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(W=t.validateSchema)!==null&&W!==void 0?W:!0,validateFormats:(Z=t.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(U=t.int32range)!==null&&U!==void 0?U:!0,uriResolver:Be}}var as=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...hN(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new uN.ValueScope({scope:{},prefixes:fN,es5:r,lines:n}),this.logger=wN(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,cN.getRules)(),Rb.call(this,pN,e,"NOT SUPPORTED"),Rb.call(this,mN,e,"DEPRECATED","warn"),this._metaOpts=vN.call(this),e.formats&&yN.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&_N.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),gN.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Ob;n==="id"&&(o={...Ob},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let m=this._addSchema(l,d);return m.validate||i.call(this,m)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Ab.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,is.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Nb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new ss.SchemaEnv({schema:{},schemaId:n});if(r=ss.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Nb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,is.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(SN.call(this,n,r),!r)return(0,od.eachItem)(n,s=>nd.call(this,s)),this;kN.call(this,r);let o={...r,type:(0,ua.getJSONTypes)(r.type),schemaType:(0,ua.getJSONTypes)(r.schemaType)};return(0,od.eachItem)(n,o.type.length===0?s=>nd.call(this,s,o):s=>o.type.forEach(i=>nd.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=jb(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,is.normalizeId)(i||n);let u=is.getSchemaRefs.call(this,e,n);return c=new ss.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):ss.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{ss.compileSchema.call(this,e)}finally{this.opts=r}}};as.ValidationError=aN.default;as.MissingRefError=Ab.default;Re.default=as;function Rb(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}function Nb(t){return t=(0,is.normalizeId)(t),this.schemas[t]||this.refs[t]}function gN(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function yN(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function _N(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function vN(){let t={...this.opts};for(let e of dN)delete t[e];return t}var bN={log(){},warn(){},error(){}};function wN(t){if(t===!1)return bN;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var xN=/^[a-z_$][a-z0-9_$:-]*$/i;function SN(t,e){let{RULES:r}=this;if((0,od.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!xN.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function nd(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ua.getJSONTypes)(e.type),schemaType:(0,ua.getJSONTypes)(e.schemaType)}};e.before?$N.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function $N(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function kN(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=jb(e)),t.validateSchema=this.compile(e,!0))}var EN={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function jb(t){return{anyOf:[t,EN]}}});var Zb=$(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0});var zN={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};sd.default=zN});var Ub=$(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.callRef=Gr.getValidate=void 0;var PN=ns(),Lb=dt(),Ye=F(),In=Wt(),qb=sa(),la=Q(),TN={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=qb.resolveRef.call(c,u,o,r);if(l===void 0)throw new PN.default(n.opts.uriResolver,o,r);if(l instanceof qb.SchemaEnv)return m(l);return p(l);function d(){if(s===u)return da(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return da(t,(0,Ye._)`${f}.validate`,u,u.$async)}function m(f){let h=Fb(t,f);da(t,h,f,f.$async)}function p(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,Ye.stringify)(f)}:{ref:f}),g=e.name("valid"),_=t.subschema({schema:f,dataTypes:[],schemaPath:Ye.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Fb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Gr.getValidate=Fb;function da(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?In.default.this:Ye.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,Ye._)`await ${(0,Lb.callValidateCode)(t,e,u)}`),p(e),i||o.assign(f,!0)},h=>{o.if((0,Ye._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),m(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,Lb.callValidateCode)(t,e,u),()=>p(e),()=>m(e))}function m(f){let h=(0,Ye._)`${f}.errors`;o.assign(In.default.vErrors,(0,Ye._)`${In.default.vErrors} === null ? ${h} : ${In.default.vErrors}.concat(${h})`),o.assign(In.default.errors,(0,Ye._)`${In.default.vErrors}.length`)}function p(f){var h;if(!s.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=la.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,Ye._)`${f}.evaluated.props`);s.props=la.mergeEvaluated.props(o,_,s.props,Ye.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=la.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,Ye._)`${f}.evaluated.items`);s.items=la.mergeEvaluated.items(o,_,s.items,Ye.Name)}}}Gr.callRef=da;Gr.default=TN});var Vb=$(id=>{"use strict";Object.defineProperty(id,"__esModule",{value:!0});var CN=Zb(),ON=Ub(),IN=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",CN.default,ON.default];id.default=IN});var Bb=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var fa=F(),mr=fa.operators,pa={maximum:{okStr:"<=",ok:mr.LTE,fail:mr.GT},minimum:{okStr:">=",ok:mr.GTE,fail:mr.LT},exclusiveMaximum:{okStr:"<",ok:mr.LT,fail:mr.GTE},exclusiveMinimum:{okStr:">",ok:mr.GT,fail:mr.LTE}},RN={message:({keyword:t,schemaCode:e})=>(0,fa.str)`must be ${pa[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,fa._)`{comparison: ${pa[t].okStr}, limit: ${e}}`},NN={keyword:Object.keys(pa),type:"number",schemaType:"number",$data:!0,error:RN,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,fa._)`${r} ${pa[e].fail} ${n} || isNaN(${r})`)}};ad.default=NN});var Hb=$(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var cs=F(),AN={message:({schemaCode:t})=>(0,cs.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,cs._)`{multipleOf: ${t}}`},DN={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:AN,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,cs._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,cs._)`${i} !== parseInt(${i})`;t.fail$data((0,cs._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};cd.default=DN});var Gb=$(ud=>{"use strict";Object.defineProperty(ud,"__esModule",{value:!0});function Wb(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}ud.default=Wb;Wb.code='require("ajv/dist/runtime/ucs2length").default'});var Jb=$(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var Jr=F(),jN=Q(),MN=Gb(),ZN={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Jr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Jr._)`{limit: ${t}}`},LN={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ZN,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Jr.operators.GT:Jr.operators.LT,i=o.opts.unicode===!1?(0,Jr._)`${r}.length`:(0,Jr._)`${(0,jN.useFunc)(t.gen,MN.default)}(${r})`;t.fail$data((0,Jr._)`${i} ${s} ${n}`)}};ld.default=LN});var Kb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var qN=dt(),FN=Q(),Rn=F(),UN={message:({schemaCode:t})=>(0,Rn.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Rn._)`{pattern: ${t}}`},VN={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:UN,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,Rn._)`new RegExp`:(0,FN.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Rn._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Rn._)`!${l}`)}else{let c=(0,qN.usePattern)(t,o);t.fail$data((0,Rn._)`!${c}.test(${r})`)}}};dd.default=VN});var Yb=$(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var us=F(),BN={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,us.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,us._)`{limit: ${t}}`},HN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:BN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?us.operators.GT:us.operators.LT;t.fail$data((0,us._)`Object.keys(${r}).length ${o} ${n}`)}};fd.default=HN});var Qb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ls=dt(),ds=F(),WN=Q(),GN={message:({params:{missingProperty:t}})=>(0,ds.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ds._)`{missingProperty: ${t}}`},JN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:GN,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let p=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(p?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,WN.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(ds.nil,d);else for(let p of r)(0,ls.checkReportMissingProp)(t,p)}function l(){let p=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>m(p,f)),t.ok(f)}else e.if((0,ls.checkMissingProp)(t,r,p)),(0,ls.reportMissingProp)(t,p),e.else()}function d(){e.forOf("prop",n,p=>{t.setParams({missingProperty:p}),e.if((0,ls.noPropertyInData)(e,o,p,a.ownProperties),()=>t.error())})}function m(p,f){t.setParams({missingProperty:p}),e.forOf(p,n,()=>{e.assign(f,(0,ls.propertyInData)(e,o,p,a.ownProperties)),e.if((0,ds.not)(f),()=>{t.error(),e.break()})},ds.nil)}}};pd.default=JN});var Xb=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});var fs=F(),KN={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,fs.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,fs._)`{limit: ${t}}`},YN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:KN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?fs.operators.GT:fs.operators.LT;t.fail$data((0,fs._)`${r}.length ${o} ${n}`)}};md.default=YN});var ma=$(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var ew=Ml();ew.code='require("ajv/dist/runtime/equal").default';hd.default=ew});var tw=$(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var gd=Qo(),Ne=F(),QN=Q(),XN=ma(),eA={message:({params:{i:t,j:e}})=>(0,Ne.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,Ne._)`{i: ${t}, j: ${e}}`},tA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:eA,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0,gd.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,Ne._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,Ne._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,Ne._)`${f} > 1`,()=>(d()?m:p)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function m(f,h){let g=e.name("item"),_=(0,gd.checkDataTypes)(u,g,a.opts.strictNumbers,gd.DataType.Wrong),x=e.const("indices",(0,Ne._)`{}`);e.for((0,Ne._)`;${f}--;`,()=>{e.let(g,(0,Ne._)`${r}[${f}]`),e.if(_,(0,Ne._)`continue`),u.length>1&&e.if((0,Ne._)`typeof ${g} == "string"`,(0,Ne._)`${g} += "_"`),e.if((0,Ne._)`typeof ${x}[${g}] == "number"`,()=>{e.assign(h,(0,Ne._)`${x}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,Ne._)`${x}[${g}] = ${f}`)})}function p(f,h){let g=(0,QN.useFunc)(e,XN.default),_=e.name("outer");e.label(_).for((0,Ne._)`;${f}--;`,()=>e.for((0,Ne._)`${h} = ${f}; ${h}--;`,()=>e.if((0,Ne._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};yd.default=tA});var rw=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var _d=F(),rA=Q(),nA=ma(),oA={message:"must be equal to constant",params:({schemaCode:t})=>(0,_d._)`{allowedValue: ${t}}`},sA={keyword:"const",$data:!0,error:oA,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,_d._)`!${(0,rA.useFunc)(e,nA.default)}(${r}, ${o})`):t.fail((0,_d._)`${s} !== ${r}`)}};vd.default=sA});var nw=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var ps=F(),iA=Q(),aA=ma(),cA={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,ps._)`{allowedValues: ${t}}`},uA={keyword:"enum",schemaType:"array",$data:!0,error:cA,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,iA.useFunc)(e,aA.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let p=e.const("vSchema",s);l=(0,ps.or)(...o.map((f,h)=>m(p,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,p=>e.if((0,ps._)`${u()}(${r}, ${p})`,()=>e.assign(l,!0).break()))}function m(p,f){let h=o[f];return typeof h=="object"&&h!==null?(0,ps._)`${u()}(${r}, ${p}[${f}])`:(0,ps._)`${r} === ${h}`}}};bd.default=uA});var ow=$(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0});var lA=Bb(),dA=Hb(),fA=Jb(),pA=Kb(),mA=Yb(),hA=Qb(),gA=Xb(),yA=tw(),_A=rw(),vA=nw(),bA=[lA.default,dA.default,fA.default,pA.default,mA.default,hA.default,gA.default,yA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},_A.default,vA.default];wd.default=bA});var Sd=$(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.validateAdditionalItems=void 0;var Kr=F(),xd=Q(),wA={message:({params:{len:t}})=>(0,Kr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Kr._)`{limit: ${t}}`},xA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:wA,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,xd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}sw(t,n)}};function sw(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Kr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Kr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,xd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Kr._)`${a} <= ${e.length}`);r.if((0,Kr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:xd.Type.Num},u),i.allErrors||r.if((0,Kr.not)(u),()=>r.break())})}}ms.validateAdditionalItems=sw;ms.default=xA});var $d=$(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.validateTuple=void 0;var iw=F(),ha=Q(),SA=dt(),$A={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return aw(t,"additionalItems",e);r.items=!0,!(0,ha.alwaysValidSchema)(r,e)&&t.ok((0,SA.validateArray)(t))}};function aw(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=t;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=ha.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,iw._)`${s}.length`);r.forEach((d,m)=>{(0,ha.alwaysValidSchema)(a,d)||(n.if((0,iw._)`${u} > ${m}`,()=>t.subschema({keyword:i,schemaProp:m,dataProp:m},c)),t.ok(c))});function l(d){let{opts:m,errSchemaPath:p}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(m.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${p}"`;(0,ha.checkStrictMode)(a,g,m.strictTuples)}}}hs.validateTuple=aw;hs.default=$A});var cw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var kA=$d(),EA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,kA.validateTuple)(t,"items")};kd.default=EA});var lw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var uw=F(),zA=Q(),PA=dt(),TA=Sd(),CA={message:({params:{len:t}})=>(0,uw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,uw._)`{limit: ${t}}`},OA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:CA,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,zA.alwaysValidSchema)(n,e)&&(o?(0,TA.validateAdditionalItems)(t,o):t.ok((0,PA.validateArray)(t)))}};Ed.default=OA});var dw=$(zd=>{"use strict";Object.defineProperty(zd,"__esModule",{value:!0});var pt=F(),ga=Q(),IA={message:({params:{min:t,max:e}})=>e===void 0?(0,pt.str)`must contain at least ${t} valid item(s)`:(0,pt.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,pt._)`{minContains: ${t}}`:(0,pt._)`{minContains: ${t}, maxContains: ${e}}`},RA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:IA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,a,{minContains:c,maxContains:u}=n;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,pt._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,ga.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,ga.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,ga.alwaysValidSchema)(s,r)){let h=(0,pt._)`${l} >= ${i}`;a!==void 0&&(h=(0,pt._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?p(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,pt._)`${o}.length > 0`,m)):(e.let(d,!1),m()),t.result(d,()=>t.reset());function m(){let h=e.name("_valid"),g=e.let("count",0);p(h,()=>e.if(h,()=>f(g)))}function p(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:ga.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,pt._)`${h}++`),a===void 0?e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,pt._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,pt._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};zd.default=RA});var mw=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateSchemaDeps=It.validatePropertyDeps=It.error=void 0;var Pd=F(),NA=Q(),gs=dt();It.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Pd.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Pd._)`{property: ${t},
28
+ || ${i} === "boolean" || ${o} === null`).assign(a,(0,q._)`[${o}]`)}}}function iI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Al(t,e,r,n=Tn.Correct){let o=n===Tn.Correct?q.operators.EQ:q.operators.NEQ,s;switch(t){case"null":return(0,q._)`${e} ${o} null`;case"array":s=(0,q._)`Array.isArray(${e})`;break;case"object":s=(0,q._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=i((0,q._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=i();break;default:return(0,q._)`typeof ${e} ${o} ${t}`}return n===Tn.Correct?s:(0,q.not)(s);function i(a=q.nil){return(0,q.and)((0,q._)`typeof ${e} == "number"`,a,r?(0,q._)`isFinite(${e})`:q.nil)}}Me.checkDataType=Al;function jl(t,e,r,n){if(t.length===1)return Al(t[0],e,r,n);let o,s=(0,Av.toHash)(t);if(s.array&&s.object){let i=(0,q._)`typeof ${e} != "object"`;o=s.null?i:(0,q._)`!${e} || ${i}`,delete s.null,delete s.array,delete s.object}else o=q.nil;s.number&&delete s.integer;for(let i in s)o=(0,q.and)(o,Al(i,e,r,n));return o}Me.checkDataTypes=jl;var aI={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,q._)`{type: ${t}}`:(0,q._)`{type: ${e}}`};function Ml(t){let e=cI(t);(0,tI.reportError)(e,aI)}Me.reportTypeError=Ml;function cI(t){let{gen:e,data:r,schema:n}=t,o=(0,Av.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var Lv=$(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.assignDefaults=void 0;var Cn=F(),uI=Q();function lI(t,e){let{properties:r,items:n}=t.schema;if(e==="object"&&r)for(let o in r)Zv(t,o,r[o].default);else e==="array"&&Array.isArray(n)&&n.forEach((o,s)=>Zv(t,s,o.default))}ta.assignDefaults=lI;function Zv(t,e,r){let{gen:n,compositeRule:o,data:s,opts:i}=t;if(r===void 0)return;let a=(0,Cn._)`${s}${(0,Cn.getProperty)(e)}`;if(o){(0,uI.checkStrictMode)(t,`default is ignored for: ${a}`);return}let c=(0,Cn._)`${a} === undefined`;i.useDefaults==="empty"&&(c=(0,Cn._)`${c} || ${a} === null || ${a} === ""`),n.if(c,(0,Cn._)`${a} = ${(0,Cn.stringify)(r)}`)}});var ft=$(ie=>{"use strict";Object.defineProperty(ie,"__esModule",{value:!0});ie.validateUnion=ie.validateArray=ie.usePattern=ie.callValidateCode=ie.schemaProperties=ie.allSchemaProperties=ie.noPropertyInData=ie.propertyInData=ie.isOwnProperty=ie.hasPropFunc=ie.reportMissingProp=ie.checkMissingProp=ie.checkReportMissingProp=void 0;var fe=F(),Zl=Q(),dr=Gt(),dI=Q();function fI(t,e){let{gen:r,data:n,it:o}=t;r.if(ql(r,n,e,o.opts.ownProperties),()=>{t.setParams({missingProperty:(0,fe._)`${e}`},!0),t.error()})}ie.checkReportMissingProp=fI;function pI({gen:t,data:e,it:{opts:r}},n,o){return(0,fe.or)(...n.map(s=>(0,fe.and)(ql(t,e,s,r.ownProperties),(0,fe._)`${o} = ${s}`)))}ie.checkMissingProp=pI;function mI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=mI;function qv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=qv;function Ll(t,e,r){return(0,fe._)`${qv(t)}.call(${e}, ${r})`}ie.isOwnProperty=Ll;function hI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Ll(t,e,r)}`:o}ie.propertyInData=hI;function ql(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} === undefined`;return n?(0,fe.or)(o,(0,fe.not)(Ll(t,e,r))):o}ie.noPropertyInData=ql;function Fv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=Fv;function gI(t,e){return Fv(e).filter(r=>!(0,Zl.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=gI;function yI({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:o,errorPath:s},it:i},a,c,u){let l=u?(0,fe._)`${t}, ${e}, ${n}${o}`:e,d=[[dr.default.instancePath,(0,fe.strConcat)(dr.default.instancePath,s)],[dr.default.parentData,i.parentData],[dr.default.parentDataProperty,i.parentDataProperty],[dr.default.rootData,dr.default.rootData]];i.opts.dynamicRef&&d.push([dr.default.dynamicAnchors,dr.default.dynamicAnchors]);let p=(0,fe._)`${l}, ${r.object(...d)}`;return c!==fe.nil?(0,fe._)`${a}.call(${c}, ${p})`:(0,fe._)`${a}(${p})`}ie.callValidateCode=yI;var _I=(0,fe._)`new RegExp`;function vI({gen:t,it:{opts:e}},r){let n=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(r,n);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:(0,fe._)`${o.code==="new RegExp"?_I:(0,dI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=vI;function bI(t){let{gen:e,data:r,keyword:n,it:o}=t,s=e.name("valid");if(o.allErrors){let a=e.let("valid",!0);return i(()=>e.assign(a,!1)),a}return e.var(s,!0),i(()=>e.break()),s;function i(a){let c=e.const("len",(0,fe._)`${r}.length`);e.forRange("i",0,c,u=>{t.subschema({keyword:n,dataProp:u,dataPropType:Zl.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=bI;function wI(t){let{gen:e,schema:r,keyword:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(c=>(0,Zl.alwaysValidSchema)(o,c))&&!o.opts.unevaluated)return;let i=e.let("valid",!1),a=e.name("_valid");e.block(()=>r.forEach((c,u)=>{let l=t.subschema({keyword:n,schemaProp:u,compositeRule:!0},a);e.assign(i,(0,fe._)`${i} || ${a}`),t.mergeValidEvaluated(l,a)||e.if((0,fe.not)(i))})),t.result(i,()=>t.reset(),()=>t.error(!0))}ie.validateUnion=wI});var Bv=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateKeywordUsage=It.validSchemaType=It.funcKeywordCode=It.macroKeywordCode=void 0;var Ve=F(),Wr=Gt(),xI=ft(),SI=Xo();function $I(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Vv(r,n,a);i.opts.validateSchema!==!1&&i.self.validateSchema(a,!0);let u=r.name("valid");t.subschema({schema:a,schemaPath:Ve.nil,errSchemaPath:`${i.errSchemaPath}/${n}`,topSchemaRef:c,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}It.macroKeywordCode=$I;function kI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;zI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Vv(n,o,u),d=n.let("valid");t.block$data(d,p),t.ok((r=e.valid)!==null&&r!==void 0?r:d);function p(){if(e.errors===!1)h(),e.modifying&&Uv(t),g(()=>t.error());else{let _=e.async?m():f();e.modifying&&Uv(t),g(()=>EI(t,_))}}function m(){let _=n.let("ruleErrs",null);return n.try(()=>h((0,Ve._)`await `),x=>n.assign(d,!1).if((0,Ve._)`${x} instanceof ${c.ValidationError}`,()=>n.assign(_,(0,Ve._)`${x}.errors`),()=>n.throw(x))),_}function f(){let _=(0,Ve._)`${l}.errors`;return n.assign(_,null),h(Ve.nil),_}function h(_=e.async?(0,Ve._)`await `:Ve.nil){let x=c.opts.passContext?Wr.default.this:Wr.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,xI.callValidateCode)(t,l,x,w)}`,e.modifying)}function g(_){var x;n.if((0,Ve.not)((x=e.valid)!==null&&x!==void 0?x:d),_)}}It.funcKeywordCode=kI;function Uv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function EI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Wr.default.vErrors,(0,Ve._)`${Wr.default.vErrors} === null ? ${e} : ${Wr.default.vErrors}.concat(${e})`).assign(Wr.default.errors,(0,Ve._)`${Wr.default.vErrors}.length`),(0,SI.extendErrors)(t)},()=>t.error())}function zI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Vv(t,e,r){if(r===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof r=="function"?{ref:r}:{ref:r,code:(0,Ve.stringify)(r)})}function PI(t,e,r=!1){return!e.length||e.some(n=>n==="array"?Array.isArray(t):n==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==n||r&&typeof t>"u")}It.validSchemaType=PI;function TI({schema:t,opts:e,self:r,errSchemaPath:n},o,s){if(Array.isArray(o.keyword)?!o.keyword.includes(s):o.keyword!==s)throw new Error("ajv implementation error");let i=o.dependencies;if(i?.some(a=>!Object.prototype.hasOwnProperty.call(t,a)))throw new Error(`parent schema must have dependencies of ${s}: ${i.join(",")}`);if(o.validateSchema&&!o.validateSchema(t[s])){let c=`keyword "${s}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if(e.validateSchema==="log")r.logger.error(c);else throw new Error(c)}}It.validateKeywordUsage=TI});var Wv=$(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.extendSubschemaMode=fr.extendSubschemaData=fr.getSubschema=void 0;var Rt=F(),Hv=Q();function CI(t,{keyword:e,schemaProp:r,schema:n,schemaPath:o,errSchemaPath:s,topSchemaRef:i}){if(e!==void 0&&n!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let a=t.schema[e];return r===void 0?{schema:a,schemaPath:(0,Rt._)`${t.schemaPath}${(0,Rt.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:a[r],schemaPath:(0,Rt._)`${t.schemaPath}${(0,Rt.getProperty)(e)}${(0,Rt.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Hv.escapeFragment)(r)}`}}if(n!==void 0){if(o===void 0||s===void 0||i===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:o,topSchemaRef:i,errSchemaPath:s}}throw new Error('either "keyword" or "schema" must be passed')}fr.getSubschema=CI;function OI(t,e,{dataProp:r,dataPropType:n,data:o,dataTypes:s,propertyName:i}){if(o!==void 0&&r!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:a}=e;if(r!==void 0){let{errorPath:u,dataPathArr:l,opts:d}=e,p=a.let("data",(0,Rt._)`${e.data}${(0,Rt.getProperty)(r)}`,!0);c(p),t.errorPath=(0,Rt.str)`${u}${(0,Hv.getErrorPath)(r,n,d.jsPropertySyntax)}`,t.parentDataProperty=(0,Rt._)`${r}`,t.dataPathArr=[...l,t.parentDataProperty]}if(o!==void 0){let u=o instanceof Rt.Name?o:a.let("data",o,!0);c(u),i!==void 0&&(t.propertyName=i)}s&&(t.dataTypes=s);function c(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}fr.extendSubschemaData=OI;function II(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:s}){n!==void 0&&(t.compositeRule=n),o!==void 0&&(t.createErrors=o),s!==void 0&&(t.allErrors=s),t.jtdDiscriminator=e,t.jtdMetadata=r}fr.extendSubschemaMode=II});var Fl=$((w9,Gv)=>{"use strict";Gv.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,o,s;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(o=n;o--!==0;)if(!t(e[o],r[o]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(r).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!t(e[i],r[i]))return!1}return!0}return e!==e&&r!==r}});var Kv=$((x9,Jv)=>{"use strict";var pr=Jv.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},o=r.post||function(){};ra(e,n,o,t,"",t)};pr.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};pr.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};pr.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};pr.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function ra(t,e,r,n,o,s,i,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,o,s,i,a,c,u);for(var l in n){var d=n[l];if(Array.isArray(d)){if(l in pr.arrayKeywords)for(var p=0;p<d.length;p++)ra(t,e,r,d[p],o+"/"+l+"/"+p,s,o,l,n,p)}else if(l in pr.propsKeywords){if(d&&typeof d=="object")for(var m in d)ra(t,e,r,d[m],o+"/"+l+"/"+RI(m),s,o,l,n,m)}else(l in pr.keywords||t.allKeys&&!(l in pr.skipKeywords))&&ra(t,e,r,d,o+"/"+l,s,o,l,n)}r(n,o,s,i,a,c,u)}}function RI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var ts=$(Ke=>{"use strict";Object.defineProperty(Ke,"__esModule",{value:!0});Ke.getSchemaRefs=Ke.resolveUrl=Ke.normalizeId=Ke._getFullPath=Ke.getFullPath=Ke.inlineRef=void 0;var DI=Q(),NI=Fl(),AI=Kv(),jI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function MI(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ul(t):e?Yv(t)<=e:!1}Ke.inlineRef=MI;var ZI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Ul(t){for(let e in t){if(ZI.has(e))return!0;let r=t[e];if(Array.isArray(r)&&r.some(Ul)||typeof r=="object"&&Ul(r))return!0}return!1}function Yv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!jI.has(r)&&(typeof t[r]=="object"&&(0,DI.eachItem)(t[r],n=>e+=Yv(n)),e===1/0))return 1/0}return e}function Qv(t,e="",r){r!==!1&&(e=On(e));let n=t.parse(e);return Xv(t,n)}Ke.getFullPath=Qv;function Xv(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=Xv;var LI=/#\/?$/;function On(t){return t?t.replace(LI,""):""}Ke.normalizeId=On;function qI(t,e,r){return r=On(r),t.resolve(e,r)}Ke.resolveUrl=qI;var FI=/^[a-z_][-a-z0-9._]*$/i;function UI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=On(t[r]||e),s={"":o},i=Qv(n,o,!1),a={},c=new Set;return AI(t,{allKeys:!0},(d,p,m,f)=>{if(f===void 0)return;let h=i+p,g=s[f];typeof d[r]=="string"&&(g=_.call(this,d[r])),x.call(this,d.$anchor),x.call(this,d.$dynamicAnchor),s[p]=g;function _(w){let S=this.opts.uriResolver.resolve;if(w=On(g?S(g,w):w),c.has(w))throw l(w);c.add(w);let k=this.refs[w];return typeof k=="string"&&(k=this.refs[k]),typeof k=="object"?u(d,k.schema,w):w!==On(h)&&(w[0]==="#"?(u(d,a[w],w),a[w]=d):this.refs[w]=h),w}function x(w){if(typeof w=="string"){if(!FI.test(w))throw new Error(`invalid anchor "${w}"`);_.call(this,`#${w}`)}}}),a;function u(d,p,m){if(p!==void 0&&!NI(d,p))throw l(m)}function l(d){return new Error(`reference "${d}" resolves to more than one schema`)}}Ke.getSchemaRefs=UI});var os=$(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.getData=mr.KeywordCxt=mr.validateFunctionCode=void 0;var ob=Rv(),eb=es(),Bl=Nl(),na=es(),VI=Lv(),ns=Bv(),Vl=Wv(),O=F(),N=Gt(),BI=ts(),Jt=Q(),rs=Xo();function HI(t){if(ab(t)&&(cb(t),ib(t))){JI(t);return}sb(t,()=>(0,ob.topBoolOrEmptySchema)(t))}mr.validateFunctionCode=HI;function sb({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,(0,O._)`${N.default.data}, ${N.default.valCxt}`,n.$async,()=>{t.code((0,O._)`"use strict"; ${tb(r,o)}`),GI(t,o),t.code(s)}):t.func(e,(0,O._)`${N.default.data}, ${WI(o)}`,n.$async,()=>t.code(tb(r,o)).code(s))}function WI(t){return(0,O._)`{${N.default.instancePath}="", ${N.default.parentData}, ${N.default.parentDataProperty}, ${N.default.rootData}=${N.default.data}${t.dynamicRef?(0,O._)`, ${N.default.dynamicAnchors}={}`:O.nil}}={}`}function GI(t,e){t.if(N.default.valCxt,()=>{t.var(N.default.instancePath,(0,O._)`${N.default.valCxt}.${N.default.instancePath}`),t.var(N.default.parentData,(0,O._)`${N.default.valCxt}.${N.default.parentData}`),t.var(N.default.parentDataProperty,(0,O._)`${N.default.valCxt}.${N.default.parentDataProperty}`),t.var(N.default.rootData,(0,O._)`${N.default.valCxt}.${N.default.rootData}`),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,O._)`${N.default.valCxt}.${N.default.dynamicAnchors}`)},()=>{t.var(N.default.instancePath,(0,O._)`""`),t.var(N.default.parentData,(0,O._)`undefined`),t.var(N.default.parentDataProperty,(0,O._)`undefined`),t.var(N.default.rootData,N.default.data),e.dynamicRef&&t.var(N.default.dynamicAnchors,(0,O._)`{}`)})}function JI(t){let{schema:e,opts:r,gen:n}=t;sb(t,()=>{r.$comment&&e.$comment&&lb(t),eR(t),n.let(N.default.vErrors,null),n.let(N.default.errors,0),r.unevaluated&&KI(t),ub(t),nR(t)})}function KI(t){let{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",(0,O._)`${r}.evaluated`),e.if((0,O._)`${t.evaluated}.dynamicProps`,()=>e.assign((0,O._)`${t.evaluated}.props`,(0,O._)`undefined`)),e.if((0,O._)`${t.evaluated}.dynamicItems`,()=>e.assign((0,O._)`${t.evaluated}.items`,(0,O._)`undefined`))}function tb(t,e){let r=typeof t=="object"&&t[e.schemaId];return r&&(e.code.source||e.code.process)?(0,O._)`/*# sourceURL=${r} */`:O.nil}function YI(t,e){if(ab(t)&&(cb(t),ib(t))){QI(t,e);return}(0,ob.boolOrEmptySchema)(t,e)}function ib({schema:t,self:e}){if(typeof t=="boolean")return!t;for(let r in t)if(e.RULES.all[r])return!0;return!1}function ab(t){return typeof t.schema!="boolean"}function QI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&lb(t),tR(t),rR(t);let s=n.const("_errs",N.default.errors);ub(t,s),n.var(e,(0,O._)`${s} === ${N.default.errors}`)}function cb(t){(0,Jt.checkUnknownRules)(t),XI(t)}function ub(t,e){if(t.opts.jtd)return rb(t,[],!1,e);let r=(0,eb.getSchemaTypes)(t.schema),n=(0,eb.coerceAndCheckDataType)(t,r);rb(t,r,!n,e)}function XI(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Jt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function eR(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Jt.checkStrictMode)(t,"default is ignored in the schema root")}function tR(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,BI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function rR(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function lb({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:o}){let s=r.$comment;if(o.$comment===!0)t.code((0,O._)`${N.default.self}.logger.log(${s})`);else if(typeof o.$comment=="function"){let i=(0,O.str)`${n}/$comment`,a=t.scopeValue("root",{ref:e.root});t.code((0,O._)`${N.default.self}.opts.$comment(${s}, ${i}, ${a}.schema)`)}}function nR(t){let{gen:e,schemaEnv:r,validateName:n,ValidationError:o,opts:s}=t;r.$async?e.if((0,O._)`${N.default.errors} === 0`,()=>e.return(N.default.data),()=>e.throw((0,O._)`new ${o}(${N.default.vErrors})`)):(e.assign((0,O._)`${n}.errors`,N.default.vErrors),s.unevaluated&&oR(t),e.return((0,O._)`${N.default.errors} === 0`))}function oR({gen:t,evaluated:e,props:r,items:n}){r instanceof O.Name&&t.assign((0,O._)`${e}.props`,r),n instanceof O.Name&&t.assign((0,O._)`${e}.items`,n)}function rb(t,e,r,n){let{gen:o,schema:s,data:i,allErrors:a,opts:c,self:u}=t,{RULES:l}=u;if(s.$ref&&(c.ignoreKeywordsWithRef||!(0,Jt.schemaHasRulesButRef)(s,l))){o.block(()=>fb(t,"$ref",l.all.$ref.definition));return}c.jtd||sR(t,e),o.block(()=>{for(let p of l.rules)d(p);d(l.post)});function d(p){(0,Bl.shouldUseGroup)(s,p)&&(p.type?(o.if((0,na.checkDataType)(p.type,i,c.strictNumbers)),nb(t,p),e.length===1&&e[0]===p.type&&r&&(o.else(),(0,na.reportTypeError)(t)),o.endIf()):nb(t,p),a||o.if((0,O._)`${N.default.errors} === ${n||0}`))}}function nb(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,VI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Bl.shouldUseRule)(n,s)&&fb(t,s.keyword,s.definition,e.type)})}function sR(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(iR(t,e),t.opts.allowUnionTypes||aR(t,e),cR(t,t.dataTypes))}function iR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{db(t.dataTypes,r)||Hl(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),lR(t,e)}}function aR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Hl(t,"use allowUnionTypes to allow union type keyword")}function cR(t,e){let r=t.self.RULES.all;for(let n in r){let o=r[n];if(typeof o=="object"&&(0,Bl.shouldUseRule)(t.schema,o)){let{type:s}=o.definition;s.length&&!s.some(i=>uR(e,i))&&Hl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function uR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function db(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function lR(t,e){let r=[];for(let n of t.dataTypes)db(e,n)?r.push(n):e.includes("integer")&&n==="number"&&r.push("integer");t.dataTypes=r}function Hl(t,e){let r=t.schemaEnv.baseId+t.errSchemaPath;e+=` at "${r}" (strictTypes)`,(0,Jt.checkStrictMode)(t,e,t.opts.strictTypes)}var oa=class{constructor(e,r,n){if((0,ns.validateKeywordUsage)(e,r,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=r.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Jt.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=r.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=r,this.$data)this.schemaCode=e.gen.const("vSchema",pb(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,ns.validSchemaType)(this.schema,r.schemaType,r.allowUndefined))throw new Error(`${n} value must be ${JSON.stringify(r.schemaType)}`);("code"in r?r.trackErrors:r.errors!==!1)&&(this.errsCount=e.gen.const("_errs",N.default.errors))}result(e,r,n){this.failResult((0,O.not)(e),r,n)}failResult(e,r,n){this.gen.if(e),n?n():this.error(),r?(this.gen.else(),r(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,r){this.failResult((0,O.not)(e),void 0,r)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:r}=this;this.fail((0,O._)`${r} !== undefined && (${(0,O.or)(this.invalid$data(),e)})`)}error(e,r,n){if(r){this.setParams(r),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,r){(e?rs.reportExtraError:rs.reportError)(this,this.def.error,r)}$dataError(){(0,rs.reportError)(this,this.def.$dataError||rs.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,rs.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,r){r?Object.assign(this.params,e):this.params=e}block$data(e,r,n=O.nil){this.gen.block(()=>{this.check$data(e,n),r()})}check$data(e=O.nil,r=O.nil){if(!this.$data)return;let{gen:n,schemaCode:o,schemaType:s,def:i}=this;n.if((0,O.or)((0,O._)`${o} === undefined`,r)),e!==O.nil&&n.assign(e,!0),(s.length||i.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==O.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:r,schemaType:n,def:o,it:s}=this;return(0,O.or)(i(),a());function i(){if(n.length){if(!(r instanceof O.Name))throw new Error("ajv implementation error");let c=Array.isArray(n)?n:[n];return(0,O._)`${(0,na.checkDataTypes)(c,r,s.opts.strictNumbers,na.DataType.Wrong)}`}return O.nil}function a(){if(o.validateSchema){let c=e.scopeValue("validate$data",{ref:o.validateSchema});return(0,O._)`!${c}(${r})`}return O.nil}}subschema(e,r){let n=(0,Vl.getSubschema)(this.it,e);(0,Vl.extendSubschemaData)(n,this.it,e),(0,Vl.extendSubschemaMode)(n,e);let o={...this.it,...n,items:void 0,props:void 0};return YI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Jt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Jt.mergeEvaluated.items(o,e.items,n.items,r)))}mergeValidEvaluated(e,r){let{it:n,gen:o}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return o.if(r,()=>this.mergeEvaluated(e,O.Name)),!0}};mr.KeywordCxt=oa;function fb(t,e,r,n){let o=new oa(t,r,e);"code"in r?r.code(o,n):o.$data&&r.validate?(0,ns.funcKeywordCode)(o,r):"macro"in r?(0,ns.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,ns.funcKeywordCode)(o,r)}var dR=/^\/(?:[^~]|~0|~1)*$/,fR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return N.default.rootData;if(t[0]==="/"){if(!dR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=N.default.rootData}else{let u=fR.exec(t);if(!u)throw new Error(`Invalid JSON-pointer: ${t}`);let l=+u[1];if(o=u[2],o==="#"){if(l>=e)throw new Error(c("property/index",l));return n[e-l]}if(l>e)throw new Error(c("data",l));if(s=r[e-l],!o)return s}let i=s,a=o.split("/");for(let u of a)u&&(s=(0,O._)`${s}${(0,O.getProperty)((0,Jt.unescapeJsonPointer)(u))}`,i=(0,O._)`${i} && ${s}`);return i;function c(u,l){return`Cannot access ${u} ${l} levels up, current level is ${e}`}}mr.getData=pb});var sa=$(Gl=>{"use strict";Object.defineProperty(Gl,"__esModule",{value:!0});var Wl=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}};Gl.default=Wl});var ss=$(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});var Jl=ts(),Kl=class extends Error{constructor(e,r,n,o){super(o||`can't resolve reference ${n} from id ${r}`),this.missingRef=(0,Jl.resolveUrl)(e,r,n),this.missingSchema=(0,Jl.normalizeId)((0,Jl.getFullPath)(e,this.missingRef))}};Yl.default=Kl});var aa=$(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.resolveSchema=pt.getCompilingSchema=pt.resolveRef=pt.compileSchema=pt.SchemaEnv=void 0;var kt=F(),pR=sa(),Gr=Gt(),Et=ts(),mb=Q(),mR=os(),In=class{constructor(e){var r;this.refs={},this.dynamicAnchors={};let n;typeof e.schema=="object"&&(n=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=(r=e.baseId)!==null&&r!==void 0?r:(0,Et.normalizeId)(n?.[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=n?.$async,this.refs={}}};pt.SchemaEnv=In;function Xl(t){let e=hb.call(this,t);if(e)return e;let r=(0,Et.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:o}=this.opts.code,{ownProperties:s}=this.opts,i=new kt.CodeGen(this.scope,{es5:n,lines:o,ownProperties:s}),a;t.$async&&(a=i.scopeValue("Error",{ref:pR.default,code:(0,kt._)`require("ajv/dist/runtime/validation_error").default`}));let c=i.scopeName("validate");t.validateName=c;let u={gen:i,allErrors:this.opts.allErrors,data:Gr.default.data,parentData:Gr.default.parentData,parentDataProperty:Gr.default.parentDataProperty,dataNames:[Gr.default.data],dataPathArr:[kt.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:i.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,kt.stringify)(t.schema)}:{ref:t.schema}),validateName:c,ValidationError:a,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:kt.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,kt._)`""`,opts:this.opts,self:this},l;try{this._compilations.add(t),(0,mR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Gr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let m=new Function(`${Gr.default.self}`,`${Gr.default.scope}`,l)(this,this.scope.get());if(this.scope.value(c,{ref:m}),m.errors=null,m.schema=t.schema,m.schemaEnv=t,t.$async&&(m.$async=!0),this.opts.code.source===!0&&(m.source={validateName:c,validateCode:d,scopeValues:i._values}),this.opts.unevaluated){let{props:f,items:h}=u;m.evaluated={props:f instanceof kt.Name?void 0:f,items:h instanceof kt.Name?void 0:h,dynamicProps:f instanceof kt.Name,dynamicItems:h instanceof kt.Name},m.source&&(m.source.evaluated=(0,kt.stringify)(m.evaluated))}return t.validate=m,t}catch(d){throw delete t.validate,delete t.validateName,l&&this.logger.error("Error compiling schema, function code:",l),d}finally{this._compilations.delete(t)}}pt.compileSchema=Xl;function hR(t,e,r){var n;r=(0,Et.resolveUrl)(this.opts.uriResolver,e,r);let o=t.refs[r];if(o)return o;let s=_R.call(this,t,r);if(s===void 0){let i=(n=t.localRefs)===null||n===void 0?void 0:n[r],{schemaId:a}=this.opts;i&&(s=new In({schema:i,schemaId:a,root:t,baseId:e}))}if(s!==void 0)return t.refs[r]=gR.call(this,s)}pt.resolveRef=hR;function gR(t){return(0,Et.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Xl.call(this,t)}function hb(t){for(let e of this._compilations)if(yR(e,t))return e}pt.getCompilingSchema=hb;function yR(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function _R(t,e){let r;for(;typeof(r=this.refs[e])=="string";)e=r;return r||this.schemas[e]||ia.call(this,t,e)}function ia(t,e){let r=this.opts.uriResolver.parse(e),n=(0,Et._getFullPath)(this.opts.uriResolver,r),o=(0,Et.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&n===o)return Ql.call(this,r,t);let s=(0,Et.normalizeId)(n),i=this.refs[s]||this.schemas[s];if(typeof i=="string"){let a=ia.call(this,t,i);return typeof a?.schema!="object"?void 0:Ql.call(this,r,a)}if(typeof i?.schema=="object"){if(i.validate||Xl.call(this,i),s===(0,Et.normalizeId)(e)){let{schema:a}=i,{schemaId:c}=this.opts,u=a[c];return u&&(o=(0,Et.resolveUrl)(this.opts.uriResolver,o,u)),new In({schema:a,schemaId:c,root:t,baseId:o})}return Ql.call(this,r,i)}}pt.resolveSchema=ia;var vR=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Ql(t,{baseId:e,schema:r,root:n}){var o;if(((o=t.fragment)===null||o===void 0?void 0:o[0])!=="/")return;for(let a of t.fragment.slice(1).split("/")){if(typeof r=="boolean")return;let c=r[(0,mb.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!vR.has(a)&&u&&(e=(0,Et.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,mb.schemaHasRulesButRef)(r,this.RULES)){let a=(0,Et.resolveUrl)(this.opts.uriResolver,e,r.$ref);s=ia.call(this,n,a)}let{schemaId:i}=this.opts;if(s=s||new In({schema:r,schemaId:i,root:n,baseId:e}),s.schema!==s.root.schema)return s}});var gb=$((P9,bR)=>{bR.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var nd=$((T9,wb)=>{"use strict";var wR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),_b=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),ca=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),ed=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),xR=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu),SR=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/?]$/iu);function td(t){let e="",r=0,n=0;for(n=0;n<t.length;n++)if(r=t[n].charCodeAt(0),r!==48){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n];break}for(n+=1;n<t.length;n++){if(r=t[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";e+=t[n]}return e}var $R=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function yb(t){return t.length=0,!0}function kR(t,e,r){if(t.length){let n=td(t);if(n!=="")e.push(n);else return r.error=!0,!1;t.length=0}return!0}function ER(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=kR;for(let c=0;c<t.length;c++){let u=t[c];if(!(u==="["||u==="]"))if(u===":"){if(s===!0&&(i=!0),!a(o,n,r))break;if(++e>7){r.error=!0;break}c>0&&t[c-1]===":"&&(s=!0),n.push(":");continue}else if(u==="%"){if(!a(o,n,r))break;a=yb}else{o.push(u);continue}}return o.length&&(a===yb?r.zone=o.join(""):i?n.push(o.join("")):n.push(td(o))),r.address=n.join(""),r}function vb(t){if(zR(t,":")<2)return{host:t,isIPV6:!1};let e=ER(t);if(e.error)return{host:t,isIPV6:!1};{let r=e.address,n=e.address;return e.zone&&(r+="%"+e.zone,n+="%25"+e.zone),{host:r,isIPV6:!0,escapedHost:n}}}function zR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function PR(t){let e=t,r=[],n=-1,o=0;for(;o=e.length;){if(o===1){if(e===".")break;if(e==="/"){r.push("/");break}else{r.push(e);break}}else if(o===2){if(e[0]==="."){if(e[1]===".")break;if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){r.push("/");break}}else if(o===3&&e==="/.."){r.length!==0&&r.pop(),r.push("/");break}if(e[0]==="."){if(e[1]==="."){if(e[2]==="/"){e=e.slice(3);continue}}else if(e[1]==="/"){e=e.slice(2);continue}}else if(e[0]==="/"&&e[1]==="."){if(e[2]==="/"){e=e.slice(2);continue}else if(e[2]==="."&&e[3]==="/"){e=e.slice(3),r.length!==0&&r.pop();continue}}if((n=e.indexOf("/",1))===-1){r.push(e);break}else r.push(e.slice(0,n)),e=e.slice(n)}return r.join("")}var TR={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},CR=/[@/?#:]/g,OR=/[@/?#]/g;function bb(t,e){let r=e?OR:CR;return r.lastIndex=0,t.replace(r,n=>TR[n])}function IR(t,e=!1){if(t.indexOf("%")===-1)return t;let r="";for(let n=0;n<t.length;n++){if(t[n]==="%"&&n+2<t.length){let o=t.slice(n+1,n+3);if(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));e&&ed(i)?r+=i:r+="%"+s,n+=2;continue}}r+=t[n]}return r}var ot=new Array(256);{let t="0123456789ABCDEF";for(let e=0;e<256;e++)ot[e]="%"+t[e>>4]+t[e&15]}function rd(t){return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===42||t===43||t===45||t===46||t===47||t===64||t===95}function mt(t){return t<2048?ot[192|t>>6]+ot[128|t&63]:t<65536?ot[224|t>>12]+ot[128|t>>6&63]+ot[128|t&63]:ot[240|t>>18]+ot[128|t>>12&63]+ot[128|t>>6&63]+ot[128|t&63]}function RR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));i!=="."&&ed(i)?e+=i:e+="%"+s,r+=2;continue}}if(xR(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}}return e}function DR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let o=t.slice(r+1,r+3);if(ca(o)){let s=o.toUpperCase(),i=String.fromCharCode(parseInt(s,16));ed(i)?e+=i:e+="%"+s,r+=2;continue}}if(SR(n))e+=n;else{let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}}return e}function NR(t){let e="";for(let r=0;r<t.length;r++){let n=t[r];if(n==="%"&&r+2<t.length){let s=t.slice(r+1,r+3);if(ca(s)){e+="%"+s.toUpperCase(),r+=2;continue}}let o=t.charCodeAt(r);if(o<128)e+=rd(o)?n:ot[o];else if(o<55296||o>57343)e+=mt(o);else if(o<=56319&&r+1<t.length){let s=t.charCodeAt(r+1);s>=56320&&s<=57343?(e+=mt(65536+(o-55296<<10)+(s-56320)),r++):e+=mt(65533)}else e+=mt(65533)}return e}function AR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!_b(r)){let n=vb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=bb(r,!1)}e.push(r)}return(typeof t.port=="number"||typeof t.port=="string")&&(e.push(":"),e.push(String(t.port))),e.length?e.join(""):void 0}wb.exports={nonSimpleDomain:$R,recomposeAuthority:AR,reescapeHostDelimiters:bb,normalizePercentEncoding:IR,normalizePathEncoding:RR,normalizeQueryFragmentEncoding:DR,escapePreservingEscapes:NR,removeDotSegments:PR,isIPv4:_b,isUUID:wR,normalizeIPv6:vb,stringArrayToHexStripped:td}});var Eb=$((C9,kb)=>{"use strict";var{isUUID:jR}=nd(),MR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZR=["http","https","ws","wss","urn","urn:uuid"];function LR(t){return ZR.indexOf(t)!==-1}function od(t){return t.secure===!0?!0:t.secure===!1?!1:t.scheme?t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S"):!1}function xb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function Sb(t){let e=String(t.scheme).toLowerCase()==="https";return(t.port===(e?443:80)||t.port==="")&&(t.port=void 0),t.path||(t.path="/"),t}function qR(t){return t.secure=od(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function FR(t){if((t.port===(od(t)?443:80)||t.port==="")&&(t.port=void 0),typeof t.secure=="boolean"&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){let[e,r]=t.resourceName.split("?");t.path=e&&e!=="/"?e:void 0,t.query=r,t.resourceName=void 0}return t.fragment=void 0,t}function UR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(MR);if(r){let n=e.scheme||t.scheme||"urn";t.nid=r[1].toLowerCase(),t.nss=r[2];let o=`${n}:${e.nid||t.nid}`,s=sd(o);t.path=void 0,s&&(t=s.parse(t,e))}else t.error=t.error||"URN can not be parsed.";return t}function VR(t,e){if(t.nid===void 0)throw new Error("URN without nid cannot be serialized");let r=e.scheme||t.scheme||"urn",n=t.nid.toLowerCase(),o=`${r}:${e.nid||n}`,s=sd(o);s&&(t=s.serialize(t,e));let i=t,a=t.nss;return i.path=`${n||e.nid}:${a}`,e.skipEscape=!0,i}function BR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!jR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function HR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var $b={scheme:"http",domainHost:!0,parse:xb,serialize:Sb},WR={scheme:"https",domainHost:$b.domainHost,parse:xb,serialize:Sb},ua={scheme:"ws",domainHost:!0,parse:qR,serialize:FR},GR={scheme:"wss",domainHost:ua.domainHost,parse:ua.parse,serialize:ua.serialize},JR={scheme:"urn",parse:UR,serialize:VR,skipNormalize:!0},KR={scheme:"urn:uuid",parse:BR,serialize:HR,skipNormalize:!0},la={http:$b,https:WR,ws:ua,wss:GR,urn:JR,"urn:uuid":KR};Object.setPrototypeOf(la,null);function sd(t){return t&&(la[t]||la[t.toLowerCase()])||void 0}kb.exports={wsIsSecure:od,SCHEMES:la,isValidSchemeName:LR,getSchemeHandler:sd}});var Ib=$((O9,pa)=>{"use strict";var{normalizeIPv6:YR,removeDotSegments:is,recomposeAuthority:QR,normalizePercentEncoding:XR,normalizePathEncoding:eD,normalizeQueryFragmentEncoding:zb,escapePreservingEscapes:tD,reescapeHostDelimiters:rD,isIPv4:nD,nonSimpleDomain:oD}=nd(),{SCHEMES:sD,getSchemeHandler:Tb}=Eb();function iD(t,e){return typeof t=="string"?t=pD(t,e):typeof t=="object"&&(t=fa(Jr(t,e),e)),t}function aD(t,e,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},{parsed:o,malformedAuthorityOrPort:s}=da(t,n),{parsed:i,malformedAuthorityOrPort:a}=da(e,n);if(s||a)throw new Error(o.error||i.error||"URI is malformed.");let c=Cb(o,i,n,!0);return n.skipEscape=!0,Jr(c,n)}function Cb(t,e,r,n){let o={};return n||(t=fa(Jr(t,r),r),e=fa(Jr(e,r),r)),r=r||{},!r.tolerant&&e.scheme?(o.scheme=e.scheme,o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=is(e.path||""),o.query=e.query):(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0?(o.userinfo=e.userinfo,o.host=e.host,o.port=e.port,o.path=is(e.path||""),o.query=e.query):(e.path?(e.path[0]==="/"?o.path=is(e.path):((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path?o.path="/"+e.path:t.path?o.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:o.path=e.path,o.path=is(o.path)),o.query=e.query):(o.path=t.path,e.query!==void 0?o.query=e.query:o.query=t.query),o.userinfo=t.userinfo,o.host=t.host,o.port=t.port),o.scheme=t.scheme),o.fragment=e.fragment,o}function cD(t,e,r){let n=Pb(t,r),o=Pb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Jr(t,e){let r={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},n=Object.assign({},e),o=[],s=Tb(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=XR(r.path):(r.path=tD(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=QR(r);if(i!==void 0&&(n.reference!=="suffix"&&o.push("//"),o.push(i),r.path&&r.path[0]!=="/"&&o.push("/")),r.path!==void 0){let a=r.path;!n.absolutePath&&(!s||!s.absolutePath)&&(a=is(a)),i===void 0&&a[0]==="/"&&a[1]==="/"&&(a="/%2F"+a.slice(2)),o.push(a)}return r.query!==void 0&&o.push("?",r.query),r.fragment!==void 0&&o.push("#",r.fragment),o.join("")}var uD=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,lD=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,dD=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function fD(t,e){if(e[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port=="number"&&(t.port<0||t.port>65535))return"URI port is malformed."}function da(t,e){let r=Object.assign({},e),n={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1,s=!1;r.reference==="suffix"&&(r.scheme?t=r.scheme+":"+t:t="//"+t);let i=t.match(lD);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let a=t.match(dD);if(a!==null){let u=a[1],l=u.replace(/[\t\n\r]/g,"");l.length>=2&&(l.slice(0,2)!=="//"?(n.error=n.error||"URI authority must not contain a literal backslash.",o=!0):u.length!==l.length&&(n.error=n.error||"URI authority introducer must not contain whitespace.",o=!0))}let c=t.match(uD);if(c){n.scheme=c[1]===void 0?void 0:c[1].toLowerCase(),n.userinfo=c[3],n.host=c[4],n.port=parseInt(c[5],10),n.path=c[6]||"",n.query=c[7],n.fragment=c[8],isNaN(n.port)&&(n.port=c[5]);let u=fD(n,c);if(u!==void 0&&(n.error=n.error||u,o=!0),n.host)if(nD(n.host)===!1){let p=YR(n.host);n.host=p.host.toLowerCase(),s=p.isIPV6}else s=!0;n.scheme===void 0&&n.userinfo===void 0&&n.host===void 0&&n.port===void 0&&n.query===void 0&&!n.path?n.reference="same-document":n.scheme===void 0?n.reference="relative":n.fragment===void 0?n.reference="absolute":n.reference="uri",r.reference&&r.reference!=="suffix"&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");let l=Tb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&s===!1&&oD(n.host))try{n.host=new URL("http://"+n.host).hostname}catch(d){n.error=n.error||"Host's domain name can not be converted to ASCII: "+d}(!l||l&&!l.skipNormalize)&&(t.indexOf("%")!==-1&&(n.scheme!==void 0&&(n.scheme=unescape(n.scheme)),n.host!==void 0&&(n.host=rD(unescape(n.host),s))),n.path&&(n.path=eD(n.path)),n.query&&(n.query=zb(n.query)),n.fragment&&(n.fragment=zb(n.fragment))),l&&l.parse&&l.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return{parsed:n,malformedAuthorityOrPort:o}}function fa(t,e){return da(t,e).parsed}function pD(t,e){return Ob(t,e).normalized}function Ob(t,e){let{parsed:r,malformedAuthorityOrPort:n}=da(t,e);return{normalized:n?t:Jr(r,e),malformedAuthorityOrPort:n}}function Pb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Ob(t,e);return n?void 0:r}if(typeof t=="object")return Jr(t,e)}var id={SCHEMES:sD,normalize:iD,resolve:aD,resolveComponent:Cb,equal:cD,serialize:Jr,parse:fa};pa.exports=id;pa.exports.default=id;pa.exports.fastUri=id});var Db=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Rb=Ib();Rb.code='require("ajv/dist/runtime/uri").default';ad.default=Rb});var Fb=$(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.CodeGen=Re.Name=Re.nil=Re.stringify=Re.str=Re._=Re.KeywordCxt=void 0;var mD=os();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return mD.KeywordCxt}});var Rn=F();Object.defineProperty(Re,"_",{enumerable:!0,get:function(){return Rn._}});Object.defineProperty(Re,"str",{enumerable:!0,get:function(){return Rn.str}});Object.defineProperty(Re,"stringify",{enumerable:!0,get:function(){return Rn.stringify}});Object.defineProperty(Re,"nil",{enumerable:!0,get:function(){return Rn.nil}});Object.defineProperty(Re,"Name",{enumerable:!0,get:function(){return Rn.Name}});Object.defineProperty(Re,"CodeGen",{enumerable:!0,get:function(){return Rn.CodeGen}});var hD=sa(),Zb=ss(),gD=Dl(),as=aa(),yD=F(),cs=ts(),ma=es(),ud=Q(),Nb=gb(),_D=Db(),Lb=(t,e)=>new RegExp(t,e);Lb.code="new RegExp";var vD=["removeAdditional","useDefaults","coerceTypes"],bD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),wD={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},xD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ab=200;function SD(t){var e,r,n,o,s,i,a,c,u,l,d,p,m,f,h,g,_,x,w,S,k,W,Z,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,xe=Ee===!0||Ee===void 0?1:Ee||0,Ze=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:Lb,Be=(o=t.uriResolver)!==null&&o!==void 0?o:_D.default;return{strictSchema:(i=(s=t.strictSchema)!==null&&s!==void 0?s:me)!==null&&i!==void 0?i:!0,strictNumbers:(c=(a=t.strictNumbers)!==null&&a!==void 0?a:me)!==null&&c!==void 0?c:!0,strictTypes:(l=(u=t.strictTypes)!==null&&u!==void 0?u:me)!==null&&l!==void 0?l:"log",strictTuples:(p=(d=t.strictTuples)!==null&&d!==void 0?d:me)!==null&&p!==void 0?p:"log",strictRequired:(f=(m=t.strictRequired)!==null&&m!==void 0?m:me)!==null&&f!==void 0?f:!1,code:t.code?{...t.code,optimize:xe,regExp:Ze}:{optimize:xe,regExp:Ze},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:Ab,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:Ab,meta:(_=t.meta)!==null&&_!==void 0?_:!0,messages:(x=t.messages)!==null&&x!==void 0?x:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(S=t.schemaId)!==null&&S!==void 0?S:"$id",addUsedSchema:(k=t.addUsedSchema)!==null&&k!==void 0?k:!0,validateSchema:(W=t.validateSchema)!==null&&W!==void 0?W:!0,validateFormats:(Z=t.validateFormats)!==null&&Z!==void 0?Z:!0,unicodeRegExp:(re=t.unicodeRegExp)!==null&&re!==void 0?re:!0,int32range:(U=t.int32range)!==null&&U!==void 0?U:!0,uriResolver:Be}}var us=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...SD(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new yD.ValueScope({scope:{},prefixes:bD,es5:r,lines:n}),this.logger=TD(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,gD.getRules)(),jb.call(this,wD,e,"NOT SUPPORTED"),jb.call(this,xD,e,"DEPRECATED","warn"),this._metaOpts=zD.call(this),e.formats&&kD.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ED.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),$D.call(this),e.validateFormats=o}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:r,schemaId:n}=this.opts,o=Nb;n==="id"&&(o={...Nb},o.id=o.$id,delete o.$id),r&&e&&this.addMetaSchema(o,o[n],!1)}defaultMeta(){let{meta:e,schemaId:r}=this.opts;return this.opts.defaultMeta=typeof e=="object"?e[r]||e:void 0}validate(e,r){let n;if(typeof e=="string"){if(n=this.getSchema(e),!n)throw new Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let o=n(r);return"$async"in n||(this.errors=n.errors),o}compile(e,r){let n=this._addSchema(e,r);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,r){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:n}=this.opts;return o.call(this,e,r);async function o(l,d){await s.call(this,l.$schema);let p=this._addSchema(l,d);return p.validate||i.call(this,p)}async function s(l){l&&!this.getSchema(l)&&await o.call(this,{$ref:l},!0)}async function i(l){try{return this._compileSchemaEnv(l)}catch(d){if(!(d instanceof Zb.default))throw d;return a.call(this,d),await c.call(this,d.missingSchema),i.call(this,l)}}function a({missingSchema:l,missingRef:d}){if(this.refs[l])throw new Error(`AnySchema ${l} is loaded but ${d} cannot be resolved`)}async function c(l){let d=await u.call(this,l);this.refs[l]||await s.call(this,d.$schema),this.refs[l]||this.addSchema(d,l,r)}async function u(l){let d=this._loading[l];if(d)return d;try{return await(this._loading[l]=n(l))}finally{delete this._loading[l]}}}addSchema(e,r,n,o=this.opts.validateSchema){if(Array.isArray(e)){for(let i of e)this.addSchema(i,void 0,n,o);return this}let s;if(typeof e=="object"){let{schemaId:i}=this.opts;if(s=e[i],s!==void 0&&typeof s!="string")throw new Error(`schema ${i} must be string`)}return r=(0,cs.normalizeId)(r||s),this._checkUnique(r),this.schemas[r]=this._addSchema(e,n,r,o,!0),this}addMetaSchema(e,r,n=this.opts.validateSchema){return this.addSchema(e,r,!0,n),this}validateSchema(e,r){if(typeof e=="boolean")return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!="string")throw new Error("$schema must be a string");if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let o=this.validate(n,e);if(!o&&r){let s="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(s);else throw new Error(s)}return o}getSchema(e){let r;for(;typeof(r=Mb.call(this,e))=="string";)e=r;if(r===void 0){let{schemaId:n}=this.opts,o=new as.SchemaEnv({schema:{},schemaId:n});if(r=as.resolveSchema.call(this,o,e),!r)return;this.refs[e]=r}return r.validate||this._compileSchemaEnv(r)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let r=Mb.call(this,e);return typeof r=="object"&&this._cache.delete(r.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let r=e;this._cache.delete(r);let n=e[this.opts.schemaId];return n&&(n=(0,cs.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let r of e)this.addKeyword(r);return this}addKeyword(e,r){let n;if(typeof e=="string")n=e,typeof r=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),r.keyword=n);else if(typeof e=="object"&&r===void 0){if(r=e,n=r.keyword,Array.isArray(n)&&!n.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(OD.call(this,n,r),!r)return(0,ud.eachItem)(n,s=>cd.call(this,s)),this;RD.call(this,r);let o={...r,type:(0,ma.getJSONTypes)(r.type),schemaType:(0,ma.getJSONTypes)(r.schemaType)};return(0,ud.eachItem)(n,o.type.length===0?s=>cd.call(this,s,o):s=>o.type.forEach(i=>cd.call(this,s,o,i))),this}getKeyword(e){let r=this.RULES.all[e];return typeof r=="object"?r.definition:!!r}removeKeyword(e){let{RULES:r}=this;delete r.keywords[e],delete r.all[e];for(let n of r.rules){let o=n.rules.findIndex(s=>s.keyword===e);o>=0&&n.rules.splice(o,1)}return this}addFormat(e,r){return typeof r=="string"&&(r=new RegExp(r)),this.formats[e]=r,this}errorsText(e=this.errors,{separator:r=", ",dataVar:n="data"}={}){return!e||e.length===0?"No errors":e.map(o=>`${n}${o.instancePath} ${o.message}`).reduce((o,s)=>o+r+s)}$dataMetaSchema(e,r){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let o of r){let s=o.split("/").slice(1),i=e;for(let a of s)i=i[a];for(let a in n){let c=n[a];if(typeof c!="object")continue;let{$data:u}=c.definition,l=i[a];u&&l&&(i[a]=qb(l))}}return e}_removeAllSchemas(e,r){for(let n in e){let o=e[n];(!r||r.test(n))&&(typeof o=="string"?delete e[n]:o&&!o.meta&&(this._cache.delete(o.schema),delete e[n]))}}_addSchema(e,r,n,o=this.opts.validateSchema,s=this.opts.addUsedSchema){let i,{schemaId:a}=this.opts;if(typeof e=="object")i=e[a];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof e!="boolean")throw new Error("schema must be object or boolean")}let c=this._cache.get(e);if(c!==void 0)return c;n=(0,cs.normalizeId)(i||n);let u=cs.getSchemaRefs.call(this,e,n);return c=new as.SchemaEnv({schema:e,schemaId:a,meta:r,baseId:n,localRefs:u}),this._cache.set(c.schema,c),s&&!n.startsWith("#")&&(n&&this._checkUnique(n),this.refs[n]=c),o&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):as.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let r=this.opts;this.opts=this._metaOpts;try{as.compileSchema.call(this,e)}finally{this.opts=r}}};us.ValidationError=hD.default;us.MissingRefError=Zb.default;Re.default=us;function jb(t,e,r,n="error"){for(let o in t){let s=o;s in e&&this.logger[n](`${r}: option ${o}. ${t[s]}`)}}function Mb(t){return t=(0,cs.normalizeId)(t),this.schemas[t]||this.refs[t]}function $D(){let t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(let e in t)this.addSchema(t[e],e)}function kD(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function ED(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let e in t){let r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}function zD(){let t={...this.opts};for(let e of vD)delete t[e];return t}var PD={log(){},warn(){},error(){}};function TD(t){if(t===!1)return PD;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}var CD=/^[a-z_$][a-z0-9_$:-]*$/i;function OD(t,e){let{RULES:r}=this;if((0,ud.eachItem)(t,n=>{if(r.keywords[n])throw new Error(`Keyword ${n} is already defined`);if(!CD.test(n))throw new Error(`Keyword ${n} has invalid name`)}),!!e&&e.$data&&!("code"in e||"validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function cd(t,e,r){var n;let o=e?.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:s}=this,i=o?s.post:s.rules.find(({type:c})=>c===r);if(i||(i={type:r,rules:[]},s.rules.push(i)),s.keywords[t]=!0,!e)return;let a={keyword:t,definition:{...e,type:(0,ma.getJSONTypes)(e.type),schemaType:(0,ma.getJSONTypes)(e.schemaType)}};e.before?ID.call(this,i,a,e.before):i.rules.push(a),s.all[t]=a,(n=e.implements)===null||n===void 0||n.forEach(c=>this.addKeyword(c))}function ID(t,e,r){let n=t.rules.findIndex(o=>o.keyword===r);n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function RD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=qb(e)),t.validateSchema=this.compile(e,!0))}var DD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function qb(t){return{anyOf:[t,DD]}}});var Ub=$(ld=>{"use strict";Object.defineProperty(ld,"__esModule",{value:!0});var ND={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};ld.default=ND});var Wb=$(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.callRef=Kr.getValidate=void 0;var AD=ss(),Vb=ft(),Ye=F(),Dn=Gt(),Bb=aa(),ha=Q(),jD={keyword:"$ref",schemaType:"string",code(t){let{gen:e,schema:r,it:n}=t,{baseId:o,schemaEnv:s,validateName:i,opts:a,self:c}=n,{root:u}=s;if((r==="#"||r==="#/")&&o===u.baseId)return d();let l=Bb.resolveRef.call(c,u,o,r);if(l===void 0)throw new AD.default(n.opts.uriResolver,o,r);if(l instanceof Bb.SchemaEnv)return p(l);return m(l);function d(){if(s===u)return ga(t,i,s,s.$async);let f=e.scopeValue("root",{ref:u});return ga(t,(0,Ye._)`${f}.validate`,u,u.$async)}function p(f){let h=Hb(t,f);ga(t,h,f,f.$async)}function m(f){let h=e.scopeValue("schema",a.code.source===!0?{ref:f,code:(0,Ye.stringify)(f)}:{ref:f}),g=e.name("valid"),_=t.subschema({schema:f,dataTypes:[],schemaPath:Ye.nil,topSchemaRef:h,errSchemaPath:r},g);t.mergeEvaluated(_),t.ok(g)}}};function Hb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Kr.getValidate=Hb;function ga(t,e,r,n){let{gen:o,it:s}=t,{allErrors:i,schemaEnv:a,opts:c}=s,u=c.passContext?Dn.default.this:Ye.nil;n?l():d();function l(){if(!a.$async)throw new Error("async schema referenced by sync schema");let f=o.let("valid");o.try(()=>{o.code((0,Ye._)`await ${(0,Vb.callValidateCode)(t,e,u)}`),m(e),i||o.assign(f,!0)},h=>{o.if((0,Ye._)`!(${h} instanceof ${s.ValidationError})`,()=>o.throw(h)),p(h),i||o.assign(f,!1)}),t.ok(f)}function d(){t.result((0,Vb.callValidateCode)(t,e,u),()=>m(e),()=>p(e))}function p(f){let h=(0,Ye._)`${f}.errors`;o.assign(Dn.default.vErrors,(0,Ye._)`${Dn.default.vErrors} === null ? ${h} : ${Dn.default.vErrors}.concat(${h})`),o.assign(Dn.default.errors,(0,Ye._)`${Dn.default.vErrors}.length`)}function m(f){var h;if(!s.opts.unevaluated)return;let g=(h=r?.validate)===null||h===void 0?void 0:h.evaluated;if(s.props!==!0)if(g&&!g.dynamicProps)g.props!==void 0&&(s.props=ha.mergeEvaluated.props(o,g.props,s.props));else{let _=o.var("props",(0,Ye._)`${f}.evaluated.props`);s.props=ha.mergeEvaluated.props(o,_,s.props,Ye.Name)}if(s.items!==!0)if(g&&!g.dynamicItems)g.items!==void 0&&(s.items=ha.mergeEvaluated.items(o,g.items,s.items));else{let _=o.var("items",(0,Ye._)`${f}.evaluated.items`);s.items=ha.mergeEvaluated.items(o,_,s.items,Ye.Name)}}}Kr.callRef=ga;Kr.default=jD});var Gb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var MD=Ub(),ZD=Wb(),LD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",MD.default,ZD.default];dd.default=LD});var Jb=$(fd=>{"use strict";Object.defineProperty(fd,"__esModule",{value:!0});var ya=F(),hr=ya.operators,_a={maximum:{okStr:"<=",ok:hr.LTE,fail:hr.GT},minimum:{okStr:">=",ok:hr.GTE,fail:hr.LT},exclusiveMaximum:{okStr:"<",ok:hr.LT,fail:hr.GTE},exclusiveMinimum:{okStr:">",ok:hr.GT,fail:hr.LTE}},qD={message:({keyword:t,schemaCode:e})=>(0,ya.str)`must be ${_a[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,ya._)`{comparison: ${_a[t].okStr}, limit: ${e}}`},FD={keyword:Object.keys(_a),type:"number",schemaType:"number",$data:!0,error:qD,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ya._)`${r} ${_a[e].fail} ${n} || isNaN(${r})`)}};fd.default=FD});var Kb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ls=F(),UD={message:({schemaCode:t})=>(0,ls.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ls._)`{multipleOf: ${t}}`},VD={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:UD,code(t){let{gen:e,data:r,schemaCode:n,it:o}=t,s=o.opts.multipleOfPrecision,i=e.let("res"),a=s?(0,ls._)`Math.abs(Math.round(${i}) - ${i}) > 1e-${s}`:(0,ls._)`${i} !== parseInt(${i})`;t.fail$data((0,ls._)`(${n} === 0 || (${i} = ${r}/${n}, ${a}))`)}};pd.default=VD});var Qb=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});function Yb(t){let e=t.length,r=0,n=0,o;for(;n<e;)r++,o=t.charCodeAt(n++),o>=55296&&o<=56319&&n<e&&(o=t.charCodeAt(n),(o&64512)===56320&&n++);return r}md.default=Yb;Yb.code='require("ajv/dist/runtime/ucs2length").default'});var Xb=$(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var Yr=F(),BD=Q(),HD=Qb(),WD={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Yr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Yr._)`{limit: ${t}}`},GD={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:WD,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Yr.operators.GT:Yr.operators.LT,i=o.opts.unicode===!1?(0,Yr._)`${r}.length`:(0,Yr._)`${(0,BD.useFunc)(t.gen,HD.default)}(${r})`;t.fail$data((0,Yr._)`${i} ${s} ${n}`)}};hd.default=GD});var ew=$(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var JD=ft(),KD=Q(),Nn=F(),YD={message:({schemaCode:t})=>(0,Nn.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,Nn._)`{pattern: ${t}}`},QD={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:YD,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t,a=i.opts.unicodeRegExp?"u":"";if(n){let{regExp:c}=i.opts.code,u=c.code==="new RegExp"?(0,Nn._)`new RegExp`:(0,KD.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,Nn._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,Nn._)`!${l}`)}else{let c=(0,JD.usePattern)(t,o);t.fail$data((0,Nn._)`!${c}.test(${r})`)}}};gd.default=QD});var tw=$(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var ds=F(),XD={message({keyword:t,schemaCode:e}){let r=t==="maxProperties"?"more":"fewer";return(0,ds.str)`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>(0,ds._)`{limit: ${t}}`},eN={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:XD,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxProperties"?ds.operators.GT:ds.operators.LT;t.fail$data((0,ds._)`Object.keys(${r}).length ${o} ${n}`)}};yd.default=eN});var rw=$(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var fs=ft(),ps=F(),tN=Q(),rN={message:({params:{missingProperty:t}})=>(0,ps.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ps._)`{missingProperty: ${t}}`},nN={keyword:"required",type:"object",schemaType:"array",$data:!0,error:rN,code(t){let{gen:e,schema:r,schemaCode:n,data:o,$data:s,it:i}=t,{opts:a}=i;if(!s&&r.length===0)return;let c=r.length>=a.loopRequired;if(i.allErrors?u():l(),a.strictRequired){let m=t.parentSchema.properties,{definedProperties:f}=t.it;for(let h of r)if(m?.[h]===void 0&&!f.has(h)){let g=i.schemaEnv.baseId+i.errSchemaPath,_=`required property "${h}" is not defined at "${g}" (strictRequired)`;(0,tN.checkStrictMode)(i,_,i.opts.strictRequired)}}function u(){if(c||s)t.block$data(ps.nil,d);else for(let m of r)(0,fs.checkReportMissingProp)(t,m)}function l(){let m=e.let("missing");if(c||s){let f=e.let("valid",!0);t.block$data(f,()=>p(m,f)),t.ok(f)}else e.if((0,fs.checkMissingProp)(t,r,m)),(0,fs.reportMissingProp)(t,m),e.else()}function d(){e.forOf("prop",n,m=>{t.setParams({missingProperty:m}),e.if((0,fs.noPropertyInData)(e,o,m,a.ownProperties),()=>t.error())})}function p(m,f){t.setParams({missingProperty:m}),e.forOf(m,n,()=>{e.assign(f,(0,fs.propertyInData)(e,o,m,a.ownProperties)),e.if((0,ps.not)(f),()=>{t.error(),e.break()})},ps.nil)}}};_d.default=nN});var nw=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var ms=F(),oN={message({keyword:t,schemaCode:e}){let r=t==="maxItems"?"more":"fewer";return(0,ms.str)`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>(0,ms._)`{limit: ${t}}`},sN={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:oN,code(t){let{keyword:e,data:r,schemaCode:n}=t,o=e==="maxItems"?ms.operators.GT:ms.operators.LT;t.fail$data((0,ms._)`${r}.length ${o} ${n}`)}};vd.default=sN});var va=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var ow=Fl();ow.code='require("ajv/dist/runtime/equal").default';bd.default=ow});var sw=$(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var wd=es(),De=F(),iN=Q(),aN=va(),cN={message:({params:{i:t,j:e}})=>(0,De.str)`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>(0,De._)`{i: ${t}, j: ${e}}`},uN={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:cN,code(t){let{gen:e,data:r,$data:n,schema:o,parentSchema:s,schemaCode:i,it:a}=t;if(!n&&!o)return;let c=e.let("valid"),u=s.items?(0,wd.getSchemaTypes)(s.items):[];t.block$data(c,l,(0,De._)`${i} === false`),t.ok(c);function l(){let f=e.let("i",(0,De._)`${r}.length`),h=e.let("j");t.setParams({i:f,j:h}),e.assign(c,!0),e.if((0,De._)`${f} > 1`,()=>(d()?p:m)(f,h))}function d(){return u.length>0&&!u.some(f=>f==="object"||f==="array")}function p(f,h){let g=e.name("item"),_=(0,wd.checkDataTypes)(u,g,a.opts.strictNumbers,wd.DataType.Wrong),x=e.const("indices",(0,De._)`{}`);e.for((0,De._)`;${f}--;`,()=>{e.let(g,(0,De._)`${r}[${f}]`),e.if(_,(0,De._)`continue`),u.length>1&&e.if((0,De._)`typeof ${g} == "string"`,(0,De._)`${g} += "_"`),e.if((0,De._)`typeof ${x}[${g}] == "number"`,()=>{e.assign(h,(0,De._)`${x}[${g}]`),t.error(),e.assign(c,!1).break()}).code((0,De._)`${x}[${g}] = ${f}`)})}function m(f,h){let g=(0,iN.useFunc)(e,aN.default),_=e.name("outer");e.label(_).for((0,De._)`;${f}--;`,()=>e.for((0,De._)`${h} = ${f}; ${h}--;`,()=>e.if((0,De._)`${g}(${r}[${f}], ${r}[${h}])`,()=>{t.error(),e.assign(c,!1).break(_)})))}}};xd.default=uN});var iw=$($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var Sd=F(),lN=Q(),dN=va(),fN={message:"must be equal to constant",params:({schemaCode:t})=>(0,Sd._)`{allowedValue: ${t}}`},pN={keyword:"const",$data:!0,error:fN,code(t){let{gen:e,data:r,$data:n,schemaCode:o,schema:s}=t;n||s&&typeof s=="object"?t.fail$data((0,Sd._)`!${(0,lN.useFunc)(e,dN.default)}(${r}, ${o})`):t.fail((0,Sd._)`${s} !== ${r}`)}};$d.default=pN});var aw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var hs=F(),mN=Q(),hN=va(),gN={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,hs._)`{allowedValues: ${t}}`},yN={keyword:"enum",schemaType:"array",$data:!0,error:gN,code(t){let{gen:e,data:r,$data:n,schema:o,schemaCode:s,it:i}=t;if(!n&&o.length===0)throw new Error("enum must have non-empty array");let a=o.length>=i.opts.loopEnum,c,u=()=>c??(c=(0,mN.useFunc)(e,hN.default)),l;if(a||n)l=e.let("valid"),t.block$data(l,d);else{if(!Array.isArray(o))throw new Error("ajv implementation error");let m=e.const("vSchema",s);l=(0,hs.or)(...o.map((f,h)=>p(m,h)))}t.pass(l);function d(){e.assign(l,!1),e.forOf("v",s,m=>e.if((0,hs._)`${u()}(${r}, ${m})`,()=>e.assign(l,!0).break()))}function p(m,f){let h=o[f];return typeof h=="object"&&h!==null?(0,hs._)`${u()}(${r}, ${m}[${f}])`:(0,hs._)`${r} === ${h}`}}};kd.default=yN});var cw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var _N=Jb(),vN=Kb(),bN=Xb(),wN=ew(),xN=tw(),SN=rw(),$N=nw(),kN=sw(),EN=iw(),zN=aw(),PN=[_N.default,vN.default,bN.default,wN.default,xN.default,SN.default,$N.default,kN.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},EN.default,zN.default];Ed.default=PN});var Pd=$(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.validateAdditionalItems=void 0;var Qr=F(),zd=Q(),TN={message:({params:{len:t}})=>(0,Qr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Qr._)`{limit: ${t}}`},CN={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:TN,code(t){let{parentSchema:e,it:r}=t,{items:n}=e;if(!Array.isArray(n)){(0,zd.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}uw(t,n)}};function uw(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Qr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Qr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,zd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Qr._)`${a} <= ${e.length}`);r.if((0,Qr.not)(u),()=>c(u)),t.ok(u)}function c(u){r.forRange("i",e.length,a,l=>{t.subschema({keyword:s,dataProp:l,dataPropType:zd.Type.Num},u),i.allErrors||r.if((0,Qr.not)(u),()=>r.break())})}}gs.validateAdditionalItems=uw;gs.default=CN});var Td=$(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.validateTuple=void 0;var lw=F(),ba=Q(),ON=ft(),IN={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return dw(t,"additionalItems",e);r.items=!0,!(0,ba.alwaysValidSchema)(r,e)&&t.ok((0,ON.validateArray)(t))}};function dw(t,e,r=t.schema){let{gen:n,parentSchema:o,data:s,keyword:i,it:a}=t;l(o),a.opts.unevaluated&&r.length&&a.items!==!0&&(a.items=ba.mergeEvaluated.items(n,r.length,a.items));let c=n.name("valid"),u=n.const("len",(0,lw._)`${s}.length`);r.forEach((d,p)=>{(0,ba.alwaysValidSchema)(a,d)||(n.if((0,lw._)`${u} > ${p}`,()=>t.subschema({keyword:i,schemaProp:p,dataProp:p},c)),t.ok(c))});function l(d){let{opts:p,errSchemaPath:m}=a,f=r.length,h=f===d.minItems&&(f===d.maxItems||d[e]===!1);if(p.strictTuples&&!h){let g=`"${i}" is ${f}-tuple, but minItems or maxItems/${e} are not specified or different at path "${m}"`;(0,ba.checkStrictMode)(a,g,p.strictTuples)}}}ys.validateTuple=dw;ys.default=IN});var fw=$(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var RN=Td(),DN={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,RN.validateTuple)(t,"items")};Cd.default=DN});var mw=$(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var pw=F(),NN=Q(),AN=ft(),jN=Pd(),MN={message:({params:{len:t}})=>(0,pw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,pw._)`{limit: ${t}}`},ZN={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:MN,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,NN.alwaysValidSchema)(n,e)&&(o?(0,jN.validateAdditionalItems)(t,o):t.ok((0,AN.validateArray)(t)))}};Od.default=ZN});var hw=$(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var ht=F(),wa=Q(),LN={message:({params:{min:t,max:e}})=>e===void 0?(0,ht.str)`must contain at least ${t} valid item(s)`:(0,ht.str)`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>e===void 0?(0,ht._)`{minContains: ${t}}`:(0,ht._)`{minContains: ${t}, maxContains: ${e}}`},qN={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:LN,code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t,i,a,{minContains:c,maxContains:u}=n;s.opts.next?(i=c===void 0?1:c,a=u):i=1;let l=e.const("len",(0,ht._)`${o}.length`);if(t.setParams({min:i,max:a}),a===void 0&&i===0){(0,wa.checkStrictMode)(s,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(a!==void 0&&i>a){(0,wa.checkStrictMode)(s,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,wa.alwaysValidSchema)(s,r)){let h=(0,ht._)`${l} >= ${i}`;a!==void 0&&(h=(0,ht._)`${h} && ${l} <= ${a}`),t.pass(h);return}s.items=!0;let d=e.name("valid");a===void 0&&i===1?m(d,()=>e.if(d,()=>e.break())):i===0?(e.let(d,!0),a!==void 0&&e.if((0,ht._)`${o}.length > 0`,p)):(e.let(d,!1),p()),t.result(d,()=>t.reset());function p(){let h=e.name("_valid"),g=e.let("count",0);m(h,()=>e.if(h,()=>f(g)))}function m(h,g){e.forRange("i",0,l,_=>{t.subschema({keyword:"contains",dataProp:_,dataPropType:wa.Type.Num,compositeRule:!0},h),g()})}function f(h){e.code((0,ht._)`${h}++`),a===void 0?e.if((0,ht._)`${h} >= ${i}`,()=>e.assign(d,!0).break()):(e.if((0,ht._)`${h} > ${a}`,()=>e.assign(d,!1).break()),i===1?e.assign(d,!0):e.if((0,ht._)`${h} >= ${i}`,()=>e.assign(d,!0)))}}};Id.default=qN});var _w=$(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.validateSchemaDeps=Dt.validatePropertyDeps=Dt.error=void 0;var Rd=F(),FN=Q(),_s=ft();Dt.error={message:({params:{property:t,depsCount:e,deps:r}})=>{let n=e===1?"property":"properties";return(0,Rd.str)`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>(0,Rd._)`{property: ${t},
29
29
  missingProperty: ${n},
30
30
  depsCount: ${e},
31
- deps: ${r}}`};var AA={keyword:"dependencies",type:"object",schemaType:"object",error:It.error,code(t){let[e,r]=DA(t);fw(t,e),pw(t,r)}};function DA({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}function fw(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,gs.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,gs.checkReportMissingProp)(t,u)}):(r.if((0,Pd._)`${c} && (${(0,gs.checkMissingProp)(t,a,s)})`),(0,gs.reportMissingProp)(t,s),r.else())}}It.validatePropertyDeps=fw;function pw(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,NA.alwaysValidSchema)(s,e[a])||(r.if((0,gs.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}It.validateSchemaDeps=pw;It.default=AA});var gw=$(Td=>{"use strict";Object.defineProperty(Td,"__esModule",{value:!0});var hw=F(),jA=Q(),MA={message:"property name must be valid",params:({params:t})=>(0,hw._)`{propertyName: ${t.propertyName}}`},ZA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:MA,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,jA.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,hw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Td.default=ZA});var Od=$(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var ya=dt(),kt=F(),LA=Wt(),_a=Q(),qA={message:"must NOT have additional properties",params:({params:t})=>(0,kt._)`{additionalProperty: ${t.additionalProperty}}`},FA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:qA,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,_a.alwaysValidSchema)(i,r))return;let u=(0,ya.allSchemaProperties)(n.properties),l=(0,ya.allSchemaProperties)(n.patternProperties);d(),t.ok((0,kt._)`${s} === ${LA.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(m(g),()=>f(g))})}function m(g){let _;if(u.length>8){let x=(0,_a.schemaRefOrVal)(i,n.properties,"properties");_=(0,ya.isOwnProperty)(e,x,g)}else u.length?_=(0,kt.or)(...u.map(x=>(0,kt._)`${g} === ${x}`)):_=kt.nil;return l.length&&(_=(0,kt.or)(_,...l.map(x=>(0,kt._)`${(0,ya.usePattern)(t,x)}.test(${g})`))),(0,kt.not)(_)}function p(g){e.code((0,kt._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){p(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,_a.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,kt.not)(_),()=>{t.reset(),p(g)})):(h(g,_),a||e.if((0,kt.not)(_),()=>e.break()))}}function h(g,_,x){let w={keyword:"additionalProperties",dataProp:g,dataPropType:_a.Type.Str};x===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Cd.default=FA});var vw=$(Rd=>{"use strict";Object.defineProperty(Rd,"__esModule",{value:!0});var UA=rs(),yw=dt(),Id=Q(),_w=Od(),VA={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&_w.default.code(new UA.KeywordCxt(s,_w.default,"additionalProperties"));let i=(0,yw.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=Id.mergeEvaluated.props(e,(0,Id.toHash)(i),s.props));let a=i.filter(d=>!(0,Id.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,yw.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Rd.default=VA});var Sw=$(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var bw=dt(),va=F(),ww=Q(),xw=Q(),BA={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,a=(0,bw.allSchemaProperties)(r),c=a.filter(h=>(0,ww.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof va.Name)&&(s.props=(0,xw.evaluatedPropsToName)(e,s.props));let{props:d}=s;m();function m(){for(let h of a)u&&p(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function p(h){for(let g in u)new RegExp(h).test(g)&&(0,ww.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,va._)`${(0,bw.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:xw.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,va._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,va.not)(l),()=>e.break())})})}}};Nd.default=BA});var $w=$(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var HA=Q(),WA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,HA.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ad.default=WA});var kw=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var GA=dt(),JA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:GA.validateUnion,error:{message:"must match a schema in anyOf"}};Dd.default=JA});var Ew=$(jd=>{"use strict";Object.defineProperty(jd,"__esModule",{value:!0});var ba=F(),KA=Q(),YA={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ba._)`{passingSchemas: ${t.passing}}`},QA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:YA,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let m;(0,KA.alwaysValidSchema)(o,l)?e.var(c,!0):m=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ba._)`${c} && ${i}`).assign(i,!1).assign(a,(0,ba._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),m&&t.mergeEvaluated(m,ba.Name)})})}}};jd.default=QA});var zw=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var XA=Q(),eD={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,XA.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Md.default=eD});var Cw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var wa=F(),Tw=Q(),tD={message:({params:t})=>(0,wa.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,wa._)`{failingKeyword: ${t.ifClause}}`},rD={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:tD,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Tw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Pw(n,"then"),s=Pw(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else o?e.if(a,u("then")):e.if((0,wa.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let m=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(m,i),d?e.assign(d,(0,wa._)`${l}`):t.setParams({ifClause:l})}}}};function Pw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Tw.alwaysValidSchema)(t,r)}Zd.default=rD});var Ow=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var nD=Q(),oD={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,nD.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Ld.default=oD});var Iw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var sD=Sd(),iD=cw(),aD=$d(),cD=lw(),uD=dw(),lD=mw(),dD=gw(),fD=Od(),pD=vw(),mD=Sw(),hD=$w(),gD=kw(),yD=Ew(),_D=zw(),vD=Cw(),bD=Ow();function wD(t=!1){let e=[hD.default,gD.default,yD.default,_D.default,vD.default,bD.default,dD.default,fD.default,lD.default,pD.default,mD.default];return t?e.push(iD.default,cD.default):e.push(sD.default,aD.default),e.push(uD.default),e}qd.default=wD});var Rw=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var $e=F(),xD={message:({schemaCode:t})=>(0,$e.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$e._)`{format: ${t}}`},SD={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:xD,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?m():p();function m(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,$e._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,$e._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,$e._)`${h}.type || "string"`).assign(_,(0,$e._)`${h}.validate`),()=>r.assign(g,(0,$e._)`"string"`).assign(_,h)),t.fail$data((0,$e.or)(x(),w()));function x(){return c.strictSchema===!1?$e.nil:(0,$e._)`${i} && !${_}`}function w(){let S=l.$async?(0,$e._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,$e._)`${_}(${n})`,k=(0,$e._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,$e._)`${_} && ${_} !== true && ${g} === ${e} && !${k}`}}function p(){let f=d.formats[s];if(!f){x();return}if(f===!0)return;let[h,g,_]=w(f);h===e&&t.pass(S());function x(){if(c.strictSchema===!1){d.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function w(k){let W=k instanceof RegExp?(0,$e.regexpCode)(k):c.code.formats?(0,$e._)`${c.code.formats}${(0,$e.getProperty)(s)}`:void 0,Z=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,$e._)`${Z}.validate`]:["string",k,Z]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,$e._)`await ${_}(${n})`}return typeof g=="function"?(0,$e._)`${_}(${n})`:(0,$e._)`${_}.test(${n})`}}}};Fd.default=SD});var Nw=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var $D=Rw(),kD=[$D.default];Ud.default=kD});var Aw=$(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.contentVocabulary=Nn.metadataVocabulary=void 0;Nn.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Nn.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var jw=$(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var ED=Vb(),zD=ow(),PD=Iw(),TD=Nw(),Dw=Aw(),CD=[ED.default,zD.default,(0,PD.default)(),TD.default,Dw.metadataVocabulary,Dw.contentVocabulary];Vd.default=CD});var Zw=$(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.DiscrError=void 0;var Mw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Mw||(xa.DiscrError=Mw={}))});var qw=$(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var An=F(),Bd=Zw(),Lw=sa(),OD=ns(),ID=Q(),RD={message:({params:{discrError:t,tagName:e}})=>t===Bd.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,An._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},ND={keyword:"discriminator",type:"object",schemaType:"object",error:RD,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,An._)`${r}${(0,An.getProperty)(a)}`);e.if((0,An._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Bd.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let p=m();e.if(!1);for(let f in p)e.elseIf((0,An._)`${u} === ${f}`),e.assign(c,d(p[f]));e.else(),t.error(!1,{discrError:Bd.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(p){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:p},f);return t.mergeEvaluated(h,An.Name),f}function m(){var p;let f={},h=_(o),g=!0;for(let S=0;S<i.length;S++){let k=i[S];if(k?.$ref&&!(0,ID.schemaHasRulesButRef)(k,s.self.RULES)){let Z=k.$ref;if(k=Lw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Z),k instanceof Lw.SchemaEnv&&(k=k.schema),k===void 0)throw new OD.default(s.opts.uriResolver,s.baseId,Z)}let W=(p=k?.properties)===null||p===void 0?void 0:p[a];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||_(k)),x(W,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function _({required:S}){return Array.isArray(S)&&S.includes(a)}function x(S,k){if(S.const)w(S.const,k);else if(S.enum)for(let W of S.enum)w(W,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(S,k){if(typeof S!="string"||S in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[S]=k}}}};Hd.default=ND});var Fw=$((dU,AD)=>{AD.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Gd=$((pe,Wd)=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.MissingRefError=pe.ValidationError=pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=pe.Ajv=void 0;var DD=Mb(),jD=jw(),MD=qw(),Uw=Fw(),ZD=["/properties"],Sa="http://json-schema.org/draft-07/schema",Dn=class extends DD.default{_addVocabularies(){super._addVocabularies(),jD.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(MD.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Uw,ZD):Uw;this.addMetaSchema(e,Sa,!1),this.refs["http://json-schema.org/schema"]=Sa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Sa)?Sa:void 0)}};pe.Ajv=Dn;Wd.exports=pe=Dn;Wd.exports.Ajv=Dn;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=Dn;var LD=rs();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return LD.KeywordCxt}});var jn=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return jn._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return jn.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return jn.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return jn.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return jn.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return jn.CodeGen}});var qD=na();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return qD.default}});var FD=ns();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return FD.default}})});var Yw=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function Rt(t,e){return{validate:t,compare:e}}Nt.fullFormats={date:Rt(Ww,Qd),time:Rt(Kd(!0),Xd),"date-time":Rt(Vw(!0),Jw),"iso-time":Rt(Kd(),Gw),"iso-date-time":Rt(Vw(),Kw),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:GD,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:tj,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:JD,int32:{type:"number",validate:QD},int64:{type:"number",validate:XD},float:{type:"number",validate:Hw},double:{type:"number",validate:Hw},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,Qd),time:Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xd),"date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Jw),"iso-time":Rt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Gw),"iso-date-time":Rt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Kw),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};Nt.formatNames=Object.keys(Nt.fullFormats);function UD(t){return t%4===0&&(t%100!==0||t%400===0)}var VD=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,BD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Ww(t){let e=VD.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&UD(r)?29:BD[n])}function Qd(t,e){if(t&&e)return t>e?1:t<e?-1:0}var Jd=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function Kd(t){return function(r){let n=Jd.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-l*c,m=o-u*c-(d<0?1:0);return(m===23||m===-1)&&(d===59||d===-1)&&i<61}}function Xd(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Gw(t,e){if(!(t&&e))return;let r=Jd.exec(t),n=Jd.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var Yd=/t|\s/i;function Vw(t){let e=Kd(t);return function(n){let o=n.split(Yd);return o.length===2&&Ww(o[0])&&e(o[1])}}function Jw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function Kw(t,e){if(!(t&&e))return;let[r,n]=t.split(Yd),[o,s]=e.split(Yd),i=Qd(r,o);if(i!==void 0)return i||Xd(n,s)}var HD=/\/|:/,WD=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function GD(t){return HD.test(t)&&WD.test(t)}var Bw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function JD(t){return Bw.lastIndex=0,Bw.test(t)}var KD=-(2**31),YD=2**31-1;function QD(t){return Number.isInteger(t)&&t<=YD&&t>=KD}function XD(t){return Number.isInteger(t)}function Hw(){return!0}var ej=/[^\\]\\Z/;function tj(t){if(ej.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var Qw=$(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.formatLimitDefinition=void 0;var rj=Gd(),Et=F(),hr=Et.operators,$a={formatMaximum:{okStr:"<=",ok:hr.LTE,fail:hr.GT},formatMinimum:{okStr:">=",ok:hr.GTE,fail:hr.LT},formatExclusiveMaximum:{okStr:"<",ok:hr.LT,fail:hr.GTE},formatExclusiveMinimum:{okStr:">",ok:hr.GT,fail:hr.LTE}},nj={message:({keyword:t,schemaCode:e})=>(0,Et.str)`should be ${$a[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Et._)`{comparison: ${$a[t].okStr}, limit: ${e}}`};Mn.formatLimitDefinition={keyword:Object.keys($a),type:"string",schemaType:"string",$data:!0,error:nj,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new rj.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let m=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),p=e.const("fmt",(0,Et._)`${m}[${c.schemaCode}]`);t.fail$data((0,Et.or)((0,Et._)`typeof ${p} != "object"`,(0,Et._)`${p} instanceof RegExp`,(0,Et._)`typeof ${p}.compare != "function"`,d(p)))}function l(){let m=c.schema,p=a.formats[m];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${o}": format "${m}" does not define "compare" function`);let f=e.scopeValue("formats",{key:m,ref:p,code:i.code.formats?(0,Et._)`${i.code.formats}${(0,Et.getProperty)(m)}`:void 0});t.fail$data(d(f))}function d(m){return(0,Et._)`${m}.compare(${r}, ${n}) ${$a[o].fail} 0`}},dependencies:["format"]};var oj=t=>(t.addKeyword(Mn.formatLimitDefinition),t);Mn.default=oj});var rx=$((ys,tx)=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});var Zn=Yw(),sj=Qw(),ef=F(),Xw=new ef.Name("fullFormats"),ij=new ef.Name("fastFormats"),tf=(t,e={keywords:!0})=>{if(Array.isArray(e))return ex(t,e,Zn.fullFormats,Xw),t;let[r,n]=e.mode==="fast"?[Zn.fastFormats,ij]:[Zn.fullFormats,Xw],o=e.formats||Zn.formatNames;return ex(t,o,r,n),e.keywords&&(0,sj.default)(t),t};tf.get=(t,e="full")=>{let n=(e==="fast"?Zn.fastFormats:Zn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function ex(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,ef._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}tx.exports=ys=tf;Object.defineProperty(ys,"__esModule",{value:!0});ys.default=tf});var te;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,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"&&isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(te||(te={}));var ja;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(ja||(ja={}));var z=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Jt=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},E=te.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"]),_x=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_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)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Qe.create=t=>new Qe(t);var Xn=(t,e)=>{let r;switch(t.code){case E.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(t.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(t.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(t.options)}, received '${t.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case E.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case E.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=e.defaultError,te.assertNever(t)}return{message:r}},uf=Xn;function vx(t){uf=t}function xs(){return uf}var Ss=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:o.message||a}},bx=[];function T(t,e){let r=Ss({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,xs(),Xn].filter(n=>!!n)});t.common.issues.push(r)}var Ae=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return D;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r)n.push({key:await o.key,value:await o.value});return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return D;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}},D=Object.freeze({status:"aborted"}),lf=t=>({status:"dirty",value:t}),Le=t=>({status:"valid",value:t}),Ma=t=>t.status==="aborted",Za=t=>t.status==="dirty",eo=t=>t.status==="valid",$s=t=>typeof Promise<"u"&&t instanceof Promise,I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));var ot=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},af=(t,e)=>{if(eo(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 r=new Qe(t.common.issues);return this._error=r,this._error}}};function j(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))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)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:o}}var M=class{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)}get description(){return this._def.description}_getType(e){return Jt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ae,ctx:{common:e.parent.common,data:e.data,parsedType:Jt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if($s(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let o={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return af(o,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Jt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await($s(o)?o:Promise.resolve(o));return af(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Xe({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ht.create(this,this._def)}nullable(){return jt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Dt.create(this,this._def)}promise(){return Qt.create(this,this._def)}or(e){return $r.create([this,e],this._def)}and(e){return kr.create(this,e,this._def)}transform(e){return new Xe({...j(this._def),schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Cr({...j(this._def),innerType:this,defaultValue:r,typeName:N.ZodDefault})}brand(){return new Ps({typeName:N.ZodBranded,type:this,...j(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new rn({...j(this._def),innerType:this,catchValue:r,typeName:N.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return to.create(this,e)}readonly(){return on.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},wx=/^c[^\s-]{8,}$/i,xx=/^[a-z][a-z0-9]*$/,Sx=/^[0-9A-HJKMNP-TV-Z]{26}$/,$x=/^[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,kx=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Da,zx=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Px=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Tx=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Cx(t,e){return!!((e==="v4"||!e)&&zx.test(t)||(e==="v6"||!e)&&Px.test(t))}var Kt=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.string,received:s.parsedType}),D}let n=new Ae,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.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?T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")kx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"email",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Da||(Da=new RegExp(Ex,"u")),Da.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"emoji",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")$x.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"uuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")wx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")xx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid2",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")Sx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ulid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),T(o,{validation:"url",code:E.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"regex",code:E.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.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),T(o,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Tx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Cx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ip",code:E.invalid_string,message:s.message}),n.dirty()):te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:E.invalid_string,...I.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...I.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.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 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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Kt.create=t=>{var e;return new Kt({checks:[],typeName:N.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Ox(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}var _r=class t extends M{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)!==z.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.number,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="int"?te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.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)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Ox(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_finite,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};_r.create=t=>new _r({checks:[],typeName:N.ZodNumber,coerce:t?.coerce||!1,...j(t)});var vr=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==z.bigint){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.bigint,received:s.parsedType}),D}let n,o=new Ae;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.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)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.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:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};vr.create=t=>{var e;return new vr({checks:[],typeName:N.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};var br=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.boolean,received:n.parsedType}),D}return Le(e.data)}};br.create=t=>new br({typeName:N.ZodBoolean,coerce:t?.coerce||!1,...j(t)});var wr=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.date,received:s.parsedType}),D}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),D}let n=new Ae,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};wr.create=t=>new wr({checks:[],coerce:t?.coerce||!1,typeName:N.ZodDate,...j(t)});var Qr=class extends M{_parse(e){if(this._getType(e)!==z.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.symbol,received:n.parsedType}),D}return Le(e.data)}};Qr.create=t=>new Qr({typeName:N.ZodSymbol,...j(t)});var xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.undefined,received:n.parsedType}),D}return Le(e.data)}};xr.create=t=>new xr({typeName:N.ZodUndefined,...j(t)});var Sr=class extends M{_parse(e){if(this._getType(e)!==z.null){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.null,received:n.parsedType}),D}return Le(e.data)}};Sr.create=t=>new Sr({typeName:N.ZodNull,...j(t)});var Yt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Le(e.data)}};Yt.create=t=>new Yt({typeName:N.ZodAny,...j(t)});var At=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Le(e.data)}};At.create=t=>new At({typeName:N.ZodUnknown,...j(t)});var gt=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:z.never,received:r.parsedType}),D}};gt.create=t=>new gt({typeName:N.ZodNever,...j(t)});var Xr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.void,received:n.parsedType}),D}return Le(e.data)}};Xr.create=t=>new Xr({typeName:N.ZodVoid,...j(t)});var Dt=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==z.array)return T(r,{code:E.invalid_type,expected:z.array,received:r.parsedType}),D;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(T(r,{code:i?E.too_big:E.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}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(T(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(T(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new ot(r,i,r.path,a)))).then(i=>Ae.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new ot(r,i,r.path,a)));return Ae.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}};Dt.create=(t,e)=>new Dt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray,...j(e)});function Yr(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=ht.create(Yr(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Dt?new Dt({...t._def,type:Yr(t.element)}):t instanceof ht?ht.create(Yr(t.unwrap())):t instanceof jt?jt.create(Yr(t.unwrap())):t instanceof zt?zt.create(t.items.map(e=>Yr(e))):t}var He=class t extends M{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(),r=te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==z.object){let u=this._getOrReturnCtx(e);return T(u,{code:E.invalid_type,expected:z.object,received:u.parsedType}),D}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof gt&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new ot(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof gt){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(T(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new ot(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key;u.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return u}).then(u=>Ae.mergeObjectSync(n,u)):Ae.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,s,i,a;let c=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=I.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}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:N.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Yr(this)}partial(e){let r={};return te.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof ht;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return df(te.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:gt.create(),typeName:N.ZodObject,...j(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:gt.create(),typeName:N.ZodObject,...j(e)});var $r=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=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 r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Qe(a.ctx.common.issues));return T(r,{code:E.invalid_union,unionErrors:i}),D}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Qe(c));return T(r,{code:E.invalid_union,unionErrors:a}),D}}get options(){return this._def.options}};$r.create=(t,e)=>new $r({options:t,typeName:N.ZodUnion,...j(e)});var ws=t=>t instanceof Er?ws(t.schema):t instanceof Xe?ws(t.innerType()):t instanceof zr?[t.value]:t instanceof Pr?t.options:t instanceof Tr?Object.keys(t.enum):t instanceof Cr?ws(t._def.innerType):t instanceof xr?[void 0]:t instanceof Sr?[null]:null,ks=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return T(r,{code:E.invalid_type,expected:z.object,received:r.parsedType}),D;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(T(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),D)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=ws(s.shape[e]);if(!i)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:N.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...j(n)})}};function La(t,e){let r=Jt(t),n=Jt(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.object){let o=te.objectKeys(e),s=te.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=La(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===z.array&&n===z.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=La(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var kr=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Ma(s)||Ma(i))return D;let a=La(s.value,i.value);return a.valid?((Za(s)||Za(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:E.invalid_intersection_types}),D)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kr.create=(t,e,r)=>new kr({left:t,right:e,typeName:N.ZodIntersection,...j(r)});var zt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return T(n,{code:E.invalid_type,expected:z.array,received:n.parsedType}),D;if(n.data.length<this._def.items.length)return T(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new ot(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Ae.mergeArray(r,i)):Ae.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};zt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new zt({items:t,typeName:N.ZodTuple,rest:null,...j(e)})};var Es=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return T(n,{code:E.invalid_type,expected:z.object,received:n.parsedType}),D;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new ot(n,a,n.path,a)),value:i._parse(new ot(n,n.data[a],n.path,a))});return n.common.async?Ae.mergeObjectAsync(r,o):Ae.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:N.ZodRecord,...j(n)}):new t({keyType:Kt.create(),valueType:e,typeName:N.ZodRecord,...j(r)})}},en=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.map)return T(n,{code:E.invalid_type,expected:z.map,received:n.parsedType}),D;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new ot(n,a,n.path,[u,"key"])),value:s._parse(new ot(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return D;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};en.create=(t,e,r)=>new en({valueType:e,keyType:t,typeName:N.ZodMap,...j(r)});var tn=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return T(n,{code:E.invalid_type,expected:z.set,received:n.parsedType}),D;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(T(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(T(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return D;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new ot(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};tn.create=(t,e)=>new tn({valueType:t,minSize:null,maxSize:null,typeName:N.ZodSet,...j(e)});var zs=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.function)return T(r,{code:E.invalid_type,expected:z.function,received:r.parsedType}),D;function n(a,c){return Ss({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xs(),Xn].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return Ss({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,xs(),Xn].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Qt){let a=this;return Le(async function(...c){let u=new Qe([]),l=await a._def.args.parseAsync(c,s).catch(p=>{throw u.addIssue(n(c,p)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(p=>{throw u.addIssue(o(d,p)),u})})}else{let a=this;return Le(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Qe([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Qe([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:zt.create(e).rest(At.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,r,n){return new t({args:e||zt.create([]).rest(At.create()),returns:r||At.create(),typeName:N.ZodFunction,...j(n)})}},Er=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Er.create=(t,e)=>new Er({getter:t,typeName:N.ZodLazy,...j(e)});var zr=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:e.data}}get value(){return this._def.value}};zr.create=(t,e)=>new zr({value:t,typeName:N.ZodLiteral,...j(e)});function df(t,e){return new Pr({values:t,typeName:N.ZodEnum,...j(e)})}var Pr=class t extends M{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),D}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),D}return Le(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Pr.create=df;var Tr=class extends M{_parse(e){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){let o=te.objectValues(r);return T(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),D}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),D}return Le(e.data)}get enum(){return this._def.values}};Tr.create=(t,e)=>new Tr({values:t,typeName:N.ZodNativeEnum,...j(e)});var Qt=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return T(r,{code:E.invalid_type,expected:z.promise,received:r.parsedType}),D;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Le(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Qt.create=(t,e)=>new Qt({type:t,typeName:N.ZodPromise,...j(e)});var Xe=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{T(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.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(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?D:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!eo(i))return i;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:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>eo(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):i);te.assertNever(o)}};Xe.create=(t,e,r)=>new Xe({schema:t,typeName:N.ZodEffects,effect:e,...j(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:N.ZodEffects,...j(r)});var ht=class extends M{_parse(e){return this._getType(e)===z.undefined?Le(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ht.create=(t,e)=>new ht({innerType:t,typeName:N.ZodOptional,...j(e)});var jt=class extends M{_parse(e){return this._getType(e)===z.null?Le(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jt.create=(t,e)=>new jt({innerType:t,typeName:N.ZodNullable,...j(e)});var Cr=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Cr.create=(t,e)=>new Cr({innerType:t,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var rn=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return $s(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rn.create=(t,e)=>new rn({innerType:t,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var nn=class extends M{_parse(e){if(this._getType(e)!==z.nan){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.nan,received:n.parsedType}),D}return{status:"valid",value:e.data}}};nn.create=t=>new nn({typeName:N.ZodNaN,...j(t)});var Ix=Symbol("zod_brand"),Ps=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},to=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?D:s.status==="dirty"?(r.dirty(),lf(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?D:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:N.ZodPipeline})}},on=class extends M{_parse(e){let r=this._def.innerType._parse(e);return eo(r)&&(r.value=Object.freeze(r.value)),r}};on.create=(t,e)=>new on({innerType:t,typeName:N.ZodReadonly,...j(e)});var ff=(t,e={},r)=>t?Yt.create().superRefine((n,o)=>{var s,i;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:c})}}):Yt.create(),Rx={object:He.lazycreate},N;(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"})(N||(N={}));var Nx=(t,e={message:`Input not instance of ${t.name}`})=>ff(r=>r instanceof t,e),pf=Kt.create,mf=_r.create,Ax=nn.create,Dx=vr.create,hf=br.create,jx=wr.create,Mx=Qr.create,Zx=xr.create,Lx=Sr.create,qx=Yt.create,Fx=At.create,Ux=gt.create,Vx=Xr.create,Bx=Dt.create,Hx=He.create,Wx=He.strictCreate,Gx=$r.create,Jx=ks.create,Kx=kr.create,Yx=zt.create,Qx=Es.create,Xx=en.create,e0=tn.create,t0=zs.create,r0=Er.create,n0=zr.create,o0=Pr.create,s0=Tr.create,i0=Qt.create,cf=Xe.create,a0=ht.create,c0=jt.create,u0=Xe.createWithPreprocess,l0=to.create,d0=()=>pf().optional(),f0=()=>mf().optional(),p0=()=>hf().optional(),m0={string:(t=>Kt.create({...t,coerce:!0})),number:(t=>_r.create({...t,coerce:!0})),boolean:(t=>br.create({...t,coerce:!0})),bigint:(t=>vr.create({...t,coerce:!0})),date:(t=>wr.create({...t,coerce:!0}))},h0=D,ke=Object.freeze({__proto__:null,defaultErrorMap:Xn,setErrorMap:vx,getErrorMap:xs,makeIssue:Ss,EMPTY_PATH:bx,addIssueToContext:T,ParseStatus:Ae,INVALID:D,DIRTY:lf,OK:Le,isAborted:Ma,isDirty:Za,isValid:eo,isAsync:$s,get util(){return te},get objectUtil(){return ja},ZodParsedType:z,getParsedType:Jt,ZodType:M,ZodString:Kt,ZodNumber:_r,ZodBigInt:vr,ZodBoolean:br,ZodDate:wr,ZodSymbol:Qr,ZodUndefined:xr,ZodNull:Sr,ZodAny:Yt,ZodUnknown:At,ZodNever:gt,ZodVoid:Xr,ZodArray:Dt,ZodObject:He,ZodUnion:$r,ZodDiscriminatedUnion:ks,ZodIntersection:kr,ZodTuple:zt,ZodRecord:Es,ZodMap:en,ZodSet:tn,ZodFunction:zs,ZodLazy:Er,ZodLiteral:zr,ZodEnum:Pr,ZodNativeEnum:Tr,ZodPromise:Qt,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:ht,ZodNullable:jt,ZodDefault:Cr,ZodCatch:rn,ZodNaN:nn,BRAND:Ix,ZodBranded:Ps,ZodPipeline:to,ZodReadonly:on,custom:ff,Schema:M,ZodSchema:M,late:Rx,get ZodFirstPartyTypeKind(){return N},coerce:m0,any:qx,array:Bx,bigint:Dx,boolean:hf,date:jx,discriminatedUnion:Jx,effect:cf,enum:o0,function:t0,instanceof:Nx,intersection:Kx,lazy:r0,literal:n0,map:Xx,nan:Ax,nativeEnum:s0,never:Ux,null:Lx,nullable:c0,number:mf,object:Hx,oboolean:p0,onumber:f0,optional:a0,ostring:d0,pipeline:l0,preprocess:u0,promise:i0,record:Qx,set:e0,strictObject:Wx,string:pf,symbol:Mx,transformer:cf,tuple:Yx,undefined:Zx,union:Gx,unknown:Fx,void:Vx,NEVER:h0,ZodIssueCode:E,quotelessJson:_x,ZodError:Qe});var Xt=class{static detect(e){let r=e.trim();return this.isRemoteUrl(r)?{type:new URL(r).protocol==="https:"?"https_url":"http_url",originalPath:e,normalizedPath:r}:{type:"local",originalPath:e,normalizedPath:r}}static isValidUrl(e){try{return new URL(e.trim()).protocol.length>0}catch{return!1}}static isRemoteUrl(e){try{let r=e.trim();if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;let n=new URL(r);return!(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname||n.hostname.length===0)}catch{return!1}}};var g0=ke.object({name:ke.string().default("eui-compodoc-mcp"),version:ke.string().default("1.0.0")}),y0=ke.object({path:ke.string().refine(t=>!t||t==="__bundled__"?!0:t.trim().length>0,{message:"Documentation path cannot be only whitespace"}).refine(t=>{if(!t||t==="__bundled__")return!0;let e=t.trim();return e.startsWith("http://")||e.startsWith("https://")?Xt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:ke.boolean().default(!0),reloadDebounce:ke.number().min(0).default(1e3),timeout:ke.number().min(1e3).default(1e4),maxRetries:ke.number().min(0).max(10).default(3),pollingInterval:ke.number().min(5e3).default(6e4)}).default({}),_0=ke.object({maxResults:ke.number().min(1).max(1e3).default(50),minQueryLength:ke.number().min(1).default(2)}),v0=ke.object({level:ke.enum(["debug","info","warn","error"]).default("info"),format:ke.enum(["json","text"]).default("text")}),b0=ke.object({path:ke.string().optional()}).default({}),gf=ke.object({server:g0.default({}),documentation:y0,search:_0.default({}),logging:v0.default({}),accessibility:b0.default({})}),Ts={server:{name:"eui-compodoc-mcp",version:"1.0.0"},documentation:{path:"__bundled__",watchForChanges:!0,reloadDebounce:1e3,timeout:1e4,maxRetries:3,pollingInterval:6e4},search:{maxResults:50,minQueryLength:2},logging:{level:"info",format:"text"}};function qa(t){return gf.safeParse(t)}var sn=mt(require("fs")),ro=mt(require("path"));function w0(){let t=ro.join(__dirname,"documentation.json.gz");if(sn.existsSync(t))return t;let e=ro.join(__dirname,"documentation.json");return sn.existsSync(e)?e:Ts.documentation.path}function yf(){let t={};return process.env.COMPODOC_MCP_DOC_PATH&&(t.documentation={path:process.env.COMPODOC_MCP_DOC_PATH}),process.env.COMPODOC_MCP_LOG_LEVEL&&(t.logging={level:process.env.COMPODOC_MCP_LOG_LEVEL}),process.env.COMPODOC_MCP_WATCH!==void 0&&(t.documentation||(t.documentation={path:""}),t.documentation.watchForChanges=process.env.COMPODOC_MCP_WATCH==="true"),process.env.COMPODOC_MCP_A11Y_PATH&&(t.accessibility={path:process.env.COMPODOC_MCP_A11Y_PATH}),t}function _f(t){let e={};for(let r=0;r<t.length;r++)switch(t[r]){case"--doc-path":case"--documentation-path":e.documentation||(e.documentation={path:""}),e.documentation.path=t[++r];break;case"--watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!0;break;case"--no-watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!1;break;case"--log-level":e.logging={level:t[++r]};break;case"--max-results":e.search={maxResults:parseInt(t[++r],10)};break;case"--a11y-path":e.accessibility||(e.accessibility={}),e.accessibility.path=t[++r];break;case"--help":case"-h":S0(),process.exit(0);break}return e}function vf(t){try{if(!sn.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
- `),{};let e=sn.readFileSync(t,"utf-8"),r=ro.extname(t).toLowerCase();return r===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${r}
31
+ deps: ${r}}`};var UN={keyword:"dependencies",type:"object",schemaType:"object",error:Dt.error,code(t){let[e,r]=VN(t);gw(t,e),yw(t,r)}};function VN({schema:t}){let e={},r={};for(let n in t){if(n==="__proto__")continue;let o=Array.isArray(t[n])?e:r;o[n]=t[n]}return[e,r]}function gw(t,e=t.schema){let{gen:r,data:n,it:o}=t;if(Object.keys(e).length===0)return;let s=r.let("missing");for(let i in e){let a=e[i];if(a.length===0)continue;let c=(0,_s.propertyInData)(r,n,i,o.opts.ownProperties);t.setParams({property:i,depsCount:a.length,deps:a.join(", ")}),o.allErrors?r.if(c,()=>{for(let u of a)(0,_s.checkReportMissingProp)(t,u)}):(r.if((0,Rd._)`${c} && (${(0,_s.checkMissingProp)(t,a,s)})`),(0,_s.reportMissingProp)(t,s),r.else())}}Dt.validatePropertyDeps=gw;function yw(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,FN.alwaysValidSchema)(s,e[a])||(r.if((0,_s.propertyInData)(r,n,a,s.opts.ownProperties),()=>{let c=t.subschema({keyword:o,schemaProp:a},i);t.mergeValidEvaluated(c,i)},()=>r.var(i,!0)),t.ok(i))}Dt.validateSchemaDeps=yw;Dt.default=UN});var bw=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var vw=F(),BN=Q(),HN={message:"property name must be valid",params:({params:t})=>(0,vw._)`{propertyName: ${t.propertyName}}`},WN={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:HN,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,BN.alwaysValidSchema)(o,r))return;let s=e.name("valid");e.forIn("key",n,i=>{t.setParams({propertyName:i}),t.subschema({keyword:"propertyNames",data:i,dataTypes:["string"],propertyName:i,compositeRule:!0},s),e.if((0,vw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Dd.default=WN});var Ad=$(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0});var xa=ft(),zt=F(),GN=Gt(),Sa=Q(),JN={message:"must NOT have additional properties",params:({params:t})=>(0,zt._)`{additionalProperty: ${t.additionalProperty}}`},KN={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:JN,code(t){let{gen:e,schema:r,parentSchema:n,data:o,errsCount:s,it:i}=t;if(!s)throw new Error("ajv implementation error");let{allErrors:a,opts:c}=i;if(i.props=!0,c.removeAdditional!=="all"&&(0,Sa.alwaysValidSchema)(i,r))return;let u=(0,xa.allSchemaProperties)(n.properties),l=(0,xa.allSchemaProperties)(n.patternProperties);d(),t.ok((0,zt._)`${s} === ${GN.default.errors}`);function d(){e.forIn("key",o,g=>{!u.length&&!l.length?f(g):e.if(p(g),()=>f(g))})}function p(g){let _;if(u.length>8){let x=(0,Sa.schemaRefOrVal)(i,n.properties,"properties");_=(0,xa.isOwnProperty)(e,x,g)}else u.length?_=(0,zt.or)(...u.map(x=>(0,zt._)`${g} === ${x}`)):_=zt.nil;return l.length&&(_=(0,zt.or)(_,...l.map(x=>(0,zt._)`${(0,xa.usePattern)(t,x)}.test(${g})`))),(0,zt.not)(_)}function m(g){e.code((0,zt._)`delete ${o}[${g}]`)}function f(g){if(c.removeAdditional==="all"||c.removeAdditional&&r===!1){m(g);return}if(r===!1){t.setParams({additionalProperty:g}),t.error(),a||e.break();return}if(typeof r=="object"&&!(0,Sa.alwaysValidSchema)(i,r)){let _=e.name("valid");c.removeAdditional==="failing"?(h(g,_,!1),e.if((0,zt.not)(_),()=>{t.reset(),m(g)})):(h(g,_),a||e.if((0,zt.not)(_),()=>e.break()))}}function h(g,_,x){let w={keyword:"additionalProperties",dataProp:g,dataPropType:Sa.Type.Str};x===!1&&Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(w,_)}}};Nd.default=KN});var Sw=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var YN=os(),ww=ft(),jd=Q(),xw=Ad(),QN={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,parentSchema:n,data:o,it:s}=t;s.opts.removeAdditional==="all"&&n.additionalProperties===void 0&&xw.default.code(new YN.KeywordCxt(s,xw.default,"additionalProperties"));let i=(0,ww.allSchemaProperties)(r);for(let d of i)s.definedProperties.add(d);s.opts.unevaluated&&i.length&&s.props!==!0&&(s.props=jd.mergeEvaluated.props(e,(0,jd.toHash)(i),s.props));let a=i.filter(d=>!(0,jd.alwaysValidSchema)(s,r[d]));if(a.length===0)return;let c=e.name("valid");for(let d of a)u(d)?l(d):(e.if((0,ww.propertyInData)(e,o,d,s.opts.ownProperties)),l(d),s.allErrors||e.else().var(c,!0),e.endIf()),t.it.definedProperties.add(d),t.ok(c);function u(d){return s.opts.useDefaults&&!s.compositeRule&&r[d].default!==void 0}function l(d){t.subschema({keyword:"properties",schemaProp:d,dataProp:d},c)}}};Md.default=QN});var zw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var $w=ft(),$a=F(),kw=Q(),Ew=Q(),XN={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:e,schema:r,data:n,parentSchema:o,it:s}=t,{opts:i}=s,a=(0,$w.allSchemaProperties)(r),c=a.filter(h=>(0,kw.alwaysValidSchema)(s,r[h]));if(a.length===0||c.length===a.length&&(!s.opts.unevaluated||s.props===!0))return;let u=i.strictSchema&&!i.allowMatchingProperties&&o.properties,l=e.name("valid");s.props!==!0&&!(s.props instanceof $a.Name)&&(s.props=(0,Ew.evaluatedPropsToName)(e,s.props));let{props:d}=s;p();function p(){for(let h of a)u&&m(h),s.allErrors?f(h):(e.var(l,!0),f(h),e.if(l))}function m(h){for(let g in u)new RegExp(h).test(g)&&(0,kw.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,$a._)`${(0,$w.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:Ew.Type.Str},l),s.opts.unevaluated&&d!==!0?e.assign((0,$a._)`${d}[${g}]`,!0):!_&&!s.allErrors&&e.if((0,$a.not)(l),()=>e.break())})})}}};Zd.default=XN});var Pw=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var eA=Q(),tA={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,eA.alwaysValidSchema)(n,r)){t.fail();return}let o=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),t.failResult(o,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Ld.default=tA});var Tw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var rA=ft(),nA={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:rA.validateUnion,error:{message:"must match a schema in anyOf"}};qd.default=nA});var Cw=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ka=F(),oA=Q(),sA={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ka._)`{passingSchemas: ${t.passing}}`},iA={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:sA,code(t){let{gen:e,schema:r,parentSchema:n,it:o}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(o.opts.discriminator&&n.discriminator)return;let s=r,i=e.let("valid",!1),a=e.let("passing",null),c=e.name("_valid");t.setParams({passing:a}),e.block(u),t.result(i,()=>t.reset(),()=>t.error(!0));function u(){s.forEach((l,d)=>{let p;(0,oA.alwaysValidSchema)(o,l)?e.var(c,!0):p=t.subschema({keyword:"oneOf",schemaProp:d,compositeRule:!0},c),d>0&&e.if((0,ka._)`${c} && ${i}`).assign(i,!1).assign(a,(0,ka._)`[${a}, ${d}]`).else(),e.if(c,()=>{e.assign(i,!0),e.assign(a,d),p&&t.mergeEvaluated(p,ka.Name)})})}}};Fd.default=iA});var Ow=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var aA=Q(),cA={keyword:"allOf",schemaType:"array",code(t){let{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");let o=e.name("valid");r.forEach((s,i)=>{if((0,aA.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Ud.default=cA});var Dw=$(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var Ea=F(),Rw=Q(),uA={message:({params:t})=>(0,Ea.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ea._)`{failingKeyword: ${t.ifClause}}`},lA={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:uA,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Rw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Iw(n,"then"),s=Iw(n,"else");if(!o&&!s)return;let i=e.let("valid",!0),a=e.name("_valid");if(c(),t.reset(),o&&s){let l=e.let("ifClause");t.setParams({ifClause:l}),e.if(a,u("then",l),u("else",l))}else o?e.if(a,u("then")):e.if((0,Ea.not)(a),u("else"));t.pass(i,()=>t.error(!0));function c(){let l=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(l)}function u(l,d){return()=>{let p=t.subschema({keyword:l},a);e.assign(i,a),t.mergeValidEvaluated(p,i),d?e.assign(d,(0,Ea._)`${l}`):t.setParams({ifClause:l})}}}};function Iw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Rw.alwaysValidSchema)(t,r)}Vd.default=lA});var Nw=$(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var dA=Q(),fA={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,dA.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bd.default=fA});var Aw=$(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var pA=Pd(),mA=fw(),hA=Td(),gA=mw(),yA=hw(),_A=_w(),vA=bw(),bA=Ad(),wA=Sw(),xA=zw(),SA=Pw(),$A=Tw(),kA=Cw(),EA=Ow(),zA=Dw(),PA=Nw();function TA(t=!1){let e=[SA.default,$A.default,kA.default,EA.default,zA.default,PA.default,vA.default,bA.default,_A.default,wA.default,xA.default];return t?e.push(mA.default,gA.default):e.push(pA.default,hA.default),e.push(yA.default),e}Hd.default=TA});var jw=$(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var $e=F(),CA={message:({schemaCode:t})=>(0,$e.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,$e._)`{format: ${t}}`},OA={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:CA,code(t,e){let{gen:r,data:n,$data:o,schema:s,schemaCode:i,it:a}=t,{opts:c,errSchemaPath:u,schemaEnv:l,self:d}=a;if(!c.validateFormats)return;o?p():m();function p(){let f=r.scopeValue("formats",{ref:d.formats,code:c.code.formats}),h=r.const("fDef",(0,$e._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,$e._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,$e._)`${h}.type || "string"`).assign(_,(0,$e._)`${h}.validate`),()=>r.assign(g,(0,$e._)`"string"`).assign(_,h)),t.fail$data((0,$e.or)(x(),w()));function x(){return c.strictSchema===!1?$e.nil:(0,$e._)`${i} && !${_}`}function w(){let S=l.$async?(0,$e._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,$e._)`${_}(${n})`,k=(0,$e._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,$e._)`${_} && ${_} !== true && ${g} === ${e} && !${k}`}}function m(){let f=d.formats[s];if(!f){x();return}if(f===!0)return;let[h,g,_]=w(f);h===e&&t.pass(S());function x(){if(c.strictSchema===!1){d.logger.warn(k());return}throw new Error(k());function k(){return`unknown format "${s}" ignored in schema at path "${u}"`}}function w(k){let W=k instanceof RegExp?(0,$e.regexpCode)(k):c.code.formats?(0,$e._)`${c.code.formats}${(0,$e.getProperty)(s)}`:void 0,Z=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,$e._)`${Z}.validate`]:["string",k,Z]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,$e._)`await ${_}(${n})`}return typeof g=="function"?(0,$e._)`${_}(${n})`:(0,$e._)`${_}.test(${n})`}}}};Wd.default=OA});var Mw=$(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var IA=jw(),RA=[IA.default];Gd.default=RA});var Zw=$(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.contentVocabulary=An.metadataVocabulary=void 0;An.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];An.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var qw=$(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var DA=Gb(),NA=cw(),AA=Aw(),jA=Mw(),Lw=Zw(),MA=[DA.default,NA.default,(0,AA.default)(),jA.default,Lw.metadataVocabulary,Lw.contentVocabulary];Jd.default=MA});var Uw=$(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.DiscrError=void 0;var Fw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Fw||(za.DiscrError=Fw={}))});var Bw=$(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var jn=F(),Kd=Uw(),Vw=aa(),ZA=ss(),LA=Q(),qA={message:({params:{discrError:t,tagName:e}})=>t===Kd.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>(0,jn._)`{error: ${t}, tag: ${r}, tagValue: ${e}}`},FA={keyword:"discriminator",type:"object",schemaType:"object",error:qA,code(t){let{gen:e,data:r,schema:n,parentSchema:o,it:s}=t,{oneOf:i}=o;if(!s.opts.discriminator)throw new Error("discriminator: requires discriminator option");let a=n.propertyName;if(typeof a!="string")throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!i)throw new Error("discriminator: requires oneOf keyword");let c=e.let("valid",!1),u=e.const("tag",(0,jn._)`${r}${(0,jn.getProperty)(a)}`);e.if((0,jn._)`typeof ${u} == "string"`,()=>l(),()=>t.error(!1,{discrError:Kd.DiscrError.Tag,tag:u,tagName:a})),t.ok(c);function l(){let m=p();e.if(!1);for(let f in m)e.elseIf((0,jn._)`${u} === ${f}`),e.assign(c,d(m[f]));e.else(),t.error(!1,{discrError:Kd.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}function d(m){let f=e.name("valid"),h=t.subschema({keyword:"oneOf",schemaProp:m},f);return t.mergeEvaluated(h,jn.Name),f}function p(){var m;let f={},h=_(o),g=!0;for(let S=0;S<i.length;S++){let k=i[S];if(k?.$ref&&!(0,LA.schemaHasRulesButRef)(k,s.self.RULES)){let Z=k.$ref;if(k=Vw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,Z),k instanceof Vw.SchemaEnv&&(k=k.schema),k===void 0)throw new ZA.default(s.opts.uriResolver,s.baseId,Z)}let W=(m=k?.properties)===null||m===void 0?void 0:m[a];if(typeof W!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);g=g&&(h||_(k)),x(W,S)}if(!g)throw new Error(`discriminator: "${a}" must be required`);return f;function _({required:S}){return Array.isArray(S)&&S.includes(a)}function x(S,k){if(S.const)w(S.const,k);else if(S.enum)for(let W of S.enum)w(W,k);else throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`)}function w(S,k){if(typeof S!="string"||S in f)throw new Error(`discriminator: "${a}" values must be unique strings`);f[S]=k}}}};Yd.default=FA});var Hw=$((vU,UA)=>{UA.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var Xd=$((pe,Qd)=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.MissingRefError=pe.ValidationError=pe.CodeGen=pe.Name=pe.nil=pe.stringify=pe.str=pe._=pe.KeywordCxt=pe.Ajv=void 0;var VA=Fb(),BA=qw(),HA=Bw(),Ww=Hw(),WA=["/properties"],Pa="http://json-schema.org/draft-07/schema",Mn=class extends VA.default{_addVocabularies(){super._addVocabularies(),BA.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(HA.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Ww,WA):Ww;this.addMetaSchema(e,Pa,!1),this.refs["http://json-schema.org/schema"]=Pa}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Pa)?Pa:void 0)}};pe.Ajv=Mn;Qd.exports=pe=Mn;Qd.exports.Ajv=Mn;Object.defineProperty(pe,"__esModule",{value:!0});pe.default=Mn;var GA=os();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return GA.KeywordCxt}});var Zn=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return Zn._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return Zn.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return Zn.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return Zn.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return Zn.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return Zn.CodeGen}});var JA=sa();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return JA.default}});var KA=ss();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return KA.default}})});var tx=$(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.formatNames=At.fastFormats=At.fullFormats=void 0;function Nt(t,e){return{validate:t,compare:e}}At.fullFormats={date:Nt(Yw,nf),time:Nt(tf(!0),of),"date-time":Nt(Gw(!0),Xw),"iso-time":Nt(tf(),Qw),"iso-date-time":Nt(Gw(),ex),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:r1,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:u1,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:n1,int32:{type:"number",validate:i1},int64:{type:"number",validate:a1},float:{type:"number",validate:Kw},double:{type:"number",validate:Kw},password:!0,binary:!0};At.fastFormats={...At.fullFormats,date:Nt(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,nf),time:Nt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,of),"date-time":Nt(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,Xw),"iso-time":Nt(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Qw),"iso-date-time":Nt(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,ex),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i};At.formatNames=Object.keys(At.fullFormats);function YA(t){return t%4===0&&(t%100!==0||t%400===0)}var QA=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,XA=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Yw(t){let e=QA.exec(t);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n===2&&YA(r)?29:XA[n])}function nf(t,e){if(t&&e)return t>e?1:t<e?-1:0}var ef=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function tf(t){return function(r){let n=ef.exec(r);if(!n)return!1;let o=+n[1],s=+n[2],i=+n[3],a=n[4],c=n[5]==="-"?-1:1,u=+(n[6]||0),l=+(n[7]||0);if(u>23||l>59||t&&!a)return!1;if(o<=23&&s<=59&&i<60)return!0;let d=s-l*c,p=o-u*c-(d<0?1:0);return(p===23||p===-1)&&(d===59||d===-1)&&i<61}}function of(t,e){if(!(t&&e))return;let r=new Date("2020-01-01T"+t).valueOf(),n=new Date("2020-01-01T"+e).valueOf();if(r&&n)return r-n}function Qw(t,e){if(!(t&&e))return;let r=ef.exec(t),n=ef.exec(e);if(r&&n)return t=r[1]+r[2]+r[3],e=n[1]+n[2]+n[3],t>e?1:t<e?-1:0}var rf=/t|\s/i;function Gw(t){let e=tf(t);return function(n){let o=n.split(rf);return o.length===2&&Yw(o[0])&&e(o[1])}}function Xw(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function ex(t,e){if(!(t&&e))return;let[r,n]=t.split(rf),[o,s]=e.split(rf),i=nf(r,o);if(i!==void 0)return i||of(n,s)}var e1=/\/|:/,t1=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function r1(t){return e1.test(t)&&t1.test(t)}var Jw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function n1(t){return Jw.lastIndex=0,Jw.test(t)}var o1=-(2**31),s1=2**31-1;function i1(t){return Number.isInteger(t)&&t<=s1&&t>=o1}function a1(t){return Number.isInteger(t)}function Kw(){return!0}var c1=/[^\\]\\Z/;function u1(t){if(c1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var rx=$(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.formatLimitDefinition=void 0;var l1=Xd(),Pt=F(),gr=Pt.operators,Ta={formatMaximum:{okStr:"<=",ok:gr.LTE,fail:gr.GT},formatMinimum:{okStr:">=",ok:gr.GTE,fail:gr.LT},formatExclusiveMaximum:{okStr:"<",ok:gr.LT,fail:gr.GTE},formatExclusiveMinimum:{okStr:">",ok:gr.GT,fail:gr.LTE}},d1={message:({keyword:t,schemaCode:e})=>(0,Pt.str)`should be ${Ta[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>(0,Pt._)`{comparison: ${Ta[t].okStr}, limit: ${e}}`};Ln.formatLimitDefinition={keyword:Object.keys(Ta),type:"string",schemaType:"string",$data:!0,error:d1,code(t){let{gen:e,data:r,schemaCode:n,keyword:o,it:s}=t,{opts:i,self:a}=s;if(!i.validateFormats)return;let c=new l1.KeywordCxt(s,a.RULES.all.format.definition,"format");c.$data?u():l();function u(){let p=e.scopeValue("formats",{ref:a.formats,code:i.code.formats}),m=e.const("fmt",(0,Pt._)`${p}[${c.schemaCode}]`);t.fail$data((0,Pt.or)((0,Pt._)`typeof ${m} != "object"`,(0,Pt._)`${m} instanceof RegExp`,(0,Pt._)`typeof ${m}.compare != "function"`,d(m)))}function l(){let p=c.schema,m=a.formats[p];if(!m||m===!0)return;if(typeof m!="object"||m instanceof RegExp||typeof m.compare!="function")throw new Error(`"${o}": format "${p}" does not define "compare" function`);let f=e.scopeValue("formats",{key:p,ref:m,code:i.code.formats?(0,Pt._)`${i.code.formats}${(0,Pt.getProperty)(p)}`:void 0});t.fail$data(d(f))}function d(p){return(0,Pt._)`${p}.compare(${r}, ${n}) ${Ta[o].fail} 0`}},dependencies:["format"]};var f1=t=>(t.addKeyword(Ln.formatLimitDefinition),t);Ln.default=f1});var ix=$((vs,sx)=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var qn=tx(),p1=rx(),sf=F(),nx=new sf.Name("fullFormats"),m1=new sf.Name("fastFormats"),af=(t,e={keywords:!0})=>{if(Array.isArray(e))return ox(t,e,qn.fullFormats,nx),t;let[r,n]=e.mode==="fast"?[qn.fastFormats,m1]:[qn.fullFormats,nx],o=e.formats||qn.formatNames;return ox(t,o,r,n),e.keywords&&(0,p1.default)(t),t};af.get=(t,e="full")=>{let n=(e==="fast"?qn.fastFormats:qn.fullFormats)[t];if(!n)throw new Error(`Unknown format "${t}"`);return n};function ox(t,e,r,n){var o,s;(o=(s=t.opts.code).formats)!==null&&o!==void 0||(s.formats=(0,sf._)`require("ajv-formats/dist/formats").${n}`);for(let i of e)t.addFormat(i,r[i])}sx.exports=vs=af;Object.defineProperty(vs,"__esModule",{value:!0});vs.default=af});var te;(function(t){t.assertEqual=o=>o;function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,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"&&isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(te||(te={}));var Fa;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Fa||(Fa={}));var z=te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Kt=t=>{switch(typeof t){case"undefined":return z.undefined;case"string":return z.string;case"number":return isNaN(t)?z.nan:z.number;case"boolean":return z.boolean;case"function":return z.function;case"bigint":return z.bigint;case"symbol":return z.symbol;case"object":return Array.isArray(t)?z.array:t===null?z.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?z.promise:typeof Map<"u"&&t instanceof Map?z.map:typeof Set<"u"&&t instanceof Set?z.set:typeof Date<"u"&&t instanceof Date?z.date:z.object;default:return z.unknown}},E=te.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"]),xx=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Qe=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(s){return s.message},n={_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)n._errors.push(r(i));else{let a=n,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let o of this.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Qe.create=t=>new Qe(t);var to=(t,e)=>{let r;switch(t.code){case E.invalid_type:t.received===z.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case E.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,te.jsonStringifyReplacer)}`;break;case E.unrecognized_keys:r=`Unrecognized key(s) in object: ${te.joinValues(t.keys,", ")}`;break;case E.invalid_union:r="Invalid input";break;case E.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${te.joinValues(t.options)}`;break;case E.invalid_enum_value:r=`Invalid enum value. Expected ${te.joinValues(t.options)}, received '${t.received}'`;break;case E.invalid_arguments:r="Invalid function arguments";break;case E.invalid_return_type:r="Invalid function return type";break;case E.invalid_date:r="Invalid date";break;case E.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:te.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case E.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case E.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case E.custom:r="Invalid input";break;case E.invalid_intersection_types:r="Intersection results could not be merged";break;case E.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case E.not_finite:r="Number must be finite";break;default:r=e.defaultError,te.assertNever(t)}return{message:r}},mf=to;function Sx(t){mf=t}function $s(){return mf}var ks=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,s=[...r,...o.path||[]],i={...o,path:s},a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:o.message||a}},$x=[];function T(t,e){let r=ks({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,$s(),to].filter(n=>!!n)});t.common.issues.push(r)}var Ne=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let o of r){if(o.status==="aborted")return A;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r)n.push({key:await o.key,value:await o.value});return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return A;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}},A=Object.freeze({status:"aborted"}),hf=t=>({status:"dirty",value:t}),Le=t=>({status:"valid",value:t}),Ua=t=>t.status==="aborted",Va=t=>t.status==="dirty",ro=t=>t.status==="valid",Es=t=>typeof Promise<"u"&&t instanceof Promise,I;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(I||(I={}));var st=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},ff=(t,e)=>{if(ro(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 r=new Qe(t.common.issues);return this._error=r,this._error}}};function j(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=t;if(e&&(r||n))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)=>i.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:n??a.defaultError}:{message:r??a.defaultError},description:o}}var M=class{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)}get description(){return this._def.description}_getType(e){return Kt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Kt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ne,ctx:{common:e.parent.common,data:e.data,parsedType:Kt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Es(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){var n;let o={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return ff(o,s)}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Kt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Es(o)?o:Promise.resolve(o));return ff(n,s)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:E.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Xe({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return yt.create(this,this._def)}nullable(){return Zt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mt.create(this,this._def)}promise(){return Xt.create(this,this._def)}or(e){return kr.create([this,e],this._def)}and(e){return Er.create(this,e,this._def)}transform(e){return new Xe({...j(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Or({...j(this._def),innerType:this,defaultValue:r,typeName:D.ZodDefault})}brand(){return new Cs({typeName:D.ZodBranded,type:this,...j(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new on({...j(this._def),innerType:this,catchValue:r,typeName:D.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return no.create(this,e)}readonly(){return an.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kx=/^c[^\s-]{8,}$/i,Ex=/^[a-z][a-z0-9]*$/,zx=/^[0-9A-HJKMNP-TV-Z]{26}$/,Px=/^[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,Tx=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",qa,Ox=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Ix=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Rx=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function Dx(t,e){return!!((e==="v4"||!e)&&Ox.test(t)||(e==="v6"||!e)&&Ix.test(t))}var Yt=class t extends M{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==z.string){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.string,received:s.parsedType}),A}let n=new Ne,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.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?T(o,{code:E.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&T(o,{code:E.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Tx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"email",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")qa||(qa=new RegExp(Cx,"u")),qa.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"emoji",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")Px.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"uuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")kx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")Ex.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"cuid2",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")zx.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ulid",code:E.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),T(o,{validation:"url",code:E.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"regex",code:E.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.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),T(o,{code:E.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Rx(s).test(e.data)||(o=this._getOrReturnCtx(e,o),T(o,{code:E.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="ip"?Dx(e.data,s.version)||(o=this._getOrReturnCtx(e,o),T(o,{validation:"ip",code:E.invalid_string,message:s.message}),n.dirty()):te.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(o=>e.test(o),{validation:r,code:E.invalid_string,...I.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...I.errToObj(e)})}url(e){return this._addCheck({kind:"url",...I.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...I.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...I.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...I.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...I.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...I.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...I.errToObj(e)})}datetime(e){var r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,...I.errToObj(e?.message)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...I.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...I.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...I.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...I.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...I.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...I.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...I.errToObj(r)})}nonempty(e){return this.min(1,I.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 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 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 minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Yt.create=t=>{var e;return new Yt({checks:[],typeName:D.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Nx(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,s=parseInt(t.toFixed(o).replace(".","")),i=parseInt(e.toFixed(o).replace(".",""));return s%i/Math.pow(10,o)}var vr=class t extends M{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)!==z.number){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.number,received:s.parsedType}),A}let n,o=new Ne;for(let s of this._def.checks)s.kind==="int"?te.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.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)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?Nx(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_finite,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:I.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:I.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:I.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:I.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&te.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};vr.create=t=>new vr({checks:[],typeName:D.ZodNumber,coerce:t?.coerce||!1,...j(t)});var br=class t extends M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==z.bigint){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.bigint,received:s.parsedType}),A}let n,o=new Ne;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.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)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),T(n,{code:E.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):te.assertNever(s);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,I.toString(r))}gt(e,r){return this.setLimit("min",e,!1,I.toString(r))}lte(e,r){return this.setLimit("max",e,!0,I.toString(r))}lt(e,r){return this.setLimit("max",e,!1,I.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:I.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:I.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:I.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:I.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:I.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:I.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};br.create=t=>{var e;return new br({checks:[],typeName:D.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};var wr=class extends M{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==z.boolean){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.boolean,received:n.parsedType}),A}return Le(e.data)}};wr.create=t=>new wr({typeName:D.ZodBoolean,coerce:t?.coerce||!1,...j(t)});var xr=class t extends M{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==z.date){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_type,expected:z.date,received:s.parsedType}),A}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),A}let n=new Ne,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),T(o,{code:E.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):te.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:I.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:I.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};xr.create=t=>new xr({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...j(t)});var en=class extends M{_parse(e){if(this._getType(e)!==z.symbol){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.symbol,received:n.parsedType}),A}return Le(e.data)}};en.create=t=>new en({typeName:D.ZodSymbol,...j(t)});var Sr=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.undefined,received:n.parsedType}),A}return Le(e.data)}};Sr.create=t=>new Sr({typeName:D.ZodUndefined,...j(t)});var $r=class extends M{_parse(e){if(this._getType(e)!==z.null){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.null,received:n.parsedType}),A}return Le(e.data)}};$r.create=t=>new $r({typeName:D.ZodNull,...j(t)});var Qt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Le(e.data)}};Qt.create=t=>new Qt({typeName:D.ZodAny,...j(t)});var jt=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Le(e.data)}};jt.create=t=>new jt({typeName:D.ZodUnknown,...j(t)});var _t=class extends M{_parse(e){let r=this._getOrReturnCtx(e);return T(r,{code:E.invalid_type,expected:z.never,received:r.parsedType}),A}};_t.create=t=>new _t({typeName:D.ZodNever,...j(t)});var tn=class extends M{_parse(e){if(this._getType(e)!==z.undefined){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.void,received:n.parsedType}),A}return Le(e.data)}};tn.create=t=>new tn({typeName:D.ZodVoid,...j(t)});var Mt=class t extends M{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==z.array)return T(r,{code:E.invalid_type,expected:z.array,received:r.parsedType}),A;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,a=r.data.length<o.exactLength.value;(i||a)&&(T(r,{code:i?E.too_big:E.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}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(T(r,{code:E.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(T(r,{code:E.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,a)=>o.type._parseAsync(new st(r,i,r.path,a)))).then(i=>Ne.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new st(r,i,r.path,a)));return Ne.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:I.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:I.toString(r)}})}nonempty(e){return this.min(1,e)}};Mt.create=(t,e)=>new Mt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...j(e)});function Xr(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=yt.create(Xr(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Mt?new Mt({...t._def,type:Xr(t.element)}):t instanceof yt?yt.create(Xr(t.unwrap())):t instanceof Zt?Zt.create(Xr(t.unwrap())):t instanceof Tt?Tt.create(t.items.map(e=>Xr(e))):t}var He=class t extends M{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(),r=te.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==z.object){let u=this._getOrReturnCtx(e);return T(u,{code:E.invalid_type,expected:z.object,received:u.parsedType}),A}let{status:n,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof _t&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new st(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof _t){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(T(o,{code:E.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new st(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key;u.push({key:d,value:await l.value,alwaysSet:l.alwaysSet})}return u}).then(u=>Ne.mergeObjectSync(n,u)):Ne.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return I.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var o,s,i,a;let c=(i=(s=(o=this._def).errorMap)===null||s===void 0?void 0:s.call(o,r,n).message)!==null&&i!==void 0?i:n.defaultError;return r.code==="unrecognized_keys"?{message:(a=I.errToObj(e).message)!==null&&a!==void 0?a:c}:{message:c}}}:{}})}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:D.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return te.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return te.objectKeys(this.shape).forEach(n=>{e[n]||(r[n]=this.shape[n])}),new t({...this._def,shape:()=>r})}deepPartial(){return Xr(this)}partial(e){let r={};return te.objectKeys(this.shape).forEach(n=>{let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return te.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yt;)s=s._def.innerType;r[n]=s}}),new t({...this._def,shape:()=>r})}keyof(){return gf(te.objectKeys(this.shape))}};He.create=(t,e)=>new He({shape:()=>t,unknownKeys:"strip",catchall:_t.create(),typeName:D.ZodObject,...j(e)});He.strictCreate=(t,e)=>new He({shape:()=>t,unknownKeys:"strict",catchall:_t.create(),typeName:D.ZodObject,...j(e)});He.lazycreate=(t,e)=>new He({shape:t,unknownKeys:"strip",catchall:_t.create(),typeName:D.ZodObject,...j(e)});var kr=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=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 r.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new Qe(a.ctx.common.issues));return T(r,{code:E.invalid_union,unionErrors:i}),A}if(r.common.async)return Promise.all(n.map(async s=>{let i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},l=c._parseSync({data:r.data,path:r.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new Qe(c));return T(r,{code:E.invalid_union,unionErrors:a}),A}}get options(){return this._def.options}};kr.create=(t,e)=>new kr({options:t,typeName:D.ZodUnion,...j(e)});var Ss=t=>t instanceof zr?Ss(t.schema):t instanceof Xe?Ss(t.innerType()):t instanceof Pr?[t.value]:t instanceof Tr?t.options:t instanceof Cr?Object.keys(t.enum):t instanceof Or?Ss(t._def.innerType):t instanceof Sr?[void 0]:t instanceof $r?[null]:null,zs=class t extends M{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.object)return T(r,{code:E.invalid_type,expected:z.object,received:r.parsedType}),A;let n=this.discriminator,o=r.data[n],s=this.optionsMap.get(o);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(T(r,{code:E.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),A)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let s of r){let i=Ss(s.shape[e]);if(!i)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:D.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...j(n)})}};function Ba(t,e){let r=Kt(t),n=Kt(e);if(t===e)return{valid:!0,data:t};if(r===z.object&&n===z.object){let o=te.objectKeys(e),s=te.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=Ba(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(r===z.array&&n===z.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=Ba(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return r===z.date&&n===z.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Er=class extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(s,i)=>{if(Ua(s)||Ua(i))return A;let a=Ba(s.value,i.value);return a.valid?((Va(s)||Va(i))&&r.dirty(),{status:r.value,value:a.data}):(T(n,{code:E.invalid_intersection_types}),A)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Er.create=(t,e,r)=>new Er({left:t,right:e,typeName:D.ZodIntersection,...j(r)});var Tt=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.array)return T(n,{code:E.invalid_type,expected:z.array,received:n.parsedType}),A;if(n.data.length<this._def.items.length)return T(n,{code:E.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),A;!this._def.rest&&n.data.length>this._def.items.length&&(T(n,{code:E.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=[...n.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new st(n,i,n.path,a)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>Ne.mergeArray(r,i)):Ne.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Tt.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tt({items:t,typeName:D.ZodTuple,rest:null,...j(e)})};var Ps=class t extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.object)return T(n,{code:E.invalid_type,expected:z.object,received:n.parsedType}),A;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in n.data)o.push({key:s._parse(new st(n,a,n.path,a)),value:i._parse(new st(n,n.data[a],n.path,a))});return n.common.async?Ne.mergeObjectAsync(r,o):Ne.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof M?new t({keyType:e,valueType:r,typeName:D.ZodRecord,...j(n)}):new t({keyType:Yt.create(),valueType:e,typeName:D.ZodRecord,...j(r)})}},rn=class extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.map)return T(n,{code:E.invalid_type,expected:z.map,received:n.parsedType}),A;let o=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([a,c],u)=>({key:o._parse(new st(n,a,n.path,[u,"key"])),value:s._parse(new st(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return A;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};rn.create=(t,e,r)=>new rn({valueType:e,keyType:t,typeName:D.ZodMap,...j(r)});var nn=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==z.set)return T(n,{code:E.invalid_type,expected:z.set,received:n.parsedType}),A;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(T(n,{code:E.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(T(n,{code:E.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return A;l.status==="dirty"&&r.dirty(),u.add(l.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>s._parse(new st(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:I.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:I.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};nn.create=(t,e)=>new nn({valueType:t,minSize:null,maxSize:null,typeName:D.ZodSet,...j(e)});var Ts=class t extends M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.function)return T(r,{code:E.invalid_type,expected:z.function,received:r.parsedType}),A;function n(a,c){return ks({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),to].filter(u=>!!u),issueData:{code:E.invalid_arguments,argumentsError:c}})}function o(a,c){return ks({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,$s(),to].filter(u=>!!u),issueData:{code:E.invalid_return_type,returnTypeError:c}})}let s={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Xt){let a=this;return Le(async function(...c){let u=new Qe([]),l=await a._def.args.parseAsync(c,s).catch(m=>{throw u.addIssue(n(c,m)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(m=>{throw u.addIssue(o(d,m)),u})})}else{let a=this;return Le(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new Qe([n(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new Qe([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Tt.create(e).rest(jt.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,r,n){return new t({args:e||Tt.create([]).rest(jt.create()),returns:r||jt.create(),typeName:D.ZodFunction,...j(n)})}},zr=class extends M{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};zr.create=(t,e)=>new zr({getter:t,typeName:D.ZodLazy,...j(e)});var Pr=class extends M{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return T(r,{received:r.data,code:E.invalid_literal,expected:this._def.value}),A}return{status:"valid",value:e.data}}get value(){return this._def.value}};Pr.create=(t,e)=>new Pr({value:t,typeName:D.ZodLiteral,...j(e)});function gf(t,e){return new Tr({values:t,typeName:D.ZodEnum,...j(e)})}var Tr=class t extends M{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{expected:te.joinValues(n),received:r.parsedType,code:E.invalid_type}),A}if(this._def.values.indexOf(e.data)===-1){let r=this._getOrReturnCtx(e),n=this._def.values;return T(r,{received:r.data,code:E.invalid_enum_value,options:n}),A}return Le(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(r=>!e.includes(r)))}};Tr.create=gf;var Cr=class extends M{_parse(e){let r=te.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==z.string&&n.parsedType!==z.number){let o=te.objectValues(r);return T(n,{expected:te.joinValues(o),received:n.parsedType,code:E.invalid_type}),A}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),A}return Le(e.data)}get enum(){return this._def.values}};Cr.create=(t,e)=>new Cr({values:t,typeName:D.ZodNativeEnum,...j(e)});var Xt=class extends M{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==z.promise&&r.common.async===!1)return T(r,{code:E.invalid_type,expected:z.promise,received:r.parsedType}),A;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Le(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Xt.create=(t,e)=>new Xt({type:t,typeName:D.ZodPromise,...j(e)});var Xe=class extends M{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{T(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(n.data,s);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(i).then(a=>this._def.schema._parseAsync({data:a,path:n.path,parent:n})):this._def.schema._parseSync({data:i,path:n.path,parent:n})}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(n.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(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?A:(a.status==="dirty"&&r.dirty(),i(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?A:(a.status==="dirty"&&r.dirty(),i(a.value).then(()=>({status:r.value,value:a.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ro(i))return i;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:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>ro(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:r.value,value:a})):i);te.assertNever(o)}};Xe.create=(t,e,r)=>new Xe({schema:t,typeName:D.ZodEffects,effect:e,...j(r)});Xe.createWithPreprocess=(t,e,r)=>new Xe({schema:e,effect:{type:"preprocess",transform:t},typeName:D.ZodEffects,...j(r)});var yt=class extends M{_parse(e){return this._getType(e)===z.undefined?Le(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yt.create=(t,e)=>new yt({innerType:t,typeName:D.ZodOptional,...j(e)});var Zt=class extends M{_parse(e){return this._getType(e)===z.null?Le(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Zt.create=(t,e)=>new Zt({innerType:t,typeName:D.ZodNullable,...j(e)});var Or=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===z.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Or.create=(t,e)=>new Or({innerType:t,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});var on=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Es(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Qe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};on.create=(t,e)=>new on({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var sn=class extends M{_parse(e){if(this._getType(e)!==z.nan){let n=this._getOrReturnCtx(e);return T(n,{code:E.invalid_type,expected:z.nan,received:n.parsedType}),A}return{status:"valid",value:e.data}}};sn.create=t=>new sn({typeName:D.ZodNaN,...j(t)});var Ax=Symbol("zod_brand"),Cs=class extends M{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},no=class t extends M{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?A:s.status==="dirty"?(r.dirty(),hf(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?A:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:D.ZodPipeline})}},an=class extends M{_parse(e){let r=this._def.innerType._parse(e);return ro(r)&&(r.value=Object.freeze(r.value)),r}};an.create=(t,e)=>new an({innerType:t,typeName:D.ZodReadonly,...j(e)});var yf=(t,e={},r)=>t?Qt.create().superRefine((n,o)=>{var s,i;if(!t(n)){let a=typeof e=="function"?e(n):typeof e=="string"?{message:e}:e,c=(i=(s=a.fatal)!==null&&s!==void 0?s:r)!==null&&i!==void 0?i:!0,u=typeof a=="string"?{message:a}:a;o.addIssue({code:"custom",...u,fatal:c})}}):Qt.create(),jx={object:He.lazycreate},D;(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"})(D||(D={}));var Mx=(t,e={message:`Input not instance of ${t.name}`})=>yf(r=>r instanceof t,e),_f=Yt.create,vf=vr.create,Zx=sn.create,Lx=br.create,bf=wr.create,qx=xr.create,Fx=en.create,Ux=Sr.create,Vx=$r.create,Bx=Qt.create,Hx=jt.create,Wx=_t.create,Gx=tn.create,Jx=Mt.create,Kx=He.create,Yx=He.strictCreate,Qx=kr.create,Xx=zs.create,e0=Er.create,t0=Tt.create,r0=Ps.create,n0=rn.create,o0=nn.create,s0=Ts.create,i0=zr.create,a0=Pr.create,c0=Tr.create,u0=Cr.create,l0=Xt.create,pf=Xe.create,d0=yt.create,f0=Zt.create,p0=Xe.createWithPreprocess,m0=no.create,h0=()=>_f().optional(),g0=()=>vf().optional(),y0=()=>bf().optional(),_0={string:(t=>Yt.create({...t,coerce:!0})),number:(t=>vr.create({...t,coerce:!0})),boolean:(t=>wr.create({...t,coerce:!0})),bigint:(t=>br.create({...t,coerce:!0})),date:(t=>xr.create({...t,coerce:!0}))},v0=A,ke=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:Sx,getErrorMap:$s,makeIssue:ks,EMPTY_PATH:$x,addIssueToContext:T,ParseStatus:Ne,INVALID:A,DIRTY:hf,OK:Le,isAborted:Ua,isDirty:Va,isValid:ro,isAsync:Es,get util(){return te},get objectUtil(){return Fa},ZodParsedType:z,getParsedType:Kt,ZodType:M,ZodString:Yt,ZodNumber:vr,ZodBigInt:br,ZodBoolean:wr,ZodDate:xr,ZodSymbol:en,ZodUndefined:Sr,ZodNull:$r,ZodAny:Qt,ZodUnknown:jt,ZodNever:_t,ZodVoid:tn,ZodArray:Mt,ZodObject:He,ZodUnion:kr,ZodDiscriminatedUnion:zs,ZodIntersection:Er,ZodTuple:Tt,ZodRecord:Ps,ZodMap:rn,ZodSet:nn,ZodFunction:Ts,ZodLazy:zr,ZodLiteral:Pr,ZodEnum:Tr,ZodNativeEnum:Cr,ZodPromise:Xt,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:yt,ZodNullable:Zt,ZodDefault:Or,ZodCatch:on,ZodNaN:sn,BRAND:Ax,ZodBranded:Cs,ZodPipeline:no,ZodReadonly:an,custom:yf,Schema:M,ZodSchema:M,late:jx,get ZodFirstPartyTypeKind(){return D},coerce:_0,any:Bx,array:Jx,bigint:Lx,boolean:bf,date:qx,discriminatedUnion:Xx,effect:pf,enum:c0,function:s0,instanceof:Mx,intersection:e0,lazy:i0,literal:a0,map:n0,nan:Zx,nativeEnum:u0,never:Wx,null:Vx,nullable:f0,number:vf,object:Kx,oboolean:y0,onumber:g0,optional:d0,ostring:h0,pipeline:m0,preprocess:p0,promise:l0,record:r0,set:o0,strictObject:Yx,string:_f,symbol:Fx,transformer:pf,tuple:t0,undefined:Ux,union:Qx,unknown:Hx,void:Gx,NEVER:v0,ZodIssueCode:E,quotelessJson:xx,ZodError:Qe});var er=class{static detect(e){let r=e.trim();return this.isRemoteUrl(r)?{type:new URL(r).protocol==="https:"?"https_url":"http_url",originalPath:e,normalizedPath:r}:{type:"local",originalPath:e,normalizedPath:r}}static isValidUrl(e){try{return new URL(e.trim()).protocol.length>0}catch{return!1}}static isRemoteUrl(e){try{let r=e.trim();if(!r.startsWith("http://")&&!r.startsWith("https://"))return!1;let n=new URL(r);return!(n.protocol!=="http:"&&n.protocol!=="https:"||!n.hostname||n.hostname.length===0)}catch{return!1}}};var b0=ke.object({name:ke.string().default("eui-compodoc-mcp"),version:ke.string().default("1.0.0")}),w0=ke.object({path:ke.string().refine(t=>!t||t==="__bundled__"?!0:t.trim().length>0,{message:"Documentation path cannot be only whitespace"}).refine(t=>{if(!t||t==="__bundled__")return!0;let e=t.trim();return e.startsWith("http://")||e.startsWith("https://")?er.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:ke.boolean().default(!0),reloadDebounce:ke.number().min(0).default(1e3),timeout:ke.number().min(1e3).default(1e4),maxRetries:ke.number().min(0).max(10).default(3),pollingInterval:ke.number().min(5e3).default(6e4)}).default({}),x0=ke.object({maxResults:ke.number().min(1).max(1e3).default(50),minQueryLength:ke.number().min(1).default(2)}),S0=ke.object({level:ke.enum(["debug","info","warn","error"]).default("info"),format:ke.enum(["json","text"]).default("text")}),$0=ke.object({path:ke.string().optional()}).default({}),wf=ke.object({server:b0.default({}),documentation:w0,search:x0.default({}),logging:S0.default({}),accessibility:$0.default({})}),Os={server:{name:"eui-compodoc-mcp",version:"1.0.0"},documentation:{path:"__bundled__",watchForChanges:!0,reloadDebounce:1e3,timeout:1e4,maxRetries:3,pollingInterval:6e4},search:{maxResults:50,minQueryLength:2},logging:{level:"info",format:"text"}};function Ha(t){return wf.safeParse(t)}var cn=gt(require("fs")),oo=gt(require("path"));function k0(){let t=oo.join(__dirname,"documentation.json.gz");if(cn.existsSync(t))return t;let e=oo.join(__dirname,"documentation.json");return cn.existsSync(e)?e:Os.documentation.path}function xf(){let t={};return process.env.COMPODOC_MCP_DOC_PATH&&(t.documentation={path:process.env.COMPODOC_MCP_DOC_PATH}),process.env.COMPODOC_MCP_LOG_LEVEL&&(t.logging={level:process.env.COMPODOC_MCP_LOG_LEVEL}),process.env.COMPODOC_MCP_WATCH!==void 0&&(t.documentation||(t.documentation={path:""}),t.documentation.watchForChanges=process.env.COMPODOC_MCP_WATCH==="true"),process.env.COMPODOC_MCP_A11Y_PATH&&(t.accessibility={path:process.env.COMPODOC_MCP_A11Y_PATH}),t}function Sf(t){let e={};for(let r=0;r<t.length;r++)switch(t[r]){case"--doc-path":case"--documentation-path":e.documentation||(e.documentation={path:""}),e.documentation.path=t[++r];break;case"--watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!0;break;case"--no-watch":e.documentation||(e.documentation={path:""}),e.documentation.watchForChanges=!1;break;case"--log-level":e.logging={level:t[++r]};break;case"--max-results":e.search={maxResults:parseInt(t[++r],10)};break;case"--a11y-path":e.accessibility||(e.accessibility={}),e.accessibility.path=t[++r];break;case"--help":case"-h":z0(),process.exit(0);break}return e}function $f(t){try{if(!cn.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
+ `),{};let e=cn.readFileSync(t,"utf-8"),r=oo.extname(t).toLowerCase();return r===".json"?JSON.parse(e):(process.stderr.write(`Unsupported configuration file format: ${r}
33
33
  `),{})}catch(e){let r=e instanceof Error?e.message:"Unknown error occurred";return process.stderr.write(`Failed to load config file ${t}: ${r}
34
- `),{}}}function Cs(t,e){let r={...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],s=r[n];o&&typeof o=="object"&&!Array.isArray(o)&&s&&typeof s=="object"&&!Array.isArray(s)?r[n]=Cs(s,o):o!==void 0&&(r[n]=o)}return r}function Fa(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?vf(r):{},o=yf(),s=_f(t),i={...Ts};i=Cs(i,n),i=Cs(i,o),i=Cs(i,s);let a=qa(i);if(!a.success){let c=x0(a.error);return process.stderr.write(`Configuration validation failed:
34
+ `),{}}}function Is(t,e){let r={...t};for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let o=e[n],s=r[n];o&&typeof o=="object"&&!Array.isArray(o)&&s&&typeof s=="object"&&!Array.isArray(s)?r[n]=Is(s,o):o!==void 0&&(r[n]=o)}return r}function Wa(t=process.argv.slice(2)){try{let e=t.indexOf("--config"),r=e>=0?t[e+1]:void 0,n=r?$f(r):{},o=xf(),s=Sf(t),i={...Os};i=Is(i,n),i=Is(i,o),i=Is(i,s);let a=Ha(i);if(!a.success){let c=E0(a.error);return process.stderr.write(`Configuration validation failed:
35
35
  `),c.forEach(u=>process.stderr.write(` - ${u}
36
- `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=w0()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function x0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function S0(){process.stderr.write(`
36
+ `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=k0()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function E0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function z0(){process.stderr.write(`
37
37
  EUI Compodoc MCP Server - Model Context Protocol server for Angular component documentation
38
38
 
39
39
  Usage:
@@ -86,9 +86,9 @@ Examples:
86
86
  COMPODOC_MCP_DOC_PATH=./documentation.json eui-compodoc-mcp
87
87
 
88
88
  For more information, visit: https://github.com/your-org/eui-compodoc-mcp
89
- `)}var fo=mt(require("fs")),Ym=mt(require("path")),Qm=require("zlib");var Af=require("node:events"),Df=require("node:fs"),Ms=require("node:fs/promises"),H=mt(require("node:path"),1);var Mt=require("node:fs/promises"),Zt=require("node:path"),Sf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},Ua={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:4096};Object.freeze(Ua);var $f="READDIRP_RECURSIVE_ERROR",$0=new Set(["ENOENT","EPERM","EACCES","ELOOP",$f]),bf=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],k0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),E0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),z0=t=>$0.has(t.code),P0=process.platform==="win32",wf=t=>!0,xf=t=>{if(t===void 0)return wf;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(n=>r.basename===n)}return wf},Va=class extends Sf.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark});let r={...Ua,...e},{root:n,type:o}=r;this._fileFilter=xf(r.fileFilter),this._directoryFilter=xf(r.directoryFilter);let s=r.lstat?Mt.lstat:Mt.stat;P0?this._stat=i=>s(i,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:Ua.depth,this._wantsDir=o?k0.has(o):!1,this._wantsFile=o?E0.has(o):!1,this._wantsEverything=o===et.EVERYTHING_TYPE,this._root=(0,Zt.resolve)(n),this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,n=r&&r.files;if(n&&n.length>0){let{path:o,depth:s}=r,i=n.splice(0,e).map(c=>this._formatEntry(c,o)),a=await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=await this._getEntryType(c);u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push(this._exploreDir(c.fullPath,s+1)),this._wantsDir&&(this.push(c),e--)):(u==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}if(this.parent=await o,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,Mt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}async _formatEntry(e,r){let n,o=this._isDirent?e.name:e;try{let s=(0,Zt.resolve)((0,Zt.join)(r,o));n={path:(0,Zt.relative)(this._root,s),fullPath:s,basename:o},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(s){this._onError(s);return}return n}_onError(e){z0(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){if(!e&&this._statsProp in e)return"";let r=e[this._statsProp];if(r.isFile())return"file";if(r.isDirectory())return"directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let o=await(0,Mt.realpath)(n),s=await(0,Mt.lstat)(o);if(s.isFile())return"file";if(s.isDirectory()){let i=o.length;if(n.startsWith(o)&&n.substr(i,1)===Zt.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${o}"`);return a.code=$f,this._onError(a)}return"directory"}}catch(o){return this._onError(o),""}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function kf(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=et.FILE_DIR_TYPE),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!bf.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${bf.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Va(e)}var Ir=require("node:fs"),_t=require("node:fs/promises"),zf=require("node:os"),he=mt(require("node:path"),1),T0="data",Wa="end",Pf="close",As=()=>{};var Ds=process.platform,Ga=Ds==="win32",C0=Ds==="darwin",O0=Ds==="linux",I0=Ds==="freebsd",Tf=(0,zf.type)()==="OS400",be={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},yt=be,R0="watch",N0={lstat:_t.lstat,stat:_t.stat},Or="listeners",Os="errHandlers",an="rawEmitters",A0=[Or,Os,an],D0=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),j0=t=>D0.has(he.extname(t).slice(1).toLowerCase()),Ha=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},no=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},M0=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},oo=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Cf=t=>t instanceof Set?t.size===0:!t,Is=new Map;function Ef(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&Rs(he.resolve(t,a),Or,he.join(t,a))};try{return(0,Ir.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var Rs=(t,e,r,n,o)=>{let s=Is.get(t);s&&Ha(s[e],i=>{i(r,n,o)})},Z0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Is.get(e),c;if(!r.persistent)return c=Ef(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)no(a,Or,o),no(a,Os,s),no(a,an,i);else{if(c=Ef(t,r,Rs.bind(null,e,Or),s,Rs.bind(null,e,an)),!c)return;c.on(yt.ERROR,async u=>{let l=Rs.bind(null,e,Os);if(a&&(a.watcherUnusable=!0),Ga&&u.code==="EPERM")try{await(await(0,_t.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},Is.set(e,a)}return()=>{oo(a,Or,o),oo(a,Os,s),oo(a,an,i),Cf(a.listeners)&&(a.watcher.close(),Is.delete(e),A0.forEach(M0(a)),a.watcher=void 0,Object.freeze(a))}},Ba=new Map,L0=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Ba.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Ir.unwatchFile)(e),i=void 0),i?(no(i,Or,o),no(i,an,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Ir.watchFile)(e,r,(c,u)=>{Ha(i.rawEmitters,d=>{d(yt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&Ha(i.listeners,d=>d(t,c))})},Ba.set(e,i)),()=>{oo(i,Or,o),oo(i,an,s),Cf(i.listeners)&&(Ba.delete(e),(0,Ir.unwatchFile)(e),i.options=i.watcher=void 0,Object.freeze(i))}},Ns=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,o=he.dirname(e),s=he.basename(e);this.fsw._getWatchedDir(o).add(s);let a=he.resolve(e),c={persistent:n.persistent};r||(r=As);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&j0(s)?n.binaryInterval:n.interval,u=L0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=Z0(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return u}_handleFile(e,r,n){if(this.fsw.closed)return;let o=he.dirname(e),s=he.basename(e),i=this.fsw._getWatchedDir(o),a=r;if(i.has(s))return;let c=async(l,d)=>{if(this.fsw._throttle(R0,e,5)){if(!d||d.mtimeMs===0)try{let m=await(0,_t.stat)(e);if(this.fsw.closed)return;let p=m.atimeMs,f=m.mtimeMs;if((!p||p<=f||f!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,m),(C0||O0||I0)&&a.ino!==m.ino){this.fsw._closeFile(l),a=m;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=m}catch{this.fsw._remove(o,s)}else if(i.has(s)){let m=d.atimeMs,p=d.mtimeMs;(!m||m<=p||p!==a.mtimeMs)&&this.fsw._emit(yt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(yt.ADD,e,0))return;this.fsw._emit(yt.ADD,e,r)}return u}async _handleSymlink(e,r,n,o){if(this.fsw.closed)return;let s=e.fullPath,i=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,_t.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(o)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(yt.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,n,o,s,i,a){e=he.join(e,"");let c=o?`${e}:${o}`:e;if(a=this.fsw._throttle("readdir",c,1e3),!a)return;let u=this.fsw._getWatchedDir(n.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:m=>n.filterPath(m),directoryFilter:m=>n.filterDir(m)});if(d)return d.on(T0,async m=>{if(this.fsw.closed){d=void 0;return}let p=m.path,f=he.join(e,p);if(l.add(p),!(m.stats.isSymbolicLink()&&await this._handleSymlink(m,e,f,p))){if(this.fsw.closed){d=void 0;return}(p===o||!o&&!u.has(p))&&(this.fsw._incrReadyCount(),f=he.join(s,he.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(yt.ERROR,this._boundHandleError),new Promise((m,p)=>{if(!d)return p();d.once(Wa,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;m(void 0),u.getChildren().filter(h=>h!==e&&!l.has(h)).forEach(h=>{this.fsw._remove(e,h)}),d=void 0,f&&this._handleRead(e,!1,n,o,s,i,a)})})}async _handleDir(e,r,n,o,s,i,a){let c=this.fsw._getWatchedDir(he.dirname(e)),u=c.has(he.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&this.fsw._emit(yt.ADD_DIR,e,r),c.add(he.basename(e)),this.fsw._getWatchedDir(e);let l,d,m=this.fsw.options.depth;if((m==null||o<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,i,s,e,o,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(p,f)=>{f&&f.mtimeMs===0||this._handleRead(p,!1,i,s,e,o,l)})}return d}async _addToNodeFs(e,r,n,o,s){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e);n&&(a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await N0[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=he.resolve(e),m=u?await(0,_t.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,m),this.fsw.closed))return;d!==m&&m!==void 0&&this.fsw._symlinkPaths.set(d,m)}else if(c.isSymbolicLink()){let d=u?await(0,_t.realpath)(e):e;if(this.fsw.closed)return;let m=he.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(yt.ADD,a.watchPath,c),l=await this._handleDir(m,c,r,o,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(he.resolve(e),d)}else l=this._handleFile(a.watchPath,c,r);return i(),l&&this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};var Ja="/",q0="//",jf=".",F0="..",U0="string",V0=/\\/g,Mf=/\/\//g,B0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,H0=/^\.[/\\]/;function js(t){return Array.isArray(t)?t:[t]}var Ka=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function W0(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=H.relative(t.path,e);return r?!r.startsWith("..")&&!H.isAbsolute(r):!1}return!1}:()=>!1}function G0(t){if(typeof t!="string")throw new Error("string expected");t=H.normalize(t),t=t.replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(Mf,"/"),e&&(t="/"+t),t}function Of(t,e,r){let n=G0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function J0(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=js(t).map(o=>W0(o));return e==null?(o,s)=>Of(n,o,s):Of(n,e)}var If=t=>{let e=js(t).flat();if(!e.every(r=>typeof r===U0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Zf)},Rf=t=>{let e=t.replace(V0,Ja),r=!1;return e.startsWith(q0)&&(r=!0),e=e.replace(Mf,Ja),r&&(e=Ja+e),e},Zf=t=>Rf(H.normalize(Rf(t))),Nf=(t="")=>e=>typeof e=="string"?Zf(H.isAbsolute(e)?e:H.join(t,e)):e,K0=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),Y0=Object.freeze(new Set),Ya=class{path;_removeWatcher;items;constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==jf&&e!==F0&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await(0,Ms.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(H.dirname(n),H.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=As,this.items=Y0,Object.freeze(this)}},Q0="stat",X0="lstat",Qa=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(H0,""),this.watchPath=o,this.fullWatchPath=H.resolve(o),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?Q0:X0}entryPath(e){return H.join(this.watchPath,H.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Xa=class extends Af.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?js(e.ignored):js([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Tf&&(o.usePolling=!0),o.atomic===void 0&&(o.atomic=!o.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?o.usePolling=!1:c==="true"||c==="1"?o.usePolling=!0:o.usePolling=!!c}let i=process.env.CHOKIDAR_INTERVAL;i&&(o.interval=Number.parseInt(i,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=As,this._readyEmitted=!0,process.nextTick(()=>this.emit(be.READY)))},this._emitRaw=(...c)=>this.emit(be.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new Ns(this),Object.freeze(o)}_addIgnoredPath(e){if(Ka(e)){for(let r of this._ignoredPaths)if(Ka(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)Ka(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let s=If(e);return o&&(s=s.map(i=>K0(i,o))),s.forEach(i=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async i=>{let a=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,r);return a&&this._emitReady(),a})).then(i=>{this.closed||i.forEach(a=>{a&&this.add(H.dirname(a),H.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=If(e),{cwd:n}=this.options;return r.forEach(o=>{!H.isAbsolute(o)&&!this._closers.has(o)&&(n&&(o=H.join(n,o)),o=H.resolve(o)),this._closePath(o),this._addIgnoredPath(o),this._watched.has(o)&&this._addIgnoredPath({path:o,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let o=n();o instanceof Promise&&e.push(o)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=(this.options.cwd?H.relative(this.options.cwd,n):n)||jf;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==be.ERROR&&this.emit(be.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let o=this.options;Ga&&(r=H.normalize(r)),o.cwd&&(r=H.relative(o.cwd,r));let s=[r];n!=null&&s.push(n);let i=o.awaitWriteFinish,a;if(i&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(o.atomic){if(e===be.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((c,u)=>{this.emit(...c),this.emit(be.ALL,...c),this._pendingUnlinks.delete(u)})},typeof o.atomic=="number"?o.atomic:100),this;e===be.ADD&&this._pendingUnlinks.has(r)&&(e=be.CHANGE,this._pendingUnlinks.delete(r))}if(i&&(e===be.ADD||e===be.CHANGE)&&this._readyEmitted){let c=(u,l)=>{u?(e=be.ERROR,s[0]=u,this.emitWithAll(e,s)):l&&(s.length>1?s[1]=l:s.push(l),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,i.stabilityThreshold,e,c),this}if(e===be.CHANGE&&!this._throttle(be.CHANGE,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===be.ADD||e===be.ADD_DIR||e===be.CHANGE)){let c=o.cwd?H.join(o.cwd,r):r,u;try{u=await(0,Ms.stat)(c)}catch{}if(!u||this.closed)return;s.push(u)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(be.ERROR,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw new Error("invalid throttle");let s=o.get(r);if(s)return s.count++,!1;let i,a=()=>{let u=o.get(r),l=u?u.count:0;return o.delete(r),clearTimeout(i),u&&clearTimeout(u.timeoutObject),l};i=setTimeout(a,n);let c={timeoutObject:i,clear:a,count:0};return o.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,o){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let i=s.pollInterval,a,c=e;this.options.cwd&&!H.isAbsolute(e)&&(c=H.join(this.options.cwd,e));let u=new Date,l=this._pendingWrites;function d(m){(0,Df.stat)(c,(p,f)=>{if(p||!l.has(e)){p&&p.code!=="ENOENT"&&o(p);return}let h=Number(new Date);m&&f.size!==m.size&&(l.get(e).lastChange=h);let g=l.get(e);h-g.lastChange>=r?(l.delete(e),o(void 0,f)):a=setTimeout(d,i,f)})}l.has(e)||(l.set(e,{lastChange:u,cancelWait:()=>(l.delete(e),clearTimeout(a),n)}),a=setTimeout(d,i))}_isIgnored(e,r){if(this.options.atomic&&B0.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Nf(n)),a=[...[...this._ignoredPaths].map(Nf(n)),...s];this._userIgnored=J0(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new Qa(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=H.resolve(e);return this._watched.has(r)||this._watched.set(r,new Ya(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let o=H.join(e,r),s=H.resolve(o);if(n=n??(this._watched.has(o)||this._watched.has(s)),!this._throttle("remove",o,100))return;!n&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(o).getChildren().forEach(m=>this._remove(o,m));let c=this._getWatchedDir(e),u=c.has(r);c.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let l=o;if(this.options.cwd&&(l=H.relative(this.options.cwd,o)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===be.ADD)return;this._watched.delete(o),this._watched.delete(s);let d=n?be.UNLINK_DIR:be.UNLINK;u&&!this._isIgnored(o)&&this._emit(d,o),this._closePath(o)}_closePath(e){this._closeFile(e);let r=H.dirname(e);this._getWatchedDir(r).remove(H.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:be.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},o=kf(e,n);return this._streams.add(o),o.once(Pf,()=>{o=void 0}),o.once(Wa,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Lf(t,e={}){let r=new Xa(e);return r.add(t),r}var Wc=mt(Km()),lo=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Wc.default)({level:e.level},Wc.default.destination({dest:2,sync:!0}))}child(e){let r=new t({level:this.pino.level,format:"json",context:this.context?`${this.context}:${e}`:e});return r.pino=this.pino.child({context:e}),r}setLevel(e){this.pino.level=e}debug(e,r){this.pino.debug(r||{},e)}info(e,r){this.pino.info(r||{},e)}warn(e,r){this.pino.warn(r||{},e)}error(e,r,n){let o=n&&typeof n=="object"?n:{};this.pino.error({err:r,...o},e)}},uo=null;function Gc(t){return uo=new lo(t),uo}function ne(){return uo||(uo=new lo({level:"info",format:"text"})),uo}var Az={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},ni=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...Az,...r}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let r=ne();if(this.state==="OPEN"){if(Date.now()<this.nextAttempt){let n=new Error(`Circuit breaker '${this.name}' is OPEN. Next attempt at ${new Date(this.nextAttempt).toISOString()}`);throw r.warn("Circuit breaker is open",{name:this.name,nextAttempt:this.nextAttempt}),n}this.state="HALF_OPEN",this.successCount=0,r.info("Circuit breaker transitioning to HALF_OPEN",{name:this.name})}try{let n=await this.executeWithTimeout(e);return this.onSuccess(),n}catch(n){throw this.onFailure(),n}}async executeWithTimeout(e){return Promise.race([e(),new Promise((r,n)=>setTimeout(()=>n(new Error(`Operation timed out after ${this.options.timeout}ms`)),this.options.timeout))])}onSuccess(){let e=ne();this.failureCount=0,this.state==="HALF_OPEN"&&(this.successCount++,e.debug("Circuit breaker success in HALF_OPEN",{name:this.name,successCount:this.successCount,threshold:this.options.successThreshold}),this.successCount>=this.options.successThreshold&&(this.state="CLOSED",this.successCount=0,e.info("Circuit breaker closed",{name:this.name})))}onFailure(){let e=ne();this.failureCount++,e.debug("Circuit breaker failure",{name:this.name,failureCount:this.failureCount,threshold:this.options.failureThreshold,state:this.state}),(this.state==="HALF_OPEN"||this.failureCount>=this.options.failureThreshold)&&(this.state="OPEN",this.nextAttempt=Date.now()+this.options.resetTimeout,e.warn("Circuit breaker opened",{name:this.name,failureCount:this.failureCount,nextAttempt:this.nextAttempt}))}reset(){let e=ne();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},oi=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new ni(e,r)),this.breakers.get(e)}getAll(){return new Map(this.breakers)}resetAll(){this.breakers.forEach(e=>{e.reset()})}getAllStats(){let e={};return this.breakers.forEach((r,n)=>{e[n]=r.getStats()}),e}},Dz=new oi;var si=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=Ym.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!fo.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e;if(this.filePath.endsWith(".gz")){let o=await fo.promises.readFile(this.filePath);e=(0,Qm.gunzipSync)(o).toString("utf-8")}else e=await fo.promises.readFile(this.filePath,"utf-8");let r;try{r=JSON.parse(e)}catch(o){return{success:!1,error:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}let n=this.validateStructure(r);return n?{success:!1,error:n}:(this.currentData=r,this.watchForChanges&&!this.watcher&&this.startMonitoring(),{success:!0,data:r})}catch(e){return{success:!1,error:`Failed to load documentation: ${e instanceof Error?e.message:String(e)}`}}}startMonitoring(){!this.watchForChanges||this.watcher||this.startWatching()}async stopMonitoring(){this.reloadTimer&&(clearTimeout(this.reloadTimer),this.reloadTimer=void 0),this.watcher&&(await this.watcher.close(),this.watcher=void 0,ne().info("Stopped watching documentation file"))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}startWatching(){this.watcher||(this.watcher=Lf(this.filePath,{persistent:!0,ignoreInitial:!0}),this.watcher.on("change",()=>{this.scheduleReload()}),this.watcher.on("error",e=>{let r=e instanceof Error?e:new Error(String(e));ne().error("File watcher error",r),this.onErrorCallback&&this.onErrorCallback(r)}),ne().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){ne().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(ne().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(ne().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var dn=class{options;constructor(e){this.options=e}async fetch(e,r){let n;for(let o=0;o<=this.options.maxRetries;o++)try{let s=await this.fetchOnce(e,r);if(!this.isRetryableError(void 0,s.status)||o>=this.options.maxRetries)return s;let i=this.calculateBackoff(o);await this.sleep(i)}catch(s){if(n=s instanceof Error?s:new Error(String(s)),o<this.options.maxRetries&&this.isRetryableError(n)){let i=this.calculateBackoff(o);await this.sleep(i);continue}throw n}throw n||new Error("Unknown error during fetch")}async fetchOnce(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeout);try{let s={Accept:"application/json","User-Agent":this.options.userAgent||"DocumentationLoader/1.0"};r&&r.forEach((u,l)=>{s[l]=u});let i=await fetch(e,{signal:n.signal,headers:s});clearTimeout(o);let a=new Map;i.headers.forEach((u,l)=>{a.set(l,u)});let c=await i.text();return{status:i.status,statusText:i.statusText,data:c,headers:a}}catch(s){throw clearTimeout(o),s instanceof Error&&s.name==="AbortError"?new Error(`Request timeout after ${this.options.timeout}ms`):s}}isRetryableError(e,r){if(r!==void 0){if(r>=200&&r<400)return!1;if(r>=500||r===408||r===429)return!0;if(r>=400&&r<500)return!1}if(e){let n=e.message.toLowerCase();if(n.includes("timeout")||n.includes("network")||n.includes("econnrefused")||n.includes("enotfound")||n.includes("econnreset"))return!0}return!0}calculateBackoff(e){return this.options.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(r=>setTimeout(r,e))}};var ii=class{cache;constructor(){this.cache=new Map}set(e,r,n){let o={data:r,timestamp:Date.now()},s=this.getHeaderCaseInsensitive(n,"etag");s&&(o.etag=s);let i=this.getHeaderCaseInsensitive(n,"last-modified");i&&(o.lastModified=i),this.cache.set(e,o)}get(e){return this.cache.get(e)}getConditionalHeaders(e){let r=new Map,n=this.cache.get(e);return n&&(n.etag&&r.set("If-None-Match",n.etag),n.lastModified&&r.set("If-Modified-Since",n.lastModified)),r}clear(e){this.cache.delete(e)}clearAll(){this.cache.clear()}getHeaderCaseInsensitive(e,r){let n=r.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===n)return s}};var Jc=class t extends Error{constructor(r,n,o){super(r);this.url=n;this.cause=o;this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}url;cause};var po=class t extends Jc{constructor(r,n,o,s){super(r,n);this.statusCode=o;this.statusText=s;this.name="HttpError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}statusCode;statusText},mo=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var ai=class{url;httpClient;cacheManager;pollingTimer;currentData;pollingInterval;onReloadCallback;onErrorCallback;constructor(e){this.url=e.url,this.pollingInterval=e.pollingInterval,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError;let r={timeout:e.timeout,maxRetries:e.maxRetries,retryDelay:1e3,userAgent:"DocumentationLoader/1.0"};this.httpClient=new dn(r),this.cacheManager=new ii}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),ne().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,ne().info(`Stopped polling ${this.url}`))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.cacheManager.clear(this.url),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}async poll(){try{ne().debug(`Polling ${this.url} for updates...`);let e=this.cacheManager.getConditionalHeaders(this.url),r=await this.httpClient.fetch(this.url,e);if(r.status===304){ne().debug("No changes detected (304 Not Modified)");return}if(r.status===200){let n=this.parseJson(r.data),o=this.validateStructure(n);if(o)throw new mo(o,r.data);this.cacheManager.set(this.url,n,r.headers),this.currentData=n,ne().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(n);return}throw new po(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText)}catch(e){let r=e instanceof Error?e.message:String(e);ne().error(`Polling error for ${this.url}`,e instanceof Error?e:new Error(r)),this.onErrorCallback&&this.onErrorCallback(e instanceof Error?e:new Error(r))}}async fetchDocumentation(){try{let e=this.cacheManager.get(this.url),r=e?this.cacheManager.getConditionalHeaders(this.url):void 0,n=await this.httpClient.fetch(this.url,r);if(n.status===304&&e)return ne().debug("Using cached documentation (304 Not Modified)"),this.currentData=e.data,{success:!0,data:e.data};if(n.status!==200)return{success:!1,error:`${new po(`HTTP ${n.status}: ${n.statusText}`,this.url,n.status,n.statusText).message} (URL: ${this.url})`};let o=this.parseJson(n.data),s=this.validateStructure(o);return s?{success:!1,error:s}:(this.cacheManager.set(this.url,o,n.headers),this.currentData=o,{success:!0,data:o})}catch(e){let r=e instanceof Error?e.message:String(e);return{success:!1,error:`Failed to fetch documentation from ${this.url}: ${r}`}}}parseJson(e){try{return JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);throw new mo(`Failed to parse JSON: ${n}`,e)}}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}};var ho=class{source;constructor(e){this.source=this.createSource(e)}async load(){let e=await this.source.load();return e.success&&this.source.startMonitoring(),e}getCurrentData(){return this.source.getCurrentData()}async stopWatching(){await this.source.stopMonitoring()}async dispose(){await this.source.dispose()}createSource(e){let r=Xt.detect(e.path);return r.type==="local"?new si({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new ai({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var go=class{build(e){let r={byName:new Map,bySelector:new Map,searchIndex:new Map,components:[],directives:[],pipes:[],services:[],lastUpdated:new Date,totalCount:0},n=new Map;if(e.components)for(let o of e.components){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and component. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"component"),this.indexComponent(o,r)}if(e.directives)for(let o of e.directives){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and directive. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"directive"),this.indexDirective(o,r)}if(e.pipes)for(let o of e.pipes){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and pipe. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"pipe"),this.indexPipe(o,r)}if(e.injectables)for(let o of e.injectables){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and injectable. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"injectable"),this.indexInjectable(o,r)}return r.totalCount=r.components.length+r.directives.length+r.pipes.length+r.services.length,r}indexComponent(e,r){r.components.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexDirective(e,r){r.directives.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexPipe(e,r){r.pipes.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}indexInjectable(e,r){r.services.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}addToSearchIndex(e,r){let n=new Set;if(this.extractWords(e.name,n),"selector"in e&&e.selector&&this.extractWords(e.selector,n),e.description&&this.extractWords(e.description,n),"inputs"in e&&e.inputs)for(let o of e.inputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("outputs"in e&&e.outputs)for(let o of e.outputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("methods"in e&&e.methods)for(let o of e.methods)this.extractWords(o.name,n);for(let o of n)r.searchIndex.has(o)||r.searchIndex.set(o,new Set),r.searchIndex.get(o).add(e.name)}extractWords(e,r){let n=e.toLowerCase(),o=n.split(/[^a-z0-9]+/).filter(s=>s.length>0);for(let s of o)r.add(s);o.length===0&&e.trim().length>0&&r.add(n.trim())}getStatistics(e){return{totalCount:e.totalCount,componentCount:e.components.length,directiveCount:e.directives.length,pipeCount:e.pipes.length,serviceCount:e.services.length,lastUpdated:e.lastUpdated}}rebuild(e,r){return this.build(e)}};var Xm;function v(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let m=l[d];m in a||(a[m]=u[m].bind(a))}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Tt=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},fn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(Xm=globalThis).__zod_globalConfig??(Xm.__zod_globalConfig={});var pn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(pn,t),pn}var Y={};sf(Y,{BIGINT_FORMAT_RANGES:()=>nh,Class:()=>Yc,NUMBER_FORMAT_RANGES:()=>nu,aborted:()=>nr,allowsEval:()=>eu,assert:()=>Uz,assertEqual:()=>Zz,assertIs:()=>qz,assertNever:()=>Fz,assertNotEqual:()=>Lz,assignProp:()=>tr,base64ToUint8Array:()=>sh,base64urlToUint8Array:()=>iP,cached:()=>hn,captureStackTrace:()=>li,cleanEnum:()=>sP,cleanRegex:()=>bo,clone:()=>wt,cloneDef:()=>Bz,createTransparentProxy:()=>Yz,defineLazy:()=>oe,esc:()=>ui,escapeRegex:()=>Ft,explicitlyAborted:()=>ou,extend:()=>eP,finalizeIssue:()=>at,floatSafeRemainder:()=>Qc,getElementAtPath:()=>Hz,getEnumValues:()=>_o,getLengthableOrigin:()=>wo,getParsedType:()=>Kz,getSizableOrigin:()=>oh,hexToUint8Array:()=>cP,isObject:()=>Mr,isPlainObject:()=>rr,issue:()=>gn,joinValues:()=>ci,jsonStringifyReplacer:()=>mn,merge:()=>rP,mergeDefs:()=>qt,normalizeParams:()=>R,nullish:()=>vo,numKeys:()=>Jz,objectClone:()=>Vz,omit:()=>Xz,optionalKeys:()=>ru,parsedType:()=>su,partial:()=>nP,pick:()=>Qz,prefixIssues:()=>Ut,primitiveTypes:()=>rh,promiseAllObject:()=>Wz,propertyKeyTypes:()=>tu,randomString:()=>Gz,required:()=>oP,safeExtend:()=>tP,shallowClone:()=>th,slugify:()=>Xc,stringifyPrimitive:()=>di,uint8ArrayToBase64:()=>ih,uint8ArrayToBase64url:()=>aP,uint8ArrayToHex:()=>uP,unwrapMessage:()=>yo});function Zz(t){return t}function Lz(t){return t}function qz(t){}function Fz(t){throw new Error("Unexpected value in exhaustive check")}function Uz(t){}function _o(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function ci(t,e="|"){return t.map(r=>di(r)).join(e)}function mn(t,e){return typeof e=="bigint"?e.toString():e}function hn(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vo(t){return t==null}function bo(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Qc(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var eh=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==eh)return n===void 0&&(n=eh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Vz(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function tr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qt(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Bz(t){return qt(t._zod.def)}function Hz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Wz(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function Gz(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function ui(t){return JSON.stringify(t)}function Xc(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var li="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Mr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var eu=hn(()=>{if(pn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function rr(t){if(Mr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Mr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function th(t){return rr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Jz(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Kz=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},tu=new Set(["string","number","symbol"]),rh=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ft(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function wt(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Yz(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function di(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function ru(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var nu={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},nh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Qz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function Xz(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=qt(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return tr(this,"shape",i),i},checks:[]});return wt(t,s)}function eP(t,e){if(!rr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=qt(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return tr(this,"shape",s),s}});return wt(t,o)}function tP(t,e){if(!rr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return tr(this,"shape",n),n}});return wt(t,r)}function rP(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=qt(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return tr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return wt(t,r)}function nP(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=qt(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return tr(this,"shape",c),c},checks:[]});return wt(e,i)}function oP(t,e,r){let n=qt(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:o[i]}))}else for(let i in o)s[i]=new t({type:"nonoptional",innerType:o[i]});return tr(this,"shape",s),s}});return wt(e,n)}function nr(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function ou(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Ut(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function yo(t){return typeof t=="string"?t:t?.message}function at(t,e,r){let n=t.message?t.message:yo(t.inst?._zod.def?.error?.(t))??yo(e?.error?.(t))??yo(r.customError?.(t))??yo(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=n,e?.reportInput&&(a.input=i),a}function oh(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function wo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function su(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function gn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function sP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function sh(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function ih(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function iP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return sh(e+r)}function aP(t){return ih(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function cP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function uP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Yc=class{constructor(...e){}};var ah=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,mn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},fi=v("$ZodError",ah),iu=v("$ZodError",ah,{Parent:Error});function ch(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function uh(t,e=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return n(t),r}var pi=t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Tt;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw li(a,o?.callee),a}return i.value};var mi=t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>at(c,s,tt())));throw li(a,o?.callee),a}return i.value};var xo=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Tt;return s.issues.length?{success:!1,error:new(t??fi)(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},So=xo(iu),$o=t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>at(i,o,tt())))}:{success:!0,data:s.value}},hi=$o(iu),lh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return pi(t)(e,r,o)};var dh=t=>(e,r,n)=>pi(t)(e,r,n);var fh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return mi(t)(e,r,o)};var ph=t=>async(e,r,n)=>mi(t)(e,r,n);var mh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return xo(t)(e,r,o)};var hh=t=>(e,r,n)=>xo(t)(e,r,n);var gh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $o(t)(e,r,o)};var yh=t=>async(e,r,n)=>$o(t)(e,r,n);var _h=/^[cC][0-9a-z]{6,}$/,vh=/^[0-9a-z]+$/,bh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,wh=/^[0-9a-vA-V]{20}$/,xh=/^[A-Za-z0-9]{27}$/,Sh=/^[a-zA-Z0-9_-]{21}$/,$h=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var kh=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,au=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Eh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var dP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function zh(){return new RegExp(dP,"u")}var Ph=/^(?:(?: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])$/,Th=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Ch=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Oh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ih=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,cu=/^[A-Za-z0-9_-]*$/;var Rh=/^https?$/,Nh=/^\+[1-9]\d{6,14}$/,Ah="(?:(?:\\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])))",Dh=new RegExp(`^${Ah}$`);function jh(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Mh(t){return new RegExp(`^${jh(t)}$`)}function Zh(t){let e=jh({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Ah}T(?:${n})$`)}var Lh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var qh=/^-?\d+$/,uu=/^-?\d+(?:\.\d+)?$/,Fh=/^(?:true|false)$/i,Uh=/^null$/i;var Vh=/^[^A-Z]*$/,Bh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Hh={number:"number",bigint:"bigint",object:"date"},lu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Hh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),du=v("$ZodCheckGreaterThan",(t,e)=>{Pe.init(t,e);let r=Hh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Wh=v("$ZodCheckMultipleOf",(t,e)=>{Pe.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Qc(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Gh=v("$ZodCheckNumberFormat",(t,e)=>{Pe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=nu[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,r&&(a.pattern=qh)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var Jh=v("$ZodCheckMaxLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=wo(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Kh=v("$ZodCheckMinLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=wo(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),Yh=v("$ZodCheckLengthEquals",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!vo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=wo(o),a=s>e.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),ko=v("$ZodCheckStringFormat",(t,e)=>{var r,n;Pe.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),Qh=v("$ZodCheckRegex",(t,e)=>{ko.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Xh=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Vh),ko.init(t,e)}),eg=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Bh),ko.init(t,e)}),tg=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Ft(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),rg=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Ft(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),ng=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Ft(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var og=v("$ZodCheckOverwrite",(t,e)=>{Pe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var yi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
89
+ `)}var mo=gt(require("fs")),rh=gt(require("path")),nh=require("zlib");var Lf=require("node:events"),qf=require("node:fs"),Ls=require("node:fs/promises"),H=gt(require("node:path"),1);var Lt=require("node:fs/promises"),Ir=require("node:path"),Pf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},un={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(un);var Tf="READDIRP_RECURSIVE_ERROR",P0=new Set(["ENOENT","EPERM","EACCES","ELOOP",Tf]),kf=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],T0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),C0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),O0=t=>P0.has(t.code),I0=process.platform==="win32",Ef=t=>!0,zf=t=>{if(t===void 0)return Ef;if(typeof t=="function")return t;if(typeof t=="string"){let e=t.trim();return r=>r.basename===e}if(Array.isArray(t)){let e=t.map(r=>r.trim());return r=>e.some(n=>r.basename===n)}return Ef},Ga=class extends Pf.Readable{parents;reading;parent;_stat;_maxDepth;_wantsDir;_wantsFile;_wantsEverything;_root;_isDirent;_statsProp;_rdOptions;_fileFilter;_directoryFilter;_relStart;constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark??un.highWaterMark});let r={...un,...e},n=r.root??un.root,o=r.type??un.type;this._fileFilter=zf(r.fileFilter),this._directoryFilter=zf(r.directoryFilter);let s=r.lstat?Lt.lstat:Lt.stat;I0?this._stat=a=>s(a,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:un.depth,this._wantsDir=T0.has(o),this._wantsFile=C0.has(o),this._wantsEverything=o===et.EVERYTHING_TYPE,this._root=(0,Ir.resolve)(n),this._relStart=this._root.endsWith(Ir.sep)?this._root.length:this._root.length+1,this._isDirent=!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent};let i={path:this._root,depth:1};i.pending=this._exploreDir(this._root,1),this.parents=[i],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let r=this.parent,n=r&&r.files;if(n&&n.length>0){let{path:o,depth:s}=r,i=n.splice(0,e).map(c=>this._formatEntry(c,o)),a=this._isDirent?i:await Promise.all(i);for(let c of a){if(!c)continue;if(this.destroyed)return;let u=this._getEntryType(c);typeof u!="string"&&(u=await u),u==="directory"&&this._directoryFilter(c)?(s<=this._maxDepth&&this.parents.push({path:c.fullPath,depth:s+1}),this._wantsDir&&(this.push(c),e--)):(u==="file"||this._includeAsFile(c))&&this._fileFilter(c)&&this._wantsFile&&(this.push(c),e--)}}else{let o=this.parents.pop();if(!o){this.push(null);break}let s=o.pending??this._exploreDir(o.path,o.depth),i=this.parents[this.parents.length-1];if(i&&!i.pending&&(i.pending=this._exploreDir(i.path,i.depth)),this.parent=await s,this.destroyed)return}}}catch(r){this.destroy(r)}finally{this.reading=!1}}}async _exploreDir(e,r){let n;try{n=await(0,Lt.readdir)(e,this._rdOptions)}catch(o){this._onError(o)}return{files:n,depth:r,path:e}}_formatEntry(e,r){let n=this._isDirent?e.name:e,o=(0,Ir.join)(r,n),s={path:o.slice(this._relStart),fullPath:o,basename:n};return this._isDirent?(s.dirent=e,s):this._stat(o).then(i=>(s.stats=i,s),i=>{this._onError(i)})}_onError(e){O0(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}_getEntryType(e){if(!e||!(this._statsProp in e))return"";let r=e[this._statsProp];return r.isFile()?"file":r.isDirectory()?"directory":r.isSymbolicLink()?this._getSymlinkEntryType(e):""}async _getSymlinkEntryType(e){let r=e.fullPath;try{let n=await(0,Lt.realpath)(r),o=await(0,Lt.lstat)(n);if(o.isFile())return"file";if(o.isDirectory()){let s=n.length;if(r.startsWith(n)&&r[s]===Ir.sep){let i=new Error(`Circular symlink detected: "${r}" points to "${n}"`);return i.code=Tf,this._onError(i),""}return"directory"}}catch(n){this._onError(n)}return""}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}};function Cf(t,e={}){let r=e.entryType||e.type;if(r==="both"&&(r=et.FILE_DIR_TYPE),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!kf.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${kf.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");let n={...e,root:t};return r&&(n.type=r),new Ga(n)}var Dr=require("node:fs"),bt=require("node:fs/promises"),If=require("node:os"),he=gt(require("node:path"),1),R0="data",Ya="end",Rf="close",js=()=>{};var Ms=process.platform,Qa=Ms==="win32",D0=Ms==="darwin",N0=Ms==="linux",A0=Ms==="freebsd",Df=(0,If.type)()==="OS400",be={ALL:"all",READY:"ready",ADD:"add",CHANGE:"change",ADD_DIR:"addDir",UNLINK:"unlink",UNLINK_DIR:"unlinkDir",RAW:"raw",ERROR:"error"},vt=be,j0="watch",M0={lstat:bt.lstat,stat:bt.stat},Rr="listeners",Rs="errHandlers",ln="rawEmitters",Z0=[Rr,Rs,ln],L0=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),q0=t=>L0.has(he.extname(t).slice(1).toLowerCase()),Ka=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},so=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r)},F0=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e]},io=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e]},Nf=t=>t instanceof Set?t.size===0:!t,Ds=new Map;function Of(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&Ns(he.resolve(t,a),Rr,he.join(t,a))};try{return(0,Dr.watch)(t,{persistent:e.persistent},s)}catch(i){n(i);return}}var Ns=(t,e,r,n,o)=>{let s=Ds.get(t);s&&Ka(s[e],i=>{i(r,n,o)})},U0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Ds.get(e),c;if(!r.persistent)return c=Of(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)so(a,Rr,o),so(a,Rs,s),so(a,ln,i);else{if(c=Of(t,r,Ns.bind(null,e,Rr),s,Ns.bind(null,e,ln)),!c)return;c.on(vt.ERROR,async u=>{let l=Ns.bind(null,e,Rs);if(a&&(a.watcherUnusable=!0),Qa&&u.code==="EPERM")try{await(await(0,bt.open)(t,"r")).close(),l(u)}catch{}else l(u)}),a={listeners:o,errHandlers:s,rawEmitters:i,watcher:c},Ds.set(e,a)}return()=>{io(a,Rr,o),io(a,Rs,s),io(a,ln,i),Nf(a.listeners)&&(a.watcher.close(),Ds.delete(e),Z0.forEach(F0(a)),a.watcher=void 0,Object.freeze(a))}},Ja=new Map,V0=(t,e,r,n)=>{let{listener:o,rawEmitter:s}=n,i=Ja.get(e),a=i&&i.options;return a&&(a.persistent<r.persistent||a.interval>r.interval)&&((0,Dr.unwatchFile)(e),i=void 0),i?(so(i,Rr,o),so(i,ln,s)):(i={listeners:o,rawEmitters:s,options:r,watcher:(0,Dr.watchFile)(e,r,(c,u)=>{Ka(i.rawEmitters,d=>{d(vt.CHANGE,e,{curr:c,prev:u})});let l=c.mtimeMs;(c.size!==u.size||l>u.mtimeMs||l===0)&&Ka(i.listeners,d=>d(t,c))})},Ja.set(e,i)),()=>{io(i,Rr,o),io(i,ln,s),Nf(i.listeners)&&(Ja.delete(e),(0,Dr.unwatchFile)(e),i.options=i.watcher=void 0,Object.freeze(i))}},As=class{fsw;_boundHandleError;constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r)}_watchWithNodeFs(e,r){let n=this.fsw.options,o=he.dirname(e),s=he.basename(e);this.fsw._getWatchedDir(o).add(s);let a=he.resolve(e),c={persistent:n.persistent};r||(r=js);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&q0(s)?n.binaryInterval:n.interval,u=V0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=U0(e,a,c,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw});return u}_handleFile(e,r,n){if(this.fsw.closed)return;let o=he.dirname(e),s=he.basename(e),i=this.fsw._getWatchedDir(o),a=r;if(i.has(s))return;let c=async(l,d)=>{if(this.fsw._throttle(j0,e,5)){if(!d||d.mtimeMs===0)try{let p=await(0,bt.stat)(e);if(this.fsw.closed)return;let m=p.atimeMs,f=p.mtimeMs;if((!m||m<=f||f!==a.mtimeMs)&&this.fsw._emit(vt.CHANGE,e,p),(D0||N0||A0)&&a.ino!==p.ino){this.fsw._closeFile(l),a=p;let h=this._watchWithNodeFs(e,c);h&&this.fsw._addPathCloser(l,h)}else a=p}catch{this.fsw._remove(o,s)}else if(i.has(s)){let p=d.atimeMs,m=d.mtimeMs;(!p||p<=m||m!==a.mtimeMs)&&this.fsw._emit(vt.CHANGE,e,d),a=d}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(vt.ADD,e,0))return;this.fsw._emit(vt.ADD,e,r)}return u}async _handleSymlink(e,r,n,o){if(this.fsw.closed)return;let s=e.fullPath,i=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await(0,bt.realpath)(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(o)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(vt.CHANGE,n,e.stats)):(i.add(o),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(vt.ADD,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,r,n,o,s,i,a){e=he.join(e,"");let c=o?`${e}:${o}`:e;if(a=this.fsw._throttle("readdir",c,1e3),!a)return;let u=this.fsw._getWatchedDir(n.path),l=new Set,d=this.fsw._readdirp(e,{fileFilter:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p)});if(d)return d.on(R0,async p=>{if(this.fsw.closed){d=void 0;return}let m=p.path,f=he.join(e,m);if(l.add(m),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,f,m))){if(this.fsw.closed){d=void 0;return}(m===o||!o&&!u.has(m))&&(this.fsw._incrReadyCount(),f=he.join(s,he.relative(s,f)),this._addToNodeFs(f,r,n,i+1))}}).on(vt.ERROR,this._boundHandleError),new Promise((p,m)=>{if(!d)return m();d.once(Ya,()=>{if(this.fsw.closed){d=void 0;return}let f=a?a.clear():!1;p(void 0),u.getChildren().filter(h=>h!==e&&!l.has(h)).forEach(h=>{this.fsw._remove(e,h)}),d=void 0,f&&this._handleRead(e,!1,n,o,s,i,a)})})}async _handleDir(e,r,n,o,s,i,a){let c=this.fsw._getWatchedDir(he.dirname(e)),u=c.has(he.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&this.fsw._emit(vt.ADD_DIR,e,r),c.add(he.basename(e)),this.fsw._getWatchedDir(e);let l,d,p=this.fsw.options.depth;if((p==null||o<=p)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,i,s,e,o,l),this.fsw.closed))return;d=this._watchWithNodeFs(e,(m,f)=>{f&&f.mtimeMs===0||this._handleRead(m,!1,i,s,e,o,l)})}return d}async _addToNodeFs(e,r,n,o,s){let i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;let a=this.fsw._getWatchHelpers(e);n&&(a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await M0[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return i(),!1;let u=this.fsw.options.followSymlinks,l;if(c.isDirectory()){let d=he.resolve(e),p=u?await(0,bt.realpath)(e):e;if(this.fsw.closed||(l=await this._handleDir(a.watchPath,c,r,o,s,a,p),this.fsw.closed))return;d!==p&&p!==void 0&&this.fsw._symlinkPaths.set(d,p)}else if(c.isSymbolicLink()){let d=u?await(0,bt.realpath)(e):e;if(this.fsw.closed)return;let p=he.dirname(a.watchPath);if(this.fsw._getWatchedDir(p).add(a.watchPath),this.fsw._emit(vt.ADD,a.watchPath,c),l=await this._handleDir(p,c,r,o,e,a,d),this.fsw.closed)return;d!==void 0&&this.fsw._symlinkPaths.set(he.resolve(e),d)}else l=this._handleFile(a.watchPath,c,r);return i(),l&&this.fsw._addPathCloser(e,l),!1}catch(c){if(this.fsw._handleError(c))return i(),e}}};var Xa="/",B0="//",Ff=".",H0="..",W0="string",G0=/\\/g,Uf=/\/\//g,J0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,K0=/^\.[/\\]/;function Zs(t){return Array.isArray(t)?t:[t]}var ec=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function Y0(t){return typeof t=="function"?t:typeof t=="string"?e=>t===e:t instanceof RegExp?e=>t.test(e):typeof t=="object"&&t!==null?e=>{if(t.path===e)return!0;if(t.recursive){let r=H.relative(t.path,e);return r?!r.startsWith("..")&&!H.isAbsolute(r):!1}return!1}:()=>!1}function Q0(t){if(typeof t!="string")throw new Error("string expected");t=H.normalize(t),t=t.replace(/\\/g,"/");let e=!1;return t.startsWith("//")&&(e=!0),t=t.replace(Uf,"/"),e&&(t="/"+t),t}function Af(t,e,r){let n=Q0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function X0(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=Zs(t).map(o=>Y0(o));return e==null?(o,s)=>Af(n,o,s):Af(n,e)}var jf=t=>{let e=Zs(t).flat();if(!e.every(r=>typeof r===W0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Vf)},Mf=t=>{let e=t.replace(G0,Xa),r=!1;return e.startsWith(B0)&&(r=!0),e=e.replace(Uf,Xa),r&&(e=Xa+e),e},Vf=t=>Mf(H.normalize(Mf(t))),Zf=(t="")=>e=>typeof e=="string"?Vf(H.isAbsolute(e)?e:H.join(t,e)):e,eS=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),tS=Object.freeze(new Set),tc=class{path;_removeWatcher;items;constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set}add(e){let{items:r}=this;r&&e!==Ff&&e!==H0&&r.add(e)}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await(0,Ls.readdir)(n)}catch{this._removeWatcher&&this._removeWatcher(H.dirname(n),H.basename(n))}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;return e?[...e.values()]:[]}dispose(){this.items.clear(),this.path="",this._removeWatcher=js,this.items=tS,Object.freeze(this)}},rS="stat",nS="lstat",rc=class{fsw;path;watchPath;fullWatchPath;dirParts;followSymlinks;statMethod;constructor(e,r,n){this.fsw=n;let o=e;this.path=e=e.replace(K0,""),this.watchPath=o,this.fullWatchPath=H.resolve(o),this.dirParts=[],this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=r,this.statMethod=r?rS:nS}entryPath(e){return H.join(this.watchPath,H.relative(this.watchPath,e.fullPath))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}filterDir(e){return this.fsw._isntIgnored(this.entryPath(e),e.stats)}},nc=class extends Lf.EventEmitter{closed;options;_closers;_ignoredPaths;_throttled;_streams;_symlinkPaths;_watched;_pendingWrites;_pendingUnlinks;_readyCount;_emitReady;_closePromise;_userIgnored;_readyEmitted;_emitRaw;_boundRemove;_nodeFsHandler;constructor(e={}){super(),this.closed=!1,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._streams=new Set,this._symlinkPaths=new Map,this._watched=new Map,this._pendingWrites=new Map,this._pendingUnlinks=new Map,this._readyCount=0,this._readyEmitted=!1;let r=e.awaitWriteFinish,n={stabilityThreshold:2e3,pollInterval:100},o={persistent:!0,ignoreInitial:!1,ignorePermissionErrors:!1,interval:100,binaryInterval:300,followSymlinks:!0,usePolling:!1,atomic:!0,...e,ignored:e.ignored?Zs(e.ignored):Zs([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Df&&(o.usePolling=!0),o.atomic===void 0&&(o.atomic=!o.usePolling);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let c=s.toLowerCase();c==="false"||c==="0"?o.usePolling=!1:c==="true"||c==="1"?o.usePolling=!0:o.usePolling=!!c}let i=process.env.CHOKIDAR_INTERVAL;i&&(o.interval=Number.parseInt(i,10));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=js,this._readyEmitted=!0,process.nextTick(()=>this.emit(be.READY)))},this._emitRaw=(...c)=>this.emit(be.RAW,...c),this._boundRemove=this._remove.bind(this),this.options=o,this._nodeFsHandler=new As(this),Object.freeze(o)}_addIgnoredPath(e){if(ec(e)){for(let r of this._ignoredPaths)if(ec(r)&&r.path===e.path&&r.recursive===e.recursive)return}this._ignoredPaths.add(e)}_removeIgnoredPath(e){if(this._ignoredPaths.delete(e),typeof e=="string")for(let r of this._ignoredPaths)ec(r)&&r.path===e&&this._ignoredPaths.delete(r)}add(e,r,n){let{cwd:o}=this.options;this.closed=!1,this._closePromise=void 0;let s=jf(e);return o&&(s=s.map(i=>eS(i,o))),s.forEach(i=>{this._removeIgnoredPath(i)}),this._userIgnored=void 0,this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map(async i=>{let a=await this._nodeFsHandler._addToNodeFs(i,!n,void 0,0,r);return a&&this._emitReady(),a})).then(i=>{this.closed||i.forEach(a=>{a&&this.add(H.dirname(a),H.basename(r||a))})}),this}unwatch(e){if(this.closed)return this;let r=jf(e),{cwd:n}=this.options;return r.forEach(o=>{!H.isAbsolute(o)&&!this._closers.has(o)&&(n&&(o=H.join(n,o)),o=H.resolve(o)),this._closePath(o),this._addIgnoredPath(o),this._watched.has(o)&&this._addIgnoredPath({path:o,recursive:!0}),this._userIgnored=void 0}),this}close(){if(this._closePromise)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let o=n();o instanceof Promise&&e.push(o)})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),this._closers.clear(),this._watched.clear(),this._streams.clear(),this._symlinkPaths.clear(),this._throttled.clear(),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=(this.options.cwd?H.relative(this.options.cwd,n):n)||Ff;e[s]=r.getChildren().sort()}),e}emitWithAll(e,r){this.emit(e,...r),e!==be.ERROR&&this.emit(be.ALL,e,...r)}async _emit(e,r,n){if(this.closed)return;let o=this.options;Qa&&(r=H.normalize(r)),o.cwd&&(r=H.relative(o.cwd,r));let s=[r];n!=null&&s.push(n);let i=o.awaitWriteFinish,a;if(i&&(a=this._pendingWrites.get(r)))return a.lastChange=new Date,this;if(o.atomic){if(e===be.UNLINK)return this._pendingUnlinks.set(r,[e,...s]),setTimeout(()=>{this._pendingUnlinks.forEach((c,u)=>{this.emit(...c),this.emit(be.ALL,...c),this._pendingUnlinks.delete(u)})},typeof o.atomic=="number"?o.atomic:100),this;e===be.ADD&&this._pendingUnlinks.has(r)&&(e=be.CHANGE,this._pendingUnlinks.delete(r))}if(i&&(e===be.ADD||e===be.CHANGE)&&this._readyEmitted){let c=(u,l)=>{u?(e=be.ERROR,s[0]=u,this.emitWithAll(e,s)):l&&(s.length>1?s[1]=l:s.push(l),this.emitWithAll(e,s))};return this._awaitWriteFinish(r,i.stabilityThreshold,e,c),this}if(e===be.CHANGE&&!this._throttle(be.CHANGE,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===be.ADD||e===be.ADD_DIR||e===be.CHANGE)){let c=o.cwd?H.join(o.cwd,r):r,u;try{u=await(0,Ls.stat)(c)}catch{}if(!u||this.closed)return;s.push(u)}return this.emitWithAll(e,s),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(be.ERROR,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let o=this._throttled.get(e);if(!o)throw new Error("invalid throttle");let s=o.get(r);if(s)return s.count++,!1;let i,a=()=>{let u=o.get(r),l=u?u.count:0;return o.delete(r),clearTimeout(i),u&&clearTimeout(u.timeoutObject),l};i=setTimeout(a,n);let c={timeoutObject:i,clear:a,count:0};return o.set(r,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,o){let s=this.options.awaitWriteFinish;if(typeof s!="object")return;let i=s.pollInterval,a,c=e;this.options.cwd&&!H.isAbsolute(e)&&(c=H.join(this.options.cwd,e));let u=new Date,l=this._pendingWrites;function d(p){(0,qf.stat)(c,(m,f)=>{if(m||!l.has(e)){m&&m.code!=="ENOENT"&&o(m);return}let h=Number(new Date);p&&f.size!==p.size&&(l.get(e).lastChange=h);let g=l.get(e);h-g.lastChange>=r?(l.delete(e),o(void 0,f)):a=setTimeout(d,i,f)})}l.has(e)||(l.set(e,{lastChange:u,cancelWait:()=>(l.delete(e),clearTimeout(a),n)}),a=setTimeout(d,i))}_isIgnored(e,r){if(this.options.atomic&&J0.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,s=(this.options.ignored||[]).map(Zf(n)),a=[...[...this._ignoredPaths].map(Zf(n)),...s];this._userIgnored=X0(a,void 0)}return this._userIgnored(e,r)}_isntIgnored(e,r){return!this._isIgnored(e,r)}_getWatchHelpers(e){return new rc(e,this.options.followSymlinks,this)}_getWatchedDir(e){let r=H.resolve(e);return this._watched.has(r)||this._watched.set(r,new tc(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){return this.options.ignorePermissionErrors?!0:!!(Number(e.mode)&256)}_remove(e,r,n){let o=H.join(e,r),s=H.resolve(o);if(n=n??(this._watched.has(o)||this._watched.has(s)),!this._throttle("remove",o,100))return;!n&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(o).getChildren().forEach(p=>this._remove(o,p));let c=this._getWatchedDir(e),u=c.has(r);c.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let l=o;if(this.options.cwd&&(l=H.relative(this.options.cwd,o)),this.options.awaitWriteFinish&&this._pendingWrites.has(l)&&this._pendingWrites.get(l).cancelWait()===be.ADD)return;this._watched.delete(o),this._watched.delete(s);let d=n?be.UNLINK_DIR:be.UNLINK;u&&!this._isIgnored(o)&&this._emit(d,o),this._closePath(o)}_closePath(e){this._closeFile(e);let r=H.dirname(e);this._getWatchedDir(r).remove(H.basename(e))}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r)}_readdirp(e,r){if(this.closed)return;let n={type:be.ALL,alwaysStat:!0,lstat:!0,...r,depth:0},o=Cf(e,n);return this._streams.add(o),o.once(Rf,()=>{o=void 0}),o.once(Ya,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Bf(t,e={}){let r=new nc(e);return r.add(t),r}var Yc=gt(th()),po=class t{pino;context;constructor(e){this.context=e.context,this.pino=(0,Yc.default)({level:e.level},Yc.default.destination({dest:2,sync:!0}))}child(e){let r=new t({level:this.pino.level,format:"json",context:this.context?`${this.context}:${e}`:e});return r.pino=this.pino.child({context:e}),r}setLevel(e){this.pino.level=e}debug(e,r){this.pino.debug(r||{},e)}info(e,r){this.pino.info(r||{},e)}warn(e,r){this.pino.warn(r||{},e)}error(e,r,n){let o=n&&typeof n=="object"?n:{};this.pino.error({err:r,...o},e)}},fo=null;function Qc(t){return fo=new po(t),fo}function ne(){return fo||(fo=new po({level:"info",format:"text"})),fo}var Zz={failureThreshold:5,successThreshold:2,timeout:1e4,resetTimeout:6e4},si=class{state="CLOSED";failureCount=0;successCount=0;nextAttempt=Date.now();options;name;constructor(e,r={}){this.name=e,this.options={...Zz,...r}}getState(){return this.state}getStats(){return{state:this.state,failureCount:this.failureCount,successCount:this.successCount,nextAttempt:this.nextAttempt}}async execute(e){let r=ne();if(this.state==="OPEN"){if(Date.now()<this.nextAttempt){let n=new Error(`Circuit breaker '${this.name}' is OPEN. Next attempt at ${new Date(this.nextAttempt).toISOString()}`);throw r.warn("Circuit breaker is open",{name:this.name,nextAttempt:this.nextAttempt}),n}this.state="HALF_OPEN",this.successCount=0,r.info("Circuit breaker transitioning to HALF_OPEN",{name:this.name})}try{let n=await this.executeWithTimeout(e);return this.onSuccess(),n}catch(n){throw this.onFailure(),n}}async executeWithTimeout(e){return Promise.race([e(),new Promise((r,n)=>setTimeout(()=>n(new Error(`Operation timed out after ${this.options.timeout}ms`)),this.options.timeout))])}onSuccess(){let e=ne();this.failureCount=0,this.state==="HALF_OPEN"&&(this.successCount++,e.debug("Circuit breaker success in HALF_OPEN",{name:this.name,successCount:this.successCount,threshold:this.options.successThreshold}),this.successCount>=this.options.successThreshold&&(this.state="CLOSED",this.successCount=0,e.info("Circuit breaker closed",{name:this.name})))}onFailure(){let e=ne();this.failureCount++,e.debug("Circuit breaker failure",{name:this.name,failureCount:this.failureCount,threshold:this.options.failureThreshold,state:this.state}),(this.state==="HALF_OPEN"||this.failureCount>=this.options.failureThreshold)&&(this.state="OPEN",this.nextAttempt=Date.now()+this.options.resetTimeout,e.warn("Circuit breaker opened",{name:this.name,failureCount:this.failureCount,nextAttempt:this.nextAttempt}))}reset(){let e=ne();this.state="CLOSED",this.failureCount=0,this.successCount=0,this.nextAttempt=Date.now(),e.info("Circuit breaker manually reset",{name:this.name})}},ii=class{breakers=new Map;get(e,r){return this.breakers.has(e)||this.breakers.set(e,new si(e,r)),this.breakers.get(e)}getAll(){return new Map(this.breakers)}resetAll(){this.breakers.forEach(e=>{e.reset()})}getAllStats(){let e={};return this.breakers.forEach((r,n)=>{e[n]=r.getStats()}),e}},Lz=new ii;var ai=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=rh.resolve(e.path),this.watchForChanges=e.watchForChanges,this.reloadDebounce=e.reloadDebounce,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError}async load(){try{if(!mo.existsSync(this.filePath))return{success:!1,error:`Documentation file not found: ${this.filePath}`};let e;if(this.filePath.endsWith(".gz")){let o=await mo.promises.readFile(this.filePath);e=(0,nh.gunzipSync)(o).toString("utf-8")}else e=await mo.promises.readFile(this.filePath,"utf-8");let r;try{r=JSON.parse(e)}catch(o){return{success:!1,error:`Failed to parse JSON: ${o instanceof Error?o.message:String(o)}`}}let n=this.validateStructure(r);return n?{success:!1,error:n}:(this.currentData=r,this.watchForChanges&&!this.watcher&&this.startMonitoring(),{success:!0,data:r})}catch(e){return{success:!1,error:`Failed to load documentation: ${e instanceof Error?e.message:String(e)}`}}}startMonitoring(){!this.watchForChanges||this.watcher||this.startWatching()}async stopMonitoring(){this.reloadTimer&&(clearTimeout(this.reloadTimer),this.reloadTimer=void 0),this.watcher&&(await this.watcher.close(),this.watcher=void 0,ne().info("Stopped watching documentation file"))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}startWatching(){this.watcher||(this.watcher=Bf(this.filePath,{persistent:!0,ignoreInitial:!0}),this.watcher.on("change",()=>{this.scheduleReload()}),this.watcher.on("error",e=>{let r=e instanceof Error?e:new Error(String(e));ne().error("File watcher error",r),this.onErrorCallback&&this.onErrorCallback(r)}),ne().info(`Watching for changes: ${this.filePath}`))}scheduleReload(){this.reloadTimer&&clearTimeout(this.reloadTimer),this.reloadTimer=setTimeout(()=>{this.reload()},this.reloadDebounce)}async reload(){ne().info("Reloading documentation...");let e=await this.load();e.success&&e.data?(ne().info("Documentation reloaded successfully"),this.onReloadCallback&&this.onReloadCallback(e.data)):(ne().error("Failed to reload documentation",new Error(e.error)),this.onErrorCallback&&this.onErrorCallback(new Error(e.error)))}};var mn=class{options;constructor(e){this.options=e}async fetch(e,r){let n;for(let o=0;o<=this.options.maxRetries;o++)try{let s=await this.fetchOnce(e,r);if(!this.isRetryableError(void 0,s.status)||o>=this.options.maxRetries)return s;let i=this.calculateBackoff(o);await this.sleep(i)}catch(s){if(n=s instanceof Error?s:new Error(String(s)),o<this.options.maxRetries&&this.isRetryableError(n)){let i=this.calculateBackoff(o);await this.sleep(i);continue}throw n}throw n||new Error("Unknown error during fetch")}async fetchOnce(e,r){let n=new AbortController,o=setTimeout(()=>n.abort(),this.options.timeout);try{let s={Accept:"application/json","User-Agent":this.options.userAgent||"DocumentationLoader/1.0"};r&&r.forEach((u,l)=>{s[l]=u});let i=await fetch(e,{signal:n.signal,headers:s});clearTimeout(o);let a=new Map;i.headers.forEach((u,l)=>{a.set(l,u)});let c=await i.text();return{status:i.status,statusText:i.statusText,data:c,headers:a}}catch(s){throw clearTimeout(o),s instanceof Error&&s.name==="AbortError"?new Error(`Request timeout after ${this.options.timeout}ms`):s}}isRetryableError(e,r){if(r!==void 0){if(r>=200&&r<400)return!1;if(r>=500||r===408||r===429)return!0;if(r>=400&&r<500)return!1}if(e){let n=e.message.toLowerCase();if(n.includes("timeout")||n.includes("network")||n.includes("econnrefused")||n.includes("enotfound")||n.includes("econnreset"))return!0}return!0}calculateBackoff(e){return this.options.retryDelay*Math.pow(2,e)}sleep(e){return new Promise(r=>setTimeout(r,e))}};var ci=class{cache;constructor(){this.cache=new Map}set(e,r,n){let o={data:r,timestamp:Date.now()},s=this.getHeaderCaseInsensitive(n,"etag");s&&(o.etag=s);let i=this.getHeaderCaseInsensitive(n,"last-modified");i&&(o.lastModified=i),this.cache.set(e,o)}get(e){return this.cache.get(e)}getConditionalHeaders(e){let r=new Map,n=this.cache.get(e);return n&&(n.etag&&r.set("If-None-Match",n.etag),n.lastModified&&r.set("If-Modified-Since",n.lastModified)),r}clear(e){this.cache.delete(e)}clearAll(){this.cache.clear()}getHeaderCaseInsensitive(e,r){let n=r.toLowerCase();for(let[o,s]of e.entries())if(o.toLowerCase()===n)return s}};var Xc=class t extends Error{constructor(r,n,o){super(r);this.url=n;this.cause=o;this.name="NetworkError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}url;cause};var ho=class t extends Xc{constructor(r,n,o,s){super(r,n);this.statusCode=o;this.statusText=s;this.name="HttpError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}statusCode;statusText},go=class t extends Error{constructor(r,n){super(r);this.content=n;this.name="ParseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}content};var ui=class{url;httpClient;cacheManager;pollingTimer;currentData;pollingInterval;onReloadCallback;onErrorCallback;constructor(e){this.url=e.url,this.pollingInterval=e.pollingInterval,this.onReloadCallback=e.onReload,this.onErrorCallback=e.onError;let r={timeout:e.timeout,maxRetries:e.maxRetries,retryDelay:1e3,userAgent:"DocumentationLoader/1.0"};this.httpClient=new mn(r),this.cacheManager=new ci}async load(){return this.fetchDocumentation()}startMonitoring(){this.pollingTimer||(this.pollingTimer=setInterval(()=>{this.poll()},this.pollingInterval),ne().info(`Started polling ${this.url} every ${this.pollingInterval}ms`))}async stopMonitoring(){this.pollingTimer&&(clearInterval(this.pollingTimer),this.pollingTimer=void 0,ne().info(`Stopped polling ${this.url}`))}getCurrentData(){return this.currentData}async dispose(){await this.stopMonitoring(),this.cacheManager.clear(this.url),this.currentData=void 0,this.onReloadCallback=void 0,this.onErrorCallback=void 0}async poll(){try{ne().debug(`Polling ${this.url} for updates...`);let e=this.cacheManager.getConditionalHeaders(this.url),r=await this.httpClient.fetch(this.url,e);if(r.status===304){ne().debug("No changes detected (304 Not Modified)");return}if(r.status===200){let n=this.parseJson(r.data),o=this.validateStructure(n);if(o)throw new go(o,r.data);this.cacheManager.set(this.url,n,r.headers),this.currentData=n,ne().info(`Documentation updated from ${this.url}`),this.onReloadCallback&&this.onReloadCallback(n);return}throw new ho(`HTTP ${r.status}: ${r.statusText}`,this.url,r.status,r.statusText)}catch(e){let r=e instanceof Error?e.message:String(e);ne().error(`Polling error for ${this.url}`,e instanceof Error?e:new Error(r)),this.onErrorCallback&&this.onErrorCallback(e instanceof Error?e:new Error(r))}}async fetchDocumentation(){try{let e=this.cacheManager.get(this.url),r=e?this.cacheManager.getConditionalHeaders(this.url):void 0,n=await this.httpClient.fetch(this.url,r);if(n.status===304&&e)return ne().debug("Using cached documentation (304 Not Modified)"),this.currentData=e.data,{success:!0,data:e.data};if(n.status!==200)return{success:!1,error:`${new ho(`HTTP ${n.status}: ${n.statusText}`,this.url,n.status,n.statusText).message} (URL: ${this.url})`};let o=this.parseJson(n.data),s=this.validateStructure(o);return s?{success:!1,error:s}:(this.cacheManager.set(this.url,o,n.headers),this.currentData=o,{success:!0,data:o})}catch(e){let r=e instanceof Error?e.message:String(e);return{success:!1,error:`Failed to fetch documentation from ${this.url}: ${r}`}}}parseJson(e){try{return JSON.parse(e)}catch(r){let n=r instanceof Error?r.message:String(r);throw new go(`Failed to parse JSON: ${n}`,e)}}validateStructure(e){if(!e||typeof e!="object")return"Documentation must be an object";let r=e,n=["pipes","components","directives","injectables","interfaces","classes","modules"];for(let o of n){let s=r[o];if(s!==void 0&&!Array.isArray(s))return`${o} must be an array`}return null}};var yo=class{source;constructor(e){this.source=this.createSource(e)}async load(){let e=await this.source.load();return e.success&&this.source.startMonitoring(),e}getCurrentData(){return this.source.getCurrentData()}async stopWatching(){await this.source.stopMonitoring()}async dispose(){await this.source.dispose()}createSource(e){let r=er.detect(e.path);return r.type==="local"?new ai({path:r.normalizedPath,watchForChanges:e.watchForChanges??!0,reloadDebounce:e.reloadDebounce??1e3,onReload:e.onReload,onError:e.onError}):new ui({url:r.normalizedPath,timeout:e.timeout??1e4,maxRetries:e.maxRetries??3,pollingInterval:e.pollingInterval??6e4,onReload:e.onReload,onError:e.onError})}};var _o=class{build(e){let r={byName:new Map,bySelector:new Map,searchIndex:new Map,components:[],directives:[],pipes:[],services:[],lastUpdated:new Date,totalCount:0},n=new Map;if(e.components)for(let o of e.components){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and component. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"component"),this.indexComponent(o,r)}if(e.directives)for(let o of e.directives){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and directive. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"directive"),this.indexDirective(o,r)}if(e.pipes)for(let o of e.pipes){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and pipe. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"pipe"),this.indexPipe(o,r)}if(e.injectables)for(let o of e.injectables){if(n.has(o.name))throw new Error(`Duplicate name detected: "${o.name}" exists as both ${n.get(o.name)} and injectable. All component, directive, pipe, and service names must be unique across the entire documentation.`);n.set(o.name,"injectable"),this.indexInjectable(o,r)}return r.totalCount=r.components.length+r.directives.length+r.pipes.length+r.services.length,r}indexComponent(e,r){r.components.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexDirective(e,r){r.directives.push(e),r.byName.set(e.name,e),e.selector&&r.bySelector.set(e.selector,e),this.addToSearchIndex(e,r)}indexPipe(e,r){r.pipes.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}indexInjectable(e,r){r.services.push(e),r.byName.set(e.name,e),this.addToSearchIndex(e,r)}addToSearchIndex(e,r){let n=new Set;if(this.extractWords(e.name,n),"selector"in e&&e.selector&&this.extractWords(e.selector,n),e.description&&this.extractWords(e.description,n),"inputs"in e&&e.inputs)for(let o of e.inputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("outputs"in e&&e.outputs)for(let o of e.outputs)this.extractWords(o.name,n),o.description&&this.extractWords(o.description,n);if("methods"in e&&e.methods)for(let o of e.methods)this.extractWords(o.name,n);for(let o of n)r.searchIndex.has(o)||r.searchIndex.set(o,new Set),r.searchIndex.get(o).add(e.name)}extractWords(e,r){let n=e.toLowerCase(),o=n.split(/[^a-z0-9]+/).filter(s=>s.length>0);for(let s of o)r.add(s);o.length===0&&e.trim().length>0&&r.add(n.trim())}getStatistics(e){return{totalCount:e.totalCount,componentCount:e.components.length,directiveCount:e.directives.length,pipeCount:e.pipes.length,serviceCount:e.services.length,lastUpdated:e.lastUpdated}}rebuild(e,r){return this.build(e)}};var oh;function v(t,e,r){function n(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let u=i.prototype,l=Object.keys(u);for(let d=0;d<l.length;d++){let p=l[d];p in a||(a[p]=u[p].bind(a))}}let o=r?.Parent??Object;class s extends o{}Object.defineProperty(s,"name",{value:t});function i(a){var c;let u=r?.Parent?new s:this;n(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let l of u._zod.deferred)l();return u}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?!0:a?._zod?.traits?.has(t)}),Object.defineProperty(i,"name",{value:t}),i}var Ot=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},hn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}};(oh=globalThis).__zod_globalConfig??(oh.__zod_globalConfig={});var gn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(gn,t),gn}var Y={};df(Y,{BIGINT_FORMAT_RANGES:()=>ch,Class:()=>tu,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>or,allowsEval:()=>ou,assert:()=>Wz,assertEqual:()=>Uz,assertIs:()=>Bz,assertNever:()=>Hz,assertNotEqual:()=>Vz,assignProp:()=>rr,base64ToUint8Array:()=>lh,base64urlToUint8Array:()=>lP,cached:()=>_n,captureStackTrace:()=>fi,cleanEnum:()=>uP,cleanRegex:()=>xo,clone:()=>St,cloneDef:()=>Jz,createTransparentProxy:()=>tP,defineLazy:()=>oe,esc:()=>di,escapeRegex:()=>Ut,explicitlyAborted:()=>cu,extend:()=>oP,finalizeIssue:()=>ct,floatSafeRemainder:()=>ru,getElementAtPath:()=>Kz,getEnumValues:()=>bo,getLengthableOrigin:()=>So,getParsedType:()=>eP,getSizableOrigin:()=>uh,hexToUint8Array:()=>fP,isObject:()=>Lr,isPlainObject:()=>nr,issue:()=>vn,joinValues:()=>li,jsonStringifyReplacer:()=>yn,merge:()=>iP,mergeDefs:()=>Ft,normalizeParams:()=>R,nullish:()=>wo,numKeys:()=>Xz,objectClone:()=>Gz,omit:()=>nP,optionalKeys:()=>iu,parsedType:()=>uu,partial:()=>aP,pick:()=>rP,prefixIssues:()=>Vt,primitiveTypes:()=>ah,promiseAllObject:()=>Yz,propertyKeyTypes:()=>su,randomString:()=>Qz,required:()=>cP,safeExtend:()=>sP,shallowClone:()=>ih,slugify:()=>nu,stringifyPrimitive:()=>pi,uint8ArrayToBase64:()=>dh,uint8ArrayToBase64url:()=>dP,uint8ArrayToHex:()=>pP,unwrapMessage:()=>vo});function Uz(t){return t}function Vz(t){return t}function Bz(t){}function Hz(t){throw new Error("Unexpected value in exhaustive check")}function Wz(t){}function bo(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function li(t,e="|"){return t.map(r=>pi(r)).join(e)}function yn(t,e){return typeof e=="bigint"?e.toString():e}function _n(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function wo(t){return t==null}function xo(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function ru(t,e){let r=t/e,n=Math.round(r),o=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-n)<o?0:r-n}var sh=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==sh)return n===void 0&&(n=sh,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Gz(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function rr(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ft(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Jz(t){return Ft(t._zod.def)}function Kz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Yz(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let s=0;s<e.length;s++)o[e[s]]=n[s];return o})}function Qz(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let n=0;n<t;n++)r+=e[Math.floor(Math.random()*e.length)];return r}function di(t){return JSON.stringify(t)}function nu(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var fi="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Lr(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var ou=_n(()=>{if(gn.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function nr(t){if(Lr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(Lr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ih(t){return nr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Xz(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var eP=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},su=new Set(["string","number","symbol"]),ah=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ut(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(t,e,r){let n=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(n._zod.parent=t),n}function R(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function tP(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,s){return e??(e=t()),Reflect.set(e,n,o,s)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function pi(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function iu(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var au={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ch={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function rP(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=Ft(t._zod.def,{get shape(){let i={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(i[a]=r.shape[a])}return rr(this,"shape",i),i},checks:[]});return St(t,s)}function nP(t,e){let r=t._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=Ft(t._zod.def,{get shape(){let i={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete i[a]}return rr(this,"shape",i),i},checks:[]});return St(t,s)}function oP(t,e){if(!nr(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let i in e)if(Object.getOwnPropertyDescriptor(s,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Ft(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return rr(this,"shape",s),s}});return St(t,o)}function sP(t,e){if(!nr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ft(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return rr(this,"shape",n),n}});return St(t,r)}function iP(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=Ft(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e._zod.def.shape};return rr(this,"shape",n),n},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return St(t,r)}function aP(t,e,r){let o=e._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let i=Ft(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);r[u]&&(c[u]=t?new t({type:"optional",innerType:a[u]}):a[u])}else for(let u in a)c[u]=t?new t({type:"optional",innerType:a[u]}):a[u];return rr(this,"shape",c),c},checks:[]});return St(e,i)}function cP(t,e,r){let n=Ft(e._zod.def,{get shape(){let o=e._zod.def.shape,s={...o};if(r)for(let i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(s[i]=new t({type:"nonoptional",innerType:o[i]}))}else for(let i in o)s[i]=new t({type:"nonoptional",innerType:o[i]});return rr(this,"shape",s),s}});return St(e,n)}function or(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function cu(t,e=0){if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===!1)return!0;return!1}function Vt(t,e){return e.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function vo(t){return typeof t=="string"?t:t?.message}function ct(t,e,r){let n=t.message?t.message:vo(t.inst?._zod.def?.error?.(t))??vo(e?.error?.(t))??vo(r.customError?.(t))??vo(r.localeError?.(t))??"Invalid input",{inst:o,continue:s,input:i,...a}=t;return a.path??(a.path=[]),a.message=n,e?.reportInput&&(a.input=i),a}function uh(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function So(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function uu(t){let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function vn(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function uP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function lh(t){let e=atob(t),r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e.charCodeAt(n);return r}function dh(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function lP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return lh(e+r)}function dP(t){return dh(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function fP(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)r[n/2]=Number.parseInt(e.slice(n,n+2),16);return r}function pP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var tu=class{constructor(...e){}};var fh=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,yn,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},mi=v("$ZodError",fh),lu=v("$ZodError",fh,{Parent:Error});function ph(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function mh(t,e=r=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(e(i));else{let c=r,u=0;for(;u<a.length;){let l=a[u];u===a.length-1?(c[l]=c[l]||{_errors:[]},c[l]._errors.push(e(i))):c[l]=c[l]||{_errors:[]},c=c[l],u++}}}};return n(t),r}var hi=t=>(e,r,n,o)=>{let s=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Ot;if(i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>ct(c,s,tt())));throw fi(a,o?.callee),a}return i.value};var gi=t=>async(e,r,n,o)=>{let s=n?{...n,async:!0}:{async:!0},i=e._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){let a=new(o?.Err??t)(i.issues.map(c=>ct(c,s,tt())));throw fi(a,o?.callee),a}return i.value};var $o=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=e._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Ot;return s.issues.length?{success:!1,error:new(t??mi)(s.issues.map(i=>ct(i,o,tt())))}:{success:!0,data:s.value}},ko=$o(lu),Eo=t=>async(e,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=e._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new t(s.issues.map(i=>ct(i,o,tt())))}:{success:!0,data:s.value}},yi=Eo(lu),hh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return hi(t)(e,r,o)};var gh=t=>(e,r,n)=>hi(t)(e,r,n);var yh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return gi(t)(e,r,o)};var _h=t=>async(e,r,n)=>gi(t)(e,r,n);var vh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $o(t)(e,r,o)};var bh=t=>(e,r,n)=>$o(t)(e,r,n);var wh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Eo(t)(e,r,o)};var xh=t=>async(e,r,n)=>Eo(t)(e,r,n);var Sh=/^[cC][0-9a-z]{6,}$/,$h=/^[0-9a-z]+$/,kh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Eh=/^[0-9a-vA-V]{20}$/,zh=/^[A-Za-z0-9]{27}$/,Ph=/^[a-zA-Z0-9_-]{21}$/,Th=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Ch=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,du=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var Oh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var hP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ih(){return new RegExp(hP,"u")}var Rh=/^(?:(?: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])$/,Dh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Nh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ah=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fu=/^[A-Za-z0-9_-]*$/;var Mh=/^https?$/,Zh=/^\+[1-9]\d{6,14}$/,Lh="(?:(?:\\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])))",qh=new RegExp(`^${Lh}$`);function Fh(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Uh(t){return new RegExp(`^${Fh(t)}$`)}function Vh(t){let e=Fh({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${Lh}T(?:${n})$`)}var Bh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Hh=/^-?\d+$/,pu=/^-?\d+(?:\.\d+)?$/,Wh=/^(?:true|false)$/i,Gh=/^null$/i;var Jh=/^[^A-Z]*$/,Kh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Yh={number:"number",bigint:"bigint",object:"date"},mu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Yh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?o.maximum=e.value:o.exclusiveMaximum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value<=e.value:n.value<e.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),hu=v("$ZodCheckGreaterThan",(t,e)=>{Pe.init(t,e);let r=Yh[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,s=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),Qh=v("$ZodCheckMultipleOf",(t,e)=>{Pe.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):ru(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),Xh=v("$ZodCheckNumberFormat",(t,e)=>{Pe.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,s]=au[e.format];t._zod.onattach.push(i=>{let a=i._zod.bag;a.format=e.format,a.minimum=o,a.maximum=s,r&&(a.pattern=Hh)}),t._zod.check=i=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:e.format,code:"invalid_type",continue:!1,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,inclusive:!0,continue:!e.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:t,continue:!e.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:t,continue:!e.abort})}});var eg=v("$ZodCheckMaxLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<o&&(n._zod.bag.maximum=e.maximum)}),t._zod.check=n=>{let o=n.value;if(o.length<=e.maximum)return;let i=So(o);n.issues.push({origin:i,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),tg=v("$ZodCheckMinLength",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let i=So(o);n.issues.push({origin:i,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),rg=v("$ZodCheckLengthEquals",(t,e)=>{var r;Pe.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!wo(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,s=o.length;if(s===e.length)return;let i=So(o),a=s>e.length;n.issues.push({origin:i,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),zo=v("$ZodCheckStringFormat",(t,e)=>{var r,n;Pe.init(t,e),t._zod.onattach.push(o=>{let s=o._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),ng=v("$ZodCheckRegex",(t,e)=>{zo.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),og=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Jh),zo.init(t,e)}),sg=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Kh),zo.init(t,e)}),ig=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Ut(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),ag=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Ut(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),cg=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Ut(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});var ug=v("$ZodCheckOverwrite",(t,e)=>{Pe.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var vi=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
90
90
  `).filter(i=>i),o=Math.min(...n.map(i=>i.length-i.trimStart().length)),s=n.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,o.join(`
91
- `))}};var ig={major:4,minor:4,patch:3};var le=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=ig;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,c)=>{let u=nr(i),l;for(let d of a){if(d._zod.def.when){if(ou(i)||!d._zod.def.when(i))continue}else if(u)continue;let m=i.issues.length,p=d._zod.check(i);if(p instanceof Promise&&c?.async===!1)throw new Tt;if(l||p instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await p,i.issues.length!==m&&(u||(u=nr(i,m)))});else{if(i.issues.length===m)continue;u||(u=nr(i,m))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(nr(i))return i.aborted=!0,i;let u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Tt;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Tt;return c.then(u=>o(u,n,a))}return o(c,n,a)}}oe(t,"~standard",()=>({validate:o=>{try{let s=So(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return hi(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),bi=v("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Lh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),de=v("$ZodStringFormat",(t,e)=>{ko.init(t,e),bi.init(t,e)}),hg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),gg=v("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=au(n))}else e.pattern??(e.pattern=au());de.init(t,e)}),yg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Eh),de.init(t,e)}),_g=v("$ZodURL",(t,e)=>{de.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===Rh.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),vg=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=zh()),de.init(t,e)}),bg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Sh),de.init(t,e)}),wg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=_h),de.init(t,e)}),xg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=vh),de.init(t,e)}),Sg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=bh),de.init(t,e)}),$g=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=wh),de.init(t,e)}),kg=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=xh),de.init(t,e)}),Eg=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Zh(e)),de.init(t,e)}),zg=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Dh),de.init(t,e)}),Pg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Mh(e)),de.init(t,e)}),Tg=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),Cg=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e),t._zod.bag.format="ipv4"}),Og=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var Ig=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e)}),Rg=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Ng(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Ag=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ih),de.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Ng(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function mP(t){if(!cu.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ng(r)}var Dg=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=cu),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{mP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),jg=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Nh),de.init(t,e)});function hP(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var Mg=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{hP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var pu=v("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??uu,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Zg=v("$ZodNumberFormat",(t,e)=>{Gh.init(t,e),pu.init(t,e)}),Lg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=Fh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}});var qg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Uh,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}});var Fg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Ug=v("$ZodNever",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function ag(t,e,r){t.issues.length&&e.issues.push(...Ut(r,t.issues)),e.value[r]=t.value}var Vg=v("$ZodArray",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=e.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>ag(u,r,i))):ag(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function vi(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Ut(r,t.issues))}if(!i&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function Bg(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=ru(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Hg(t,e,r,n,o,s){let i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let m in e){if(m==="__proto__"||a.has(m))continue;if(u==="never"){i.push(m);continue}let p=c.run({value:e[m],issues:[]},n);p instanceof Promise?t.push(p.then(f=>vi(f,r,m,e,l,d))):vi(p,r,m,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var gP=v("$ZodObject",(t,e)=>{if(le.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=hn(()=>Bg(e));oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let o=Mr,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=n.value);let u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let m of i.keys){let p=d[m],f=p._zod.optin==="optional",h=p._zod.optout==="optional",g=p._zod.run({value:u[m],issues:[]},c);g instanceof Promise?l.push(g.then(_=>vi(_,a,m,u,f,h))):vi(g,a,m,u,f,h)}return s?Hg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Wg=v("$ZodObjectJIT",(t,e)=>{gP.init(t,e);let r=t._zod.parse,n=hn(()=>Bg(e)),o=m=>{let p=new yi(["shape","payload","ctx"]),f=n.value,h=w=>{let S=ui(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};p.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of f.keys)g[w]=`key_${_++}`;p.write("const newResult = {};");for(let w of f.keys){let S=g[w],k=ui(w),W=m[w],Z=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";p.write(`const ${S} = ${h(w)};`),Z&&re?p.write(`
91
+ `))}};var dg={major:4,minor:4,patch:3};var le=v("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=dg;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let s of o._zod.onattach)s(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,c)=>{let u=or(i),l;for(let d of a){if(d._zod.def.when){if(cu(i)||!d._zod.def.when(i))continue}else if(u)continue;let p=i.issues.length,m=d._zod.check(i);if(m instanceof Promise&&c?.async===!1)throw new Ot;if(l||m instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await m,i.issues.length!==p&&(u||(u=or(i,p)))});else{if(i.issues.length===p)continue;u||(u=or(i,p))}}return l?l.then(()=>i):i},s=(i,a,c)=>{if(or(i))return i.aborted=!0,i;let u=o(a,n,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;return u.then(l=>t._zod.parse(l,c))}return t._zod.parse(u,c)};t._zod.run=(i,a)=>{if(a.skipChecks)return t._zod.parse(i,a);if(a.direction==="backward"){let u=t._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return u instanceof Promise?u.then(l=>s(l,i,a)):s(u,i,a)}let c=t._zod.parse(i,a);if(c instanceof Promise){if(a.async===!1)throw new Ot;return c.then(u=>o(u,n,a))}return o(c,n,a)}}oe(t,"~standard",()=>({validate:o=>{try{let s=ko(t,o);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return yi(t,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),xi=v("$ZodString",(t,e)=>{le.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Bh(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),de=v("$ZodStringFormat",(t,e)=>{zo.init(t,e),xi.init(t,e)}),bg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e)}),wg=v("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=du(n))}else e.pattern??(e.pattern=du());de.init(t,e)}),xg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e)}),Sg=v("$ZodURL",(t,e)=>{de.init(t,e),t._zod.check=r=>{try{let n=r.value.trim();if(!e.normalize&&e.protocol?.source===Mh.source&&!/^https?:\/\//i.test(n)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let o=new URL(n);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),$g=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Ih()),de.init(t,e)}),kg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e)}),Eg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Sh),de.init(t,e)}),zg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),Pg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),Tg=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Eh),de.init(t,e)}),Cg=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=zh),de.init(t,e)}),Og=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Vh(e)),de.init(t,e)}),Ig=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=qh),de.init(t,e)}),Rg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Uh(e)),de.init(t,e)}),Dg=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e)}),Ng=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Rh),de.init(t,e),t._zod.bag.format="ipv4"}),Ag=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Dh),de.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}});var jg=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Nh),de.init(t,e)}),Mg=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Ah),de.init(t,e),t._zod.check=r=>{let n=r.value.split("/");try{if(n.length!==2)throw new Error;let[o,s]=n;if(!s)throw new Error;let i=Number(s);if(`${i}`!==s)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function Zg(t){if(t==="")return!0;if(/\s/.test(t)||t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var Lg=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=jh),de.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Zg(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function _P(t){if(!fu.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Zg(r)}var qg=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=fu),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{_P(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Fg=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Zh),de.init(t,e)});function vP(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}var Ug=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{vP(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}});var yu=v("$ZodNumber",(t,e)=>{le.init(t,e),t._zod.pattern=t._zod.bag.pattern??pu,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...s?{received:s}:{}}),r}}),Vg=v("$ZodNumberFormat",(t,e)=>{Xh.init(t,e),yu.init(t,e)}),Bg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=Wh,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}});var Hg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Gh,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}});var Wg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Gg=v("$ZodNever",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)});function fg(t,e,r){t.issues.length&&e.issues.push(...Vt(r,t.issues)),e.value[r]=t.value}var Jg=v("$ZodArray",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let s=[];for(let i=0;i<o.length;i++){let a=o[i],c=e.element._zod.run({value:a,issues:[]},n);c instanceof Promise?s.push(c.then(u=>fg(u,r,i))):fg(c,r,i)}return s.length?Promise.all(s).then(()=>r):r}});function wi(t,e,r,n,o,s){let i=r in n;if(t.issues.length){if(o&&s&&!i)return;e.issues.push(...Vt(r,t.issues))}if(!i&&!o){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?i&&(e.value[r]=void 0):e.value[r]=t.value}function Kg(t){let e=Object.keys(t.shape);for(let n of e)if(!t.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=iu(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function Yg(t,e,r,n,o,s){let i=[],a=o.keySet,c=o.catchall._zod,u=c.def.type,l=c.optin==="optional",d=c.optout==="optional";for(let p in e){if(p==="__proto__"||a.has(p))continue;if(u==="never"){i.push(p);continue}let m=c.run({value:e[p],issues:[]},n);m instanceof Promise?t.push(m.then(f=>wi(f,r,p,e,l,d))):wi(m,r,p,e,l,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var bP=v("$ZodObject",(t,e)=>{if(le.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}let n=_n(()=>Kg(e));oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let u in a){let l=a[u]._zod;if(l.values){c[u]??(c[u]=new Set);for(let d of l.values)c[u].add(d)}}return c});let o=Lr,s=e.catchall,i;t._zod.parse=(a,c)=>{i??(i=n.value);let u=a.value;if(!o(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:t}),a;a.value={};let l=[],d=i.shape;for(let p of i.keys){let m=d[p],f=m._zod.optin==="optional",h=m._zod.optout==="optional",g=m._zod.run({value:u[p],issues:[]},c);g instanceof Promise?l.push(g.then(_=>wi(_,a,p,u,f,h))):wi(g,a,p,u,f,h)}return s?Yg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Qg=v("$ZodObjectJIT",(t,e)=>{bP.init(t,e);let r=t._zod.parse,n=_n(()=>Kg(e)),o=p=>{let m=new vi(["shape","payload","ctx"]),f=n.value,h=w=>{let S=di(w);return`shape[${S}]._zod.run({ value: input[${S}], issues: [] }, ctx)`};m.write("const input = payload.value;");let g=Object.create(null),_=0;for(let w of f.keys)g[w]=`key_${_++}`;m.write("const newResult = {};");for(let w of f.keys){let S=g[w],k=di(w),W=p[w],Z=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";m.write(`const ${S} = ${h(w)};`),Z&&re?m.write(`
92
92
  if (${S}.issues.length) {
93
93
  if (${k} in input) {
94
94
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
@@ -106,7 +106,7 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
106
106
  newResult[${k}] = ${S}.value;
107
107
  }
108
108
 
109
- `):Z?p.write(`
109
+ `):Z?m.write(`
110
110
  if (${S}.issues.length) {
111
111
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
112
112
  ...iss,
@@ -122,7 +122,7 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
122
122
  newResult[${k}] = ${S}.value;
123
123
  }
124
124
 
125
- `):p.write(`
125
+ `):m.write(`
126
126
  const ${S}_present = ${k} in input;
127
127
  if (${S}.issues.length) {
128
128
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
@@ -147,11 +147,11 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
147
147
  }
148
148
  }
149
149
 
150
- `)}p.write("payload.value = newResult;"),p.write("return payload;");let x=p.compile();return(w,S)=>x(m,w,S)},s,i=Mr,a=!pn.jitless,u=a&&eu.value,l=e.catchall,d;t._zod.parse=(m,p)=>{d??(d=n.value);let f=m.value;return i(f)?a&&u&&p?.async===!1&&p.jitless!==!0?(s||(s=o(e.shape)),m=s(m,p),l?Hg([],f,m,p,d,t):m):r(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),m)}});function cg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!nr(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>at(i,n,tt())))}),e)}var mu=v("$ZodUnion",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),oe(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),oe(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),oe(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>bo(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>cg(a,n,t,o)):cg(i,n,t,o)}});var Gg=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,mu.init(t,e);let r=t._zod.parse;oe(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=hn(()=>{let o=e.options,s=new Map;for(let i of o){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!Mr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=n.value.get(i?.[e.discriminator]);return a?a._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:i,path:[e.discriminator],inst:t}),o)}}),Jg=v("$ZodIntersection",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>ug(r,c,u)):ug(r,s,i)}});function fu(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(rr(t)&&rr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let i=fu(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],i=fu(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ug(t,e,r){let n=new Map,o;for(let a of e.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&t.issues.push({...o,keys:s}),nr(t))return t;let i=fu(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var Kg=v("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!rr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(p=>at(p,n,tt())),input:u,path:[u],inst:t});continue}let d=l.value,m=e.valueType._zod.run({value:o[u],issues:[]},n);m instanceof Promise?s.push(m.then(p=>{p.issues.length&&r.issues.push(...Ut(u,p.issues)),r.value[d]=p.value})):(m.issues.length&&r.issues.push(...Ut(u,m.issues)),r.value[d]=m.value)}let c;for(let u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&uu.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>at(d,n,tt())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:o[a],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Ut(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Ut(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var Yg=v("$ZodEnum",(t,e)=>{le.init(t,e);let r=_o(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>tu.has(typeof o)).map(o=>typeof o=="string"?Ft(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:t}),o}}),Qg=v("$ZodLiteral",(t,e)=>{if(le.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ft(n):n?Ft(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var Xg=v("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Tt;return r.value=o,r.fallback=!0,r}});function lg(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var hu=v("$ZodOptional",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.optout="optional",oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bo(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>lg(i,o)):lg(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),ey=v("$ZodExactOptional",(t,e)=>{hu.init(t,e),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),ty=v("$ZodNullable",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.innerType._zod.optin),oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${bo(r.source)}|null)$`):void 0}),oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),ry=v("$ZodDefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>dg(s,e)):dg(o,e)}});function dg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var ny=v("$ZodPrefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),oy=v("$ZodNonOptional",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>fg(s,t)):fg(o,t)}});function fg(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var sy=v("$ZodCatch",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>at(i,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>at(s,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var gu=v("$ZodPipe",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>e.in._zod.values),oe(t._zod,"optin",()=>e.in._zod.optin),oe(t._zod,"optout",()=>e.out._zod.optout),oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(i=>_i(i,e.in,n)):_i(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>_i(s,e.out,n)):_i(o,e.out,n)}});function _i(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var iy=v("$ZodPreprocess",(t,e)=>{gu.init(t,e)}),ay=v("$ZodReadonly",(t,e)=>{le.init(t,e),oe(t._zod,"propValues",()=>e.innerType._zod.propValues),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"optin",()=>e.innerType?._zod?.optin),oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(pg):pg(o)}});function pg(t){return t.value=Object.freeze(t.value),t}var cy=v("$ZodCustom",(t,e)=>{Pe.init(t,e),le.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>mg(s,r,n,t));mg(o,r,n,t)}});function mg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(gn(o))}}var yP=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,i=su(o.input),a=n[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${di(o.values[0])}`:`Invalid option: expected one of ${ci(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=e(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=e(o.origin);return i?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${ci(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function uy(){return{localeError:yP()}}var ly;var yu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function _P(){return new yu}(ly=globalThis).__zod_globalRegistry??(ly.__zod_globalRegistry=_P());var Zr=globalThis.__zod_globalRegistry;function dy(t,e){return new t({type:"string",...R(e)})}function fy(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function _u(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function py(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function my(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function hy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function gy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function yy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}function _y(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}function vy(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function by(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function wy(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function xy(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Sy(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function $y(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function ky(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function Ry(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Ny(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function Ay(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Dy(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function jy(t,e){return new t({type:"number",checks:[],...R(e)})}function My(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function Zy(t,e){return new t({type:"boolean",...R(e)})}function Ly(t,e){return new t({type:"null",...R(e)})}function qy(t){return new t({type:"unknown"})}function Fy(t,e){return new t({type:"never",...R(e)})}function wi(t,e){return new lu({check:"less_than",...R(e),value:t,inclusive:!1})}function Eo(t,e){return new lu({check:"less_than",...R(e),value:t,inclusive:!0})}function xi(t,e){return new du({check:"greater_than",...R(e),value:t,inclusive:!1})}function zo(t,e){return new du({check:"greater_than",...R(e),value:t,inclusive:!0})}function Si(t,e){return new Wh({check:"multiple_of",...R(e),value:t})}function $i(t,e){return new Jh({check:"max_length",...R(e),maximum:t})}function yn(t,e){return new Kh({check:"min_length",...R(e),minimum:t})}function ki(t,e){return new Yh({check:"length_equals",...R(e),length:t})}function vu(t,e){return new Qh({check:"string_format",format:"regex",...R(e),pattern:t})}function bu(t){return new Xh({check:"string_format",format:"lowercase",...R(t)})}function wu(t){return new eg({check:"string_format",format:"uppercase",...R(t)})}function xu(t,e){return new tg({check:"string_format",format:"includes",...R(e),includes:t})}function Su(t,e){return new rg({check:"string_format",format:"starts_with",...R(e),prefix:t})}function $u(t,e){return new ng({check:"string_format",format:"ends_with",...R(e),suffix:t})}function or(t){return new og({check:"overwrite",tx:t})}function ku(t){return or(e=>e.normalize(t))}function Eu(){return or(t=>t.trim())}function zu(){return or(t=>t.toLowerCase())}function Pu(){return or(t=>t.toUpperCase())}function Tu(){return or(t=>Xc(t))}function Uy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Vy(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function By(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Hy(t,e){let r=vP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(gn(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(gn(s))}},t(n.value,n)),e);return r}function vP(t,e){let r=new Pe({check:"custom",...R(e)});return r._zod.check=t,r}function Cu(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??Zr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Se(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let m=i.schema,p=e.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(t,e,m,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),Se(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&qe(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function Ou(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}let o=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,m=t.external.uri??(f=>f);if(d)return{ref:m(d)};let p=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=p,{defId:p,ref:`${m("__shared")}#/${a}/${p}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
150
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let x=m.compile();return(w,S)=>x(p,w,S)},s,i=Lr,a=!gn.jitless,u=a&&ou.value,l=e.catchall,d;t._zod.parse=(p,m)=>{d??(d=n.value);let f=p.value;return i(f)?a&&u&&m?.async===!1&&m.jitless!==!0?(s||(s=o(e.shape)),p=s(p,m),l?Yg([],f,p,m,d,t):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),p)}});function pg(t,e,r,n){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let o=t.filter(s=>!or(s));return o.length===1?(e.value=o[0].value,o[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(i=>ct(i,n,tt())))}),e)}var _u=v("$ZodUnion",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),oe(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),oe(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),oe(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>xo(o.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(n,o)=>{if(r)return r(n,o);let s=!1,i=[];for(let a of e.options){let c=a._zod.run({value:n.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>pg(a,n,t,o)):pg(i,n,t,o)}});var Xg=v("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,_u.init(t,e);let r=t._zod.parse;oe(t._zod,"propValues",()=>{let o={};for(let s of e.options){let i=s._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(i)){o[a]||(o[a]=new Set);for(let u of c)o[a].add(u)}}return o});let n=_n(()=>{let o=e.options,s=new Map;for(let i of o){let a=i._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});t._zod.parse=(o,s)=>{let i=o.value;if(!Lr(i))return o.issues.push({code:"invalid_type",expected:"object",input:i,inst:t}),o;let a=n.value.get(i?.[e.discriminator]);return a?a._zod.run(o,s):e.unionFallback||s.direction==="backward"?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(n.value.keys()),input:i,path:[e.discriminator],inst:t}),o)}}),ey=v("$ZodIntersection",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,s=e.left._zod.run({value:o,issues:[]},n),i=e.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>mg(r,c,u)):mg(r,s,i)}});function gu(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(nr(t)&&nr(e)){let r=Object.keys(e),n=Object.keys(t).filter(s=>r.indexOf(s)!==-1),o={...t,...e};for(let s of n){let i=gu(t[s],e[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<t.length;n++){let o=t[n],s=e[n],i=gu(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function mg(t,e,r){let n=new Map,o;for(let a of e.issues)if(a.code==="unrecognized_keys"){o??(o=a);for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else t.issues.push(a);let s=[...n].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&o&&t.issues.push({...o,keys:s}),or(t))return t;let i=gu(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var ty=v("$ZodRecord",(t,e)=>{le.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!nr(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let s=[],i=e.keyType._zod.values;if(i){r.value={};let a=new Set;for(let u of i)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let l=e.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(l.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(m=>ct(m,n,tt())),input:u,path:[u],inst:t});continue}let d=l.value,p=e.valueType._zod.run({value:o[u],issues:[]},n);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&r.issues.push(...Vt(u,m.issues)),r.value[d]=m.value})):(p.issues.length&&r.issues.push(...Vt(u,p.issues)),r.value[d]=p.value)}let c;for(let u in o)a.has(u)||(c=c??[],c.push(u));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(o,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&pu.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?r.value[a]=o[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>ct(d,n,tt())),input:a,path:[a],inst:t});continue}let l=e.valueType._zod.run({value:o[a],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...Vt(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Vt(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ry=v("$ZodEnum",(t,e)=>{le.init(t,e);let r=bo(e.entries),n=new Set(r);t._zod.values=n,t._zod.pattern=new RegExp(`^(${r.filter(o=>su.has(typeof o)).map(o=>typeof o=="string"?Ut(o):o.toString()).join("|")})$`),t._zod.parse=(o,s)=>{let i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:t}),o}}),ny=v("$ZodLiteral",(t,e)=>{if(le.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(n=>typeof n=="string"?Ut(n):n?Ut(n.toString()):String(n)).join("|")})$`),t._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),n}});var oy=v("$ZodTransform",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hn(t.constructor.name);let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r.fallback=!0,r));if(o instanceof Promise)throw new Ot;return r.value=o,r.fallback=!0,r}});function hg(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var vu=v("$ZodOptional",(t,e)=>{le.init(t,e),t._zod.optin="optional",t._zod.optout="optional",oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${xo(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>{if(e.innerType._zod.optin==="optional"){let o=r.value,s=e.innerType._zod.run(r,n);return s instanceof Promise?s.then(i=>hg(i,o)):hg(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),sy=v("$ZodExactOptional",(t,e)=>{vu.init(t,e),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,n)=>e.innerType._zod.run(r,n)}),iy=v("$ZodNullable",(t,e)=>{le.init(t,e),oe(t._zod,"optin",()=>e.innerType._zod.optin),oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${xo(r.source)}|null)$`):void 0}),oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),ay=v("$ZodDefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>gg(s,e)):gg(o,e)}});function gg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var cy=v("$ZodPrefault",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),uy=v("$ZodNonOptional",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>yg(s,t)):yg(o,t)}});function yg(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var ly=v("$ZodCatch",(t,e)=>{le.init(t,e),t._zod.optin="optional",oe(t._zod,"optout",()=>e.innerType._zod.optout),oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(i=>ct(i,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(s=>ct(s,n,tt()))},input:r.value}),r.issues=[],r.fallback=!0),r)}});var bu=v("$ZodPipe",(t,e)=>{le.init(t,e),oe(t._zod,"values",()=>e.in._zod.values),oe(t._zod,"optin",()=>e.in._zod.optin),oe(t._zod,"optout",()=>e.out._zod.optout),oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,n)=>{if(n.direction==="backward"){let s=e.out._zod.run(r,n);return s instanceof Promise?s.then(i=>bi(i,e.in,n)):bi(s,e.in,n)}let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(s=>bi(s,e.out,n)):bi(o,e.out,n)}});function bi(t,e,r){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var dy=v("$ZodPreprocess",(t,e)=>{bu.init(t,e)}),fy=v("$ZodReadonly",(t,e)=>{le.init(t,e),oe(t._zod,"propValues",()=>e.innerType._zod.propValues),oe(t._zod,"values",()=>e.innerType._zod.values),oe(t._zod,"optin",()=>e.innerType?._zod?.optin),oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,n)=>{if(n.direction==="backward")return e.innerType._zod.run(r,n);let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(_g):_g(o)}});function _g(t){return t.value=Object.freeze(t.value),t}var py=v("$ZodCustom",(t,e)=>{Pe.init(t,e),le.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(s=>vg(s,r,n,t));vg(o,r,n,t)}});function vg(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(vn(o))}}var wP=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(o){return t[o]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return o=>{switch(o.code){case"invalid_type":{let s=n[o.expected]??o.expected,i=uu(o.input),a=n[i]??i;return`Invalid input: expected ${s}, received ${a}`}case"invalid_value":return o.values.length===1?`Invalid input: expected ${pi(o.values[0])}`:`Invalid option: expected one of ${li(o.values,"|")}`;case"too_big":{let s=o.inclusive?"<=":"<",i=e(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${s}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${s}${o.maximum.toString()}`}case"too_small":{let s=o.inclusive?">=":">",i=e(o.origin);return i?`Too small: expected ${o.origin} to have ${s}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${s}${o.minimum.toString()}`}case"invalid_format":{let s=o;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${li(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return o.options&&Array.isArray(o.options)&&o.options.length>0?`Invalid discriminator value. Expected ${o.options.map(i=>`'${i}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}};function my(){return{localeError:wP()}}var hy;var wu=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...r){let n=r[0];return this._map.set(e,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function xP(){return new wu}(hy=globalThis).__zod_globalRegistry??(hy.__zod_globalRegistry=xP());var qr=globalThis.__zod_globalRegistry;function gy(t,e){return new t({type:"string",...R(e)})}function yy(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...R(e)})}function xu(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...R(e)})}function _y(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function vy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function by(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function wy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function xy(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...R(e)})}function Sy(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...R(e)})}function $y(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function ky(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function Ry(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Dy(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...R(e)})}function Ny(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...R(e)})}function Ay(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function jy(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function My(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(e)})}function Zy(t,e){return new t({type:"string",format:"date",check:"string_format",...R(e)})}function Ly(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function qy(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function Fy(t,e){return new t({type:"number",checks:[],...R(e)})}function Uy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function Vy(t,e){return new t({type:"boolean",...R(e)})}function By(t,e){return new t({type:"null",...R(e)})}function Hy(t){return new t({type:"unknown"})}function Wy(t,e){return new t({type:"never",...R(e)})}function Si(t,e){return new mu({check:"less_than",...R(e),value:t,inclusive:!1})}function Po(t,e){return new mu({check:"less_than",...R(e),value:t,inclusive:!0})}function $i(t,e){return new hu({check:"greater_than",...R(e),value:t,inclusive:!1})}function To(t,e){return new hu({check:"greater_than",...R(e),value:t,inclusive:!0})}function ki(t,e){return new Qh({check:"multiple_of",...R(e),value:t})}function Ei(t,e){return new eg({check:"max_length",...R(e),maximum:t})}function bn(t,e){return new tg({check:"min_length",...R(e),minimum:t})}function zi(t,e){return new rg({check:"length_equals",...R(e),length:t})}function Su(t,e){return new ng({check:"string_format",format:"regex",...R(e),pattern:t})}function $u(t){return new og({check:"string_format",format:"lowercase",...R(t)})}function ku(t){return new sg({check:"string_format",format:"uppercase",...R(t)})}function Eu(t,e){return new ig({check:"string_format",format:"includes",...R(e),includes:t})}function zu(t,e){return new ag({check:"string_format",format:"starts_with",...R(e),prefix:t})}function Pu(t,e){return new cg({check:"string_format",format:"ends_with",...R(e),suffix:t})}function sr(t){return new ug({check:"overwrite",tx:t})}function Tu(t){return sr(e=>e.normalize(t))}function Cu(){return sr(t=>t.trim())}function Ou(){return sr(t=>t.toLowerCase())}function Iu(){return sr(t=>t.toUpperCase())}function Ru(){return sr(t=>nu(t))}function Gy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Jy(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Ky(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Yy(t,e){let r=SP(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(vn(o,n.value,r._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),n.issues.push(vn(s))}},t(n.value,n)),e);return r}function SP(t,e){let r=new Pe({check:"custom",...R(e)});return r._zod.check=t,r}function Du(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??qr,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Se(t,e,r={path:[],schemaPath:[]}){var n;let o=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,i);let a=t._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,i.schema,l);else{let p=i.schema,m=e.processors[o.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);m(t,e,p,l)}let d=t._zod.parent;d&&(i.ref||(i.ref=d),Se(d,e,l),e.seen.get(d).isParent=!0)}let c=e.metadataRegistry.get(t);return c&&Object.assign(i.schema,c),e.io==="input"&&qe(t)&&(delete i.schema.examples,delete i.schema.default),e.io==="input"&&"_prefault"in i.schema&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,e.seen.get(t).schema}function Nu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let i of t.seen.entries()){let a=t.metadataRegistry.get(i[0])?.id;if(a){let c=n.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(a,i[0])}}let o=i=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(i[0])?.id,p=t.external.uri??(f=>f);if(d)return{ref:p(d)};let m=i[1].defId??i[1].schema.id??`schema${t.counter++}`;return i[1].defId=m,{defId:m,ref:`${p("__shared")}#/${a}/${m}`}}if(i[1]===r)return{ref:"#"};let u=`#/${a}/`,l=i[1].schema.id??`__schema${t.counter++}`;return{defId:l,ref:u+l}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(t.cycles==="throw")for(let i of t.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
151
151
 
152
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function Iu(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){n(d);let p=t.seen.get(d),f=p.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),a._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&p.def)for(let g in u)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(u[g])===JSON.stringify(p.def[g])&&delete u[g]}let m=a._zod.parent;if(m&&m!==d){n(m);let p=t.seen.get(m);if(p?.schema.$ref&&(u.$ref=p.schema.$ref,p.def))for(let f in u)f==="$ref"||f==="allOf"||f in p.def&&JSON.stringify(u[f])===JSON.stringify(p.def[f])&&delete u[f]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(a)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:Po(e,"input",t.processors),output:Po(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function qe(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return qe(n.element,r);if(n.type==="set")return qe(n.valueType,r);if(n.type==="lazy")return qe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return qe(n.innerType,r);if(n.type==="intersection")return qe(n.left,r)||qe(n.right,r);if(n.type==="record"||n.type==="map")return qe(n.keyType,r)||qe(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:qe(n.in,r)||qe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(qe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(qe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(qe(o,r))return!0;return!!(n.rest&&qe(n.rest,r))}return!1}var Wy=(t,e={})=>r=>{let n=Cu({...r,processors:e});return Se(t,n),Ou(n,t),Iu(n,t)},Po=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Cu({...o??{},target:s,io:e,processors:r});return Se(t,i),Ou(i,t),Iu(i,t)};var bP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Gy=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=bP[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Jy=(t,e,r,n)=>{let o=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),m=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof s=="number"&&(o.minimum=s),m?p?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},Ky=(t,e,r,n)=>{r.type="boolean"};var Yy=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var Qy=(t,e,r,n)=>{r.not={}};var Xy=(t,e,r,n)=>{};var e_=(t,e,r,n)=>{let o=t._zod.def,s=_o(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},t_=(t,e,r,n)=>{let o=t._zod.def,s=[];for(let i of o.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var r_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var n_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var o_=(t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Se(s.element,e,{...n,path:[...n.path,"items"]})},s_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let i=s.shape;for(let u in i)o.properties[u]=Se(i[u],e,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Se(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},i_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Se(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},a_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Se(o.right,e,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var c_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Se(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)o.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Se(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Se(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},u_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.innerType,e,n),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},l_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},d_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},f_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},p_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},m_=(t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?o.out:o.in:o.out;Se(i,e,n);let a=e.seen.get(t);a.ref=i},h_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var Ru=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function _n(t){return!!t._zod}function sr(t,e){return _n(t)?So(t,e):t.safeParse(e)}function Ei(t){if(!t)return;let e;if(_n(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function g_(t){if(_n(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var Co={};sf(Co,{ZodISODate:()=>__,ZodISODateTime:()=>y_,ZodISODuration:()=>b_,ZodISOTime:()=>v_,date:()=>Au,datetime:()=>Nu,duration:()=>ju,time:()=>Du});var y_=v("ZodISODateTime",(t,e)=>{Eg.init(t,e),ge.init(t,e)});function Nu(t){return Ry(y_,t)}var __=v("ZodISODate",(t,e)=>{zg.init(t,e),ge.init(t,e)});function Au(t){return Ny(__,t)}var v_=v("ZodISOTime",(t,e)=>{Pg.init(t,e),ge.init(t,e)});function Du(t){return Ay(v_,t)}var b_=v("ZodISODuration",(t,e)=>{Tg.init(t,e),ge.init(t,e)});function ju(t){return Dy(b_,t)}var TP=(t,e)=>{fi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>uh(t,r)},flatten:{value:r=>ch(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,mn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,mn,2)}},isEmpty:{get(){return t.issues.length===0}}})};var rt=v("ZodError",TP,{Parent:Error});var w_=pi(rt),x_=mi(rt),S_=xo(rt),$_=$o(rt),k_=lh(rt),E_=dh(rt),z_=fh(rt),P_=ph(rt),T_=mh(rt),C_=hh(rt),O_=gh(rt),I_=yh(rt);var R_=new WeakMap;function Oo(t,e,r){let n=Object.getPrototypeOf(t),o=R_.get(n);if(o||(o=new Set,R_.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var _e=v("ZodType",(t,e)=>(le.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Po(t,"input"),output:Po(t,"output")}}),t.toJSONSchema=Wy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>w_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>S_(t,r,n),t.parseAsync=async(r,n)=>x_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>$_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>k_(t,r,n),t.decode=(r,n)=>E_(t,r,n),t.encodeAsync=async(r,n)=>z_(t,r,n),t.decodeAsync=async(r,n)=>P_(t,r,n),t.safeEncode=(r,n)=>T_(t,r,n),t.safeDecode=(r,n)=>C_(t,r,n),t.safeEncodeAsync=async(r,n)=>O_(t,r,n),t.safeDecodeAsync=async(r,n)=>I_(t,r,n),Oo(t,"ZodType",{check(...r){let n=this.def;return this.clone(Y.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return wt(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(vT(r,n))},superRefine(r,n){return this.check(bT(r,n))},overwrite(r){return this.check(or(r))},optional(){return we(this)},exactOptional(){return aT(this)},nullable(){return j_(this)},nullish(){return we(j_(this))},nonoptional(r){return pT(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Pi(this,r)},transform(r){return M_(this,U_(r))},default(r){return lT(this,r)},prefault(r){return fT(this,r)},catch(r){return hT(this,r)},pipe(r){return M_(this,r)},readonly(){return _T(this)},describe(r){let n=this.clone();return Zr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Zr.get(this);let n=this.clone();return Zr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return Zr.get(t)?.description},configurable:!0}),t)),Z_=v("_ZodString",(t,e)=>{bi.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Gy(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Oo(t,"_ZodString",{regex(...n){return this.check(vu(...n))},includes(...n){return this.check(xu(...n))},startsWith(...n){return this.check(Su(...n))},endsWith(...n){return this.check($u(...n))},min(...n){return this.check(yn(...n))},max(...n){return this.check($i(...n))},length(...n){return this.check(ki(...n))},nonempty(...n){return this.check(yn(1,...n))},lowercase(n){return this.check(bu(n))},uppercase(n){return this.check(wu(n))},trim(){return this.check(Eu())},normalize(...n){return this.check(ku(...n))},toLowerCase(){return this.check(zu())},toUpperCase(){return this.check(Pu())},slugify(){return this.check(Tu())}})}),OP=v("ZodString",(t,e)=>{bi.init(t,e),Z_.init(t,e),t.email=r=>t.check(fy(IP,r)),t.url=r=>t.check(yy(RP,r)),t.jwt=r=>t.check(Iy(GP,r)),t.emoji=r=>t.check(_y(NP,r)),t.guid=r=>t.check(_u(N_,r)),t.uuid=r=>t.check(py(zi,r)),t.uuidv4=r=>t.check(my(zi,r)),t.uuidv6=r=>t.check(hy(zi,r)),t.uuidv7=r=>t.check(gy(zi,r)),t.nanoid=r=>t.check(vy(AP,r)),t.guid=r=>t.check(_u(N_,r)),t.cuid=r=>t.check(by(DP,r)),t.cuid2=r=>t.check(wy(jP,r)),t.ulid=r=>t.check(xy(MP,r)),t.base64=r=>t.check(Ty(BP,r)),t.base64url=r=>t.check(Cy(HP,r)),t.xid=r=>t.check(Sy(ZP,r)),t.ksuid=r=>t.check($y(LP,r)),t.ipv4=r=>t.check(ky(qP,r)),t.ipv6=r=>t.check(Ey(FP,r)),t.cidrv4=r=>t.check(zy(UP,r)),t.cidrv6=r=>t.check(Py(VP,r)),t.e164=r=>t.check(Oy(WP,r)),t.datetime=r=>t.check(Nu(r)),t.date=r=>t.check(Au(r)),t.time=r=>t.check(Du(r)),t.duration=r=>t.check(ju(r))});function y(t){return dy(OP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),Z_.init(t,e)}),IP=v("ZodEmail",(t,e)=>{yg.init(t,e),ge.init(t,e)});var N_=v("ZodGUID",(t,e)=>{hg.init(t,e),ge.init(t,e)});var zi=v("ZodUUID",(t,e)=>{gg.init(t,e),ge.init(t,e)});var RP=v("ZodURL",(t,e)=>{_g.init(t,e),ge.init(t,e)});var NP=v("ZodEmoji",(t,e)=>{vg.init(t,e),ge.init(t,e)});var AP=v("ZodNanoID",(t,e)=>{bg.init(t,e),ge.init(t,e)});var DP=v("ZodCUID",(t,e)=>{wg.init(t,e),ge.init(t,e)});var jP=v("ZodCUID2",(t,e)=>{xg.init(t,e),ge.init(t,e)});var MP=v("ZodULID",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var ZP=v("ZodXID",(t,e)=>{$g.init(t,e),ge.init(t,e)});var LP=v("ZodKSUID",(t,e)=>{kg.init(t,e),ge.init(t,e)});var qP=v("ZodIPv4",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var FP=v("ZodIPv6",(t,e)=>{Og.init(t,e),ge.init(t,e)});var UP=v("ZodCIDRv4",(t,e)=>{Ig.init(t,e),ge.init(t,e)});var VP=v("ZodCIDRv6",(t,e)=>{Rg.init(t,e),ge.init(t,e)});var BP=v("ZodBase64",(t,e)=>{Ag.init(t,e),ge.init(t,e)});var HP=v("ZodBase64URL",(t,e)=>{Dg.init(t,e),ge.init(t,e)});var WP=v("ZodE164",(t,e)=>{jg.init(t,e),ge.init(t,e)});var GP=v("ZodJWT",(t,e)=>{Mg.init(t,e),ge.init(t,e)});var L_=v("ZodNumber",(t,e)=>{pu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Jy(t,n,o,s),Oo(t,"ZodNumber",{gt(n,o){return this.check(xi(n,o))},gte(n,o){return this.check(zo(n,o))},min(n,o){return this.check(zo(n,o))},lt(n,o){return this.check(wi(n,o))},lte(n,o){return this.check(Eo(n,o))},max(n,o){return this.check(Eo(n,o))},int(n){return this.check(A_(n))},safe(n){return this.check(A_(n))},positive(n){return this.check(xi(0,n))},nonnegative(n){return this.check(zo(0,n))},negative(n){return this.check(wi(0,n))},nonpositive(n){return this.check(Eo(0,n))},multipleOf(n,o){return this.check(Si(n,o))},step(n,o){return this.check(Si(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function se(t){return jy(L_,t)}var JP=v("ZodNumberFormat",(t,e)=>{Zg.init(t,e),L_.init(t,e)});function A_(t){return My(JP,t)}var KP=v("ZodBoolean",(t,e)=>{Lg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ky(t,r,n,o)});function ze(t){return Zy(KP,t)}var YP=v("ZodNull",(t,e)=>{qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Yy(t,r,n,o)});function Zu(t){return Ly(YP,t)}var QP=v("ZodUnknown",(t,e)=>{Fg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Xy(t,r,n,o)});function ye(){return qy(QP)}var XP=v("ZodNever",(t,e)=>{Ug.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qy(t,r,n,o)});function eT(t){return Fy(XP,t)}var tT=v("ZodArray",(t,e)=>{Vg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o),t.element=e.element,Oo(t,"ZodArray",{min(r,n){return this.check(yn(r,n))},nonempty(r){return this.check(yn(1,r))},max(r,n){return this.check($i(r,n))},length(r,n){return this.check(ki(r,n))},unwrap(){return this.element}})});function J(t,e){return Uy(tT,t,e)}var q_=v("ZodObject",(t,e)=>{Wg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>s_(t,r,n,o),Y.defineLazy(t,"shape",()=>e.shape),Oo(t,"ZodObject",{keyof(){return We(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ye()})},loose(){return this.clone({...this._zod.def,catchall:ye()})},strict(){return this.clone({...this._zod.def,catchall:eT()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Y.extend(this,r)},safeExtend(r){return Y.safeExtend(this,r)},merge(r){return Y.merge(this,r)},pick(r){return Y.pick(this,r)},omit(r){return Y.omit(this,r)},partial(...r){return Y.partial(V_,this,r[0])},required(...r){return Y.required(B_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new q_(r)}function Fe(t,e){return new q_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var F_=v("ZodUnion",(t,e)=>{mu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>i_(t,r,n,o),t.options=e.options});function ce(t,e){return new F_({type:"union",options:t,...Y.normalizeParams(e)})}var rT=v("ZodDiscriminatedUnion",(t,e)=>{F_.init(t,e),Gg.init(t,e)});function Lu(t,e,r){return new rT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var nT=v("ZodIntersection",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(t,r,n,o)});function Pi(t,e){return new nT({type:"intersection",left:t,right:e})}var D_=v("ZodRecord",(t,e)=>{Kg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new D_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new D_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var Mu=v("ZodEnum",(t,e)=>{Yg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>e_(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...e,checks:[],...Y.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Mu({...e,checks:[],...Y.normalizeParams(o),entries:s})}});function We(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Mu({type:"enum",entries:r,...Y.normalizeParams(e)})}var oT=v("ZodLiteral",(t,e)=>{Qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>t_(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(t,e){return new oT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var sT=v("ZodTransform",(t,e)=>{Xg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new fn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Y.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(Y.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function U_(t){return new sT({type:"transform",transform:t})}var V_=v("ZodOptional",(t,e)=>{hu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ru(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function we(t){return new V_({type:"optional",innerType:t})}var iT=v("ZodExactOptional",(t,e)=>{ey.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Ru(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function aT(t){return new iT({type:"optional",innerType:t})}var cT=v("ZodNullable",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function j_(t){return new cT({type:"nullable",innerType:t})}var uT=v("ZodDefault",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function lT(t,e){return new uT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var dT=v("ZodPrefault",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function fT(t,e){return new dT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var B_=v("ZodNonOptional",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function pT(t,e){return new B_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var mT=v("ZodCatch",(t,e)=>{sy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function hT(t,e){return new mT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var H_=v("ZodPipe",(t,e)=>{gu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.in=e.in,t.out=e.out});function M_(t,e){return new H_({type:"pipe",in:t,out:e})}var gT=v("ZodPreprocess",(t,e)=>{H_.init(t,e),iy.init(t,e)}),yT=v("ZodReadonly",(t,e)=>{ay.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>h_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function _T(t){return new yT({type:"readonly",innerType:t})}var W_=v("ZodCustom",(t,e)=>{cy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o)});function G_(t,e){return Vy(W_,t??(()=>!0),e)}function vT(t,e={}){return By(W_,t,e)}function bT(t,e){return Hy(t,e)}function qu(t,e){return new gT({type:"pipe",in:U_(t),out:e})}tt(uy());var Uu="2025-11-25";var J_=[Uu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ir="io.modelcontextprotocol/related-task",Ci="2.0",Te=G_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),K_=ce([y(),se().int()]),Y_=y(),dq=Fe({ttl:ce([se(),Zu()]).optional(),pollInterval:se().optional()}),wT=P({ttl:se().optional()}),xT=P({taskId:y()}),Vu=Fe({progressToken:K_.optional(),[ir]:xT.optional()}),nt=P({_meta:Vu.optional()}),Io=nt.extend({task:wT.optional()}),Q_=t=>Io.safeParse(t).success,Ce=P({method:y(),params:nt.loose().optional()}),ct=P({_meta:Vu.optional()}),ut=P({method:y(),params:ct.loose().optional()}),Oe=Fe({_meta:Vu.optional()}),Oi=ce([y(),se().int()]),X_=P({jsonrpc:C(Ci),id:Oi,...Ce.shape}).strict(),Bu=t=>X_.safeParse(t).success,ev=P({jsonrpc:C(Ci),...ut.shape}).strict(),tv=t=>ev.safeParse(t).success,Hu=P({jsonrpc:C(Ci),id:Oi,result:Oe}).strict(),Ro=t=>Hu.safeParse(t).success;var G;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(G||(G={}));var Wu=P({jsonrpc:C(Ci),id:Oi.optional(),error:P({code:se().int(),message:y(),data:ye().optional()})}).strict();var rv=t=>Wu.safeParse(t).success;var nv=ce([X_,ev,Hu,Wu]),fq=ce([Hu,Wu]),Ii=Oe.strict(),ST=ct.extend({requestId:Oi.optional(),reason:y().optional()}),Ri=ut.extend({method:C("notifications/cancelled"),params:ST}),$T=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),No=P({icons:J($T).optional()}),vn=P({name:y(),title:y().optional()}),ov=vn.extend({...vn.shape,...No.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),kT=Pi(P({applyDefaults:ze().optional()}),ve(y(),ye())),ET=qu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Pi(P({form:kT.optional(),url:Te.optional()}),ve(y(),ye()).optional())),zT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),PT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),TT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:ET.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:zT.optional()}),CT=nt.extend({protocolVersion:y(),capabilities:TT,clientInfo:ov}),Gu=Ce.extend({method:C("initialize"),params:CT});var OT=P({experimental:ve(y(),Te).optional(),logging:Te.optional(),completions:Te.optional(),prompts:P({listChanged:ze().optional()}).optional(),resources:P({subscribe:ze().optional(),listChanged:ze().optional()}).optional(),tools:P({listChanged:ze().optional()}).optional(),tasks:PT.optional()}),IT=Oe.extend({protocolVersion:y(),capabilities:OT,serverInfo:ov,instructions:y().optional()}),Ju=ut.extend({method:C("notifications/initialized"),params:ct.optional()});var Ni=Ce.extend({method:C("ping"),params:nt.optional()}),RT=P({progress:se(),total:we(se()),message:we(y())}),NT=P({...ct.shape,...RT.shape,progressToken:K_}),Ai=ut.extend({method:C("notifications/progress"),params:NT}),AT=nt.extend({cursor:Y_.optional()}),Ao=Ce.extend({params:AT.optional()}),Do=Oe.extend({nextCursor:Y_.optional()}),DT=We(["working","input_required","completed","failed","cancelled"]),jo=P({taskId:y(),status:DT,ttl:ce([se(),Zu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),bn=Oe.extend({task:jo}),jT=ct.merge(jo),Mo=ut.extend({method:C("notifications/tasks/status"),params:jT}),Di=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),ji=Oe.merge(jo),Mi=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),pq=Oe.loose(),Zi=Ao.extend({method:C("tasks/list")}),Li=Do.extend({tasks:J(jo)}),qi=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),sv=Oe.merge(jo),iv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),av=iv.extend({text:y()}),Ku=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),cv=iv.extend({blob:Ku}),Zo=We(["user","assistant"]),wn=P({audience:J(Zo).optional(),priority:se().min(0).max(1).optional(),lastModified:Co.datetime({offset:!0}).optional()}),uv=P({...vn.shape,...No.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:wn.optional(),_meta:we(Fe({}))}),MT=P({...vn.shape,...No.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:wn.optional(),_meta:we(Fe({}))}),ZT=Ao.extend({method:C("resources/list")}),LT=Do.extend({resources:J(uv)}),qT=Ao.extend({method:C("resources/templates/list")}),FT=Do.extend({resourceTemplates:J(MT)}),Yu=nt.extend({uri:y()}),UT=Yu,VT=Ce.extend({method:C("resources/read"),params:UT}),BT=Oe.extend({contents:J(ce([av,cv]))}),HT=ut.extend({method:C("notifications/resources/list_changed"),params:ct.optional()}),WT=Yu,GT=Ce.extend({method:C("resources/subscribe"),params:WT}),JT=Yu,KT=Ce.extend({method:C("resources/unsubscribe"),params:JT}),YT=ct.extend({uri:y()}),QT=ut.extend({method:C("notifications/resources/updated"),params:YT}),XT=P({name:y(),description:we(y()),required:we(ze())}),eC=P({...vn.shape,...No.shape,description:we(y()),arguments:we(J(XT)),_meta:we(Fe({}))}),tC=Ao.extend({method:C("prompts/list")}),rC=Do.extend({prompts:J(eC)}),nC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),oC=Ce.extend({method:C("prompts/get"),params:nC}),Qu=P({type:C("text"),text:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),Xu=P({type:C("image"),data:Ku,mimeType:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),el=P({type:C("audio"),data:Ku,mimeType:y(),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),sC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),iC=P({type:C("resource"),resource:ce([av,cv]),annotations:wn.optional(),_meta:ve(y(),ye()).optional()}),aC=uv.extend({type:C("resource_link")}),tl=ce([Qu,Xu,el,aC,iC]),cC=P({role:Zo,content:tl}),uC=Oe.extend({description:y().optional(),messages:J(cC)}),lC=ut.extend({method:C("notifications/prompts/list_changed"),params:ct.optional()}),dC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),fC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),lv=P({...vn.shape,...No.shape,description:y().optional(),inputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()),outputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()).optional(),annotations:dC.optional(),execution:fC.optional(),_meta:ve(y(),ye()).optional()}),rl=Ao.extend({method:C("tools/list")}),pC=Do.extend({tools:J(lv)}),Fi=Oe.extend({content:J(tl).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),mq=Fi.or(Oe.extend({toolResult:ye()})),mC=Io.extend({name:y(),arguments:ve(y(),ye()).optional()}),Lo=Ce.extend({method:C("tools/call"),params:mC}),hC=ut.extend({method:C("notifications/tools/list_changed"),params:ct.optional()}),hq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),qo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),gC=nt.extend({level:qo}),nl=Ce.extend({method:C("logging/setLevel"),params:gC}),yC=ct.extend({level:qo,logger:y().optional(),data:ye()}),_C=ut.extend({method:C("notifications/message"),params:yC}),vC=P({name:y().optional()}),bC=P({hints:J(vC).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),wC=P({mode:We(["auto","required","none"]).optional()}),xC=P({type:C("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:J(tl).default([]),structuredContent:P({}).loose().optional(),isError:ze().optional(),_meta:ve(y(),ye()).optional()}),SC=Lu("type",[Qu,Xu,el]),Ti=Lu("type",[Qu,Xu,el,sC,xC]),$C=P({role:Zo,content:ce([Ti,J(Ti)]),_meta:ve(y(),ye()).optional()}),kC=Io.extend({messages:J($C),modelPreferences:bC.optional(),systemPrompt:y().optional(),includeContext:We(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:J(y()).optional(),metadata:Te.optional(),tools:J(lv).optional(),toolChoice:wC.optional()}),EC=Ce.extend({method:C("sampling/createMessage"),params:kC}),ol=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:Zo,content:SC}),sl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Zo,content:ce([Ti,J(Ti)])}),zC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),PC=P({type:C("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:We(["email","uri","date","date-time"]).optional(),default:y().optional()}),TC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),CC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),default:y().optional()}),OC=P({type:C("string"),title:y().optional(),description:y().optional(),oneOf:J(P({const:y(),title:y()})),default:y().optional()}),IC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),RC=ce([CC,OC]),NC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({type:C("string"),enum:J(y())}),default:J(y()).optional()}),AC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({anyOf:J(P({const:y(),title:y()}))}),default:J(y()).optional()}),DC=ce([NC,AC]),jC=ce([IC,RC,DC]),MC=ce([jC,zC,PC,TC]),ZC=Io.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),MC),required:J(y()).optional()})}),LC=Io.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),qC=ce([ZC,LC]),FC=Ce.extend({method:C("elicitation/create"),params:qC}),UC=ct.extend({elicitationId:y()}),VC=ut.extend({method:C("notifications/elicitation/complete"),params:UC}),Ui=Oe.extend({action:We(["accept","decline","cancel"]),content:qu(t=>t===null?void 0:t,ve(y(),ce([y(),se(),ze(),J(y())])).optional())}),BC=P({type:C("ref/resource"),uri:y()});var HC=P({type:C("ref/prompt"),name:y()}),WC=nt.extend({ref:ce([HC,BC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),GC=Ce.extend({method:C("completion/complete"),params:WC});var JC=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),KC=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),YC=Ce.extend({method:C("roots/list"),params:nt.optional()}),il=Oe.extend({roots:J(KC)}),QC=ut.extend({method:C("notifications/roots/list_changed"),params:ct.optional()}),gq=ce([Ni,Gu,GC,nl,oC,tC,ZT,qT,VT,GT,KT,Lo,rl,Di,Mi,Zi,qi]),yq=ce([Ri,Ai,Ju,QC,Mo]),_q=ce([Ii,ol,sl,Ui,il,ji,Li,bn]),vq=ce([Ni,EC,FC,YC,Di,Mi,Zi,qi]),bq=ce([Ri,Ai,_C,QT,HT,hC,lC,Mo,VC]),wq=ce([Ii,IT,JC,uC,rC,LT,FT,BT,Fi,pC,ji,Li,bn]),L=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===G.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Fu(o.elicitations,r)}return new t(e,r,n)}},Fu=class extends L{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(G.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function ar(t){return t==="completed"||t==="failed"||t==="cancelled"}var e2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function al(t){let r=Ei(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=g_(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function cl(t,e){let r=sr(t,e);if(!r.success)throw r.error;return r.data}var oO=6e4,Vi=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Ri,r=>{this._oncancel(r)}),this.setNotificationHandler(Ai,r=>{this._onprogress(r)}),this.setRequestHandler(Ni,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Di,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Mi,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,m=new L(d.error.code,d.error.message,d.error.data);l(m)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new L(G.InvalidParams,`Task not found: ${s}`);if(!ar(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(ar(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ir]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(Zi,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new L(G.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(qi,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(ar(o.status))throw new L(G.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new L(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof L?o:new L(G.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),L.fromError(G.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),Ro(s)||rv(s)?this._onresponse(s):Bu(s)?this._onrequest(s,i):tv(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=L.fromError(G.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[ir]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:G.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=Q_(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,m)=>{if(i.signal.aborted)throw new L(G.ConnectionClosed,"Request was cancelled");let p={...m,relatedRequestId:e.id};s&&!p.relatedTask&&(p.relatedTask={taskId:s});let f=p.relatedTask?.taskId??s;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,p)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:G.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(c);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),Ro(e))n(e);else{let i=new L(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(Ro(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),Ro(e))o(e);else{let i=L.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}return}let s;try{let i=await this.request(e,bn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new L(G.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},ar(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new L(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new L(G.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=x=>{l(x)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(x){d(x);return}n?.signal?.throwIfAborted();let m=this._requestMessageId++,p={...e,jsonrpc:"2.0",id:m};n?.onprogress&&(this._progressHandlers.set(m,n.onprogress),p.params={...e.params,_meta:{...e.params?._meta||{},progressToken:m}}),a&&(p.params={...p.params,task:a}),c&&(p.params={...p.params,_meta:{...p.params?._meta||{},[ir]:c}});let f=x=>{this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let w=x instanceof L?x:new L(G.RequestTimeout,String(x));l(w)};this._responseHandlers.set(m,x=>{if(!n?.signal?.aborted){if(x instanceof Error)return l(x);try{let w=sr(r,x.result);w.success?u(w.data):l(w.error)}catch(w){l(w)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??oO,g=()=>f(L.fromError(G.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(m,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let x=w=>{let S=this._responseHandlers.get(m);S?S(w):this._onerror(new Error(`Response handler missing for side-channeled request ${m}`))};this._requestResolvers.set(m,x),this._enqueueTaskMessage(_,{type:"request",message:p,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(m),l(w)})}else this._transport.send(p,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>{this._cleanupTimeout(m),l(x)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},ji,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Li,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},sv,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ir]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ir]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ir]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=al(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=cl(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=al(e);this._notificationHandlers.set(n,o=>{let s=cl(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Bu(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new L(G.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new L(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new L(G.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let a=await n.getTask(o,r);if(a){let c=Mo.parse({method:"notifications/tasks/status",params:a});await this.notification(c),ar(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let a=await n.getTask(o,r);if(!a)throw new L(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(ar(a.status))throw new L(G.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Mo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),ar(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function dv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function fv(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];dv(i)&&dv(s)?r[o]={...i,...s}:r[o]=s}return r}var nx=mt(Gd(),1),ox=mt(rx(),1);function aj(){let t=new nx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ox.default)(t),t}var ka=class{constructor(e){this._ajv=e??aj()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Ea=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function sx(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function ix(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var za=class extends Vi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(qo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new ka,this.setRequestHandler(Gu,n=>this._oninitialize(n)),this.setNotificationHandler(Ju,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(nl,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=qo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Ea(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=fv(this._capabilities,e)}setRequestHandler(e,r){let o=Ei(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(_n(o)){let a=o;s=a._zod?.def?.value??a.value}else{let a=o;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=sr(Lo,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new L(G.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,m=await Promise.resolve(r(c,u));if(d.task){let f=sr(bn,m);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new L(G.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let p=sr(Fi,m);if(!p.success){let f=p.error instanceof Error?p.error.message:String(p.error);throw new L(G.InvalidParams,`Invalid tools/call result: ${f}`)}return p.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){ix(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&sx(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:J_.includes(r)?r:Uu,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Ii)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},sl,r):this.request({method:"sampling/createMessage",params:e},ol,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},Ui,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},Ui,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new L(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof L?i:new L(G.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},il,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var rf=mt(require("node:process"),1);var Pa=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
153
- `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),cj(r)}clear(){this._buffer=void 0}};function cj(t){return nv.parse(JSON.parse(t))}function ax(t){return JSON.stringify(t)+`
154
- `}var Ta=class{constructor(e=rf.default.stdin,r=rf.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Pa,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=ax(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var _s=class{index;constructor(e){this.index=e}getByName(e){return this.index.byName.get(e)}getBySelector(e){return this.index.bySelector.get(e)}getByType(e){switch(e){case"component":return this.index.components;case"directive":return this.index.directives;case"pipe":return this.index.pipes;case"service":return this.index.services;case"all":return[...this.index.components,...this.index.directives,...this.index.pipes,...this.index.services];default:return[]}}getAll(e=!1){let r=this.getByType("all");return e?r:r.filter(n=>!n.deprecated)}updateIndex(e){this.index=e}};var vs=class{index;constructor(e){this.index=e}search(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50,offset:i=0}=e,a=r.toLowerCase().trim();if(a.length===0)return{items:[],total:0,hasMore:!1};let c=this.getCandidates(a,n),u=[];for(let p of c){if(!o&&p.deprecated)continue;let f=this.calculateRelevanceScore(p,a);f>0&&u.push({doc:p,relevanceScore:f})}u.sort((p,f)=>f.relevanceScore-p.relevanceScore);let l=u.length,d=u.slice(i,i+s),m=i+s<l;return{items:d,total:l,hasMore:m}}getCandidates(e,r){let n=e.split(/[^a-z0-9]+/).filter(i=>i.length>0),o=new Set;for(let i of n){if(this.index.searchIndex.has(i)){let a=this.index.searchIndex.get(i);for(let c of a)o.add(c)}for(let[a,c]of this.index.searchIndex.entries())if(a.startsWith(i))for(let u of c)o.add(u)}let s=[];for(let i of o){let a=this.index.byName.get(i);a&&(r&&r.length>0?r.includes(a.type)&&s.push(a):s.push(a))}return s}calculateRelevanceScore(e,r){let n=0,o=e.name.toLowerCase();if(o===r&&(n+=100),"selector"in e&&e.selector){let s=e.selector.toLowerCase();(s===r||s.includes(r))&&(n+=80)}if(o.startsWith(r)&&(n+=60),!o.startsWith(r)&&o.includes(r)&&(n+=30),e.description&&e.description.toLowerCase().includes(r)&&(n+=40),"inputs"in e&&e.inputs){for(let s of e.inputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("outputs"in e&&e.outputs){for(let s of e.outputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("methods"in e&&e.methods){for(let s of e.methods)if(s.name.toLowerCase().includes(r)){n+=20;break}}return e.deprecated&&(n=Math.floor(n*.5)),n}updateIndex(e){this.index=e}};var Ca=class{getPreferredDescription(e){return e.rawdescription??e.description??""}formatList(e,r=!1){return e.filter(n=>r||!n.deprecated).map(n=>this.formatSummary(n))}formatSummary(e){let r=e.type==="injectable"?"service":e.type,n="selector"in e?e.selector:void 0;return{name:e.name,type:r,selector:n,description:this.getPreferredDescription(e),deprecated:e.deprecated}}formatDetails(e){let r=this.formatInputs(e),n=this.formatOutputs(e),o=this.formatMethods(e),s=this.formatExamples(e),i=e.type==="injectable"?"service":e.type,a="selector"in e?e.selector:void 0,c="standalone"in e?e.standalone:void 0,u="imports"in e?e.imports:void 0;return{name:e.name,type:i,selector:a,description:this.getPreferredDescription(e),inputs:r,outputs:n,methods:o,examples:s,deprecated:e.deprecated,deprecationMessage:e.deprecationMessage,standalone:c,imports:u}}formatInputs(e){let r=[];return"inputs"in e&&e.inputs&&r.push(...e.inputs.map(n=>this.formatProperty(n))),"inputsClass"in e&&e.inputsClass&&r.push(...e.inputsClass.map(n=>this.formatProperty(n))),r}formatOutputs(e){let r=[];return"outputs"in e&&e.outputs&&r.push(...e.outputs.map(n=>this.formatProperty(n))),"outputsClass"in e&&e.outputsClass&&r.push(...e.outputsClass.map(n=>this.formatProperty(n))),r}formatProperty(e){return{name:e.name,type:e.type||"any",required:!e.optional,description:this.getPreferredDescription(e),defaultValue:e.defaultValue}}formatMethods(e){return!("methods"in e)||!e.methods?[]:e.methods.map(r=>this.formatMethod(r))}formatMethod(e){let r=(e.args||[]).map(s=>({name:s.name,type:s.type||"any",optional:s.optional||!1,defaultValue:s.defaultValue})),n=r.map(s=>{let i=s.optional?"?":"",a=s.defaultValue?` = ${s.defaultValue}`:"";return`${s.name}${i}: ${s.type}${a}`}).join(", "),o=`${e.name}(${n}): ${e.returnType||"void"}`;return{name:e.name,signature:o,description:this.getPreferredDescription(e),parameters:r,returnType:e.returnType||"void"}}formatExamples(e){return!("examples"in e)||!e.examples?[]:e.examples}formatSearchResults(e){return e.map(r=>{let n=r.doc.type==="injectable"?"service":r.doc.type,o="selector"in r.doc?r.doc.selector:void 0;return{name:r.doc.name,type:n,selector:o,description:this.getPreferredDescription(r.doc),deprecated:r.doc.deprecated,relevanceScore:r.relevanceScore}})}toJSON(e){return JSON.stringify(e,null,2)}formatDeprecatedList(e,r){if(e.length===0)return"No deprecated items found.";let n=e.reduce((s,i)=>(s[i.type]||(s[i.type]=[]),s[i.type].push(i),s),{}),o=`Found ${e.length} deprecated item(s):
152
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of t.seen.entries()){let a=i[1];if(e===i[0]){s(i);continue}if(t.external){let u=t.external.registry.get(i[0])?.id;if(e!==i[0]&&u){s(i);continue}}if(t.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1&&t.reused==="ref"){s(i);continue}}}function Au(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let n=a=>{let c=t.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){n(d);let m=t.seen.get(d),f=m.schema;if(f.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(f)):Object.assign(u,f),Object.assign(u,l),a._zod.parent===d)for(let g in u)g==="$ref"||g==="allOf"||g in l||delete u[g];if(f.$ref&&m.def)for(let g in u)g==="$ref"||g==="allOf"||g in m.def&&JSON.stringify(u[g])===JSON.stringify(m.def[g])&&delete u[g]}let p=a._zod.parent;if(p&&p!==d){n(p);let m=t.seen.get(p);if(m?.schema.$ref&&(u.$ref=m.schema.$ref,m.def))for(let f in u)f==="$ref"||f==="allOf"||f in m.def&&JSON.stringify(u[f])===JSON.stringify(m.def[f])&&delete u[f]}t.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...t.seen.entries()].reverse())n(a[0]);let o={};if(t.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=t.external.uri(a)}Object.assign(o,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&o.id===s&&delete o.id;let i=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,i[c.defId]=c.def)}t.external||Object.keys(i).length>0&&(t.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:Co(e,"input",t.processors),output:Co(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function qe(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return qe(n.element,r);if(n.type==="set")return qe(n.valueType,r);if(n.type==="lazy")return qe(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return qe(n.innerType,r);if(n.type==="intersection")return qe(n.left,r)||qe(n.right,r);if(n.type==="record"||n.type==="map")return qe(n.keyType,r)||qe(n.valueType,r);if(n.type==="pipe")return t._zod.traits.has("$ZodCodec")?!0:qe(n.in,r)||qe(n.out,r);if(n.type==="object"){for(let o in n.shape)if(qe(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(let o of n.options)if(qe(o,r))return!0;return!1}if(n.type==="tuple"){for(let o of n.items)if(qe(o,r))return!0;return!!(n.rest&&qe(n.rest,r))}return!1}var Qy=(t,e={})=>r=>{let n=Du({...r,processors:e});return Se(t,n),Nu(n,t),Au(n,t)},Co=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Du({...o??{},target:s,io:e,processors:r});return Se(t,i),Nu(i,t),Au(i,t)};var $P={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Xy=(t,e,r,n)=>{let o=r;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u}=t._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=$P[a]??a,o.format===""&&delete o.format,a==="time"&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let l=[...c];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},e_=(t,e,r,n)=>{let o=r,{minimum:s,maximum:i,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=t._zod.bag;typeof a=="string"&&a.includes("int")?o.type="integer":o.type="number";let d=typeof l=="number"&&l>=(s??Number.NEGATIVE_INFINITY),p=typeof u=="number"&&u<=(i??Number.POSITIVE_INFINITY),m=e.target==="draft-04"||e.target==="openapi-3.0";d?m?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l:typeof s=="number"&&(o.minimum=s),p?m?(o.maximum=u,o.exclusiveMaximum=!0):o.exclusiveMaximum=u:typeof i=="number"&&(o.maximum=i),typeof c=="number"&&(o.multipleOf=c)},t_=(t,e,r,n)=>{r.type="boolean"};var r_=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var n_=(t,e,r,n)=>{r.not={}};var o_=(t,e,r,n)=>{};var s_=(t,e,r,n)=>{let o=t._zod.def,s=bo(o.entries);s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),r.enum=s},i_=(t,e,r,n)=>{let o=t._zod.def,s=[];for(let i of o.values)if(i===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof i=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(i))}else s.push(i);if(s.length!==0)if(s.length===1){let i=s[0];r.type=i===null?"null":typeof i,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[i]:r.const=i}else s.every(i=>typeof i=="number")&&(r.type="number"),s.every(i=>typeof i=="string")&&(r.type="string"),s.every(i=>typeof i=="boolean")&&(r.type="boolean"),s.every(i=>i===null)&&(r.type="null"),r.enum=s};var a_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var c_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var u_=(t,e,r,n)=>{let o=r,s=t._zod.def,{minimum:i,maximum:a}=t._zod.bag;typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=Se(s.element,e,{...n,path:[...n.path,"items"]})},l_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object",o.properties={};let i=s.shape;for(let u in i)o.properties[u]=Se(i[u],e,{...n,path:[...n.path,"properties",u]});let a=new Set(Object.keys(i)),c=new Set([...a].filter(u=>{let l=s.shape[u]._zod;return e.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(o.required=Array.from(c)),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=Se(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},d_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>Se(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},f_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=Se(o.right,e,{...n,path:[...n.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c};var p_=(t,e,r,n)=>{let o=r,s=t._zod.def;o.type="object";let i=s.keyType,c=i._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let l=Se(s.valueType,e,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(let d of c)o.patternProperties[d.source]=l}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(o.propertyNames=Se(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=Se(s.valueType,e,{...n,path:[...n.path,"additionalProperties"]});let u=i._zod.values;if(u){let l=[...u].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},m_=(t,e,r,n)=>{let o=t._zod.def,s=Se(o.innerType,e,n),i=e.seen.get(t);e.target==="openapi-3.0"?(i.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},h_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},g_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},y_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},__=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},v_=(t,e,r,n)=>{let o=t._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=e.io==="input"?s?o.out:o.in:o.out;Se(i,e,n);let a=e.seen.get(t);a.ref=i},b_=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.readOnly=!0};var ju=(t,e,r,n)=>{let o=t._zod.def;Se(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType};function wn(t){return!!t._zod}function ir(t,e){return wn(t)?ko(t,e):t.safeParse(e)}function Pi(t){if(!t)return;let e;if(wn(t)?e=t._zod?.def?.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function w_(t){if(wn(t)){let s=t._zod?.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}let r=t._def;if(r){if(r.value!==void 0)return r.value;if(Array.isArray(r.values)&&r.values.length>0)return r.values[0]}let n=t.value;if(n!==void 0)return n}var Io={};df(Io,{ZodISODate:()=>S_,ZodISODateTime:()=>x_,ZodISODuration:()=>k_,ZodISOTime:()=>$_,date:()=>Zu,datetime:()=>Mu,duration:()=>qu,time:()=>Lu});var x_=v("ZodISODateTime",(t,e)=>{Og.init(t,e),ge.init(t,e)});function Mu(t){return My(x_,t)}var S_=v("ZodISODate",(t,e)=>{Ig.init(t,e),ge.init(t,e)});function Zu(t){return Zy(S_,t)}var $_=v("ZodISOTime",(t,e)=>{Rg.init(t,e),ge.init(t,e)});function Lu(t){return Ly($_,t)}var k_=v("ZodISODuration",(t,e)=>{Dg.init(t,e),ge.init(t,e)});function qu(t){return qy(k_,t)}var RP=(t,e)=>{mi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>mh(t,r)},flatten:{value:r=>ph(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,yn,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,yn,2)}},isEmpty:{get(){return t.issues.length===0}}})};var rt=v("ZodError",RP,{Parent:Error});var E_=hi(rt),z_=gi(rt),P_=$o(rt),T_=Eo(rt),C_=hh(rt),O_=gh(rt),I_=yh(rt),R_=_h(rt),D_=vh(rt),N_=bh(rt),A_=wh(rt),j_=xh(rt);var M_=new WeakMap;function Ro(t,e,r){let n=Object.getPrototypeOf(t),o=M_.get(n);if(o||(o=new Set,M_.set(n,o)),!o.has(e)){o.add(e);for(let s in r){let i=r[s];Object.defineProperty(n,s,{configurable:!0,enumerable:!1,get(){let a=i.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}}var _e=v("ZodType",(t,e)=>(le.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:Co(t,"input"),output:Co(t,"output")}}),t.toJSONSchema=Qy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>E_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>P_(t,r,n),t.parseAsync=async(r,n)=>z_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>T_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>C_(t,r,n),t.decode=(r,n)=>O_(t,r,n),t.encodeAsync=async(r,n)=>I_(t,r,n),t.decodeAsync=async(r,n)=>R_(t,r,n),t.safeEncode=(r,n)=>D_(t,r,n),t.safeDecode=(r,n)=>N_(t,r,n),t.safeEncodeAsync=async(r,n)=>A_(t,r,n),t.safeDecodeAsync=async(r,n)=>j_(t,r,n),Ro(t,"ZodType",{check(...r){let n=this.def;return this.clone(Y.mergeDefs(n,{checks:[...n.checks??[],...r.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,n){return St(this,r,n)},brand(){return this},register(r,n){return r.add(this,n),this},refine(r,n){return this.check(ST(r,n))},superRefine(r,n){return this.check($T(r,n))},overwrite(r){return this.check(sr(r))},optional(){return we(this)},exactOptional(){return dT(this)},nullable(){return F_(this)},nullish(){return we(F_(this))},nonoptional(r){return yT(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Ci(this,r)},transform(r){return U_(this,G_(r))},default(r){return mT(this,r)},prefault(r){return gT(this,r)},catch(r){return vT(this,r)},pipe(r){return U_(this,r)},readonly(){return xT(this)},describe(r){let n=this.clone();return qr.add(n,{description:r}),n},meta(...r){if(r.length===0)return qr.get(this);let n=this.clone();return qr.add(n,r[0]),n},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return qr.get(t)?.description},configurable:!0}),t)),V_=v("_ZodString",(t,e)=>{xi.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>Xy(t,n,o,s);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Ro(t,"_ZodString",{regex(...n){return this.check(Su(...n))},includes(...n){return this.check(Eu(...n))},startsWith(...n){return this.check(zu(...n))},endsWith(...n){return this.check(Pu(...n))},min(...n){return this.check(bn(...n))},max(...n){return this.check(Ei(...n))},length(...n){return this.check(zi(...n))},nonempty(...n){return this.check(bn(1,...n))},lowercase(n){return this.check($u(n))},uppercase(n){return this.check(ku(n))},trim(){return this.check(Cu())},normalize(...n){return this.check(Tu(...n))},toLowerCase(){return this.check(Ou())},toUpperCase(){return this.check(Iu())},slugify(){return this.check(Ru())}})}),NP=v("ZodString",(t,e)=>{xi.init(t,e),V_.init(t,e),t.email=r=>t.check(yy(AP,r)),t.url=r=>t.check(xy(jP,r)),t.jwt=r=>t.check(jy(QP,r)),t.emoji=r=>t.check(Sy(MP,r)),t.guid=r=>t.check(xu(Z_,r)),t.uuid=r=>t.check(_y(Ti,r)),t.uuidv4=r=>t.check(vy(Ti,r)),t.uuidv6=r=>t.check(by(Ti,r)),t.uuidv7=r=>t.check(wy(Ti,r)),t.nanoid=r=>t.check($y(ZP,r)),t.guid=r=>t.check(xu(Z_,r)),t.cuid=r=>t.check(ky(LP,r)),t.cuid2=r=>t.check(Ey(qP,r)),t.ulid=r=>t.check(zy(FP,r)),t.base64=r=>t.check(Dy(JP,r)),t.base64url=r=>t.check(Ny(KP,r)),t.xid=r=>t.check(Py(UP,r)),t.ksuid=r=>t.check(Ty(VP,r)),t.ipv4=r=>t.check(Cy(BP,r)),t.ipv6=r=>t.check(Oy(HP,r)),t.cidrv4=r=>t.check(Iy(WP,r)),t.cidrv6=r=>t.check(Ry(GP,r)),t.e164=r=>t.check(Ay(YP,r)),t.datetime=r=>t.check(Mu(r)),t.date=r=>t.check(Zu(r)),t.time=r=>t.check(Lu(r)),t.duration=r=>t.check(qu(r))});function y(t){return gy(NP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),V_.init(t,e)}),AP=v("ZodEmail",(t,e)=>{xg.init(t,e),ge.init(t,e)});var Z_=v("ZodGUID",(t,e)=>{bg.init(t,e),ge.init(t,e)});var Ti=v("ZodUUID",(t,e)=>{wg.init(t,e),ge.init(t,e)});var jP=v("ZodURL",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var MP=v("ZodEmoji",(t,e)=>{$g.init(t,e),ge.init(t,e)});var ZP=v("ZodNanoID",(t,e)=>{kg.init(t,e),ge.init(t,e)});var LP=v("ZodCUID",(t,e)=>{Eg.init(t,e),ge.init(t,e)});var qP=v("ZodCUID2",(t,e)=>{zg.init(t,e),ge.init(t,e)});var FP=v("ZodULID",(t,e)=>{Pg.init(t,e),ge.init(t,e)});var UP=v("ZodXID",(t,e)=>{Tg.init(t,e),ge.init(t,e)});var VP=v("ZodKSUID",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var BP=v("ZodIPv4",(t,e)=>{Ng.init(t,e),ge.init(t,e)});var HP=v("ZodIPv6",(t,e)=>{Ag.init(t,e),ge.init(t,e)});var WP=v("ZodCIDRv4",(t,e)=>{jg.init(t,e),ge.init(t,e)});var GP=v("ZodCIDRv6",(t,e)=>{Mg.init(t,e),ge.init(t,e)});var JP=v("ZodBase64",(t,e)=>{Lg.init(t,e),ge.init(t,e)});var KP=v("ZodBase64URL",(t,e)=>{qg.init(t,e),ge.init(t,e)});var YP=v("ZodE164",(t,e)=>{Fg.init(t,e),ge.init(t,e)});var QP=v("ZodJWT",(t,e)=>{Ug.init(t,e),ge.init(t,e)});var B_=v("ZodNumber",(t,e)=>{yu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>e_(t,n,o,s),Ro(t,"ZodNumber",{gt(n,o){return this.check($i(n,o))},gte(n,o){return this.check(To(n,o))},min(n,o){return this.check(To(n,o))},lt(n,o){return this.check(Si(n,o))},lte(n,o){return this.check(Po(n,o))},max(n,o){return this.check(Po(n,o))},int(n){return this.check(L_(n))},safe(n){return this.check(L_(n))},positive(n){return this.check($i(0,n))},nonnegative(n){return this.check(To(0,n))},negative(n){return this.check(Si(0,n))},nonpositive(n){return this.check(Po(0,n))},multipleOf(n,o){return this.check(ki(n,o))},step(n,o){return this.check(ki(n,o))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function se(t){return Fy(B_,t)}var XP=v("ZodNumberFormat",(t,e)=>{Vg.init(t,e),B_.init(t,e)});function L_(t){return Uy(XP,t)}var eT=v("ZodBoolean",(t,e)=>{Bg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>t_(t,r,n,o)});function ze(t){return Vy(eT,t)}var tT=v("ZodNull",(t,e)=>{Hg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o)});function Uu(t){return By(tT,t)}var rT=v("ZodUnknown",(t,e)=>{Wg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o)});function ye(){return Hy(rT)}var nT=v("ZodNever",(t,e)=>{Gg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o)});function oT(t){return Wy(nT,t)}var sT=v("ZodArray",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(t,r,n,o),t.element=e.element,Ro(t,"ZodArray",{min(r,n){return this.check(bn(r,n))},nonempty(r){return this.check(bn(1,r))},max(r,n){return this.check(Ei(r,n))},length(r,n){return this.check(zi(r,n))},unwrap(){return this.element}})});function J(t,e){return Gy(sT,t,e)}var H_=v("ZodObject",(t,e)=>{Qg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(t,r,n,o),Y.defineLazy(t,"shape",()=>e.shape),Ro(t,"ZodObject",{keyof(){return We(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ye()})},loose(){return this.clone({...this._zod.def,catchall:ye()})},strict(){return this.clone({...this._zod.def,catchall:oT()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return Y.extend(this,r)},safeExtend(r){return Y.safeExtend(this,r)},merge(r){return Y.merge(this,r)},pick(r){return Y.pick(this,r)},omit(r){return Y.omit(this,r)},partial(...r){return Y.partial(J_,this,r[0])},required(...r){return Y.required(K_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new H_(r)}function Fe(t,e){return new H_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var W_=v("ZodUnion",(t,e)=>{_u.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(t,r,n,o),t.options=e.options});function ce(t,e){return new W_({type:"union",options:t,...Y.normalizeParams(e)})}var iT=v("ZodDiscriminatedUnion",(t,e)=>{W_.init(t,e),Xg.init(t,e)});function Vu(t,e,r){return new iT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var aT=v("ZodIntersection",(t,e)=>{ey.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o)});function Ci(t,e){return new aT({type:"intersection",left:t,right:e})}var q_=v("ZodRecord",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new q_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new q_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var Fu=v("ZodEnum",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>s_(t,n,o,s),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let s={};for(let i of n)if(r.has(i))s[i]=e.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Fu({...e,checks:[],...Y.normalizeParams(o),entries:s})},t.exclude=(n,o)=>{let s={...e.entries};for(let i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Fu({...e,checks:[],...Y.normalizeParams(o),entries:s})}});function We(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Fu({type:"enum",entries:r,...Y.normalizeParams(e)})}var cT=v("ZodLiteral",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>i_(t,r,n,o),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function C(t,e){return new cT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var uT=v("ZodTransform",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o),t._zod.parse=(r,n)=>{if(n.direction==="backward")throw new hn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(Y.issue(s,r.value,e));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=t),r.issues.push(Y.issue(i))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r.fallback=!0,r)):(r.value=o,r.fallback=!0,r)}});function G_(t){return new uT({type:"transform",transform:t})}var J_=v("ZodOptional",(t,e)=>{vu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ju(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function we(t){return new J_({type:"optional",innerType:t})}var lT=v("ZodExactOptional",(t,e)=>{sy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>ju(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function dT(t){return new lT({type:"optional",innerType:t})}var fT=v("ZodNullable",(t,e)=>{iy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function F_(t){return new fT({type:"nullable",innerType:t})}var pT=v("ZodDefault",(t,e)=>{ay.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>g_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function mT(t,e){return new pT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var hT=v("ZodPrefault",(t,e)=>{cy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>y_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function gT(t,e){return new hT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var K_=v("ZodNonOptional",(t,e)=>{uy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>h_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function yT(t,e){return new K_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var _T=v("ZodCatch",(t,e)=>{ly.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>__(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function vT(t,e){return new _T({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Y_=v("ZodPipe",(t,e)=>{bu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>v_(t,r,n,o),t.in=e.in,t.out=e.out});function U_(t,e){return new Y_({type:"pipe",in:t,out:e})}var bT=v("ZodPreprocess",(t,e)=>{Y_.init(t,e),dy.init(t,e)}),wT=v("ZodReadonly",(t,e)=>{fy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>b_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function xT(t){return new wT({type:"readonly",innerType:t})}var Q_=v("ZodCustom",(t,e)=>{py.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(t,r,n,o)});function X_(t,e){return Jy(Q_,t??(()=>!0),e)}function ST(t,e={}){return Ky(Q_,t,e)}function $T(t,e){return Yy(t,e)}function Bu(t,e){return new bT({type:"pipe",in:G_(t),out:e})}tt(my());var Wu="2025-11-25";var ev=[Wu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ar="io.modelcontextprotocol/related-task",Ii="2.0",Te=X_(t=>t!==null&&(typeof t=="object"||typeof t=="function")),tv=ce([y(),se().int()]),rv=y(),vq=Fe({ttl:ce([se(),Uu()]).optional(),pollInterval:se().optional()}),kT=P({ttl:se().optional()}),ET=P({taskId:y()}),Gu=Fe({progressToken:tv.optional(),[ar]:ET.optional()}),nt=P({_meta:Gu.optional()}),Do=nt.extend({task:kT.optional()}),nv=t=>Do.safeParse(t).success,Ce=P({method:y(),params:nt.loose().optional()}),ut=P({_meta:Gu.optional()}),lt=P({method:y(),params:ut.loose().optional()}),Oe=Fe({_meta:Gu.optional()}),Ri=ce([y(),se().int()]),ov=P({jsonrpc:C(Ii),id:Ri,...Ce.shape}).strict(),Ju=t=>ov.safeParse(t).success,sv=P({jsonrpc:C(Ii),...lt.shape}).strict(),iv=t=>sv.safeParse(t).success,Ku=P({jsonrpc:C(Ii),id:Ri,result:Oe}).strict(),No=t=>Ku.safeParse(t).success;var G;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(G||(G={}));var Yu=P({jsonrpc:C(Ii),id:Ri.optional(),error:P({code:se().int(),message:y(),data:ye().optional()})}).strict();var av=t=>Yu.safeParse(t).success;var cv=ce([ov,sv,Ku,Yu]),bq=ce([Ku,Yu]),Di=Oe.strict(),zT=ut.extend({requestId:Ri.optional(),reason:y().optional()}),Ni=lt.extend({method:C("notifications/cancelled"),params:zT}),PT=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),Ao=P({icons:J(PT).optional()}),xn=P({name:y(),title:y().optional()}),uv=xn.extend({...xn.shape,...Ao.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),TT=Ci(P({applyDefaults:ze().optional()}),ve(y(),ye())),CT=Bu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Ci(P({form:TT.optional(),url:Te.optional()}),ve(y(),ye()).optional())),OT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),IT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),RT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:CT.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:OT.optional()}),DT=nt.extend({protocolVersion:y(),capabilities:RT,clientInfo:uv}),Qu=Ce.extend({method:C("initialize"),params:DT});var NT=P({experimental:ve(y(),Te).optional(),logging:Te.optional(),completions:Te.optional(),prompts:P({listChanged:ze().optional()}).optional(),resources:P({subscribe:ze().optional(),listChanged:ze().optional()}).optional(),tools:P({listChanged:ze().optional()}).optional(),tasks:IT.optional()}),AT=Oe.extend({protocolVersion:y(),capabilities:NT,serverInfo:uv,instructions:y().optional()}),Xu=lt.extend({method:C("notifications/initialized"),params:ut.optional()});var Ai=Ce.extend({method:C("ping"),params:nt.optional()}),jT=P({progress:se(),total:we(se()),message:we(y())}),MT=P({...ut.shape,...jT.shape,progressToken:tv}),ji=lt.extend({method:C("notifications/progress"),params:MT}),ZT=nt.extend({cursor:rv.optional()}),jo=Ce.extend({params:ZT.optional()}),Mo=Oe.extend({nextCursor:rv.optional()}),LT=We(["working","input_required","completed","failed","cancelled"]),Zo=P({taskId:y(),status:LT,ttl:ce([se(),Uu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),Sn=Oe.extend({task:Zo}),qT=ut.merge(Zo),Lo=lt.extend({method:C("notifications/tasks/status"),params:qT}),Mi=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),Zi=Oe.merge(Zo),Li=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),wq=Oe.loose(),qi=jo.extend({method:C("tasks/list")}),Fi=Mo.extend({tasks:J(Zo)}),Ui=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),lv=Oe.merge(Zo),dv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),fv=dv.extend({text:y()}),el=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),pv=dv.extend({blob:el}),qo=We(["user","assistant"]),$n=P({audience:J(qo).optional(),priority:se().min(0).max(1).optional(),lastModified:Io.datetime({offset:!0}).optional()}),mv=P({...xn.shape,...Ao.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),FT=P({...xn.shape,...Ao.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),UT=jo.extend({method:C("resources/list")}),VT=Mo.extend({resources:J(mv)}),BT=jo.extend({method:C("resources/templates/list")}),HT=Mo.extend({resourceTemplates:J(FT)}),tl=nt.extend({uri:y()}),WT=tl,GT=Ce.extend({method:C("resources/read"),params:WT}),JT=Oe.extend({contents:J(ce([fv,pv]))}),KT=lt.extend({method:C("notifications/resources/list_changed"),params:ut.optional()}),YT=tl,QT=Ce.extend({method:C("resources/subscribe"),params:YT}),XT=tl,eC=Ce.extend({method:C("resources/unsubscribe"),params:XT}),tC=ut.extend({uri:y()}),rC=lt.extend({method:C("notifications/resources/updated"),params:tC}),nC=P({name:y(),description:we(y()),required:we(ze())}),oC=P({...xn.shape,...Ao.shape,description:we(y()),arguments:we(J(nC)),_meta:we(Fe({}))}),sC=jo.extend({method:C("prompts/list")}),iC=Mo.extend({prompts:J(oC)}),aC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),cC=Ce.extend({method:C("prompts/get"),params:aC}),rl=P({type:C("text"),text:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),nl=P({type:C("image"),data:el,mimeType:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),ol=P({type:C("audio"),data:el,mimeType:y(),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),uC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),lC=P({type:C("resource"),resource:ce([fv,pv]),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),dC=mv.extend({type:C("resource_link")}),sl=ce([rl,nl,ol,dC,lC]),fC=P({role:qo,content:sl}),pC=Oe.extend({description:y().optional(),messages:J(fC)}),mC=lt.extend({method:C("notifications/prompts/list_changed"),params:ut.optional()}),hC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),gC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),hv=P({...xn.shape,...Ao.shape,description:y().optional(),inputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()),outputSchema:P({type:C("object"),properties:ve(y(),Te).optional(),required:J(y()).optional()}).catchall(ye()).optional(),annotations:hC.optional(),execution:gC.optional(),_meta:ve(y(),ye()).optional()}),il=jo.extend({method:C("tools/list")}),yC=Mo.extend({tools:J(hv)}),Vi=Oe.extend({content:J(sl).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),xq=Vi.or(Oe.extend({toolResult:ye()})),_C=Do.extend({name:y(),arguments:ve(y(),ye()).optional()}),Fo=Ce.extend({method:C("tools/call"),params:_C}),vC=lt.extend({method:C("notifications/tools/list_changed"),params:ut.optional()}),Sq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),Uo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),bC=nt.extend({level:Uo}),al=Ce.extend({method:C("logging/setLevel"),params:bC}),wC=ut.extend({level:Uo,logger:y().optional(),data:ye()}),xC=lt.extend({method:C("notifications/message"),params:wC}),SC=P({name:y().optional()}),$C=P({hints:J(SC).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),kC=P({mode:We(["auto","required","none"]).optional()}),EC=P({type:C("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:J(sl).default([]),structuredContent:P({}).loose().optional(),isError:ze().optional(),_meta:ve(y(),ye()).optional()}),zC=Vu("type",[rl,nl,ol]),Oi=Vu("type",[rl,nl,ol,uC,EC]),PC=P({role:qo,content:ce([Oi,J(Oi)]),_meta:ve(y(),ye()).optional()}),TC=Do.extend({messages:J(PC),modelPreferences:$C.optional(),systemPrompt:y().optional(),includeContext:We(["none","thisServer","allServers"]).optional(),temperature:se().optional(),maxTokens:se().int(),stopSequences:J(y()).optional(),metadata:Te.optional(),tools:J(hv).optional(),toolChoice:kC.optional()}),CC=Ce.extend({method:C("sampling/createMessage"),params:TC}),cl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:qo,content:zC}),ul=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:qo,content:ce([Oi,J(Oi)])}),OC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),IC=P({type:C("string"),title:y().optional(),description:y().optional(),minLength:se().optional(),maxLength:se().optional(),format:We(["email","uri","date","date-time"]).optional(),default:y().optional()}),RC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),DC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),default:y().optional()}),NC=P({type:C("string"),title:y().optional(),description:y().optional(),oneOf:J(P({const:y(),title:y()})),default:y().optional()}),AC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),jC=ce([DC,NC]),MC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({type:C("string"),enum:J(y())}),default:J(y()).optional()}),ZC=P({type:C("array"),title:y().optional(),description:y().optional(),minItems:se().optional(),maxItems:se().optional(),items:P({anyOf:J(P({const:y(),title:y()}))}),default:J(y()).optional()}),LC=ce([MC,ZC]),qC=ce([AC,jC,LC]),FC=ce([qC,OC,IC,RC]),UC=Do.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),FC),required:J(y()).optional()})}),VC=Do.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),BC=ce([UC,VC]),HC=Ce.extend({method:C("elicitation/create"),params:BC}),WC=ut.extend({elicitationId:y()}),GC=lt.extend({method:C("notifications/elicitation/complete"),params:WC}),Bi=Oe.extend({action:We(["accept","decline","cancel"]),content:Bu(t=>t===null?void 0:t,ve(y(),ce([y(),se(),ze(),J(y())])).optional())}),JC=P({type:C("ref/resource"),uri:y()});var KC=P({type:C("ref/prompt"),name:y()}),YC=nt.extend({ref:ce([KC,JC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),QC=Ce.extend({method:C("completion/complete"),params:YC});var XC=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),eO=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),tO=Ce.extend({method:C("roots/list"),params:nt.optional()}),ll=Oe.extend({roots:J(eO)}),rO=lt.extend({method:C("notifications/roots/list_changed"),params:ut.optional()}),$q=ce([Ai,Qu,QC,al,cC,sC,UT,BT,GT,QT,eC,Fo,il,Mi,Li,qi,Ui]),kq=ce([Ni,ji,Xu,rO,Lo]),Eq=ce([Di,cl,ul,Bi,ll,Zi,Fi,Sn]),zq=ce([Ai,CC,HC,tO,Mi,Li,qi,Ui]),Pq=ce([Ni,ji,xC,rC,KT,vC,mC,Lo,GC]),Tq=ce([Di,AT,XC,pC,iC,VT,HT,JT,Vi,yC,Zi,Fi,Sn]),L=class t extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}static fromError(e,r,n){if(e===G.UrlElicitationRequired&&n){let o=n;if(o.elicitations)return new Hu(o.elicitations,r)}return new t(e,r,n)}},Hu=class extends L{constructor(e,r=`URL elicitation${e.length>1?"s":""} required`){super(G.UrlElicitationRequired,r,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function cr(t){return t==="completed"||t==="failed"||t==="cancelled"}var c2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dl(t){let r=Pi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=w_(r);if(typeof n!="string")throw new Error("Schema method literal must be a string");return n}function fl(t,e){let r=ir(t,e);if(!r.success)throw r.error;return r.data}var cO=6e4,Hi=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Ni,r=>{this._oncancel(r)}),this.setNotificationHandler(ji,r=>{this._onprogress(r)}),this.setRequestHandler(Ai,r=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Mi,async(r,n)=>{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Li,async(r,n)=>{let o=async()=>{let s=r.params.taskId;if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(s,n.sessionId);){if(a.type==="response"||a.type==="error"){let c=a.message,u=c.id,l=this._requestResolvers.get(u);if(l)if(this._requestResolvers.delete(u),a.type==="response")l(c);else{let d=c,p=new L(d.error.code,d.error.message,d.error.data);l(p)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:n.requestId})}}let i=await this._taskStore.getTask(s,n.sessionId);if(!i)throw new L(G.InvalidParams,`Task not found: ${s}`);if(!cr(i.status))return await this._waitForTaskUpdate(s,n.signal),await o();if(cr(i.status)){let a=await this._taskStore.getTaskResult(s,n.sessionId);return this._clearTaskQueue(s),{...a,_meta:{...a._meta,[ar]:{taskId:s}}}}return await o()};return await o()}),this.setRequestHandler(qi,async(r,n)=>{try{let{tasks:o,nextCursor:s}=await this._taskStore.listTasks(r.params?.cursor,n.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new L(G.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Ui,async(r,n)=>{try{let o=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!o)throw new L(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(cr(o.status))throw new L(G.InvalidParams,`Cannot cancel task in terminal status: ${o.status}`);await this._taskStore.updateTaskStatus(r.params.taskId,"cancelled","Client cancelled task execution.",n.sessionId),this._clearTaskQueue(r.params.taskId);let s=await this._taskStore.getTask(r.params.taskId,n.sessionId);if(!s)throw new L(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof L?o:new L(G.InvalidRequest,`Failed to cancel task: ${o instanceof Error?o.message:String(o)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,r,n,o,s=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:s,onTimeout:o})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),L.fromError(G.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;let r=this.transport?.onclose;this._transport.onclose=()=>{r?.(),this._onclose()};let n=this.transport?.onerror;this._transport.onerror=s=>{n?.(s),this._onerror(s)};let o=this._transport?.onmessage;this._transport.onmessage=(s,i)=>{o?.(s,i),No(s)||av(s)?this._onresponse(s):Ju(s)?this._onrequest(s,i):iv(s)?this._onnotification(s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(s)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();let r=L.fromError(G.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let n of e.values())n(r)}_onerror(e){this.onerror?.(e)}_onnotification(e){let r=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;r!==void 0&&Promise.resolve().then(()=>r(e)).catch(n=>this._onerror(new Error(`Uncaught error in notification handler: ${n}`)))}_onrequest(e,r){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,o=this._transport,s=e.params?._meta?.[ar]?.taskId;if(n===void 0){let l={jsonrpc:"2.0",id:e.id,error:{code:G.MethodNotFound,message:"Method not found"}};s&&this._taskMessageQueue?this._enqueueTaskMessage(s,{type:"error",message:l,timestamp:Date.now()},o?.sessionId).catch(d=>this._onerror(new Error(`Failed to enqueue error response: ${d}`))):o?.send(l).catch(d=>this._onerror(new Error(`Failed to send an error response: ${d}`)));return}let i=new AbortController;this._requestHandlerAbortControllers.set(e.id,i);let a=nv(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,o?.sessionId):void 0,u={signal:i.signal,sessionId:o?.sessionId,_meta:e.params?._meta,sendNotification:async l=>{if(i.signal.aborted)return;let d={relatedRequestId:e.id};s&&(d.relatedTask={taskId:s}),await this.notification(l,d)},sendRequest:async(l,d,p)=>{if(i.signal.aborted)throw new L(G.ConnectionClosed,"Request was cancelled");let m={...p,relatedRequestId:e.id};s&&!m.relatedTask&&(m.relatedTask={taskId:s});let f=m.relatedTask?.taskId??s;return f&&c&&await c.updateTaskStatus(f,"input_required"),await this.request(l,d,m)},authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo,taskId:s,taskStore:c,taskRequestedTtl:a?.ttl,closeSSEStream:r?.closeSSEStream,closeStandaloneSSEStream:r?.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,u)).then(async l=>{if(i.signal.aborted)return;let d={result:l,jsonrpc:"2.0",id:e.id};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"response",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)},async l=>{if(i.signal.aborted)return;let d={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(l.code)?l.code:G.InternalError,message:l.message??"Internal error",...l.data!==void 0&&{data:l.data}}};s&&this._taskMessageQueue?await this._enqueueTaskMessage(s,{type:"error",message:d,timestamp:Date.now()},o?.sessionId):await o?.send(d)}).catch(l=>this._onerror(new Error(`Failed to send response: ${l}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,o=Number(r),s=this._progressHandlers.get(o);if(!s){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let i=this._responseHandlers.get(o),a=this._timeoutInfo.get(o);if(a&&i&&a.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(c){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),i(c);return}s(n)}_onresponse(e){let r=Number(e.id),n=this._requestResolvers.get(r);if(n){if(this._requestResolvers.delete(r),No(e))n(e);else{let i=new L(e.error.code,e.error.message,e.error.data);n(i)}return}let o=this._responseHandlers.get(r);if(o===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(r),this._cleanupTimeout(r);let s=!1;if(No(e)&&e.result&&typeof e.result=="object"){let i=e.result;if(i.task&&typeof i.task=="object"){let a=i.task;typeof a.taskId=="string"&&(s=!0,this._taskProgressTokens.set(a.taskId,r))}}if(s||this._progressHandlers.delete(r),No(e))o(e);else{let i=L.fromError(e.error.code,e.error.message,e.error.data);o(i)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,r,n){let{task:o}=n??{};if(!o){try{yield{type:"result",result:await this.request(e,r,n)}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}return}let s;try{let i=await this.request(e,Sn,n);if(i.task)s=i.task.taskId,yield{type:"taskCreated",task:i.task};else throw new L(G.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:s},n);if(yield{type:"taskStatus",task:a},cr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)}:a.status==="failed"?yield{type:"error",error:new L(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new L(G.InternalError,`Task ${s} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:s},r,n)};return}let c=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,c)),n?.signal?.throwIfAborted()}}catch(i){yield{type:"error",error:i instanceof L?i:new L(G.InternalError,String(i))}}}request(e,r,n){let{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i,task:a,relatedTask:c}=n??{};return new Promise((u,l)=>{let d=x=>{l(x)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(x){d(x);return}n?.signal?.throwIfAborted();let p=this._requestMessageId++,m={...e,jsonrpc:"2.0",id:p};n?.onprogress&&(this._progressHandlers.set(p,n.onprogress),m.params={...e.params,_meta:{...e.params?._meta||{},progressToken:p}}),a&&(m.params={...m.params,task:a}),c&&(m.params={...m.params,_meta:{...m.params?._meta||{},[ar]:c}});let f=x=>{this._responseHandlers.delete(p),this._progressHandlers.delete(p),this._cleanupTimeout(p),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:p,reason:String(x)}},{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(S=>this._onerror(new Error(`Failed to send cancellation: ${S}`)));let w=x instanceof L?x:new L(G.RequestTimeout,String(x));l(w)};this._responseHandlers.set(p,x=>{if(!n?.signal?.aborted){if(x instanceof Error)return l(x);try{let w=ir(r,x.result);w.success?u(w.data):l(w.error)}catch(w){l(w)}}}),n?.signal?.addEventListener("abort",()=>{f(n?.signal?.reason)});let h=n?.timeout??cO,g=()=>f(L.fromError(G.RequestTimeout,"Request timed out",{timeout:h}));this._setupTimeout(p,h,n?.maxTotalTimeout,g,n?.resetTimeoutOnProgress??!1);let _=c?.taskId;if(_){let x=w=>{let S=this._responseHandlers.get(p);S?S(w):this._onerror(new Error(`Response handler missing for side-channeled request ${p}`))};this._requestResolvers.set(p,x),this._enqueueTaskMessage(_,{type:"request",message:m,timestamp:Date.now()}).catch(w=>{this._cleanupTimeout(p),l(w)})}else this._transport.send(m,{relatedRequestId:o,resumptionToken:s,onresumptiontoken:i}).catch(x=>{this._cleanupTimeout(p),l(x)})})}async getTask(e,r){return this.request({method:"tasks/get",params:e},Zi,r)}async getTaskResult(e,r,n){return this.request({method:"tasks/result",params:e},r,n)}async listTasks(e,r){return this.request({method:"tasks/list",params:e},Fi,r)}async cancelTask(e,r){return this.request({method:"tasks/cancel",params:e},lv,r)}async notification(e,r){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);let n=r?.relatedTask?.taskId;if(n){let a={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...e.params?._meta||{},[ar]:r.relatedTask}}};await this._enqueueTaskMessage(n,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId&&!r?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let a={...e,jsonrpc:"2.0"};r?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[ar]:r.relatedTask}}}),this._transport?.send(a,r).catch(c=>this._onerror(c))});return}let i={...e,jsonrpc:"2.0"};r?.relatedTask&&(i={...i,params:{...i.params,_meta:{...i.params?._meta||{},[ar]:r.relatedTask}}}),await this._transport.send(i,r)}setRequestHandler(e,r){let n=dl(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(o,s)=>{let i=fl(e,o);return Promise.resolve(r(i,s))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){let n=dl(e);this._notificationHandlers.set(n,o=>{let s=fl(e,o);return Promise.resolve(r(s))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let r=this._taskProgressTokens.get(e);r!==void 0&&(this._progressHandlers.delete(r),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,r,n){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let o=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,r,n,o)}async _clearTaskQueue(e,r){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,r);for(let o of n)if(o.type==="request"&&Ju(o.message)){let s=o.message.id,i=this._requestResolvers.get(s);i?(i(new L(G.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(s)):this._onerror(new Error(`Resolver missing for request ${s} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,r){let n=this._options?.defaultTaskPollInterval??1e3;try{let o=await this._taskStore?.getTask(e);o?.pollInterval&&(n=o.pollInterval)}catch{}return new Promise((o,s)=>{if(r.aborted){s(new L(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new L(G.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,r){let n=this._taskStore;if(!n)throw new Error("No task store configured");return{createTask:async o=>{if(!e)throw new Error("No request provided");return await n.createTask(o,e.id,{method:e.method,params:e.params},r)},getTask:async o=>{let s=await n.getTask(o,r);if(!s)throw new L(G.InvalidParams,"Failed to retrieve task: Task not found");return s},storeTaskResult:async(o,s,i)=>{await n.storeTaskResult(o,s,i,r);let a=await n.getTask(o,r);if(a){let c=Lo.parse({method:"notifications/tasks/status",params:a});await this.notification(c),cr(a.status)&&this._cleanupTaskProgressHandler(o)}},getTaskResult:o=>n.getTaskResult(o,r),updateTaskStatus:async(o,s,i)=>{let a=await n.getTask(o,r);if(!a)throw new L(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(cr(a.status))throw new L(G.InvalidParams,`Cannot update task "${o}" from terminal status "${a.status}" to "${s}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(o,s,i,r);let c=await n.getTask(o,r);if(c){let u=Lo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),cr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function gv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function yv(t,e){let r={...t};for(let n in e){let o=n,s=e[o];if(s===void 0)continue;let i=r[o];gv(i)&&gv(s)?r[o]={...i,...s}:r[o]=s}return r}var ax=gt(Xd(),1),cx=gt(ix(),1);function h1(){let t=new ax.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,cx.default)(t),t}var Ca=class{constructor(e){this._ajv=e??h1()}getValidator(e){let r="$id"in e&&typeof e.$id=="string"?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return n=>r(n)?{valid:!0,data:n,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(r.errors)}}};var Oa=class{constructor(e){this._server=e}requestStream(e,r,n){return this._server.requestStream(e,r,n)}async getTask(e,r){return this._server.getTask({taskId:e},r)}async getTaskResult(e,r,n){return this._server.getTaskResult({taskId:e},r,n)}async listTasks(e,r){return this._server.listTasks(e?{cursor:e}:void 0,r)}async cancelTask(e,r){return this._server.cancelTask({taskId:e},r)}};function ux(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"tools/call":if(!t.tools?.call)throw new Error(`${r} does not support task creation for tools/call (required for ${e})`);break;default:break}}function lx(t,e,r){if(!t)throw new Error(`${r} does not support task creation (required for ${e})`);switch(e){case"sampling/createMessage":if(!t.sampling?.createMessage)throw new Error(`${r} does not support task creation for sampling/createMessage (required for ${e})`);break;case"elicitation/create":if(!t.elicitation?.create)throw new Error(`${r} does not support task creation for elicitation/create (required for ${e})`);break;default:break}}var Ia=class extends Hi{constructor(e,r){super(r),this._serverInfo=e,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(Uo.options.map((n,o)=>[n,o])),this.isMessageIgnored=(n,o)=>{let s=this._loggingLevels.get(o);return s?this.LOG_LEVEL_SEVERITY.get(n)<this.LOG_LEVEL_SEVERITY.get(s):!1},this._capabilities=r?.capabilities??{},this._instructions=r?.instructions,this._jsonSchemaValidator=r?.jsonSchemaValidator??new Ca,this.setRequestHandler(Qu,n=>this._oninitialize(n)),this.setNotificationHandler(Xu,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(al,async(n,o)=>{let s=o.sessionId||o.requestInfo?.headers["mcp-session-id"]||void 0,{level:i}=n.params,a=Uo.safeParse(i);return a.success&&this._loggingLevels.set(s,a.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new Oa(this)}),this._experimental}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=yv(this._capabilities,e)}setRequestHandler(e,r){let o=Pi(e)?.method;if(!o)throw new Error("Schema is missing a method literal");let s;if(wn(o)){let a=o;s=a._zod?.def?.value??a.value}else{let a=o;s=a._def?.value??a.value}if(typeof s!="string")throw new Error("Schema method literal must be a string");if(s==="tools/call"){let a=async(c,u)=>{let l=ir(Fo,c);if(!l.success){let f=l.error instanceof Error?l.error.message:String(l.error);throw new L(G.InvalidParams,`Invalid tools/call request: ${f}`)}let{params:d}=l.data,p=await Promise.resolve(r(c,u));if(d.task){let f=ir(Sn,p);if(!f.success){let h=f.error instanceof Error?f.error.message:String(f.error);throw new L(G.InvalidParams,`Invalid task creation result: ${h}`)}return f.data}let m=ir(Vi,p);if(!m.success){let f=m.error instanceof Error?m.error.message:String(m.error);throw new L(G.InvalidParams,`Invalid tools/call result: ${f}`)}return m.data};return super.setRequestHandler(e,a)}return super.setRequestHandler(e,r)}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${e})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${e})`);break;case"ping":case"initialize":break}}assertTaskCapability(e){lx(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&ux(this._capabilities.tasks?.requests,e,"Server")}async _oninitialize(e){let r=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:ev.includes(r)?r:Wu,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},Di)}async createMessage(e,r){if((e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(e.messages.length>0){let n=e.messages[e.messages.length-1],o=Array.isArray(n.content)?n.content:[n.content],s=o.some(u=>u.type==="tool_result"),i=e.messages.length>1?e.messages[e.messages.length-2]:void 0,a=i?Array.isArray(i.content)?i.content:[i.content]:[],c=a.some(u=>u.type==="tool_use");if(s){if(o.some(u=>u.type!=="tool_result"))throw new Error("The last message must contain only tool_result content if any is present");if(!c)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(c){let u=new Set(a.filter(d=>d.type==="tool_use").map(d=>d.id)),l=new Set(o.filter(d=>d.type==="tool_result").map(d=>d.toolUseId));if(u.size!==l.size||![...u].every(d=>l.has(d)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return e.tools?this.request({method:"sampling/createMessage",params:e},ul,r):this.request({method:"sampling/createMessage",params:e},cl,r)}async elicitInput(e,r){switch(e.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");let o=e;return this.request({method:"elicitation/create",params:o},Bi,r)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");let o=e.mode==="form"?e:{...e,mode:"form"},s=await this.request({method:"elicitation/create",params:o},Bi,r);if(s.action==="accept"&&s.content&&o.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(o.requestedSchema)(s.content);if(!a.valid)throw new L(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof L?i:new L(G.InternalError,`Error validating elicitation response: ${i instanceof Error?i.message:String(i)}`)}return s}}}createElicitationCompletionNotifier(e,r){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},r)}async listRoots(e,r){return this.request({method:"roots/list",params:e},ll,r)}async sendLoggingMessage(e,r){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,r))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};var cf=gt(require("node:process"),1);var Ra=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
153
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),g1(r)}clear(){this._buffer=void 0}};function g1(t){return cv.parse(JSON.parse(t))}function dx(t){return JSON.stringify(t)+`
154
+ `}var Da=class{constructor(e=cf.default.stdin,r=cf.default.stdout){this._stdin=e,this._stdout=r,this._readBuffer=new Ra,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let e=this._readBuffer.readMessage();if(e===null)break;this.onmessage?.(e)}catch(e){this.onerror?.(e)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(e){return new Promise(r=>{let n=dx(e);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var bs=class{index;constructor(e){this.index=e}getByName(e){return this.index.byName.get(e)}getBySelector(e){return this.index.bySelector.get(e)}getByType(e){switch(e){case"component":return this.index.components;case"directive":return this.index.directives;case"pipe":return this.index.pipes;case"service":return this.index.services;case"all":return[...this.index.components,...this.index.directives,...this.index.pipes,...this.index.services];default:return[]}}getAll(e=!1){let r=this.getByType("all");return e?r:r.filter(n=>!n.deprecated)}updateIndex(e){this.index=e}};var ws=class{index;constructor(e){this.index=e}search(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50,offset:i=0}=e,a=r.toLowerCase().trim();if(a.length===0)return{items:[],total:0,hasMore:!1};let c=this.getCandidates(a,n),u=[];for(let m of c){if(!o&&m.deprecated)continue;let f=this.calculateRelevanceScore(m,a);f>0&&u.push({doc:m,relevanceScore:f})}u.sort((m,f)=>f.relevanceScore-m.relevanceScore);let l=u.length,d=u.slice(i,i+s),p=i+s<l;return{items:d,total:l,hasMore:p}}getCandidates(e,r){let n=e.split(/[^a-z0-9]+/).filter(i=>i.length>0),o=new Set;for(let i of n){if(this.index.searchIndex.has(i)){let a=this.index.searchIndex.get(i);for(let c of a)o.add(c)}for(let[a,c]of this.index.searchIndex.entries())if(a.startsWith(i))for(let u of c)o.add(u)}let s=[];for(let i of o){let a=this.index.byName.get(i);a&&(r&&r.length>0?r.includes(a.type)&&s.push(a):s.push(a))}return s}calculateRelevanceScore(e,r){let n=0,o=e.name.toLowerCase();if(o===r&&(n+=100),"selector"in e&&e.selector){let s=e.selector.toLowerCase();(s===r||s.includes(r))&&(n+=80)}if(o.startsWith(r)&&(n+=60),!o.startsWith(r)&&o.includes(r)&&(n+=30),e.description&&e.description.toLowerCase().includes(r)&&(n+=40),"inputs"in e&&e.inputs){for(let s of e.inputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("outputs"in e&&e.outputs){for(let s of e.outputs)if(s.name.toLowerCase().includes(r)){n+=30;break}}if("methods"in e&&e.methods){for(let s of e.methods)if(s.name.toLowerCase().includes(r)){n+=20;break}}return e.deprecated&&(n=Math.floor(n*.5)),n}updateIndex(e){this.index=e}};var Na=class{getPreferredDescription(e){return e.rawdescription??e.description??""}formatList(e,r=!1){return e.filter(n=>r||!n.deprecated).map(n=>this.formatSummary(n))}formatSummary(e){let r=e.type==="injectable"?"service":e.type,n="selector"in e?e.selector:void 0;return{name:e.name,type:r,selector:n,description:this.getPreferredDescription(e),deprecated:e.deprecated}}formatDetails(e){let r=this.formatInputs(e),n=this.formatOutputs(e),o=this.formatMethods(e),s=this.formatExamples(e),i=e.type==="injectable"?"service":e.type,a="selector"in e?e.selector:void 0,c="standalone"in e?e.standalone:void 0,u="imports"in e?e.imports:void 0;return{name:e.name,type:i,selector:a,description:this.getPreferredDescription(e),inputs:r,outputs:n,methods:o,examples:s,deprecated:e.deprecated,deprecationMessage:e.deprecationMessage,standalone:c,imports:u}}formatInputs(e){let r=[];return"inputs"in e&&e.inputs&&r.push(...e.inputs.map(n=>this.formatProperty(n))),"inputsClass"in e&&e.inputsClass&&r.push(...e.inputsClass.map(n=>this.formatProperty(n))),r}formatOutputs(e){let r=[];return"outputs"in e&&e.outputs&&r.push(...e.outputs.map(n=>this.formatProperty(n))),"outputsClass"in e&&e.outputsClass&&r.push(...e.outputsClass.map(n=>this.formatProperty(n))),r}formatProperty(e){return{name:e.name,type:e.type||"any",required:!e.optional,description:this.getPreferredDescription(e),defaultValue:e.defaultValue}}formatMethods(e){return!("methods"in e)||!e.methods?[]:e.methods.map(r=>this.formatMethod(r))}formatMethod(e){let r=(e.args||[]).map(s=>({name:s.name,type:s.type||"any",optional:s.optional||!1,defaultValue:s.defaultValue})),n=r.map(s=>{let i=s.optional?"?":"",a=s.defaultValue?` = ${s.defaultValue}`:"";return`${s.name}${i}: ${s.type}${a}`}).join(", "),o=`${e.name}(${n}): ${e.returnType||"void"}`;return{name:e.name,signature:o,description:this.getPreferredDescription(e),parameters:r,returnType:e.returnType||"void"}}formatExamples(e){return!("examples"in e)||!e.examples?[]:e.examples}formatSearchResults(e){return e.map(r=>{let n=r.doc.type==="injectable"?"service":r.doc.type,o="selector"in r.doc?r.doc.selector:void 0;return{name:r.doc.name,type:n,selector:o,description:this.getPreferredDescription(r.doc),deprecated:r.doc.deprecated,relevanceScore:r.relevanceScore}})}toJSON(e){return JSON.stringify(e,null,2)}formatDeprecatedList(e,r){if(e.length===0)return"No deprecated items found.";let n=e.reduce((s,i)=>(s[i.type]||(s[i.type]=[]),s[i.type].push(i),s),{}),o=`Found ${e.length} deprecated item(s):
155
155
 
156
156
  `;for(let[s,i]of Object.entries(n)){o+=`## ${s.charAt(0).toUpperCase()+s.slice(1)}s
157
157
 
@@ -170,7 +170,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
170
170
 
171
171
  `),e.replacementSuggestion&&(r+=`**Recommended replacement**: ${e.replacementSuggestion}
172
172
 
173
- `),r}};var Ln=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e={}){let{includeDeprecated:r=!1,type:n="all",limit:o=50,offset:s=0}=e;if(o<1||o>1e3)throw new Error("Limit must be between 1 and 1000");if(s<0)throw new Error("Offset must be non-negative");let i=this.query.getByType(n),a=r?i:i.filter(m=>!m.deprecated),c=a.length,u=a.slice(s,s+o),l=s+o<c;return{items:this.formatter.formatList(u,!0),total:c,hasMore:l,offset:s,limit:o}}static getToolDefinition(){return{name:"list-components",description:"Lists all available components, directives, pipes, and services from the EUI component library. Supports filtering by type and deprecated status, with pagination for large result sets.",inputSchema:{type:"object",properties:{includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in the results (default: false)",default:!1},type:{type:"string",enum:["component","directive","pipe","service","all"],description:"Filter by type (default: all)",default:"all"},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3},offset:{type:"number",description:"Number of results to skip for pagination (default: 0)",default:0,minimum:0}}}}}};var qn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{component:this.formatter.formatDetails(n)}}static getToolDefinition(){return{name:"get-component-docs",description:"Retrieves detailed documentation for a specific component, directive, pipe, or service by name. Returns complete metadata including inputs, outputs, methods, examples, selector information, standalone flag, and module import requirements.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service to retrieve"}},required:["name"]}}}};var Fn=class{searchEngine;formatter;constructor(e,r){this.searchEngine=e,this.formatter=r}execute(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50}=e;if(r==null||typeof r!="string")throw new Error("Query is required and must be a string");let i=r.trim();if(i.length===0)throw new Error("Query cannot be empty");if(s<1||s>1e3)throw new Error("Limit must be between 1 and 1000");if(n&&n.length>0){let l=["component","directive","pipe","service"];for(let d of n)if(!l.includes(d))throw new Error(`Invalid type "${d}". Must be one of: ${l.join(", ")}`)}let a={query:i,types:n,includeDeprecated:o,limit:s,offset:0},c=this.searchEngine.search(a);return{items:this.formatter.formatSearchResults(c.items),total:c.total,hasMore:c.hasMore,query:i}}static getToolDefinition(){return{name:"search-components",description:"Searches for components, directives, pipes, and services by keyword or functionality. Returns results ranked by relevance, matching against component names, selectors, descriptions, inputs, outputs, and methods. Supports filtering by type and deprecated status.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query to match against component metadata"},types:{type:"array",items:{type:"string",enum:["component","directive","pipe","service"]},description:"Filter results by type (optional). If not specified, searches all types."},includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in results (default: false)",default:!1},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3}},required:["query"]}}}};var Un=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatInputs(n);return{componentName:n.name,inputs:o}}static getToolDefinition(){return{name:"get-component-inputs",description:"Retrieves all input properties for a specific component, directive, pipe, or service by name. Returns detailed information about each input including name, type, description, default value, and required flag.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Vn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatOutputs(n);return{componentName:n.name,outputs:o}}static getToolDefinition(){return{name:"get-component-outputs",description:"Retrieves all output events for a specific component, directive, pipe, or service by name. Returns detailed information about each output including name, type, and description.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Bn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatExamples(n);return{componentName:n.name,examples:o}}static getToolDefinition(){return{name:"get-component-examples",description:"Retrieves all usage examples for a specific component, directive, pipe, or service by name. Returns code examples with HTML templates and TypeScript code, preserving formatting. Returns an empty array if no examples are available.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Hn=class{async execute(e={}){try{let r=await fetch("https://registry.npmjs.org/@eui/components");if(!r.ok)throw r.status===404?new Error('Package "@eui/components" not found in npm registry'):new Error(`npm registry returned status ${r.status}`);let n=await r.json();if(!n["dist-tags"]||!n["dist-tags"].latest)throw new Error("Invalid response: missing dist-tags.latest");if(!n.time)throw new Error("Invalid response: missing time field");let o=n["dist-tags"].latest,s=n.time[o];if(!s)throw new Error(`Invalid response: no publish date for version ${o}`);return{packageName:"@eui/components",version:o,publishDate:s}}catch(r){throw r instanceof Error?r:new Error(`Unexpected error querying npm registry: ${String(r)}`)}}static getToolDefinition(){return{name:"get-library-version",description:"Queries the npm registry to retrieve the latest version information for the @eui/components package, including the version number and publish date.",inputSchema:{type:"object",properties:{}}}}};var Oa=class{isDeprecated(e){return!!(e.deprecated===!0||e.decorators&&e.decorators.some(r=>r.name==="deprecated")||e.jsdoctags&&e.jsdoctags.some(r=>r.tagName?.text==="deprecated"))}extractDeprecationMessage(e){let r=e.jsdoctags?.find(n=>n.tagName?.text==="deprecated");return r?.comment?r.comment:e.deprecationMessage?e.deprecationMessage:"This item is deprecated."}extractVersion(e){let r=[/since\s+v?(\d+\.\d+\.\d+)/i,/deprecated\s+in\s+v?(\d+\.\d+\.\d+)/i,/v(\d+\.\d+\.\d+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}extractReplacement(e){let r=[/use\s+([A-Za-z0-9_-]+)\s+instead/i,/replaced\s+by\s+([A-Za-z0-9_-]+)/i,/migrate\s+to\s+([A-Za-z0-9_-]+)/i,/see\s+([A-Za-z0-9_-]+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}parseDeprecationInfo(e){let r=this.extractDeprecationMessage(e);return{deprecationMessage:r,versionDeprecated:this.extractVersion(r),replacementSuggestion:this.extractReplacement(r),filePath:e.file}}};var Wn=class{constructor(e){this.index=e;this.parser=new Oa}index;parser;listDeprecated(e={}){let r=[],n=[{items:this.index.components,type:"component"},{items:this.index.directives,type:"directive"},{items:this.index.pipes,type:"pipe"},{items:this.index.services,type:"injectable"}];for(let{items:o,type:s}of n)if(!(e.type&&e.type!==s)){for(let i of o)if(this.parser.isDeprecated(i)){let a=this.parser.parseDeprecationInfo(i),c=e.includeReplacements?a.replacementSuggestion:void 0;r.push({name:i.name,type:s,deprecationMessage:a.deprecationMessage,versionDeprecated:a.versionDeprecated,replacementSuggestion:c,filePath:a.filePath})}}return r}getDeprecationInfo(e){let r=this.index.byName.get(e);if(!r)return null;if(!this.parser.isDeprecated(r))return{name:e,type:r.type,isDeprecated:!1};let o=this.parser.parseDeprecationInfo(r);return{name:e,type:r.type,isDeprecated:!0,deprecationMessage:o.deprecationMessage,versionDeprecated:o.versionDeprecated,replacementSuggestion:o.replacementSuggestion}}};var Gn=class{query;formatter;constructor(e,r){this.query=new Wn(e),this.formatter=r}execute(e={}){let{type:r,includeReplacements:n=!1}=e,o=this.query.listDeprecated({type:r,includeReplacements:n});return{content:[{type:"text",text:this.formatter.formatDeprecatedList(o,n)}]}}static getToolDefinition(){return{name:"list-deprecated",description:"Lists all deprecated items in the library (components, directives, pipes, services). Supports filtering by type and optionally includes replacement suggestions.",inputSchema:{type:"object",properties:{type:{type:"string",description:"Filter by type (component, directive, pipe, injectable)"},includeReplacements:{type:"boolean",description:"Include replacement suggestions in results (default: false)",default:!1}}}}}};var Jn=class{query;formatter;constructor(e,r){this.query=new Wn(e),this.formatter=r}execute(e){let{componentName:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getDeprecationInfo(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{content:[{type:"text",text:this.formatter.formatDeprecationInfo(n)}]}}static getToolDefinition(){return{name:"get-deprecation-info",description:"Retrieves detailed deprecation information for a specific component, directive, pipe, or service. Returns deprecation status, message, version deprecated, and replacement suggestions.",inputSchema:{type:"object",properties:{componentName:{type:"string",description:"The name of the component or library element to check"}},required:["componentName"]}}}};var Kn=class{execute(e={}){return Promise.resolve({content:uj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-guide",description:"Returns a comprehensive markdown guide for getting started with EUI CLI, including installation, project creation, and basic usage instructions.",inputSchema:{type:"object",properties:{}}}}},uj=`# Getting Started with EUI CLI
173
+ `),r}};var Fn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e={}){let{includeDeprecated:r=!1,type:n="all",limit:o=50,offset:s=0}=e;if(o<1||o>1e3)throw new Error("Limit must be between 1 and 1000");if(s<0)throw new Error("Offset must be non-negative");let i=this.query.getByType(n),a=r?i:i.filter(p=>!p.deprecated),c=a.length,u=a.slice(s,s+o),l=s+o<c;return{items:this.formatter.formatList(u,!0),total:c,hasMore:l,offset:s,limit:o}}static getToolDefinition(){return{name:"list-components",description:"Lists all available components, directives, pipes, and services from the EUI component library. Supports filtering by type and deprecated status, with pagination for large result sets.",inputSchema:{type:"object",properties:{includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in the results (default: false)",default:!1},type:{type:"string",enum:["component","directive","pipe","service","all"],description:"Filter by type (default: all)",default:"all"},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3},offset:{type:"number",description:"Number of results to skip for pagination (default: 0)",default:0,minimum:0}}}}}};var Un=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{component:this.formatter.formatDetails(n)}}static getToolDefinition(){return{name:"get-component-docs",description:"Retrieves detailed documentation for a specific component, directive, pipe, or service by name. Returns complete metadata including inputs, outputs, methods, examples, selector information, standalone flag, and module import requirements.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service to retrieve"}},required:["name"]}}}};var Vn=class{searchEngine;formatter;constructor(e,r){this.searchEngine=e,this.formatter=r}execute(e){let{query:r,types:n,includeDeprecated:o=!1,limit:s=50}=e;if(r==null||typeof r!="string")throw new Error("Query is required and must be a string");let i=r.trim();if(i.length===0)throw new Error("Query cannot be empty");if(s<1||s>1e3)throw new Error("Limit must be between 1 and 1000");if(n&&n.length>0){let l=["component","directive","pipe","service"];for(let d of n)if(!l.includes(d))throw new Error(`Invalid type "${d}". Must be one of: ${l.join(", ")}`)}let a={query:i,types:n,includeDeprecated:o,limit:s,offset:0},c=this.searchEngine.search(a);return{items:this.formatter.formatSearchResults(c.items),total:c.total,hasMore:c.hasMore,query:i}}static getToolDefinition(){return{name:"search-components",description:"Searches for components, directives, pipes, and services by keyword or functionality. Returns results ranked by relevance, matching against component names, selectors, descriptions, inputs, outputs, and methods. Supports filtering by type and deprecated status.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query to match against component metadata"},types:{type:"array",items:{type:"string",enum:["component","directive","pipe","service"]},description:"Filter results by type (optional). If not specified, searches all types."},includeDeprecated:{type:"boolean",description:"Whether to include deprecated components in results (default: false)",default:!1},limit:{type:"number",description:"Maximum number of results to return (default: 50, max: 1000)",default:50,minimum:1,maximum:1e3}},required:["query"]}}}};var Bn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatInputs(n);return{componentName:n.name,inputs:o}}static getToolDefinition(){return{name:"get-component-inputs",description:"Retrieves all input properties for a specific component, directive, pipe, or service by name. Returns detailed information about each input including name, type, description, default value, and required flag.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Hn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatOutputs(n);return{componentName:n.name,outputs:o}}static getToolDefinition(){return{name:"get-component-outputs",description:"Retrieves all output events for a specific component, directive, pipe, or service by name. Returns detailed information about each output including name, type, and description.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Wn=class{query;formatter;constructor(e,r){this.query=e,this.formatter=r}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getByName(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);let o=this.formatter.formatExamples(n);return{componentName:n.name,examples:o}}static getToolDefinition(){return{name:"get-component-examples",description:"Retrieves all usage examples for a specific component, directive, pipe, or service by name. Returns code examples with HTML templates and TypeScript code, preserving formatting. Returns an empty array if no examples are available.",inputSchema:{type:"object",properties:{name:{type:"string",description:"The name of the component, directive, pipe, or service"}},required:["name"]}}}};var Gn=class{async execute(e={}){try{let r=await fetch("https://registry.npmjs.org/@eui/components");if(!r.ok)throw r.status===404?new Error('Package "@eui/components" not found in npm registry'):new Error(`npm registry returned status ${r.status}`);let n=await r.json();if(!n["dist-tags"]||!n["dist-tags"].latest)throw new Error("Invalid response: missing dist-tags.latest");if(!n.time)throw new Error("Invalid response: missing time field");let o=n["dist-tags"].latest,s=n.time[o];if(!s)throw new Error(`Invalid response: no publish date for version ${o}`);return{packageName:"@eui/components",version:o,publishDate:s}}catch(r){throw r instanceof Error?r:new Error(`Unexpected error querying npm registry: ${String(r)}`)}}static getToolDefinition(){return{name:"get-library-version",description:"Queries the npm registry to retrieve the latest version information for the @eui/components package, including the version number and publish date.",inputSchema:{type:"object",properties:{}}}}};var Aa=class{isDeprecated(e){return!!(e.deprecated===!0||e.decorators&&e.decorators.some(r=>r.name==="deprecated")||e.jsdoctags&&e.jsdoctags.some(r=>r.tagName?.text==="deprecated"))}extractDeprecationMessage(e){let r=e.jsdoctags?.find(n=>n.tagName?.text==="deprecated");return r?.comment?r.comment:e.deprecationMessage?e.deprecationMessage:"This item is deprecated."}extractVersion(e){let r=[/since\s+v?(\d+\.\d+\.\d+)/i,/deprecated\s+in\s+v?(\d+\.\d+\.\d+)/i,/v(\d+\.\d+\.\d+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}extractReplacement(e){let r=[/use\s+([A-Za-z0-9_-]+)\s+instead/i,/replaced\s+by\s+([A-Za-z0-9_-]+)/i,/migrate\s+to\s+([A-Za-z0-9_-]+)/i,/see\s+([A-Za-z0-9_-]+)/i];for(let n of r){let o=e.match(n);if(o)return o[1]}}parseDeprecationInfo(e){let r=this.extractDeprecationMessage(e);return{deprecationMessage:r,versionDeprecated:this.extractVersion(r),replacementSuggestion:this.extractReplacement(r),filePath:e.file}}};var Jn=class{constructor(e){this.index=e;this.parser=new Aa}index;parser;listDeprecated(e={}){let r=[],n=[{items:this.index.components,type:"component"},{items:this.index.directives,type:"directive"},{items:this.index.pipes,type:"pipe"},{items:this.index.services,type:"injectable"}];for(let{items:o,type:s}of n)if(!(e.type&&e.type!==s)){for(let i of o)if(this.parser.isDeprecated(i)){let a=this.parser.parseDeprecationInfo(i),c=e.includeReplacements?a.replacementSuggestion:void 0;r.push({name:i.name,type:s,deprecationMessage:a.deprecationMessage,versionDeprecated:a.versionDeprecated,replacementSuggestion:c,filePath:a.filePath})}}return r}getDeprecationInfo(e){let r=this.index.byName.get(e);if(!r)return null;if(!this.parser.isDeprecated(r))return{name:e,type:r.type,isDeprecated:!1};let o=this.parser.parseDeprecationInfo(r);return{name:e,type:r.type,isDeprecated:!0,deprecationMessage:o.deprecationMessage,versionDeprecated:o.versionDeprecated,replacementSuggestion:o.replacementSuggestion}}};var Kn=class{query;formatter;constructor(e,r){this.query=new Jn(e),this.formatter=r}execute(e={}){let{type:r,includeReplacements:n=!1}=e,o=this.query.listDeprecated({type:r,includeReplacements:n});return{content:[{type:"text",text:this.formatter.formatDeprecatedList(o,n)}]}}static getToolDefinition(){return{name:"list-deprecated",description:"Lists all deprecated items in the library (components, directives, pipes, services). Supports filtering by type and optionally includes replacement suggestions.",inputSchema:{type:"object",properties:{type:{type:"string",description:"Filter by type (component, directive, pipe, injectable)"},includeReplacements:{type:"boolean",description:"Include replacement suggestions in results (default: false)",default:!1}}}}}};var Yn=class{query;formatter;constructor(e,r){this.query=new Jn(e),this.formatter=r}execute(e){let{componentName:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");let n=this.query.getDeprecationInfo(r.trim());if(!n)throw new Error(`Component "${r}" not found in documentation`);return{content:[{type:"text",text:this.formatter.formatDeprecationInfo(n)}]}}static getToolDefinition(){return{name:"get-deprecation-info",description:"Retrieves detailed deprecation information for a specific component, directive, pipe, or service. Returns deprecation status, message, version deprecated, and replacement suggestions.",inputSchema:{type:"object",properties:{componentName:{type:"string",description:"The name of the component or library element to check"}},required:["componentName"]}}}};var Qn=class{execute(e={}){return Promise.resolve({content:y1,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-guide",description:"Returns a comprehensive markdown guide for getting started with EUI CLI, including installation, project creation, and basic usage instructions.",inputSchema:{type:"object",properties:{}}}}},y1=`# Getting Started with EUI CLI
174
174
 
175
175
  The EUI CLI is a command-line tool for scaffolding and managing EUI applications.
176
176
 
@@ -295,7 +295,7 @@ my-app/
295
295
  \`\`\`
296
296
 
297
297
  The application will be available at \`http://localhost:4200\`
298
- `;var Yn=class{execute(e={}){return Promise.resolve({content:lj,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-instructions",description:"Returns complete EUI CLI instructions including all commands, options, headless mode configuration, CI/CD usage, and best practices for automated scaffolding and building.",inputSchema:{type:"object",properties:{}}}}},lj=`# eUI CLI - Complete Options Report
298
+ `;var Xn=class{execute(e={}){return Promise.resolve({content:_1,format:"markdown"})}static getToolDefinition(){return{name:"get-eui-cli-instructions",description:"Returns complete EUI CLI instructions including all commands, options, headless mode configuration, CI/CD usage, and best practices for automated scaffolding and building.",inputSchema:{type:"object",properties:{}}}}},_1=`# eUI CLI - Complete Options Report
299
299
 
300
300
  ## Overview
301
301
 
@@ -635,9 +635,9 @@ eui-cli serve-app --maxSpaceSize
635
635
 
636
636
  - **Node.js**: >=24.0.0
637
637
  - **Yarn**: >=1.22.4 <2
638
- `;function dj(t){let e=t.replace(/Component$/,"").replace(/Directive$/,"").replace(/Pipe$/,"").replace(/Service$/,"");return e=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase(),e}var Qn=class{data;constructor(e){this.data=e}updateData(e){this.data=e}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");if(!this.data||this.data.length===0)throw new Error("Accessibility data is not available. Ensure --a11y-path is configured pointing to a valid accessibility.json URL or file path.");let n=dj(r.trim()),o=this.data.find(s=>s.component===n);if(o||(o=this.data.find(s=>s.component===`eui-${n}`)),!o){let s=r.trim().toLowerCase();o=this.data.find(i=>i.component===s)}if(!o){let s=this.data.map(a=>a.component).sort().slice(0,20),i=this.data.length-20;throw new Error(`Accessibility documentation not found for "${r}". Available components: ${s.join(", ")}`+(i>0?` and ${i} more.`:"."))}return{componentName:o.component,accessibility:o.content}}static getToolDefinition(){return{name:"get-component-accessibility",description:"Retrieves accessibility (a11y) documentation for a specific EUI component. Returns plain-text accessibility guidelines, ARIA requirements, and keyboard interaction details.",inputSchema:{type:"object",properties:{name:{type:"string",description:'The name of the component (e.g. "ButtonComponent", "DatePickerComponent", or just "button")'}},required:["name"]}}}};var bs=class{server;index;query;searchEngine;formatter;accessibilityData;tools;isRunning=!1;constructor(e,r,n){this.index=r,this.accessibilityData=n??null,this.query=new _s(r),this.searchEngine=new vs(r),this.formatter=new Ca,this.tools=new Map,this.server=new za({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new Ln(this.query,this.formatter),r=new qn(this.query,this.formatter),n=new Fn(this.searchEngine,this.formatter),o=new Un(this.query,this.formatter),s=new Vn(this.query,this.formatter),i=new Bn(this.query,this.formatter),a=new Hn,c=new Gn(this.index,this.formatter),u=new Jn(this.index,this.formatter),l=new Kn,d=new Yn,m=new Qn(this.accessibilityData);this.tools.set("list-components",e),this.tools.set("get-component-docs",r),this.tools.set("search-components",n),this.tools.set("get-component-inputs",o),this.tools.set("get-component-outputs",s),this.tools.set("get-component-examples",i),this.tools.set("get-library-version",a),this.tools.set("list-deprecated",c),this.tools.set("get-deprecation-info",u),this.tools.set("get-eui-cli-guide",l),this.tools.set("get-eui-cli-instructions",d),this.tools.set("get-component-accessibility",m)}setupHandlers(){this.server.setRequestHandler(rl,()=>({tools:[Ln.getToolDefinition(),qn.getToolDefinition(),Fn.getToolDefinition(),Un.getToolDefinition(),Vn.getToolDefinition(),Bn.getToolDefinition(),Hn.getToolDefinition(),Gn.getToolDefinition(),Jn.getToolDefinition(),Kn.getToolDefinition(),Yn.getToolDefinition(),Qn.getToolDefinition()]})),this.server.setRequestHandler(Lo,async e=>{let{name:r,arguments:n}=e.params;try{let o=this.tools.get(r);if(!o)return{content:[{type:"text",text:JSON.stringify({error:{code:"TOOL_NOT_FOUND",message:`Tool '${r}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(", ")}`}})}],isError:!0};if(n==null)return{content:[{type:"text",text:JSON.stringify({error:{code:"INVALID_PARAMETERS",message:"Tool parameters are required"}})}],isError:!0};let s=await o.execute(n??{});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(o){let s=o instanceof Error?o.message:"Unknown error occurred",i=this.categorizeError(o);return{content:[{type:"text",text:JSON.stringify({error:{code:i,message:s}})}],isError:!0}}})}categorizeError(e){if(e instanceof Error){let r=e.message.toLowerCase();if(r.includes("not found")||r.includes("does not exist"))return"NOT_FOUND";if(r.includes("invalid")||r.includes("must be")||r.includes("required")||r.includes("limit")||r.includes("offset"))return"INVALID_PARAMETERS"}return"INTERNAL_ERROR"}async start(){if(this.isRunning)throw new Error("Server is already running");let e=new Ta;await this.server.connect(e),this.isRunning=!0}async stop(){this.isRunning&&(await this.server.close(),this.isRunning=!1)}isHealthy(){return this.isRunning}getStats(){return{isRunning:this.isRunning,toolCount:this.tools.size,indexStats:{totalComponents:this.index.totalCount,lastUpdated:this.index.lastUpdated}}}updateIndex(e){this.index=e,this.query=new _s(e),this.searchEngine=new vs(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}};var ux=mt(require("fs")),gr=null,Ra=null,cx=!1;async function fj(t,e){let r=Xt.detect(t);if(r.type==="local"){let s=ux.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new dn({timeout:e,maxRetries:2,retryDelay:1e3,userAgent:"EUI-MCP-Server/1.0"}).fetch(r.normalizedPath);if(o.status!==200)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return JSON.parse(o.data)}async function pj(){try{let t=Fa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
638
+ `;function v1(t){let e=t.replace(/Component$/,"").replace(/Directive$/,"").replace(/Pipe$/,"").replace(/Service$/,"");return e=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase(),e}var eo=class{data;constructor(e){this.data=e}updateData(e){this.data=e}execute(e){let{name:r}=e;if(!r||typeof r!="string"||r.trim().length===0)throw new Error("Component name is required and must be a non-empty string");if(!this.data||this.data.length===0)throw new Error("Accessibility data is not available. Ensure --a11y-path is configured pointing to a valid accessibility.json URL or file path.");let n=v1(r.trim()),o=this.data.find(s=>s.component===n);if(o||(o=this.data.find(s=>s.component===`eui-${n}`)),!o){let s=r.trim().toLowerCase();o=this.data.find(i=>i.component===s)}if(!o){let s=this.data.map(a=>a.component).sort().slice(0,20),i=this.data.length-20;throw new Error(`Accessibility documentation not found for "${r}". Available components: ${s.join(", ")}`+(i>0?` and ${i} more.`:"."))}return{componentName:o.component,accessibility:o.content}}static getToolDefinition(){return{name:"get-component-accessibility",description:"Retrieves accessibility (a11y) documentation for a specific EUI component. Returns plain-text accessibility guidelines, ARIA requirements, and keyboard interaction details.",inputSchema:{type:"object",properties:{name:{type:"string",description:'The name of the component (e.g. "ButtonComponent", "DatePickerComponent", or just "button")'}},required:["name"]}}}};var xs=class{server;index;query;searchEngine;formatter;accessibilityData;tools;isRunning=!1;constructor(e,r,n){this.index=r,this.accessibilityData=n??null,this.query=new bs(r),this.searchEngine=new ws(r),this.formatter=new Na,this.tools=new Map,this.server=new Ia({name:e.name,version:e.version},{capabilities:{tools:{}}}),this.registerTools(),this.setupHandlers()}registerTools(){let e=new Fn(this.query,this.formatter),r=new Un(this.query,this.formatter),n=new Vn(this.searchEngine,this.formatter),o=new Bn(this.query,this.formatter),s=new Hn(this.query,this.formatter),i=new Wn(this.query,this.formatter),a=new Gn,c=new Kn(this.index,this.formatter),u=new Yn(this.index,this.formatter),l=new Qn,d=new Xn,p=new eo(this.accessibilityData);this.tools.set("list-components",e),this.tools.set("get-component-docs",r),this.tools.set("search-components",n),this.tools.set("get-component-inputs",o),this.tools.set("get-component-outputs",s),this.tools.set("get-component-examples",i),this.tools.set("get-library-version",a),this.tools.set("list-deprecated",c),this.tools.set("get-deprecation-info",u),this.tools.set("get-eui-cli-guide",l),this.tools.set("get-eui-cli-instructions",d),this.tools.set("get-component-accessibility",p)}setupHandlers(){this.server.setRequestHandler(il,()=>({tools:[Fn.getToolDefinition(),Un.getToolDefinition(),Vn.getToolDefinition(),Bn.getToolDefinition(),Hn.getToolDefinition(),Wn.getToolDefinition(),Gn.getToolDefinition(),Kn.getToolDefinition(),Yn.getToolDefinition(),Qn.getToolDefinition(),Xn.getToolDefinition(),eo.getToolDefinition()]})),this.server.setRequestHandler(Fo,async e=>{let{name:r,arguments:n}=e.params;try{let o=this.tools.get(r);if(!o)return{content:[{type:"text",text:JSON.stringify({error:{code:"TOOL_NOT_FOUND",message:`Tool '${r}' does not exist. Available tools: ${Array.from(this.tools.keys()).join(", ")}`}})}],isError:!0};if(n==null)return{content:[{type:"text",text:JSON.stringify({error:{code:"INVALID_PARAMETERS",message:"Tool parameters are required"}})}],isError:!0};let s=await o.execute(n??{});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(o){let s=o instanceof Error?o.message:"Unknown error occurred",i=this.categorizeError(o);return{content:[{type:"text",text:JSON.stringify({error:{code:i,message:s}})}],isError:!0}}})}categorizeError(e){if(e instanceof Error){let r=e.message.toLowerCase();if(r.includes("not found")||r.includes("does not exist"))return"NOT_FOUND";if(r.includes("invalid")||r.includes("must be")||r.includes("required")||r.includes("limit")||r.includes("offset"))return"INVALID_PARAMETERS"}return"INTERNAL_ERROR"}async start(){if(this.isRunning)throw new Error("Server is already running");let e=new Da;await this.server.connect(e),this.isRunning=!0}async stop(){this.isRunning&&(await this.server.close(),this.isRunning=!1)}isHealthy(){return this.isRunning}getStats(){return{isRunning:this.isRunning,toolCount:this.tools.size,indexStats:{totalComponents:this.index.totalCount,lastUpdated:this.index.lastUpdated}}}updateIndex(e){this.index=e,this.query=new bs(e),this.searchEngine=new ws(e),this.registerTools()}updateAccessibilityData(e){this.accessibilityData=e;let r=this.tools.get("get-component-accessibility");r&&r.updateData(e)}};var px=gt(require("fs")),yr=null,Ma=null,fx=!1;async function b1(t,e){let r=er.detect(t);if(r.type==="local"){let s=px.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new mn({timeout:e,maxRetries:2,retryDelay:1e3,userAgent:"EUI-MCP-Server/1.0"}).fetch(r.normalizedPath);if(o.status!==200)throw new Error(`HTTP ${o.status}: ${o.statusText}`);return JSON.parse(o.data)}async function w1(){try{let t=Wa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
639
639
  `),t.errors&&t.errors.forEach(c=>process.stderr.write(` - ${c}
640
- `)),process.exit(1));let e=t.config,r=Gc({level:e.logging.level,format:e.logging.format});r.info("Starting EUI Compodoc MCP Server",{version:e.server.version,documentationPath:e.documentation.path}),r.info("Loading documentation...",{path:e.documentation.path}),Ra=new ho({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:mj,onError:hj});let n=await Ra.load();(!n.success||!n.data)&&(r.error("Failed to load documentation",void 0,{error:n.error}),process.exit(1)),r.info("Documentation loaded successfully",{path:e.documentation.path}),r.info("Building component index...");let o=new go,s;try{s=o.build(n.data);let c=o.getStatistics(s);r.info("Index built successfully",{totalCount:c.totalCount,components:c.componentCount,directives:c.directiveCount,pipes:c.pipeCount,services:c.serviceCount})}catch(c){r.error("Failed to build index",c instanceof Error?c:new Error(String(c))),process.exit(1)}r.info("Initializing MCP server...");let i=null;if(e.accessibility?.path){r.info("Loading accessibility data...",{path:e.accessibility.path});try{i=await fj(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(c){r.warn("Failed to load accessibility data - tool will be unavailable",{error:c instanceof Error?c.message:String(c)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");gr=new bs({name:e.server.name,version:e.server.version},s,i),r.info("Starting MCP server..."),await gr.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),gr.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let a=gr.getStats();r.debug("Server statistics",a),r.info("Server is ready to accept requests")}catch(t){ne().error("Fatal error during startup",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function mj(t){let e=ne();e.info("Documentation file changed, reloading...");try{let r=new go,n=r.build(t);if(gr){gr.updateIndex(n);let o=r.getStatistics(n);e.info("Index updated successfully",{totalCount:o.totalCount,components:o.componentCount,directives:o.directiveCount,pipes:o.pipeCount,services:o.serviceCount})}}catch(r){e.error("Failed to reload documentation",r instanceof Error?r:new Error(String(r)))}}function hj(t){ne().error("Documentation loader error",t)}async function Ia(t){if(cx)return;cx=!0;let e=ne();e.info(`Received ${t}, shutting down gracefully...`);try{gr&&(e.info("Stopping MCP server..."),await gr.stop(),e.info("MCP server stopped")),Ra&&(e.info("Stopping documentation loader..."),await Ra.dispose(),e.info("Documentation loader stopped")),e.info("Shutdown complete"),process.exit(0)}catch(r){e.error("Error during shutdown",r instanceof Error?r:new Error(String(r))),process.exit(1)}}function gj(){process.on("SIGINT",()=>{Ia("SIGINT")}),process.on("SIGTERM",()=>{Ia("SIGTERM")}),process.on("uncaughtException",t=>{ne().error("Uncaught exception",t),Ia("uncaughtException")}),process.on("unhandledRejection",t=>{ne().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),Ia("unhandledRejection")})}gj();pj().catch(t=>{process.stderr.write(`Fatal error: ${t}
640
+ `)),process.exit(1));let e=t.config,r=Qc({level:e.logging.level,format:e.logging.format});r.info("Starting EUI Compodoc MCP Server",{version:e.server.version,documentationPath:e.documentation.path}),r.info("Loading documentation...",{path:e.documentation.path}),Ma=new yo({path:e.documentation.path,watchForChanges:e.documentation.watchForChanges,reloadDebounce:e.documentation.reloadDebounce,onReload:x1,onError:S1});let n=await Ma.load();(!n.success||!n.data)&&(r.error("Failed to load documentation",void 0,{error:n.error}),process.exit(1)),r.info("Documentation loaded successfully",{path:e.documentation.path}),r.info("Building component index...");let o=new _o,s;try{s=o.build(n.data);let c=o.getStatistics(s);r.info("Index built successfully",{totalCount:c.totalCount,components:c.componentCount,directives:c.directiveCount,pipes:c.pipeCount,services:c.serviceCount})}catch(c){r.error("Failed to build index",c instanceof Error?c:new Error(String(c))),process.exit(1)}r.info("Initializing MCP server...");let i=null;if(e.accessibility?.path){r.info("Loading accessibility data...",{path:e.accessibility.path});try{i=await b1(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(c){r.warn("Failed to load accessibility data - tool will be unavailable",{error:c instanceof Error?c.message:String(c)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");yr=new xs({name:e.server.name,version:e.server.version},s,i),r.info("Starting MCP server..."),await yr.start(),r.info("MCP server started successfully",{name:e.server.name,version:e.server.version,watchForChanges:e.documentation.watchForChanges}),yr.isHealthy()?r.info("Health check passed"):r.warn("Health check failed - server may not be fully operational");let a=yr.getStats();r.debug("Server statistics",a),r.info("Server is ready to accept requests")}catch(t){ne().error("Fatal error during startup",t instanceof Error?t:new Error(String(t))),process.exit(1)}}function x1(t){let e=ne();e.info("Documentation file changed, reloading...");try{let r=new _o,n=r.build(t);if(yr){yr.updateIndex(n);let o=r.getStatistics(n);e.info("Index updated successfully",{totalCount:o.totalCount,components:o.componentCount,directives:o.directiveCount,pipes:o.pipeCount,services:o.serviceCount})}}catch(r){e.error("Failed to reload documentation",r instanceof Error?r:new Error(String(r)))}}function S1(t){ne().error("Documentation loader error",t)}async function ja(t){if(fx)return;fx=!0;let e=ne();e.info(`Received ${t}, shutting down gracefully...`);try{yr&&(e.info("Stopping MCP server..."),await yr.stop(),e.info("MCP server stopped")),Ma&&(e.info("Stopping documentation loader..."),await Ma.dispose(),e.info("Documentation loader stopped")),e.info("Shutdown complete"),process.exit(0)}catch(r){e.error("Error during shutdown",r instanceof Error?r:new Error(String(r))),process.exit(1)}}function $1(){process.on("SIGINT",()=>{ja("SIGINT")}),process.on("SIGTERM",()=>{ja("SIGTERM")}),process.on("uncaughtException",t=>{ne().error("Uncaught exception",t),ja("uncaughtException")}),process.on("unhandledRejection",t=>{ne().error("Unhandled promise rejection",t instanceof Error?t:new Error(String(t))),ja("unhandledRejection")})}$1();w1().catch(t=>{process.stderr.write(`Fatal error: ${t}
641
641
  `),process.exit(1)});
642
642
  /*! Bundled license information:
643
643