@eui/mcp 22.0.0-alpha.47 → 22.0.0-alpha.49

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 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+`
2
+ var gx=Object.create;var Za=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}},ff=(t,e)=>{for(var r in e)Za(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&&Za(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?Za(r,"default",{value:t,enumerable:!0}):r,t));var sc=$((Q1,Jf)=>{"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},Wf=(t,e)=>{if(!ao(t))return"";let r=t.stack||"";if(e.has(t))return r+`
3
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+=`
4
+ caused by: `+Wf(n,e)):r},sS=t=>Wf(t,new Set),Gf=(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?"":": ")+Gf(o,e,s)}else return n},iS=t=>Gf(t,new Set);Jf.exports={isErrorLike:ao,getErrorCause:oc,stackWithCauses:sS,messageWithCauses:iS}});var ic=$((X1,Yf)=>{"use strict";var aS=Symbol("circular-ref-tag"),qs=Symbol("pino-raw-err-ref"),Kf=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(Kf,qs,{writable:!0,value:{}});Yf.exports={pinoErrProto:Kf,pinoErrorSymbols:{seen:aS,rawSymbol:qs}}});var ep=$((ej,Xf)=>{"use strict";Xf.exports=cc;var{messageWithCauses:cS,stackWithCauses:uS,isErrorLike:Qf}=sc(),{pinoErrProto:lS,pinoErrorSymbols:dS}=ic(),{seen:ac}=dS,{toString:fS}=Object.prototype;function cc(t){if(!Qf(t))return t;t[ac]=void 0;let e=Object.create(lS);e.type=fS.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=cS(t),e.stack=uS(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];Qf(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 rp=$((tj,tp)=>{"use strict";tp.exports=Us;var{isErrorLike:uc}=sc(),{pinoErrProto:pS,pinoErrorSymbols:mS}=ic(),{seen:Fs}=mS,{toString:hS}=Object.prototype;function Us(t){if(!uc(t))return t;t[Fs]=void 0;let e=Object.create(pS);e.type=hS.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 ip=$((rj,sp)=>{"use strict";sp.exports={mapHttpRequest:gS,reqSerializer:op};var lc=Symbol("pino-raw-req-ref"),np=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(np,lc,{writable:!0,value:{}});function op(t){let e=t.info||t.socket,r=Object.create(np);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 gS(t){return{req:op(t)}}});var lp=$((nj,up)=>{"use strict";up.exports={mapHttpResponse:yS,resSerializer:cp};var dc=Symbol("pino-raw-res-ref"),ap=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(ap,dc,{writable:!0,value:{}});function cp(t){let e=Object.create(ap);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function yS(t){return{res:cp(t)}}});var pc=$((oj,dp)=>{"use strict";var fc=ep(),_S=rp(),Vs=ip(),Bs=lp();dp.exports={err:fc,errWithCause:_S,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=$((sj,fp)=>{"use strict";function vS(t,e){return e}fp.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=vS;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 _p=$((ij,yp)=>{"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 pp(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 mp(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 hp(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 bS(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 wS(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 xS(t,e,r,n=!1){for(let o of e){let s=pp(o);if(s.includes("*"))gp(t,s,r,o,n);else if(n)hp(t,s);else{let i=bS(t,s);if(i===Hs)continue;let a=typeof r=="function"?r(i,s):r;mp(t,s,a)}}}function gp(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 SS(t,e,r,s,n,o)}function SS(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("*"))gp(l,a,typeof r=="function"?(m,f)=>{let h=[...c.slice(0,d),...f];return r(m,h)}:r,o,s);else if(s)hp(l,a);else{let p=typeof r=="function"?r(wS(l,a),[...c.slice(0,d),...a]):r;mp(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 $S(t){if(t.length===0)return null;let e=new Map;for(let r of t){let n=pp(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 kS(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 ES(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 zS(t){if(!Array.isArray(t))throw new TypeError("paths must be an array");for(let e of t)ES(e)}function PS(t={}){let{paths:e=[],censor:r="[REDACTED]",serialize:n=JSON.stringify,strict:o=!0,remove:s=!1}=t;zS(e);let i=$S(e);return function(c){if(o&&(c===null||typeof c!="object")&&(c==null||typeof c!="object"))return n?n(c):c;let u=kS(c,i),l=c,d=r;return typeof r=="function"&&(d=r),xS(u,e,d,s),n===!1?(u.restore=function(){return hc(l)},u):typeof n=="function"?n(u):JSON.stringify(u)}}yp.exports=PS});var fn=$((aj,vp)=>{"use strict";var TS=Symbol("pino.setLevel"),CS=Symbol("pino.getLevel"),OS=Symbol("pino.levelVal"),IS=Symbol("pino.levelComp"),RS=Symbol("pino.useLevelLabels"),DS=Symbol("pino.useOnlyCustomLevels"),AS=Symbol("pino.mixin"),NS=Symbol("pino.lsCache"),jS=Symbol("pino.chindings"),MS=Symbol("pino.asJson"),LS=Symbol("pino.write"),ZS=Symbol("pino.redactFmt"),qS=Symbol("pino.time"),FS=Symbol("pino.timeSliceIndex"),US=Symbol("pino.stream"),VS=Symbol("pino.stringify"),BS=Symbol("pino.stringifySafe"),HS=Symbol("pino.stringifiers"),WS=Symbol("pino.end"),GS=Symbol("pino.formatOpts"),JS=Symbol("pino.messageKey"),KS=Symbol("pino.errorKey"),YS=Symbol("pino.nestedKey"),QS=Symbol("pino.nestedKeyStr"),XS=Symbol("pino.mixinMergeStrategy"),e$=Symbol("pino.msgPrefix"),t$=Symbol("pino.wildcardFirst"),r$=Symbol.for("pino.serializers"),n$=Symbol.for("pino.formatters"),o$=Symbol.for("pino.hooks"),s$=Symbol.for("pino.metadata");vp.exports={setLevelSym:TS,getLevelSym:CS,levelValSym:OS,levelCompSym:IS,useLevelLabelsSym:RS,mixinSym:AS,lsCacheSym:NS,chindingsSym:jS,asJsonSym:MS,writeSym:LS,serializersSym:r$,redactFmtSym:ZS,timeSym:qS,timeSliceIndexSym:FS,streamSym:US,stringifySym:VS,stringifySafeSym:BS,stringifiersSym:HS,endSym:WS,formatOptsSym:GS,messageKeySym:JS,errorKeySym:KS,nestedKeySym:YS,wildcardFirstSym:t$,needsMetadataGsym:s$,useOnlyCustomLevelsSym:DS,formattersSym:n$,hooksSym:o$,nestedKeyStrSym:QS,mixinMergeStrategySym:XS,msgPrefixSym:e$}});var yc=$((cj,Sp)=>{"use strict";var bp=_p(),{redactFmtSym:i$,wildcardFirstSym:Ws}=fn(),gc=/[^.[\]]+|\[([^[\]]*?)\]/g,wp="[Redacted]",xp=!1;function a$(t,e){let{paths:r,censor:n,remove:o}=c$(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={[i$]:bp({paths:r,censor:n,serialize:e,strict:xp,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]=bp({paths:s[u],censor:l,serialize:e,strict:xp,remove:o})}return c},i)}function c$(t){if(Array.isArray(t))return t={paths:t,censor:wp},t;let{paths:e,censor:r=wp,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}}Sp.exports=a$});var Ep=$((uj,kp)=>{"use strict";var u$=()=>"",l$=()=>`,"time":${Date.now()}`,d$=()=>`,"time":${Math.round(Date.now()/1e3)}`,f$=()=>`,"time":"${new Date(Date.now()).toISOString()}"`,p$=1000000n,$p=1000000000n,m$=BigInt(Date.now())*p$,h$=process.hrtime.bigint(),g$=()=>{let t=process.hrtime.bigint()-h$,e=m$+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"`};kp.exports={nullTime:u$,epochTime:l$,unixTime:d$,isoTime:f$,isoTimeNano:g$}});var Pp=$((lj,zp)=>{"use strict";function y$(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}zp.exports=_$;function _$(t,e,r){var n=r&&r.stringify||y$,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=$((dj,_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=$((fj,Ap)=>{"use strict";var ue=require("fs"),v$=require("events"),b$=require("util").inherits,Tp=require("path"),wc=vc(),w$=require("assert"),Gs=100,Js=Buffer.allocUnsafe(0),x$=16*1024,Cp="buffer",Op="utf8",[S$,$$]=(process.versions.node||"0.0").split(".").map(Number),k$=S$>=22&&$$>=7;function Ip(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(Tp.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(Tp.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||x$,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===Cp)this._writingBuf=Js,this.write=P$,this.flush=C$,this.flushSync=I$,this._actualWrite=D$,f=()=>ue.writeSync(this.fd,this._writingBuf),h=()=>ue.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===Op)this._writingBuf="",this.write=z$,this.flush=T$,this.flushSync=O$,this._actualWrite=R$,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 "${Op}" and "${Cp}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")Ip(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(E$,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 E$(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"))}b$(wt,v$);function Rp(t,e){return t.length===0?Js:t.length===1?t[0]:Buffer.concat(t,e)}function z$(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 P$(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 Dp(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$(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&&Dp.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite())}function C$(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&&Dp.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)})}),Ip(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 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="");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 I$(){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=Rp(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 R$(){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 D$(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:Rp(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 k$&&(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=[],w$(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;Ap.exports=wt});var xc=$((pj,qp)=>{"use strict";var xt={exit:[],beforeExit:[]},jp={exit:j$,beforeExit:M$},pn;function A$(){pn===void 0&&(pn=new FinalizationRegistry(L$))}function N$(t){xt[t].length>0||process.on(t,jp[t])}function Mp(t){xt[t].length>0||(process.removeListener(t,jp[t]),xt.exit.length===0&&xt.beforeExit.length===0&&(pn=void 0))}function j$(){Lp("exit")}function M$(){Lp("beforeExit")}function Lp(t){for(let e of xt[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t)}xt[t]=[]}function L$(t){for(let e of["exit","beforeExit"]){let r=xt[e].indexOf(t);xt[e].splice(r,r+1),Mp(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,A$(),pn.register(e,n),xt[t].push(n)}function Z$(t,e){Zp("exit",t,e)}function q$(t,e){Zp("beforeExit",t,e)}function F$(t){if(pn!==void 0){pn.unregister(t);for(let e of["exit","beforeExit"])xt[e]=xt[e].filter(r=>{let n=r.deref();return n&&n!==t}),Mp(e)}}qp.exports={register:Z$,registerBeforeExit:q$,unregister:F$}});var Fp=$((mj,U$)=>{U$.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 Vp=$((hj,Up)=>{"use strict";function V$(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 B$(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()}Up.exports={wait:V$,waitDiff:B$}});var Hp=$((gj,Bp)=>{"use strict";Bp.exports={WRITE_INDEX:4,READ_INDEX:8,SEQ_INDEX:2}});var om=$((yj,nm)=>{"use strict";var{version:H$}=Fp(),{EventEmitter:W$}=require("events"),{Worker:G$}=require("worker_threads"),{join:J$}=require("path"),{pathToFileURL:K$}=require("url"),{wait:Y$}=Vp(),{WRITE_INDEX:Ft,READ_INDEX:Ar,SEQ_INDEX:Sc}=Hp(),Q$=require("buffer"),X$=require("assert"),b=Symbol("kImpl"),ek=Q$.constants.MAX_STRING_LENGTH;function Wp(){}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 Gp(t){zc(t,()=>{Atomics.store(t[b].state,Ar,0),Atomics.store(t[b].state,Ft,0)})}var co=class{constructor(e){this._value=e}deref(){return this._value}},Ys=class{register(){}unregister(){}},tk=process.env.NODE_V8_COVERAGE?Ys:global.FinalizationRegistry||Ys,rk=process.env.NODE_V8_COVERAGE?co:global.WeakRef||co,Jp=new tk(t=>{t.exited||t.terminate()});function nk(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||J$(__dirname,"lib","worker.js"),i=new G$(s,{...e.workerOpts,name:e.workerOpts?.name||"thread-stream",trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:K$(r).href,dataBuf:t[b].dataBuf,stateBuf:t[b].stateBuf,workerData:{$context:{threadStreamVersion:H$},...n}}});return i.stream=new co(t),i.on("message",ok),i.on("exit",Qp),Jp.register(t,i),i}function Kp(t){X$(!t[b].sync),t[b].needDrain&&(t[b].needDrain=!1,t.emit("drain"))}function Yp(t){for(;;){let e=Atomics.load(t[b].state,Ft),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(Kp,t);return}tm(t,r,Wp);continue}if(r===0){if(e===0&&t[b].bufLen===0)return;Qs(t,()=>{t.destroyed||(Gp(t),Yp(t))});return}it(t,new Error("overwritten"));return}}function ok(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 rk(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 Qp(t){let e=this.stream.deref();e!==void 0&&(Jp.unregister(e),e.worker.exited=!0,e.worker.off("exit",Qp),it(e,t!==0?new Error("the worker thread exited"):null))}var kc=class extends W${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=nk(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>=ek)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(Yp,this)),this[b].needDrain=this[b].data.length-this[b].bufLen-Atomics.load(this[b].state,Ft)<=0,!this[b].needDrain}end(){this[b].destroyed||(this[b].ending=!0,Pc(this))}flush(e){e=typeof e=="function"?e:Wp,Xp(this,r=>{if(r){process.nextTick(e,r);return}em(this,e)})}flushSync(){this[b].destroyed||($c(this),rm(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 Xp(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(Xp,t,e);return}Qs(t,e)}function Qs(t,e){let r=Atomics.load(t[b].state,Ft);Y$(t[b].state,Ar,r,1/0,(n,o)=>{if(n){it(t,n),e(n);return}if(o!=="ok"){Qs(t,e);return}e()})}function em(t,e){if(t[b].destroyed){process.nextTick(e,new Error("the worker has exited"));return}if(!t[b].ready){let n=()=>{s(),em(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 sk(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,sk(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 tm(t,e,r){let o=Atomics.load(t[b].state,Ft),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,Ft,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,Ar);zc(t,()=>{Atomics.store(t[b].state,Ft,-1)});let r=0;for(;e!==-1;){if(Atomics.wait(t[b].state,Ar,e,1e3),e=Atomics.load(t[b].state,Ar),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(Kp,t)};for(t[b].flushing=!1;t[b].bufLen!==0;){let r=Atomics.load(t[b].state,Ft),n=t[b].data.length-r;if(n===0){rm(t),Gp(t);continue}else if(n<0)throw new Error("overwritten");tm(t,n,e)}}function rm(t){if(t[b].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[b].state,Ft),r=0;for(;;){let n=Atomics.load(t[b].state,Ar);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[b].state,Ar,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}nm.exports=kc});var Oc=$((_j,am)=>{"use strict";var{createRequire:ik}=require("module"),{existsSync:ak}=require("node:fs"),ck=mc(),{join:Tc,isAbsolute:im,sep:uk}=require("node:path"),{fileURLToPath:lk}=require("node:url"),dk=vc(),Cc=xc(),fk=om();function pk(t){Cc.register(t,_k),Cc.registerBeforeExit(t,vk),t.on("close",function(){Cc.unregister(t)})}function mk(){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 hk(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&&sm(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(sm(i)){n=!0;continue}}r.push(s)}return n?r.join(" "):t}function sm(t){let e=gk(t);if(!e)return!1;let r=e;if(r.startsWith("file://"))try{r=lk(r)}catch{return!1}return im(r)&&!ak(r)}function gk(t){let e=t[0],r=t[t.length-1];return e==='"'&&r==='"'||e==="'"&&r==="'"?t.slice(1,-1):t}function yk(t,e,r,n,o){if(!r.execArgv&&mk()&&require.main===void 0&&(r={...r,execArgv:[]}),!r.env&&process.env.NODE_OPTIONS){let c=hk(process.env.NODE_OPTIONS);c!==process.env.NODE_OPTIONS&&(r={...r,env:{...process.env,NODE_OPTIONS:c}})}r={...r,name:o};let s=new fk({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&&pk(s)}function a(){s.closed||(s.flushSync(),dk(100),s.end())}return s}function _k(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref()})}function vk(t){t.flushSync()}function bk(t){let{pipeline:e,targets:r,levels:n,dedupe:o,worker:s={},caller:i=ck(),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 yk(m(d),c,s,a,p);function m(f){if(f=l[f]||f,im(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()+uk:g;h=ik(_).resolve(f);break}catch{continue}if(!h)throw new Error(`unable to determine transport target for "${f}"`);return h}}am.exports=bk});var ti=$((vj,bm)=>{"use strict";var wk=require("node:diagnostics_channel"),cm=Pp(),{mapHttpRequest:xk,mapHttpResponse:Sk}=pc(),Rc=Np(),um=xc(),{lsCacheSym:$k,chindingsSym:mm,writeSym:lm,serializersSym:hm,formatOptsSym:dm,endSym:kk,stringifiersSym:gm,stringifySym:ym,stringifySafeSym:Dc,wildcardFirstSym:_m,nestedKeySym:Ek,formattersSym:vm,messageKeySym:zk,errorKeySym:Pk,nestedKeyStrSym:Tk,msgPrefixSym:Xs}=fn(),{isMainThread:Ck}=require("worker_threads"),Ok=Oc(),[Ik]=process.versions.node.split(".").map(t=>Number(t)),fm=wk.tracingChannel("pino_asJson"),Ic=Ik>=25?t=>JSON.stringify(t):Dk;function mn(){}function Rk(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=xk(n):typeof n.setHeader=="function"&&(n=Sk(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[lm](n,cm(s,i,this[dm]),t)}else{let s=n===void 0?o.shift():n;typeof this[Xs]=="string"&&s!==void 0&&s!==null&&(s=this[Xs]+s),this[lm](null,cm(s,o,this[dm]),t)}}}function Dk(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 Ak(t,e,r,n){if(fm.hasSubscribers===!1)return pm.call(this,t,e,r,n);let o={instance:this,arguments};return fm.traceSync(pm,o,this,t,e,r,n)}function pm(t,e,r,n){let o=this[ym],s=this[Dc],i=this[gm],a=this[kk],c=this[mm],u=this[hm],l=this[vm],d=this[zk],p=this[Pk],m=this[$k][r]+n;m=m+c;let f;l.log&&(t=l.log(t));let h=i[_m],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[Ek]&&g?m+this[Tk]+g.slice(1)+"}"+_+a:m+g+_+a}function Nk(t,e){let r,n=t[mm],o=t[ym],s=t[Dc],i=t[gm],a=i[_m],c=t[hm],u=t[vm].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 jk(t){return t.write!==t.constructor.prototype.write}function ei(t){let e=new Rc(t);return e.on("error",r),!t.sync&&Ck&&(um.register(e,Mk),e.on("close",function(){um.unregister(e)})),e;function r(n){if(n.code==="EPIPE"){e.write=mn,e.end=mn,e.flushSync=mn,e.destroy=mn;return}e.removeListener("error",r),e.emit("error",n)}}function Mk(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end()})):t.flushSync())}function Lk(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=Ok({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=mn),s||(jk(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 qk(t,e,r){return{level:t,bindings:e,log:r}}function Fk(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}bm.exports={noop:mn,buildSafeSonicBoom:ei,asChindings:Nk,asJson:Ak,genLog:Rk,createArgsNormalizer:Lk,stringify:Zk,buildFormatters:qk,normalizeDestFileDescriptor:Fk}});var ri=$((bj,wm)=>{var Uk={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Vk={ASC:"ASC",DESC:"DESC"};wm.exports={DEFAULT_LEVELS:Uk,SORTING_ORDER:Vk}});var jc=$((wj,km)=>{"use strict";var{lsCacheSym:Bk,levelValSym:Ac,useOnlyCustomLevelsSym:Hk,streamSym:Wk,formattersSym:Gk,hooksSym:Jk,levelCompSym:xm}=fn(),{noop:Kk,genLog:Nr}=ti(),{DEFAULT_LEVELS:Ct,SORTING_ORDER:Sm}=ri(),$m={fatal:t=>{let e=Nr(Ct.fatal,t);return function(...r){let n=this[Wk];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync()}catch{}}},error:t=>Nr(Ct.error,t),warn:t=>Nr(Ct.warn,t),info:t=>Nr(Ct.info,t),debug:t=>Nr(Ct.debug,t),trace:t=>Nr(Ct.trace,t)},Nc=Object.keys(Ct).reduce((t,e)=>(t[Ct[e]]=e,t),{}),Yk=Object.keys(Nc).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function Qk(t){let e=t[Gk].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[Bk]=n,t}function Xk(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 eE(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[Ac],o=this[Ac]=r[t],s=this[Hk],i=this[xm],a=this[Jk].logMethod;for(let c in r){if(i(r[c],o)===!1){this[c]=Kk;continue}this[c]=Xk(c,s)?$m[c](a):Nr(r[c],a)}this.emit("level-change",t,o,e[n],n,this)}function tE(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function rE(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&this[xm](r,this[Ac])}function nE(t,e,r){return t===Sm.DESC?e<=r:e>=r}function oE(t){return typeof t=="string"?nE.bind(null,t):t}function sE(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:Nc,r),o=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Ct,t);return{labels:n,values:o}}function iE(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Nc).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 aE(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 cE(t){if(typeof t!="function"&&!(typeof t=="string"&&Object.values(Sm).includes(t)))throw new Error('Levels comparison should be one of "ASC", "DESC" or "function" type')}km.exports={initialLsCache:Yk,genLsCache:Qk,levelMethods:$m,getLevel:tE,setLevel:eE,isLevelEnabled:rE,mappings:sE,assertNoLevelCollisions:aE,assertDefaultLevelFound:iE,genLevelComparison:oE,assertLevelComparison:cE}});var Mc=$((xj,Em)=>{"use strict";Em.exports={version:"10.3.1"}});var Dm=$(($j,Rm)=>{"use strict";var{EventEmitter:uE}=require("node:events"),{lsCacheSym:lE,levelValSym:dE,setLevelSym:Zc,getLevelSym:zm,chindingsSym:oi,mixinSym:fE,asJsonSym:Tm,writeSym:pE,mixinMergeStrategySym:mE,timeSym:hE,timeSliceIndexSym:gE,streamSym:Cm,serializersSym:jr,formattersSym:uo,errorKeySym:yE,messageKeySym:_E,useOnlyCustomLevelsSym:vE,needsMetadataGsym:bE,redactFmtSym:wE,stringifySym:xE,formatOptsSym:SE,stringifiersSym:$E,msgPrefixSym:qc,hooksSym:kE}=fn(),{getLevel:EE,setLevel:zE,isLevelEnabled:PE,mappings:TE,initialLsCache:CE,genLsCache:OE,assertNoLevelCollisions:IE}=jc(),{asChindings:Fc,asJson:RE,buildFormatters:Lc,stringify:Pm,noop:Om}=ti(),{version:DE}=Mc(),AE=yc(),NE=class{},Im={constructor:NE,child:jE,bindings:ME,setBindings:LE,flush:FE,isLevelEnabled:PE,version:DE,get level(){return this[zm]()},set level(t){this[Zc](t)},get levelVal(){return this[dE]},set levelVal(t){throw Error("levelVal is read-only")},get msgPrefix(){return this[qc]},get[Symbol.toStringTag](){return"Pino"},[lE]:CE,[pE]:qE,[Tm]:RE,[zm]:EE,[Zc]:zE};Object.setPrototypeOf(Im,uE.prototype);Rm.exports=function(){return Object.create(Im)};var ni=t=>t;function jE(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]=Lc(n.level,ni,n.log)),o[oi]=Fc(o,t),this.onChild!==Om&&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]=Lc(a||n.level,c||ni,u||n.log)}else o[uo]=Lc(n.level,ni,n.log);if(e.hasOwnProperty("customLevels")===!0&&(IE(this.levels,e.customLevels),o.levels=TE(e.customLevels,o[vE]),OE(o)),typeof e.redact=="object"&&e.redact!==null||Array.isArray(e.redact)){o.redact=e.redact;let a=AE(o.redact,Pm),c={stringify:a[wE]};o[xE]=Pm,o[$E]=a,o[SE]=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[Zc](a)}return this.onChild(o),o}function ME(){let e=`{${this[oi].substr(1)}}`,r=JSON.parse(e);return delete r.pid,delete r.hostname,r}function LE(t){let e=Fc(this,t);this[oi]=e}function ZE(t,e){return Object.assign(e,t)}function qE(t,e,r){let n=this[hE](),o=this[fE],s=this[yE],i=this[_E],a=this[mE]||ZE,c,u=this[kE].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[Tm](c,e,r,n),d=this[Cm];d[bE]===!0&&(d.lastLevel=r,d.lastObj=c,d.lastMsg=e,d.lastTime=n.slice(this[gE]),d.lastLogger=this),d.write(u?u(l):l)}function FE(t){if(t!=null&&typeof t!="function")throw Error("callback must be a function");let e=this[Cm];typeof e.flush=="function"?e.flush(t||Om):t&&t()}});var Mm=$((Hc,jm)=>{"use strict";var{hasOwnProperty:lo}=Object.prototype,Lr=Bc();Lr.configure=Bc;Lr.stringify=Lr;Lr.default=Lr;Hc.stringify=Lr;Hc.configure=Bc;jm.exports=Lr;var UE=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function tr(t){return t.length<5e3&&!UE.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 VE=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Vc(t){return VE.call(t)!==void 0&&t.length!==0}function Am(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 BE(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 HE(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 WE(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 GE(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function JE(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=JE(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=BE(t),n=WE(t,"bigint"),o=HE(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 _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
- ${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&&!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=`
6
+ ${x}`);let Se=Math.min(w.length,a),Le=0;for(;Le<Se-1;Le++){let _r=c(String(Le),w,h,g,_,x);S+=_r!==void 0?_r:"null",S+=k}let Be=c(String(Le),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
+ ${W}`),h.pop(),`[${S}]`}let L=Object.keys(w),re=L.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&&!Vc(w)&&(L=Uc(L,s)),h.push(w);for(let Se=0;Se<Ee;Se++){let Le=L[Se],Be=c(Le,w,h,g,_,x);Be!==void 0&&(S+=`${me}${tr(Le)}:${U}${Be}`,me=k)}if(re>a){let Se=re-a;S+=`${me}"...":${U}"${Mr(Se)} not stringified"`,me=k}return _!==""&&me.length>1&&(S=`
9
9
  ${x}${S}
10
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
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}${tr(re)}:${W}${U}`,Z=k)}return _!==""&&Z.length>1&&(S=`
14
+ ${x}`,W=" ");let L="";for(let re of g){let U=u(re,f[re],h,g,_,x);U!==void 0&&(S+=`${L}${tr(re)}:${W}${U}`,L=k)}return _!==""&&L.length>1&&(S=`
15
15
  ${x}${S}
16
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}"... ${Mr(Be)} not stringified"`}return U+=`
18
+ ${_}`,Ee=Math.min(f.length,a),Se=0;for(;Se<Ee-1;Se++){let Be=l(String(Se),f[Se],h,g,_);U+=Be!==void 0?Be:"null",U+=me}let Le=l(String(Se),f[Se],h,g,_);if(U+=Le!==void 0?Le:"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);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=`
20
+ ${_}`,W="",L="",re=Math.min(S,a);Vc(f)&&(W+=Am(f,k,a),w=w.slice(f.length),re-=f.length,L=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+=`${L}${tr(me)}: ${Ee}`,L=k)}if(S>a){let U=S-a;W+=`${L}"...": "${Mr(U)} not stringified"`,L=k}return L!==""&&(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(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
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),L=0;for(;L<W-1;L++){let U=d(String(L),f[L],h);g+=U!==void 0?U:"null",g+=","}let re=d(String(L),f[L],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+=Am(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 L=x[W],re=d(L,f[L],h);re!==void 0&&(g+=`${S}${tr(L)}:${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,[],GE(f),g,"")}if(g.length!==0)return l("",m,[],g,"")}return d("",m,[])}return p}});var Fm=$((kj,qm)=>{"use strict";var Wc=Symbol.for("pino.metadata"),{DEFAULT_LEVELS:Zm}=ri(),KE=Zm.info;function YE(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 _=QE(f.length,e.dedupe);ez(_,f.length,e.dedupe);_=XE(_,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=KE;let _={stream:m,level:g,levelVal:void 0,id:++n.lastId};return f.unshift(_),f.sort(Lm),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(Lm),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 Lm(t,e){return t.level-e.level}function QE(t,e){return e?t-1:0}function XE(t,e){return e?t-1:t+1}function ez(t,e,r){return r?t>=0:t<e}qm.exports=YE});var rh=$((Ej,at)=>{"use strict";var tz=require("node:os"),Km=pc(),rz=mc(),nz=yc(),Ym=Ep(),oz=Dm(),Qm=fn(),{configure:sz}=Mm(),{assertDefaultLevelFound:iz,mappings:Xm,genLsCache:az,genLevelComparison:cz,assertLevelComparison:uz}=jc(),{DEFAULT_LEVELS:eh,SORTING_ORDER:lz}=ri(),{createArgsNormalizer:dz,asChindings:fz,buildSafeSonicBoom:Um,buildFormatters:pz,stringify:Gc,normalizeDestFileDescriptor:Vm,noop:mz}=ti(),{version:hz}=Mc(),{chindingsSym:Bm,redactFmtSym:gz,serializersSym:Hm,timeSym:yz,timeSliceIndexSym:_z,streamSym:vz,stringifySym:Wm,stringifySafeSym:Jc,stringifiersSym:Gm,setLevelSym:bz,endSym:wz,formatOptsSym:xz,messageKeySym:Sz,errorKeySym:$z,nestedKeySym:kz,mixinSym:Ez,levelCompSym:zz,useOnlyCustomLevelsSym:Pz,formattersSym:Jm,hooksSym:Tz,nestedKeyStrSym:Cz,mixinMergeStrategySym:Oz,msgPrefixSym:Iz}=Qm,{epochTime:th,nullTime:Rz}=Ym,{pid:Dz}=process,Az=tz.hostname(),Nz=Km.err,jz={level:"info",levelComparison:lz.ASC,levels:eh,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:Dz,hostname:Az},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:th,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},Mz=dz(jz),Lz=Object.assign(Object.create(null),Km);function Kc(...t){let e={},{opts:r,stream:n}=Mz(e,rz(),...t);r.level&&typeof r.level=="string"&&eh[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:L,msgPrefix:re}=r,U=sz({maximumDepth:k,maximumBreadth:W}),me=pz(w.level,w.bindings,w.log),Ee=Gc.bind({[Jc]:U}),Se=o?nz(o,Ee):{},Le=o?{stringify:Se[gz]}:{stringify:Ee},Be="}"+(s?`\r
23
23
  `:`
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
24
+ `),_r=fz.bind(null,{[Bm]:"",[Hm]:i,[Gm]:Se,[Wm]:Gc,[Jc]:U,[Jm]:me}),La="";d!==null&&(p===void 0?La=_r(d):La=_r(Object.assign({},d,{name:p})));let lf=a instanceof Function?a:a?th:Rz,mx=lf().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"`);iz(m,f,x);let df=Xm(f,x);typeof n.emit=="function"&&n.emit("message",{code:"PINO_CONFIG",config:{levels:df,messageKey:c,errorKey:u}}),uz(h);let hx=cz(h);return Object.assign(e,{levels:df,[zz]:hx,[Pz]:x,[vz]:n,[yz]:lf,[_z]:mx,[Wm]:Gc,[Jc]:U,[Gm]:Se,[wz]:Be,[xz]:Le,[Sz]:c,[$z]:u,[kz]:l,[Cz]:l?`,${JSON.stringify(l)}:{`:"",[Hm]:i,[Ez]:g,[Oz]:_,[Bm]:La,[Jm]:me,[Tz]:S,silent:mz,onChild:L,[Iz]:re}),Object.setPrototypeOf(e,oz()),az(e),e[bz](m),e}at.exports=Kc;at.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=Vm(t.dest||process.stdout.fd),Um(t)):Um({dest:Vm(t),minLength:0});at.exports.transport=Oc();at.exports.multistream=Fm();at.exports.levels=Xm();at.exports.stdSerializers=Lz;at.exports.stdTimeFunctions=Object.assign({},Ym);at.exports.symbols=Qm;at.exports.version=hz;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 Ur=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=Ur;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 Ur&&(r[n.str]=(r[n.str]||0)+1),r),{})}};ee._Code=dt;ee.nil=new dt("");function vv(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._=vv;var pl=new dt("+");function bv(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 lO(r),new dt(r)}ee.str=bv;function ml(t,e){e instanceof dt?t.push(...e._items):e instanceof Ur?t.push(e):t.push(pO(e))}ee.addCodeArg=ml;function lO(t){let e=1;for(;e<t.length-1;){if(t[e]===pl){let r=dO(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function dO(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ur||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 Ur))return`"${t}${e.slice(1)}`}function fO(t,e){return e.emptyStr()?t:t.emptyStr()?e:bv`${t}${e}`}ee.strConcat=fO;function pO(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Ho(Array.isArray(t)?t.join(","):t)}function mO(t){return new dt(Ho(t))}ee.stringify=mO;function Ho(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}ee.safeStringify=Ho;function hO(t){return typeof t=="string"&&ee.IDENTIFIER.test(t)?new dt(`.${t}`):vv`[${t}]`}ee.getProperty=hO;function gO(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=gO;function yO(t){return new dt(t.toString())}ee.regexpCode=yO});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 _O=(0,Ge._)`\n`,gl=class extends Gi{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?_O: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 Wt=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},_l=class extends Wt{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 Wt{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 Wt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},wl=class extends Wt{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},xl=class extends Wt{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Sl=class extends Wt{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 Wt{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)||(vO(e,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Hr(e,r.names),{})}},Gt=class extends Go{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},$l=class extends Go{},kn=class extends Gt{};kn.kind="else";var Vr=class t extends Gt{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(wv(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&&Hr(e,this.else.names),e}};Vr.kind="if";var Br=class extends Gt{};Br.kind="for";var kl=class extends Br{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 Hr(super.names,this.iteration.names)}},El=class extends Br{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 Br{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 Hr(super.names,this.iterable.names)}},Jo=class extends Gt{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 Gt{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&&Hr(e,this.catch.names),this.finally&&Hr(e,this.finally.names),e}},Yo=class extends Gt{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};Yo.kind="catch";var Qo=class extends Gt{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 Vr(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 Vr(e))}else(){return this._elseNode(new kn)}endIf(){return this._endBlockNode(Vr,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(Br)}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 Vr))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 Hr(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?Hr(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 vO(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function wv(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,K._)`!${Tl(t)}`}V.not=wv;var bO=xv(V.operators.AND);function wO(...t){return t.reduce(bO)}V.and=wO;var xO=xv(V.operators.OR);function SO(...t){return t.reduce(xO)}V.or=SO;function xv(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(),$O=Wo();function kO(t){let e={};for(let r of t)e[r]=!0;return e}B.toHash=kO;function EO(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(kv(t,e),!Ev(e,t.self.RULES.all))}B.alwaysValidSchema=EO;function kv(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]||Tv(t,`unknown keyword: "${s}"`)}B.checkUnknownRules=kv;function Ev(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}B.schemaHasRules=Ev;function zO(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=zO;function PO({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=PO;function TO(t){return zv(decodeURIComponent(t))}B.unescapeFragment=TO;function CO(t){return encodeURIComponent(Ol(t))}B.escapeFragment=CO;function Ol(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Ol;function zv(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=zv;function OO(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}B.eachItem=OO;function Sv({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:Sv({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:Pv}),items:Sv({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 Pv(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=Pv;function Il(t,e,r){Object.keys(r).forEach(n=>t.assign((0,ae._)`${e}${(0,ae.getProperty)(n)}`,!0))}B.setEvaluated=Il;var $v={};function IO(t,e){return t.scopeValue("func",{ref:e,code:$v[e.code]||($v[e.code]=new $O._Code(e.code))})}B.useFunc=IO;var Cl;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Cl||(B.Type=Cl={}));function RO(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=RO;function Tv(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=Tv});var Jt=$(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});var Ne=F(),DO={data:new Ne.Name("data"),valCxt:new Ne.Name("valCxt"),instancePath:new Ne.Name("instancePath"),parentData:new Ne.Name("parentData"),parentDataProperty:new Ne.Name("parentDataProperty"),rootData:new Ne.Name("rootData"),dynamicAnchors:new Ne.Name("dynamicAnchors"),vErrors:new Ne.Name("vErrors"),errors:new Ne.Name("errors"),this:new Ne.Name("this"),self:new Ne.Name("self"),scope:new Ne.Name("scope"),json:new Ne.Name("json"),jsonPos:new Ne.Name("jsonPos"),jsonLen:new Ne.Name("jsonLen"),jsonPart:new Ne.Name("jsonPart")};Rl.default=DO});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=Jt();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 AO(t,e=je.keywordError,r,n){let{it:o}=t,{gen:s,compositeRule:i,allErrors:a}=o,c=Iv(t,e,r);n??(i||a)?Cv(s,c):Ov(o,(0,X._)`[${c}]`)}je.reportError=AO;function NO(t,e=je.keywordError,r){let{it:n}=t,{gen:o,compositeRule:s,allErrors:i}=n,a=Iv(t,e,r);Cv(o,a),s||i||Ov(n,Ue.default.vErrors)}je.reportExtraError=NO;function jO(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=jO;function MO({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=MO;function Cv(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 Ov(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 Wr={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 Iv(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,X._)`{}`:LO(t,e,r)}function LO(t,e,r={}){let{gen:n,it:o}=t,s=[ZO(o,r),qO(t,r)];return FO(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 qO({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)}`),[Wr.schemaPath,o]}function FO(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([Wr.keyword,o],[Wr.params,typeof e=="function"?e(t):e||(0,X._)`{}`]),c.messages&&n.push([Wr.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Wr.schema,i],[Wr.parentSchema,(0,X._)`${l}${d}`],[Ue.default.data,s]),u&&n.push([Wr.propertyName,u])}});var Dv=$(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.boolOrEmptySchema=zn.topBoolOrEmptySchema=void 0;var UO=Xo(),VO=F(),BO=Jt(),HO={message:"boolean schema is false"};function WO(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Rv(t,!1):typeof r=="object"&&r.$async===!0?e.return(BO.default.data):(e.assign((0,VO._)`${n}.errors`,null),e.return(!0))}zn.topBoolOrEmptySchema=WO;function GO(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Rv(t)):r.var(e,!0)}zn.boolOrEmptySchema=GO;function Rv(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,UO.reportError)(o,HO,void 0,e)}});var Dl=$(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.getRules=Pn.isJSONType=void 0;var JO=["string","number","integer","boolean","null","object","array"],KO=new Set(JO);function YO(t){return typeof t=="string"&&KO.has(t)}Pn.isJSONType=YO;function QO(){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=QO});var Al=$(lr=>{"use strict";Object.defineProperty(lr,"__esModule",{value:!0});lr.shouldUseRule=lr.shouldUseGroup=lr.schemaHasRulesForType=void 0;function XO({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Av(t,n)}lr.schemaHasRulesForType=XO;function Av(t,e){return e.rules.some(r=>Nv(t,r))}lr.shouldUseGroup=Av;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 eI=Dl(),tI=Al(),rI=Xo(),q=F(),jv=Q(),Tn;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(Tn||(Me.DataType=Tn={}));function nI(t){let e=Mv(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=nI;function Mv(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(eI.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Me.getJSONTypes=Mv;function oI(t,e){let{gen:r,data:n,opts:o}=t,s=sI(e,o.coerceTypes),i=e.length>0&&!(s.length===0&&e.length===1&&(0,tI.schemaHasRulesForType)(t,e[0]));if(i){let a=jl(e,n,o.strictNumbers,Tn.Wrong);r.if(a,()=>{s.length?iI(t,e,s):Ml(t)})}return i}Me.coerceAndCheckDataType=oI;var Lv=new Set(["string","number","integer","boolean","null"]);function sI(t,e){return e?t.filter(r=>Lv.has(r)||e==="array"&&r==="array"):[]}function iI(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)(Lv.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),aI(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 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},
28
+ || ${i} === "boolean" || ${o} === null`).assign(a,(0,q._)`[${o}]`)}}}function aI({gen:t,parentData:e,parentDataProperty:r},n){t.if((0,q._)`${e} !== undefined`,()=>t.assign((0,q._)`${e}[${r}]`,n))}function Nl(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=Nl;function jl(t,e,r,n){if(t.length===1)return Nl(t[0],e,r,n);let o,s=(0,jv.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,Nl(i,e,r,n));return o}Me.checkDataTypes=jl;var cI={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=uI(t);(0,rI.reportError)(e,cI)}Me.reportTypeError=Ml;function uI(t){let{gen:e,data:r,schema:n}=t,o=(0,jv.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:t}}});var qv=$(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.assignDefaults=void 0;var Cn=F(),lI=Q();function dI(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=dI;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,lI.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(),Ll=Q(),dr=Jt(),fI=Q();function pI(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=pI;function mI({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=mI;function hI(t,e){t.setParams({missingProperty:e},!0),t.error()}ie.reportMissingProp=hI;function Fv(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,fe._)`Object.prototype.hasOwnProperty`})}ie.hasPropFunc=Fv;function Zl(t,e,r){return(0,fe._)`${Fv(t)}.call(${e}, ${r})`}ie.isOwnProperty=Zl;function gI(t,e,r,n){let o=(0,fe._)`${e}${(0,fe.getProperty)(r)} !== undefined`;return n?(0,fe._)`${o} && ${Zl(t,e,r)}`:o}ie.propertyInData=gI;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)(Zl(t,e,r))):o}ie.noPropertyInData=ql;function Uv(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}ie.allSchemaProperties=Uv;function yI(t,e){return Uv(e).filter(r=>!(0,Ll.alwaysValidSchema)(t,e[r]))}ie.schemaProperties=yI;function _I({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=_I;var vI=(0,fe._)`new RegExp`;function bI({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"?vI:(0,fI.useFunc)(t,o)}(${r}, ${n})`})}ie.usePattern=bI;function wI(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:Ll.Type.Num},s),e.if((0,fe.not)(s),a)})}}ie.validateArray=wI;function xI(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,Ll.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=xI});var Hv=$(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.validateKeywordUsage=It.validSchemaType=It.funcKeywordCode=It.macroKeywordCode=void 0;var Ve=F(),Gr=Jt(),SI=ft(),$I=Xo();function kI(t,e){let{gen:r,keyword:n,schema:o,parentSchema:s,it:i}=t,a=e.macro.call(i.self,o,s,i),c=Bv(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=kI;function EI(t,e){var r;let{gen:n,keyword:o,schema:s,parentSchema:i,$data:a,it:c}=t;PI(c,e);let u=!a&&e.compile?e.compile.call(c.self,s,i,c):e.validate,l=Bv(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&&Vv(t),g(()=>t.error());else{let _=e.async?m():f();e.modifying&&Vv(t),g(()=>zI(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?Gr.default.this:Gr.default.self,w=!("compile"in e&&!a||e.schema===!1);n.assign(d,(0,Ve._)`${_}${(0,SI.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=EI;function Vv(t){let{gen:e,data:r,it:n}=t;e.if(n.parentData,()=>e.assign(r,(0,Ve._)`${n.parentData}[${n.parentDataProperty}]`))}function zI(t,e){let{gen:r}=t;r.if((0,Ve._)`Array.isArray(${e})`,()=>{r.assign(Gr.default.vErrors,(0,Ve._)`${Gr.default.vErrors} === null ? ${e} : ${Gr.default.vErrors}.concat(${e})`).assign(Gr.default.errors,(0,Ve._)`${Gr.default.vErrors}.length`),(0,$I.extendErrors)(t)},()=>t.error())}function PI({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function Bv(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 TI(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=TI;function CI({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=CI});var Gv=$(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.extendSubschemaMode=fr.extendSubschemaData=fr.getSubschema=void 0;var Rt=F(),Wv=Q();function OI(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,Wv.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=OI;function II(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,Wv.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=II;function RI(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=RI});var Fl=$(($9,Jv)=>{"use strict";Jv.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 Yv=$((k9,Kv)=>{"use strict";var pr=Kv.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+"/"+DI(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 DI(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 AI=Q(),NI=Fl(),jI=Yv(),MI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function LI(t,e=!0){return typeof t=="boolean"?!0:e===!0?!Ul(t):e?Qv(t)<=e:!1}Ke.inlineRef=LI;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 Qv(t){let e=0;for(let r in t){if(r==="$ref")return 1/0;if(e++,!MI.has(r)&&(typeof t[r]=="object"&&(0,AI.eachItem)(t[r],n=>e+=Qv(n)),e===1/0))return 1/0}return e}function Xv(t,e="",r){r!==!1&&(e=On(e));let n=t.parse(e);return eb(t,n)}Ke.getFullPath=Xv;function eb(t,e){return t.serialize(e).split("#")[0]+"#"}Ke._getFullPath=eb;var qI=/#\/?$/;function On(t){return t?t.replace(qI,""):""}Ke.normalizeId=On;function FI(t,e,r){return r=On(r),t.resolve(e,r)}Ke.resolveUrl=FI;var UI=/^[a-z_][-a-z0-9._]*$/i;function VI(t,e){if(typeof t=="boolean")return{};let{schemaId:r,uriResolver:n}=this.opts,o=On(t[r]||e),s={"":o},i=Xv(n,o,!1),a={},c=new Set;return jI(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(!UI.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=VI});var os=$(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.getData=mr.KeywordCxt=mr.validateFunctionCode=void 0;var sb=Dv(),tb=es(),Bl=Al(),na=es(),BI=qv(),ns=Hv(),Vl=Gv(),O=F(),A=Jt(),HI=ts(),Kt=Q(),rs=Xo();function WI(t){if(cb(t)&&(ub(t),ab(t))){KI(t);return}ib(t,()=>(0,sb.topBoolOrEmptySchema)(t))}mr.validateFunctionCode=WI;function ib({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"; ${rb(r,o)}`),JI(t,o),t.code(s)}):t.func(e,(0,O._)`${A.default.data}, ${GI(o)}`,n.$async,()=>t.code(rb(r,o)).code(s))}function GI(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 JI(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 KI(t){let{schema:e,opts:r,gen:n}=t;ib(t,()=>{r.$comment&&e.$comment&&db(t),tR(t),n.let(A.default.vErrors,null),n.let(A.default.errors,0),r.unevaluated&&YI(t),lb(t),oR(t)})}function YI(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 rb(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 QI(t,e){if(cb(t)&&(ub(t),ab(t))){XI(t,e);return}(0,sb.boolOrEmptySchema)(t,e)}function ab({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 cb(t){return typeof t.schema!="boolean"}function XI(t,e){let{schema:r,gen:n,opts:o}=t;o.$comment&&r.$comment&&db(t),rR(t),nR(t);let s=n.const("_errs",A.default.errors);lb(t,s),n.var(e,(0,O._)`${s} === ${A.default.errors}`)}function ub(t){(0,Kt.checkUnknownRules)(t),eR(t)}function lb(t,e){if(t.opts.jtd)return nb(t,[],!1,e);let r=(0,tb.getSchemaTypes)(t.schema),n=(0,tb.coerceAndCheckDataType)(t,r);nb(t,r,!n,e)}function eR(t){let{schema:e,errSchemaPath:r,opts:n,self:o}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Kt.schemaHasRulesButRef)(e,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function tR(t){let{schema:e,opts:r}=t;e.default!==void 0&&r.useDefaults&&r.strictSchema&&(0,Kt.checkStrictMode)(t,"default is ignored in the schema root")}function rR(t){let e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,HI.resolveUrl)(t.opts.uriResolver,t.baseId,e))}function nR(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}function db({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 oR(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&&sR(t),e.return((0,O._)`${A.default.errors} === 0`))}function sR({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 nb(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,Kt.schemaHasRulesButRef)(s,l))){o.block(()=>pb(t,"$ref",l.all.$ref.definition));return}c.jtd||iR(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)),ob(t,p),e.length===1&&e[0]===p.type&&r&&(o.else(),(0,na.reportTypeError)(t)),o.endIf()):ob(t,p),a||o.if((0,O._)`${A.default.errors} === ${n||0}`))}}function ob(t,e){let{gen:r,schema:n,opts:{useDefaults:o}}=t;o&&(0,BI.assignDefaults)(t,e.type),r.block(()=>{for(let s of e.rules)(0,Bl.shouldUseRule)(n,s)&&pb(t,s.keyword,s.definition,e.type)})}function iR(t,e){t.schemaEnv.meta||!t.opts.strictTypes||(aR(t,e),t.opts.allowUnionTypes||cR(t,e),uR(t,t.dataTypes))}function aR(t,e){if(e.length){if(!t.dataTypes.length){t.dataTypes=e;return}e.forEach(r=>{fb(t.dataTypes,r)||Hl(t,`type "${r}" not allowed by context "${t.dataTypes.join(",")}"`)}),dR(t,e)}}function cR(t,e){e.length>1&&!(e.length===2&&e.includes("null"))&&Hl(t,"use allowUnionTypes to allow union type keyword")}function uR(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=>lR(e,i))&&Hl(t,`missing type "${s.join(",")}" for keyword "${n}"`)}}}function lR(t,e){return t.includes(e)||e==="number"&&t.includes("integer")}function fb(t,e){return t.includes(e)||e==="integer"&&t.includes("number")}function dR(t,e){let r=[];for(let n of t.dataTypes)fb(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,Kt.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,Kt.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",mb(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",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?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 QI(o,r),o}mergeEvaluated(e,r){let{it:n,gen:o}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=Kt.mergeEvaluated.props(o,e.props,n.props,r)),n.items!==!0&&e.items!==void 0&&(n.items=Kt.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 pb(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 fR=/^\/(?:[^~]|~0|~1)*$/,pR=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function mb(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let o,s;if(t==="")return A.default.rootData;if(t[0]==="/"){if(!fR.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);o=t,s=A.default.rootData}else{let u=pR.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,Kt.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=mb});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(),mR=sa(),Jr=Jt(),Et=ts(),hb=Q(),hR=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=gb.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:mR.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:Jr.default.data,parentData:Jr.default.parentData,parentDataProperty:Jr.default.parentDataProperty,dataNames:[Jr.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,hR.validateFunctionCode)(u),i.optimize(this.opts.code.optimize);let d=i.toString();l=`${i.scopeRefs(Jr.default.scope)}return ${d}`,this.opts.code.process&&(l=this.opts.code.process(l,t));let m=new Function(`${Jr.default.self}`,`${Jr.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 gR(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=vR.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]=yR.call(this,s)}pt.resolveRef=gR;function yR(t){return(0,Et.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:Xl.call(this,t)}function gb(t){for(let e of this._compilations)if(_R(e,t))return e}pt.getCompilingSchema=gb;function _R(t,e){return t.schema===e.schema&&t.root===e.root&&t.baseId===e.baseId}function vR(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 bR=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,hb.unescapeFragment)(a)];if(c===void 0)return;r=c;let u=typeof r=="object"&&r[this.opts.schemaId];!bR.has(a)&&u&&(e=(0,Et.resolveUrl)(this.opts.uriResolver,e,u))}let s;if(typeof r!="boolean"&&r.$ref&&!(0,hb.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 yb=$((O9,wR)=>{wR.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=$((I9,xb)=>{"use strict";var xR=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),vb=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),SR=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu),$R=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 kR=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _b(t){return t.length=0,!0}function ER(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 zR(t){let e=0,r={error:!1,address:"",zone:""},n=[],o=[],s=!1,i=!1,a=ER;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=_b}else{o.push(u);continue}}return o.length&&(a===_b?r.zone=o.join(""):i?n.push(o.join("")):n.push(td(o))),r.address=n.join(""),r}function bb(t){if(PR(t,":")<2)return{host:t,isIPV6:!1};let e=zR(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 PR(t,e){let r=0;for(let n=0;n<t.length;n++)t[n]===e&&r++;return r}function TR(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 CR={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},OR=/[@/?#:]/g,IR=/[@/?#]/g;function wb(t,e){let r=e?IR:OR;return r.lastIndex=0,t.replace(r,n=>CR[n])}function RR(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 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));i!=="."&&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 AR(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($R(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 jR(t){let e=[];if(t.userinfo!==void 0&&(e.push(t.userinfo),e.push("@")),t.host!==void 0){let r=unescape(t.host);if(!vb(r)){let n=bb(r);n.isIPV6===!0?r=`[${n.escapedHost}]`:r=wb(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}xb.exports={nonSimpleDomain:kR,recomposeAuthority:jR,reescapeHostDelimiters:wb,normalizePercentEncoding:RR,normalizePathEncoding:DR,normalizeQueryFragmentEncoding:AR,escapePreservingEscapes:NR,removeDotSegments:TR,isIPv4:vb,isUUID:xR,normalizeIPv6:bb,stringArrayToHexStripped:td}});var zb=$((R9,Eb)=>{"use strict";var{isUUID:MR}=nd(),LR=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,ZR=["http","https","ws","wss","urn","urn:uuid"];function qR(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 Sb(t){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t}function $b(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 FR(t){return t.secure=od(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function UR(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 VR(t,e){if(!t.path)return t.error="URN can not be parsed",t;let r=t.path.match(LR);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 BR(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 HR(t,e){let r=t;return r.uuid=r.nss,r.nss=void 0,!e.tolerant&&(!r.uuid||!MR(r.uuid))&&(r.error=r.error||"UUID is not valid."),r}function WR(t){let e=t;return e.nss=(t.uuid||"").toLowerCase(),e}var kb={scheme:"http",domainHost:!0,parse:Sb,serialize:$b},GR={scheme:"https",domainHost:kb.domainHost,parse:Sb,serialize:$b},ua={scheme:"ws",domainHost:!0,parse:FR,serialize:UR},JR={scheme:"wss",domainHost:ua.domainHost,parse:ua.parse,serialize:ua.serialize},KR={scheme:"urn",parse:VR,serialize:BR,skipNormalize:!0},YR={scheme:"urn:uuid",parse:HR,serialize:WR,skipNormalize:!0},la={http:kb,https:GR,ws:ua,wss:JR,urn:KR,"urn:uuid":YR};Object.setPrototypeOf(la,null);function sd(t){return t&&(la[t]||la[t.toLowerCase()])||void 0}Eb.exports={wsIsSecure:od,SCHEMES:la,isValidSchemeName:qR,getSchemeHandler:sd}});var Rb=$((D9,pa)=>{"use strict";var{normalizeIPv6:QR,removeDotSegments:is,recomposeAuthority:XR,normalizePercentEncoding:eD,normalizePathEncoding:tD,normalizeQueryFragmentEncoding:Pb,escapePreservingEscapes:rD,reescapeHostDelimiters:nD,isIPv4:oD,nonSimpleDomain:sD}=nd(),{SCHEMES:iD,getSchemeHandler:Cb}=zb();function aD(t,e){return typeof t=="string"?t=mD(t,e):typeof t=="object"&&(t=fa(Kr(t,e),e)),t}function cD(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=Ob(o,i,n,!0);return n.skipEscape=!0,Kr(c,n)}function Ob(t,e,r,n){let o={};return n||(t=fa(Kr(t,r),r),e=fa(Kr(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 uD(t,e,r){let n=Tb(t,r),o=Tb(e,r);return n!==void 0&&o!==void 0&&n.toLowerCase()===o.toLowerCase()}function Kr(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=Cb(n.scheme||r.scheme);s&&s.serialize&&s.serialize(r,n),r.path!==void 0&&(n.skipEscape?r.path=eD(r.path):(r.path=rD(r.path),r.scheme!==void 0&&(r.path=r.path.split("%3A").join(":")))),n.reference!=="suffix"&&r.scheme&&o.push(r.scheme,":");let i=XR(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 lD=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,dD=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,fD=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function pD(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(dD);i!==null&&i[1].indexOf("\\")!==-1&&(n.error="URI authority must not contain a literal backslash.",o=!0);let a=t.match(fD);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(lD);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=pD(n,c);if(u!==void 0&&(n.error=n.error||u,o=!0),n.host)if(oD(n.host)===!1){let p=QR(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=Cb(r.scheme||n.scheme);if(!r.unicodeSupport&&(!l||!l.unicodeSupport)&&n.host&&(r.domainHost||l&&l.domainHost)&&s===!1&&sD(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=nD(unescape(n.host),s))),n.path&&(n.path=tD(n.path)),n.query&&(n.query=Pb(n.query)),n.fragment&&(n.fragment=Pb(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 mD(t,e){return Ib(t,e).normalized}function Ib(t,e){let{parsed:r,malformedAuthorityOrPort:n}=da(t,e);return{normalized:n?t:Kr(r,e),malformedAuthorityOrPort:n}}function Tb(t,e){if(typeof t=="string"){let{normalized:r,malformedAuthorityOrPort:n}=Ib(t,e);return n?void 0:r}if(typeof t=="object")return Kr(t,e)}var id={SCHEMES:iD,normalize:aD,resolve:cD,resolveComponent:Ob,equal:uD,serialize:Kr,parse:fa};pa.exports=id;pa.exports.default=id;pa.exports.fastUri=id});var Ab=$(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});var Db=Rb();Db.code='require("ajv/dist/runtime/uri").default';ad.default=Db});var Ub=$(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 hD=os();Object.defineProperty(Re,"KeywordCxt",{enumerable:!0,get:function(){return hD.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 gD=sa(),Zb=ss(),yD=Dl(),as=aa(),_D=F(),cs=ts(),ma=es(),ud=Q(),Nb=yb(),vD=Ab(),qb=(t,e)=>new RegExp(t,e);qb.code="new RegExp";var bD=["removeAdditional","useDefaults","coerceTypes"],wD=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),xD={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."},SD={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},jb=200;function $D(t){var e,r,n,o,s,i,a,c,u,l,d,p,m,f,h,g,_,x,w,S,k,W,L,re,U;let me=t.strict,Ee=(e=t.code)===null||e===void 0?void 0:e.optimize,Se=Ee===!0||Ee===void 0?1:Ee||0,Le=(n=(r=t.code)===null||r===void 0?void 0:r.regExp)!==null&&n!==void 0?n:qb,Be=(o=t.uriResolver)!==null&&o!==void 0?o:vD.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:Se,regExp:Le}:{optimize:Se,regExp:Le},loopRequired:(h=t.loopRequired)!==null&&h!==void 0?h:jb,loopEnum:(g=t.loopEnum)!==null&&g!==void 0?g:jb,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:(L=t.validateFormats)!==null&&L!==void 0?L:!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,...$D(e)};let{es5:r,lines:n}=this.opts.code;this.scope=new _D.ValueScope({scope:{},prefixes:wD,es5:r,lines:n}),this.logger=CD(e.logger);let o=e.validateFormats;e.validateFormats=!1,this.RULES=(0,yD.getRules)(),Mb.call(this,xD,e,"NOT SUPPORTED"),Mb.call(this,SD,e,"DEPRECATED","warn"),this._metaOpts=PD.call(this),e.formats&&ED.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&zD.call(this,e.keywords),typeof e.meta=="object"&&this.addMetaSchema(e.meta),kD.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=Lb.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=Lb.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(ID.call(this,n,r),!r)return(0,ud.eachItem)(n,s=>cd.call(this,s)),this;DD.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]=Fb(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=gD.default;us.MissingRefError=Zb.default;Re.default=us;function Mb(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 Lb(t){return t=(0,cs.normalizeId)(t),this.schemas[t]||this.refs[t]}function kD(){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 ED(){for(let t in this.opts.formats){let e=this.opts.formats[t];e&&this.addFormat(t,e)}}function zD(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 PD(){let t={...this.opts};for(let e of bD)delete t[e];return t}var TD={log(){},warn(){},error(){}};function CD(t){if(t===!1)return TD;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 OD=/^[a-z_$][a-z0-9_$:-]*$/i;function ID(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(!OD.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?RD.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 RD(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 DD(t){let{metaSchema:e}=t;e!==void 0&&(t.$data&&this.opts.$data&&(e=Fb(e)),t.validateSchema=this.compile(e,!0))}var AD={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Fb(t){return{anyOf:[t,AD]}}});var Vb=$(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 Gb=$(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr.callRef=Yr.getValidate=void 0;var jD=ss(),Bb=ft(),Ye=F(),Dn=Jt(),Hb=aa(),ha=Q(),MD={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=Hb.resolveRef.call(c,u,o,r);if(l===void 0)throw new jD.default(n.opts.uriResolver,o,r);if(l instanceof Hb.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=Wb(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 Wb(t,e){let{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):(0,Ye._)`${r.scopeValue("wrapper",{ref:e})}.validate`}Yr.getValidate=Wb;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,Bb.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,Bb.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)}}}Yr.callRef=ga;Yr.default=MD});var Jb=$(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});var LD=Vb(),ZD=Gb(),qD=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",LD.default,ZD.default];dd.default=qD});var Kb=$(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}},FD={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}}`},UD={keyword:Object.keys(_a),type:"number",schemaType:"number",$data:!0,error:FD,code(t){let{keyword:e,data:r,schemaCode:n}=t;t.fail$data((0,ya._)`${r} ${_a[e].fail} ${n} || isNaN(${r})`)}};fd.default=UD});var Yb=$(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});var ls=F(),VD={message:({schemaCode:t})=>(0,ls.str)`must be multiple of ${t}`,params:({schemaCode:t})=>(0,ls._)`{multipleOf: ${t}}`},BD={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:VD,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=BD});var Xb=$(md=>{"use strict";Object.defineProperty(md,"__esModule",{value:!0});function Qb(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=Qb;Qb.code='require("ajv/dist/runtime/ucs2length").default'});var ew=$(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});var Qr=F(),HD=Q(),WD=Xb(),GD={message({keyword:t,schemaCode:e}){let r=t==="maxLength"?"more":"fewer";return(0,Qr.str)`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>(0,Qr._)`{limit: ${t}}`},JD={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:GD,code(t){let{keyword:e,data:r,schemaCode:n,it:o}=t,s=e==="maxLength"?Qr.operators.GT:Qr.operators.LT,i=o.opts.unicode===!1?(0,Qr._)`${r}.length`:(0,Qr._)`${(0,HD.useFunc)(t.gen,WD.default)}(${r})`;t.fail$data((0,Qr._)`${i} ${s} ${n}`)}};hd.default=JD});var tw=$(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});var KD=ft(),YD=Q(),An=F(),QD={message:({schemaCode:t})=>(0,An.str)`must match pattern "${t}"`,params:({schemaCode:t})=>(0,An._)`{pattern: ${t}}`},XD={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:QD,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,An._)`new RegExp`:(0,YD.useFunc)(e,c),l=e.let("valid");e.try(()=>e.assign(l,(0,An._)`${u}(${s}, ${a}).test(${r})`),()=>e.assign(l,!1)),t.fail$data((0,An._)`!${l}`)}else{let c=(0,KD.usePattern)(t,o);t.fail$data((0,An._)`!${c}.test(${r})`)}}};gd.default=XD});var rw=$(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});var ds=F(),eA={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}}`},tA={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:eA,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=tA});var nw=$(_d=>{"use strict";Object.defineProperty(_d,"__esModule",{value:!0});var fs=ft(),ps=F(),rA=Q(),nA={message:({params:{missingProperty:t}})=>(0,ps.str)`must have required property '${t}'`,params:({params:{missingProperty:t}})=>(0,ps._)`{missingProperty: ${t}}`},oA={keyword:"required",type:"object",schemaType:"array",$data:!0,error:nA,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,rA.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=oA});var ow=$(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});var ms=F(),sA={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}}`},iA={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:sA,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=iA});var va=$(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0});var sw=Fl();sw.code='require("ajv/dist/runtime/equal").default';bd.default=sw});var iw=$(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});var wd=es(),De=F(),aA=Q(),cA=va(),uA={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}}`},lA={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:uA,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,aA.useFunc)(e,cA.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=lA});var aw=$($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});var Sd=F(),dA=Q(),fA=va(),pA={message:"must be equal to constant",params:({schemaCode:t})=>(0,Sd._)`{allowedValue: ${t}}`},mA={keyword:"const",$data:!0,error:pA,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,dA.useFunc)(e,fA.default)}(${r}, ${o})`):t.fail((0,Sd._)`${s} !== ${r}`)}};$d.default=mA});var cw=$(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});var hs=F(),hA=Q(),gA=va(),yA={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>(0,hs._)`{allowedValues: ${t}}`},_A={keyword:"enum",schemaType:"array",$data:!0,error:yA,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,hA.useFunc)(e,gA.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=_A});var uw=$(Ed=>{"use strict";Object.defineProperty(Ed,"__esModule",{value:!0});var vA=Kb(),bA=Yb(),wA=ew(),xA=tw(),SA=rw(),$A=nw(),kA=ow(),EA=iw(),zA=aw(),PA=cw(),TA=[vA.default,bA.default,wA.default,xA.default,SA.default,$A.default,kA.default,EA.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},zA.default,PA.default];Ed.default=TA});var Pd=$(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.validateAdditionalItems=void 0;var Xr=F(),zd=Q(),CA={message:({params:{len:t}})=>(0,Xr.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,Xr._)`{limit: ${t}}`},OA={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:CA,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}lw(t,n)}};function lw(t,e){let{gen:r,schema:n,data:o,keyword:s,it:i}=t;i.items=!0;let a=r.const("len",(0,Xr._)`${o}.length`);if(n===!1)t.setParams({len:e.length}),t.pass((0,Xr._)`${a} <= ${e.length}`);else if(typeof n=="object"&&!(0,zd.alwaysValidSchema)(i,n)){let u=r.var("valid",(0,Xr._)`${a} <= ${e.length}`);r.if((0,Xr.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,Xr.not)(u),()=>r.break())})}}gs.validateAdditionalItems=lw;gs.default=OA});var Td=$(ys=>{"use strict";Object.defineProperty(ys,"__esModule",{value:!0});ys.validateTuple=void 0;var dw=F(),ba=Q(),IA=ft(),RA={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:e,it:r}=t;if(Array.isArray(e))return fw(t,"additionalItems",e);r.items=!0,!(0,ba.alwaysValidSchema)(r,e)&&t.ok((0,IA.validateArray)(t))}};function fw(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,dw._)`${s}.length`);r.forEach((d,p)=>{(0,ba.alwaysValidSchema)(a,d)||(n.if((0,dw._)`${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=fw;ys.default=RA});var pw=$(Cd=>{"use strict";Object.defineProperty(Cd,"__esModule",{value:!0});var DA=Td(),AA={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,DA.validateTuple)(t,"items")};Cd.default=AA});var hw=$(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});var mw=F(),NA=Q(),jA=ft(),MA=Pd(),LA={message:({params:{len:t}})=>(0,mw.str)`must NOT have more than ${t} items`,params:({params:{len:t}})=>(0,mw._)`{limit: ${t}}`},ZA={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:LA,code(t){let{schema:e,parentSchema:r,it:n}=t,{prefixItems:o}=r;n.items=!0,!(0,NA.alwaysValidSchema)(n,e)&&(o?(0,MA.validateAdditionalItems)(t,o):t.ok((0,jA.validateArray)(t)))}};Od.default=ZA});var gw=$(Id=>{"use strict";Object.defineProperty(Id,"__esModule",{value:!0});var ht=F(),wa=Q(),qA={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}}`},FA={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:qA,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=FA});var vw=$(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.validateSchemaDeps=Dt.validatePropertyDeps=Dt.error=void 0;var Rd=F(),UA=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 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}
31
+ deps: ${r}}`};var VA={keyword:"dependencies",type:"object",schemaType:"object",error:Dt.error,code(t){let[e,r]=BA(t);yw(t,e),_w(t,r)}};function BA({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 yw(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=yw;function _w(t,e=t.schema){let{gen:r,data:n,keyword:o,it:s}=t,i=r.name("valid");for(let a in e)(0,UA.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=_w;Dt.default=VA});var ww=$(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});var bw=F(),HA=Q(),WA={message:"property name must be valid",params:({params:t})=>(0,bw._)`{propertyName: ${t.propertyName}}`},GA={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:WA,code(t){let{gen:e,schema:r,data:n,it:o}=t;if((0,HA.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,bw.not)(s),()=>{t.error(!0),o.allErrors||e.break()})}),t.ok(s)}};Dd.default=GA});var Nd=$(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});var xa=ft(),zt=F(),JA=Jt(),Sa=Q(),KA={message:"must NOT have additional properties",params:({params:t})=>(0,zt._)`{additionalProperty: ${t.additionalProperty}}`},YA={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:KA,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} === ${JA.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,_)}}};Ad.default=YA});var $w=$(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0});var QA=os(),xw=ft(),jd=Q(),Sw=Nd(),XA={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&&Sw.default.code(new QA.KeywordCxt(s,Sw.default,"additionalProperties"));let i=(0,xw.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,xw.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=XA});var Pw=$(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});var kw=ft(),$a=F(),Ew=Q(),zw=Q(),eN={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,kw.allSchemaProperties)(r),c=a.filter(h=>(0,Ew.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,zw.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,Ew.checkStrictMode)(s,`property ${g} matches pattern ${h} (use allowMatchingProperties)`)}function f(h){e.forIn("key",n,g=>{e.if((0,$a._)`${(0,kw.usePattern)(t,h)}.test(${g})`,()=>{let _=c.includes(h);_||t.subschema({keyword:"patternProperties",schemaProp:h,dataProp:g,dataPropType:zw.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())})})}}};Ld.default=eN});var Tw=$(Zd=>{"use strict";Object.defineProperty(Zd,"__esModule",{value:!0});var tN=Q(),rN={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:e,schema:r,it:n}=t;if((0,tN.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"}};Zd.default=rN});var Cw=$(qd=>{"use strict";Object.defineProperty(qd,"__esModule",{value:!0});var nN=ft(),oN={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:nN.validateUnion,error:{message:"must match a schema in anyOf"}};qd.default=oN});var Ow=$(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});var ka=F(),sN=Q(),iN={message:"must match exactly one schema in oneOf",params:({params:t})=>(0,ka._)`{passingSchemas: ${t.passing}}`},aN={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:iN,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,sN.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=aN});var Iw=$(Ud=>{"use strict";Object.defineProperty(Ud,"__esModule",{value:!0});var cN=Q(),uN={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,cN.alwaysValidSchema)(n,s))return;let a=t.subschema({keyword:"allOf",schemaProp:i},o);t.ok(o),t.mergeEvaluated(a)})}};Ud.default=uN});var Aw=$(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});var Ea=F(),Dw=Q(),lN={message:({params:t})=>(0,Ea.str)`must match "${t.ifClause}" schema`,params:({params:t})=>(0,Ea._)`{failingKeyword: ${t.ifClause}}`},dN={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:lN,code(t){let{gen:e,parentSchema:r,it:n}=t;r.then===void 0&&r.else===void 0&&(0,Dw.checkStrictMode)(n,'"if" without "then" and "else" is ignored');let o=Rw(n,"then"),s=Rw(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 Rw(t,e){let r=t.schema[e];return r!==void 0&&!(0,Dw.alwaysValidSchema)(t,r)}Vd.default=dN});var Nw=$(Bd=>{"use strict";Object.defineProperty(Bd,"__esModule",{value:!0});var fN=Q(),pN={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){e.if===void 0&&(0,fN.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};Bd.default=pN});var jw=$(Hd=>{"use strict";Object.defineProperty(Hd,"__esModule",{value:!0});var mN=Pd(),hN=pw(),gN=Td(),yN=hw(),_N=gw(),vN=vw(),bN=ww(),wN=Nd(),xN=$w(),SN=Pw(),$N=Tw(),kN=Cw(),EN=Ow(),zN=Iw(),PN=Aw(),TN=Nw();function CN(t=!1){let e=[$N.default,kN.default,EN.default,zN.default,PN.default,TN.default,bN.default,wN.default,vN.default,xN.default,SN.default];return t?e.push(hN.default,yN.default):e.push(mN.default,gN.default),e.push(_N.default),e}Hd.default=CN});var Mw=$(Wd=>{"use strict";Object.defineProperty(Wd,"__esModule",{value:!0});var ke=F(),ON={message:({schemaCode:t})=>(0,ke.str)`must match format "${t}"`,params:({schemaCode:t})=>(0,ke._)`{format: ${t}}`},IN={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:ON,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,ke._)`${f}[${i}]`),g=r.let("fType"),_=r.let("format");r.if((0,ke._)`typeof ${h} == "object" && !(${h} instanceof RegExp)`,()=>r.assign(g,(0,ke._)`${h}.type || "string"`).assign(_,(0,ke._)`${h}.validate`),()=>r.assign(g,(0,ke._)`"string"`).assign(_,h)),t.fail$data((0,ke.or)(x(),w()));function x(){return c.strictSchema===!1?ke.nil:(0,ke._)`${i} && !${_}`}function w(){let S=l.$async?(0,ke._)`(${h}.async ? await ${_}(${n}) : ${_}(${n}))`:(0,ke._)`${_}(${n})`,k=(0,ke._)`(typeof ${_} == "function" ? ${S} : ${_}.test(${n}))`;return(0,ke._)`${_} && ${_} !== 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,ke.regexpCode)(k):c.code.formats?(0,ke._)`${c.code.formats}${(0,ke.getProperty)(s)}`:void 0,L=r.scopeValue("formats",{key:s,ref:k,code:W});return typeof k=="object"&&!(k instanceof RegExp)?[k.type||"string",k.validate,(0,ke._)`${L}.validate`]:["string",k,L]}function S(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.async){if(!l.$async)throw new Error("async format in sync schema");return(0,ke._)`await ${_}(${n})`}return typeof g=="function"?(0,ke._)`${_}(${n})`:(0,ke._)`${_}.test(${n})`}}}};Wd.default=IN});var Lw=$(Gd=>{"use strict";Object.defineProperty(Gd,"__esModule",{value:!0});var RN=Mw(),DN=[RN.default];Gd.default=DN});var Zw=$(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 Fw=$(Jd=>{"use strict";Object.defineProperty(Jd,"__esModule",{value:!0});var AN=Jb(),NN=uw(),jN=jw(),MN=Lw(),qw=Zw(),LN=[AN.default,NN.default,(0,jN.default)(),MN.default,qw.metadataVocabulary,qw.contentVocabulary];Jd.default=LN});var Vw=$(za=>{"use strict";Object.defineProperty(za,"__esModule",{value:!0});za.DiscrError=void 0;var Uw;(function(t){t.Tag="tag",t.Mapping="mapping"})(Uw||(za.DiscrError=Uw={}))});var Hw=$(Yd=>{"use strict";Object.defineProperty(Yd,"__esModule",{value:!0});var jn=F(),Kd=Vw(),Bw=aa(),ZN=ss(),qN=Q(),FN={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}}`},UN={keyword:"discriminator",type:"object",schemaType:"object",error:FN,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,qN.schemaHasRulesButRef)(k,s.self.RULES)){let L=k.$ref;if(k=Bw.resolveRef.call(s.self,s.schemaEnv.root,s.baseId,L),k instanceof Bw.SchemaEnv&&(k=k.schema),k===void 0)throw new ZN.default(s.opts.uriResolver,s.baseId,L)}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=UN});var Ww=$((xU,VN)=>{VN.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 BN=Ub(),HN=Fw(),WN=Hw(),Gw=Ww(),GN=["/properties"],Pa="http://json-schema.org/draft-07/schema",Mn=class extends BN.default{_addVocabularies(){super._addVocabularies(),HN.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(WN.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(Gw,GN):Gw;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 JN=os();Object.defineProperty(pe,"KeywordCxt",{enumerable:!0,get:function(){return JN.KeywordCxt}});var Ln=F();Object.defineProperty(pe,"_",{enumerable:!0,get:function(){return Ln._}});Object.defineProperty(pe,"str",{enumerable:!0,get:function(){return Ln.str}});Object.defineProperty(pe,"stringify",{enumerable:!0,get:function(){return Ln.stringify}});Object.defineProperty(pe,"nil",{enumerable:!0,get:function(){return Ln.nil}});Object.defineProperty(pe,"Name",{enumerable:!0,get:function(){return Ln.Name}});Object.defineProperty(pe,"CodeGen",{enumerable:!0,get:function(){return Ln.CodeGen}});var KN=sa();Object.defineProperty(pe,"ValidationError",{enumerable:!0,get:function(){return KN.default}});var YN=ss();Object.defineProperty(pe,"MissingRefError",{enumerable:!0,get:function(){return YN.default}})});var rx=$(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.formatNames=Nt.fastFormats=Nt.fullFormats=void 0;function At(t,e){return{validate:t,compare:e}}Nt.fullFormats={date:At(Qw,nf),time:At(tf(!0),of),"date-time":At(Jw(!0),ex),"iso-time":At(tf(),Xw),"iso-date-time":At(Jw(),tx),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:n1,"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:l1,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:o1,int32:{type:"number",validate:a1},int64:{type:"number",validate:c1},float:{type:"number",validate:Yw},double:{type:"number",validate:Yw},password:!0,binary:!0};Nt.fastFormats={...Nt.fullFormats,date:At(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,nf),time:At(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,of),"date-time":At(/^\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,ex),"iso-time":At(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Xw),"iso-date-time":At(/^\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,tx),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 QN(t){return t%4===0&&(t%100!==0||t%400===0)}var XN=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,e1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Qw(t){let e=XN.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&&QN(r)?29:e1[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 Xw(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 Jw(t){let e=tf(t);return function(n){let o=n.split(rf);return o.length===2&&Qw(o[0])&&e(o[1])}}function ex(t,e){if(!(t&&e))return;let r=new Date(t).valueOf(),n=new Date(e).valueOf();if(r&&n)return r-n}function tx(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 t1=/\/|:/,r1=/^(?:[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 n1(t){return t1.test(t)&&r1.test(t)}var Kw=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function o1(t){return Kw.lastIndex=0,Kw.test(t)}var s1=-(2**31),i1=2**31-1;function a1(t){return Number.isInteger(t)&&t<=i1&&t>=s1}function c1(t){return Number.isInteger(t)}function Yw(){return!0}var u1=/[^\\]\\Z/;function l1(t){if(u1.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var nx=$(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.formatLimitDefinition=void 0;var d1=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}},f1={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}}`};Zn.formatLimitDefinition={keyword:Object.keys(Ta),type:"string",schemaType:"string",$data:!0,error:f1,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 d1.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 p1=t=>(t.addKeyword(Zn.formatLimitDefinition),t);Zn.default=p1});var ax=$((vs,ix)=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});var qn=rx(),m1=nx(),sf=F(),ox=new sf.Name("fullFormats"),h1=new sf.Name("fastFormats"),af=(t,e={keywords:!0})=>{if(Array.isArray(e))return sx(t,e,qn.fullFormats,ox),t;let[r,n]=e.mode==="fast"?[qn.fastFormats,h1]:[qn.fullFormats,ox],o=e.formats||qn.formatNames;return sx(t,o,r,n),e.keywords&&(0,m1.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 sx(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])}ix.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"]),Yt=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}},hf=to;function Sx(t){hf=t}function $s(){return hf}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 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 N;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 N;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}}},N=Object.freeze({status:"aborted"}),gf=t=>({status:"dirty",value:t}),Ze=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}},pf=(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 Yt(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:Yt(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:Yt(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:Yt(e)},s=this._parseSync({data:e,path:o.path,parent:o});return pf(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:Yt(e)},o=this._parse({data:e,path:n.path,parent:n}),s=await(Es(o)?o:Promise.resolve(o));return pf(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 Lt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Mt.create(this,this._def)}promise(){return er.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 sn({...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 cn.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 Qt=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}),N}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")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}};Qt.create=t=>{var e;return new Qt({checks:[],typeName:D.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...j(t)})};function Ax(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}),N}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"?Ax(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}),N}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}};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}),N}return Ze(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}),N}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return T(s,{code:E.invalid_date}),N}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}};xr.create=t=>new xr({checks:[],coerce:t?.coerce||!1,typeName:D.ZodDate,...j(t)});var tn=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}),N}return Ze(e.data)}};tn.create=t=>new tn({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}),N}return Ze(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}),N}return Ze(e.data)}};$r.create=t=>new $r({typeName:D.ZodNull,...j(t)});var Xt=class extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return Ze(e.data)}};Xt.create=t=>new Xt({typeName:D.ZodAny,...j(t)});var jt=class extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ze(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}),N}};_t.create=t=>new _t({typeName:D.ZodNever,...j(t)});var rn=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}),N}return Ze(e.data)}};rn.create=t=>new rn({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}),N;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=>Ae.mergeArray(n,i));let s=[...r.data].map((i,a)=>o.type._parseSync(new st(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)}};Mt.create=(t,e)=>new Mt({type:t,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...j(e)});function en(t){if(t instanceof He){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=yt.create(en(n))}return new He({...t._def,shape:()=>e})}else return t instanceof Mt?new Mt({...t._def,type:en(t.element)}):t instanceof yt?yt.create(en(t.unwrap())):t instanceof Lt?Lt.create(en(t.unwrap())):t instanceof Tt?Tt.create(t.items.map(e=>en(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}),N}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=>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: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 en(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 yf(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}),N}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}),N}}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}),N;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]}),N)}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=Yt(t),n=Yt(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 N;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}),N)};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}),N;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"}),N;!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=>Ae.mergeArray(r,i)):Ae.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}),N;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?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:D.ZodRecord,...j(n)}):new t({keyType:Qt.create(),valueType:e,typeName:D.ZodRecord,...j(r)})}},nn=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}),N;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 N;(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 N;(u.status==="dirty"||l.status==="dirty")&&r.dirty(),a.set(u.value,l.value)}return{status:r.value,value:a}}}};nn.create=(t,e,r)=>new nn({valueType:e,keyType:t,typeName:D.ZodMap,...j(r)});var on=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}),N;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 N;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)}};on.create=(t,e)=>new on({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}),N;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 er){let a=this;return Ze(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 Ze(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}),N}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 yf(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}),N}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}),N}return Ze(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=yf;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}),N}if(r.indexOf(e.data)===-1){let o=te.objectValues(r);return T(n,{received:n.data,code:E.invalid_enum_value,options:o}),N}return Ze(e.data)}get enum(){return this._def.values}};Cr.create=(t,e)=>new Cr({values:t,typeName:D.ZodNativeEnum,...j(e)});var er=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}),N;let n=r.parsedType===z.promise?r.data:Promise.resolve(r.data);return Ze(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};er.create=(t,e)=>new er({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"?N:(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"?N:(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?Ze(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 Lt=class extends M{_parse(e){return this._getType(e)===z.null?Ze(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Lt.create=(t,e)=>new Lt({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 sn=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}};sn.create=(t,e)=>new sn({innerType:t,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});var an=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}),N}return{status:"valid",value:e.data}}};an.create=t=>new an({typeName:D.ZodNaN,...j(t)});var Nx=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"?N:s.status==="dirty"?(r.dirty(),gf(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"?N: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})}},cn=class extends M{_parse(e){let r=this._def.innerType._parse(e);return ro(r)&&(r.value=Object.freeze(r.value)),r}};cn.create=(t,e)=>new cn({innerType:t,typeName:D.ZodReadonly,...j(e)});var _f=(t,e={},r)=>t?Xt.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})}}):Xt.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}`})=>_f(r=>r instanceof t,e),vf=Qt.create,bf=vr.create,Lx=an.create,Zx=br.create,wf=wr.create,qx=xr.create,Fx=tn.create,Ux=Sr.create,Vx=$r.create,Bx=Xt.create,Hx=jt.create,Wx=_t.create,Gx=rn.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=nn.create,o0=on.create,s0=Ts.create,i0=zr.create,a0=Pr.create,c0=Tr.create,u0=Cr.create,l0=er.create,mf=Xe.create,d0=yt.create,f0=Lt.create,p0=Xe.createWithPreprocess,m0=no.create,h0=()=>vf().optional(),g0=()=>bf().optional(),y0=()=>wf().optional(),_0={string:(t=>Qt.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=N,xe=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:Sx,getErrorMap:$s,makeIssue:ks,EMPTY_PATH:$x,addIssueToContext:T,ParseStatus:Ae,INVALID:N,DIRTY:gf,OK:Ze,isAborted:Ua,isDirty:Va,isValid:ro,isAsync:Es,get util(){return te},get objectUtil(){return Fa},ZodParsedType:z,getParsedType:Yt,ZodType:M,ZodString:Qt,ZodNumber:vr,ZodBigInt:br,ZodBoolean:wr,ZodDate:xr,ZodSymbol:tn,ZodUndefined:Sr,ZodNull:$r,ZodAny:Xt,ZodUnknown:jt,ZodNever:_t,ZodVoid:rn,ZodArray:Mt,ZodObject:He,ZodUnion:kr,ZodDiscriminatedUnion:zs,ZodIntersection:Er,ZodTuple:Tt,ZodRecord:Ps,ZodMap:nn,ZodSet:on,ZodFunction:Ts,ZodLazy:zr,ZodLiteral:Pr,ZodEnum:Tr,ZodNativeEnum:Cr,ZodPromise:er,ZodEffects:Xe,ZodTransformer:Xe,ZodOptional:yt,ZodNullable:Lt,ZodDefault:Or,ZodCatch:sn,ZodNaN:an,BRAND:Nx,ZodBranded:Cs,ZodPipeline:no,ZodReadonly:cn,custom:_f,Schema:M,ZodSchema:M,late:jx,get ZodFirstPartyTypeKind(){return D},coerce:_0,any:Bx,array:Jx,bigint:Zx,boolean:wf,date:qx,discriminatedUnion:Xx,effect:mf,enum:c0,function:s0,instanceof:Mx,intersection:e0,lazy:i0,literal:a0,map:n0,nan:Lx,nativeEnum:u0,never:Wx,null:Vx,nullable:f0,number:bf,object:Kx,oboolean:y0,onumber:g0,optional:d0,ostring:h0,pipeline:m0,preprocess:p0,promise:l0,record:r0,set:o0,strictObject:Yx,string:vf,symbol:Fx,transformer:mf,tuple:t0,undefined:Ux,union:Qx,unknown:Hx,void:Gx,NEVER:v0,ZodIssueCode:E,quotelessJson:xx,ZodError:Qe});var Zt=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=xe.object({name:xe.string().default("eui-compodoc-mcp"),version:xe.string().default("1.0.0")}),w0=xe.object({path:xe.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://")?Zt.isRemoteUrl(e):!0},{message:"Path must be a valid local file path or HTTP/HTTPS URL"}).default("__bundled__"),watchForChanges:xe.boolean().default(!0),reloadDebounce:xe.number().min(0).default(1e3),timeout:xe.number().min(1e3).default(1e4),maxRetries:xe.number().min(0).max(10).default(3),pollingInterval:xe.number().min(5e3).default(6e4)}).default({}),x0=xe.object({maxResults:xe.number().min(1).max(1e3).default(50),minQueryLength:xe.number().min(1).default(2)}),S0=xe.object({level:xe.enum(["debug","info","warn","error"]).default("info"),format:xe.enum(["json","text"]).default("text")}),$0=xe.object({path:xe.string().optional()}).default({}),k0=xe.object({path:xe.string().optional()}).default({}),xf=xe.object({server:b0.default({}),documentation:w0,search:x0.default({}),logging:S0.default({}),accessibility:$0.default({}),examples:k0.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 xf.safeParse(t)}var un=gt(require("fs")),oo=gt(require("path"));function E0(){let t=oo.join(__dirname,"documentation.json.gz");if(un.existsSync(t))return t;let e=oo.join(__dirname,"documentation.json");return un.existsSync(e)?e:Os.documentation.path}function Sf(){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}),process.env.COMPODOC_MCP_EXAMPLES_PATH&&(t.examples={path:process.env.COMPODOC_MCP_EXAMPLES_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"--examples-path":e.examples||(e.examples={}),e.examples.path=t[++r];break;case"--help":case"-h":P0(),process.exit(0);break}return e}function kf(t){try{if(!un.existsSync(t))return process.stderr.write(`Configuration file not found: ${t}
32
+ `),{};let e=un.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 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:
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?kf(r):{},o=Sf(),s=$f(t),i={...Os};i=Is(i,n),i=Is(i,o),i=Is(i,s);let a=Ha(i);if(!a.success){let c=z0(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=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(`
36
+ `)),{success:!1,errors:c}}return a.data.documentation.path==="__bundled__"&&(a.data.documentation.path=E0()),{success:!0,config:a.data}}catch(e){return{success:!1,errors:[`Failed to load configuration: ${e instanceof Error?e.message:"Configuration error"}`]}}}function z0(t){return t.errors.map(e=>`${e.path.join(".")}: ${e.message}`)}function P0(){process.stderr.write(`
37
37
  EUI Compodoc MCP Server - Model Context Protocol server for Angular component documentation
38
38
 
39
39
  Usage:
@@ -42,6 +42,7 @@ Usage:
42
42
  Options:
43
43
  --doc-path <path> Path to documentation.json file (required)
44
44
  --a11y-path <path> Path or URL to accessibility.json file (optional)
45
+ --examples-path <path> Path or URL to examples.json file (optional)
45
46
  --watch Watch for changes to documentation.json (default: true)
46
47
  --no-watch Disable file watching
47
48
  --log-level <level> Logging level: debug, info, warn, error (default: info)
@@ -52,6 +53,7 @@ Options:
52
53
  Environment Variables:
53
54
  COMPODOC_MCP_DOC_PATH Path to documentation.json file
54
55
  COMPODOC_MCP_A11Y_PATH Path or URL to accessibility.json file
56
+ COMPODOC_MCP_EXAMPLES_PATH Path or URL to examples.json file
55
57
  COMPODOC_MCP_LOG_LEVEL Logging level
56
58
  COMPODOC_MCP_WATCH Enable/disable file watching (true/false)
57
59
 
@@ -69,6 +71,9 @@ Configuration File Format (JSON):
69
71
  "accessibility": {
70
72
  "path": "https://euidev.ecdevops.eu/eui-showcase-ux-components-21.x/json/accessibility.json"
71
73
  },
74
+ "examples": {
75
+ "path": "https://euidev.ecdevops.eu/eui-showcase-ux-components-21.x/json/examples.json"
76
+ },
72
77
  "search": {
73
78
  "maxResults": 50,
74
79
  "minQueryLength": 2
@@ -86,9 +91,9 @@ Examples:
86
91
  COMPODOC_MCP_DOC_PATH=./documentation.json eui-compodoc-mcp
87
92
 
88
93
  For more information, visit: https://github.com/your-org/eui-compodoc-mcp
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(`
94
+ `)}var mo=gt(require("fs")),nh=gt(require("path")),oh=require("zlib");var qf=require("node:events"),Ff=require("node:fs"),Zs=require("node:fs/promises"),H=gt(require("node:path"),1);var qt=require("node:fs/promises"),Ir=require("node:path"),Tf=require("node:stream"),et={FILE_TYPE:"files",DIR_TYPE:"directories",FILE_DIR_TYPE:"files_directories",EVERYTHING_TYPE:"all"},ln={root:".",fileFilter:t=>!0,directoryFilter:t=>!0,type:et.FILE_TYPE,lstat:!1,depth:2147483648,alwaysStat:!1,highWaterMark:256};Object.freeze(ln);var Cf="READDIRP_RECURSIVE_ERROR",T0=new Set(["ENOENT","EPERM","EACCES","ELOOP",Cf]),Ef=[et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE],C0=new Set([et.DIR_TYPE,et.EVERYTHING_TYPE,et.FILE_DIR_TYPE]),O0=new Set([et.EVERYTHING_TYPE,et.FILE_DIR_TYPE,et.FILE_TYPE]),I0=t=>T0.has(t.code),R0=process.platform==="win32",zf=t=>!0,Pf=t=>{if(t===void 0)return zf;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 zf},Ga=class extends Tf.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??ln.highWaterMark});let r={...ln,...e},n=r.root??ln.root,o=r.type??ln.type;this._fileFilter=Pf(r.fileFilter),this._directoryFilter=Pf(r.directoryFilter);let s=r.lstat?qt.lstat:qt.stat;R0?this._stat=a=>s(a,{bigint:!0}):this._stat=s,this._maxDepth=r.depth!=null&&Number.isSafeInteger(r.depth)?r.depth:ln.depth,this._wantsDir=C0.has(o),this._wantsFile=O0.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,qt.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){I0(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,qt.realpath)(r),o=await(0,qt.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=Cf,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 Of(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&&!Ef.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${Ef.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"),Rf=require("node:os"),he=gt(require("node:path"),1),D0="data",Ya="end",Df="close",js=()=>{};var Ms=process.platform,Qa=Ms==="win32",A0=Ms==="darwin",N0=Ms==="linux",j0=Ms==="freebsd",Af=(0,Rf.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,M0="watch",L0={lstat:bt.lstat,stat:bt.stat},Rr="listeners",Rs="errHandlers",dn="rawEmitters",Z0=[Rr,Rs,dn],q0=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"]),F0=t=>q0.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)},U0=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 If(t,e,r,n,o){let s=(i,a)=>{r(t),o(i,a,{watchedPath:t}),a&&t!==a&&As(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 As=(t,e,r,n,o)=>{let s=Ds.get(t);s&&Ka(s[e],i=>{i(r,n,o)})},V0=(t,e,r,n)=>{let{listener:o,errHandler:s,rawEmitter:i}=n,a=Ds.get(e),c;if(!r.persistent)return c=If(t,r,o,s,i),c?c.close.bind(c):void 0;if(a)so(a,Rr,o),so(a,Rs,s),so(a,dn,i);else{if(c=If(t,r,As.bind(null,e,Rr),s,As.bind(null,e,dn)),!c)return;c.on(vt.ERROR,async u=>{let l=As.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,dn,i),Nf(a.listeners)&&(a.watcher.close(),Ds.delete(e),Z0.forEach(U0(a)),a.watcher=void 0,Object.freeze(a))}},Ja=new Map,B0=(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,dn,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,dn,s),Nf(i.listeners)&&(Ja.delete(e),(0,Dr.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=js);let u;if(n.usePolling){let l=n.interval!==n.binaryInterval;c.interval=l&&F0(s)?n.binaryInterval:n.interval,u=B0(e,a,c,{listener:r,rawEmitter:this.fsw._emitRaw})}else u=V0(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(M0,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),(A0||N0||j0)&&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(D0,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 L0[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="/",H0="//",Uf=".",W0="..",G0="string",J0=/\\/g,Vf=/\/\//g,K0=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,Y0=/^\.[/\\]/;function Ls(t){return Array.isArray(t)?t:[t]}var ec=t=>typeof t=="object"&&t!==null&&!(t instanceof RegExp);function Q0(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 X0(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(Vf,"/"),e&&(t="/"+t),t}function jf(t,e,r){let n=X0(e);for(let o=0;o<t.length;o++){let s=t[o];if(s(n,r))return!0}return!1}function eS(t,e){if(t==null)throw new TypeError("anymatch: specify first argument");let n=Ls(t).map(o=>Q0(o));return e==null?(o,s)=>jf(n,o,s):jf(n,e)}var Mf=t=>{let e=Ls(t).flat();if(!e.every(r=>typeof r===G0))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Bf)},Lf=t=>{let e=t.replace(J0,Xa),r=!1;return e.startsWith(H0)&&(r=!0),e=e.replace(Vf,Xa),r&&(e=Xa+e),e},Bf=t=>Lf(H.normalize(Lf(t))),Zf=(t="")=>e=>typeof e=="string"?Bf(H.isAbsolute(e)?e:H.join(t,e)):e,tS=(t,e)=>H.isAbsolute(t)?t:H.join(e,t),rS=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!==Uf&&e!==W0&&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,Zs.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=rS,Object.freeze(this)}},nS="stat",oS="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(Y0,""),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?nS:oS}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 qf.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?Ls(e.ignored):Ls([]),awaitWriteFinish:r===!0?n:typeof r=="object"?{...n,...r}:!1};Af&&(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 Ns(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=Mf(e);return o&&(s=s.map(i=>tS(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=Mf(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)||Uf;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,Zs.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,Ff.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&&K0.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=eS(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=Of(e,n);return this._streams.add(o),o.once(Df,()=>{o=void 0}),o.once(Ya,()=>{o&&(this._streams.delete(o),o=void 0)}),o}};function Hf(t,e={}){let r=new nc(e);return r.add(t),r}var Yc=gt(rh()),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}},qz=new ii;var ai=class{filePath;watchForChanges;reloadDebounce;watcher;reloadTimer;onReloadCallback;onErrorCallback;currentData;constructor(e){this.filePath=nh.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,oh.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=Hf(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 Zr=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 Zr(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=Zt.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 sh;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"}};(sh=globalThis).__zod_globalConfig??(sh.__zod_globalConfig={});var gn=globalThis.__zod_globalConfig;function tt(t){return t&&Object.assign(gn,t),gn}var Y={};ff(Y,{BIGINT_FORMAT_RANGES:()=>uh,Class:()=>tu,NUMBER_FORMAT_RANGES:()=>au,aborted:()=>or,allowsEval:()=>ou,assert:()=>Gz,assertEqual:()=>Vz,assertIs:()=>Hz,assertNever:()=>Wz,assertNotEqual:()=>Bz,assignProp:()=>rr,base64ToUint8Array:()=>dh,base64urlToUint8Array:()=>dP,cached:()=>_n,captureStackTrace:()=>fi,cleanEnum:()=>lP,cleanRegex:()=>xo,clone:()=>St,cloneDef:()=>Kz,createTransparentProxy:()=>rP,defineLazy:()=>oe,esc:()=>di,escapeRegex:()=>Vt,explicitlyAborted:()=>cu,extend:()=>sP,finalizeIssue:()=>ct,floatSafeRemainder:()=>ru,getElementAtPath:()=>Yz,getEnumValues:()=>bo,getLengthableOrigin:()=>So,getParsedType:()=>tP,getSizableOrigin:()=>lh,hexToUint8Array:()=>pP,isObject:()=>qr,isPlainObject:()=>nr,issue:()=>vn,joinValues:()=>li,jsonStringifyReplacer:()=>yn,merge:()=>aP,mergeDefs:()=>Ut,normalizeParams:()=>R,nullish:()=>wo,numKeys:()=>eP,objectClone:()=>Jz,omit:()=>oP,optionalKeys:()=>iu,parsedType:()=>uu,partial:()=>cP,pick:()=>nP,prefixIssues:()=>Bt,primitiveTypes:()=>ch,promiseAllObject:()=>Qz,propertyKeyTypes:()=>su,randomString:()=>Xz,required:()=>uP,safeExtend:()=>iP,shallowClone:()=>ah,slugify:()=>nu,stringifyPrimitive:()=>pi,uint8ArrayToBase64:()=>fh,uint8ArrayToBase64url:()=>fP,uint8ArrayToHex:()=>mP,unwrapMessage:()=>vo});function Vz(t){return t}function Bz(t){return t}function Hz(t){}function Wz(t){throw new Error("Unexpected value in exhaustive check")}function Gz(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 ih=Symbol("evaluating");function oe(t,e,r){let n;Object.defineProperty(t,e,{get(){if(n!==ih)return n===void 0&&(n=ih,n=r()),n},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Jz(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 Ut(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);Object.assign(e,n)}return Object.defineProperties({},e)}function Kz(t){return Ut(t._zod.def)}function Yz(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function Qz(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 Xz(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 qr(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(qr(t)===!1)return!1;let e=t.constructor;if(e===void 0||typeof e!="function")return!0;let r=e.prototype;return!(qr(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function ah(t){return nr(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function eP(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var tP=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"]),ch=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Vt(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 rP(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]},uh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function nP(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=Ut(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 oP(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=Ut(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 sP(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=Ut(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return rr(this,"shape",s),s}});return St(t,o)}function iP(t,e){if(!nr(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=Ut(t._zod.def,{get shape(){let n={...t._zod.def.shape,...e};return rr(this,"shape",n),n}});return St(t,r)}function aP(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=Ut(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 cP(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=Ut(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 uP(t,e,r){let n=Ut(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 Bt(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 lh(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 lP(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function dh(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 fh(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function dP(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return dh(e+r)}function fP(t){return fh(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pP(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 mP(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var tu=class{constructor(...e){}};var ph=(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",ph),lu=v("$ZodError",ph,{Parent:Error});function mh(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 hh(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),gh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return hi(t)(e,r,o)};var yh=t=>(e,r,n)=>hi(t)(e,r,n);var _h=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return gi(t)(e,r,o)};var vh=t=>async(e,r,n)=>gi(t)(e,r,n);var bh=t=>(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return $o(t)(e,r,o)};var wh=t=>(e,r,n)=>$o(t)(e,r,n);var xh=t=>async(e,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Eo(t)(e,r,o)};var Sh=t=>async(e,r,n)=>Eo(t)(e,r,n);var $h=/^[cC][0-9a-z]{6,}$/,kh=/^[0-9a-z]+$/,Eh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zh=/^[0-9a-vA-V]{20}$/,Ph=/^[A-Za-z0-9]{27}$/,Th=/^[a-zA-Z0-9_-]{21}$/,Ch=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Oh=/^([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 Ih=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var gP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Rh(){return new RegExp(gP,"u")}var Dh=/^(?:(?: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])$/,Ah=/^(([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])$/,jh=/^(([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])$/,Mh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fu=/^[A-Za-z0-9_-]*$/;var Lh=/^https?$/,Zh=/^\+[1-9]\d{6,14}$/,qh="(?:(?:\\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])))",Fh=new RegExp(`^${qh}$`);function Uh(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 Vh(t){return new RegExp(`^${Uh(t)}$`)}function Bh(t){let e=Uh({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(`^${qh}T(?:${n})$`)}var Hh=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)};var Wh=/^-?\d+$/,pu=/^-?\d+(?:\.\d+)?$/,Gh=/^(?:true|false)$/i,Jh=/^null$/i;var Kh=/^[^A-Z]*$/,Yh=/^[^a-z]*$/;var Pe=v("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),Qh={number:"number",bigint:"bigint",object:"date"},mu=v("$ZodCheckLessThan",(t,e)=>{Pe.init(t,e);let r=Qh[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=Qh[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})}}),Xh=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})}}),eg=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=Wh)}),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 tg=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})}}),rg=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})}}),ng=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=()=>{})}),og=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})}}),sg=v("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Kh),zo.init(t,e)}),ig=v("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Yh),zo.init(t,e)}),ag=v("$ZodCheckIncludes",(t,e)=>{Pe.init(t,e);let r=Vt(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})}}),cg=v("$ZodCheckStartsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`^${Vt(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})}}),ug=v("$ZodCheckEndsWith",(t,e)=>{Pe.init(t,e);let r=new RegExp(`.*${Vt(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 lg=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
95
  `).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 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(`
96
+ `))}};var fg={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=fg;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()??Hh(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)}),wg=v("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Oh),de.init(t,e)}),xg=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)}),Sg=v("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Ih),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===Lh.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})}}}),kg=v("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=Rh()),de.init(t,e)}),Eg=v("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Th),de.init(t,e)}),zg=v("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=$h),de.init(t,e)}),Pg=v("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=kh),de.init(t,e)}),Tg=v("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Eh),de.init(t,e)}),Cg=v("$ZodXID",(t,e)=>{e.pattern??(e.pattern=zh),de.init(t,e)}),Og=v("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Ph),de.init(t,e)}),Ig=v("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Bh(e)),de.init(t,e)}),Rg=v("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Fh),de.init(t,e)}),Dg=v("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Vh(e)),de.init(t,e)}),Ag=v("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Ch),de.init(t,e)}),Ng=v("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Dh),de.init(t,e),t._zod.bag.format="ipv4"}),jg=v("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Ah),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 Mg=v("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Nh),de.init(t,e)}),Lg=v("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=jh),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 qg=v("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Mh),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 vP(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 Fg=v("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=fu),de.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{vP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),Ug=v("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Zh),de.init(t,e)});function bP(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 Vg=v("$ZodJWT",(t,e)=>{de.init(t,e),t._zod.check=r=>{bP(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}}),Bg=v("$ZodNumberFormat",(t,e)=>{eg.init(t,e),yu.init(t,e)}),Hg=v("$ZodBoolean",(t,e)=>{le.init(t,e),t._zod.pattern=Gh,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 Wg=v("$ZodNull",(t,e)=>{le.init(t,e),t._zod.pattern=Jh,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 Gg=v("$ZodUnknown",(t,e)=>{le.init(t,e),t._zod.parse=r=>r}),Jg=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 pg(t,e,r){t.issues.length&&e.issues.push(...Bt(r,t.issues)),e.value[r]=t.value}var Kg=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=>pg(u,r,i))):pg(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(...Bt(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 Yg(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 Qg(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 wP=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(()=>Yg(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=qr,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?Qg(l,u,a,c,n.value,t):l.length?Promise.all(l).then(()=>a):a}}),Xg=v("$ZodObjectJIT",(t,e)=>{wP.init(t,e);let r=t._zod.parse,n=_n(()=>Yg(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],L=W?._zod?.optin==="optional",re=W?._zod?.optout==="optional";m.write(`const ${S} = ${h(w)};`),L&&re?m.write(`
92
97
  if (${S}.issues.length) {
93
98
  if (${k} in input) {
94
99
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
@@ -106,7 +111,7 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
106
111
  newResult[${k}] = ${S}.value;
107
112
  }
108
113
 
109
- `):Z?m.write(`
114
+ `):L?m.write(`
110
115
  if (${S}.issues.length) {
111
116
  payload.issues = payload.issues.concat(${S}.issues.map(iss => ({
112
117
  ...iss,
@@ -147,11 +152,11 @@ For more information, visit: https://github.com/your-org/eui-compodoc-mcp
147
152
  }
148
153
  }
149
154
 
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>
155
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");let x=m.compile();return(w,S)=>x(p,w,S)},s,i=qr,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?Qg([],f,p,m,d,t):p):r(p,m):(p.issues.push({expected:"object",code:"invalid_type",input:f,inst:t}),p)}});function mg(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=>mg(a,n,t,o)):mg(i,n,t,o)}});var ey=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(!qr(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)}}),ty=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])=>hg(r,c,u)):hg(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 hg(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 ry=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(...Bt(u,m.issues)),r.value[d]=m.value})):(p.issues.length&&r.issues.push(...Bt(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(...Bt(a,d.issues)),r.value[c.value]=d.value})):(l.issues.length&&r.issues.push(...Bt(a,l.issues)),r.value[c.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}});var ny=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"?Vt(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}}),oy=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"?Vt(n):n?Vt(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 sy=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 gg(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=>gg(i,o)):gg(s,o)}return r.value===void 0?r:e.innerType._zod.run(r,n)}}),iy=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)}),ay=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)}),cy=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=>yg(s,e)):yg(o,e)}});function yg(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var uy=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))}),ly=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=>_g(s,t)):_g(o,t)}});function _g(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 dy=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 fy=v("$ZodPreprocess",(t,e)=>{bu.init(t,e)}),py=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(vg):vg(o)}});function vg(t){return t.value=Object.freeze(t.value),t}var my=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=>bg(s,r,n,t));bg(o,r,n,t)}});function bg(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 xP=()=>{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 hy(){return{localeError:xP()}}var gy;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 SP(){return new wu}(gy=globalThis).__zod_globalRegistry??(gy.__zod_globalRegistry=SP());var Fr=globalThis.__zod_globalRegistry;function yy(t,e){return new t({type:"string",...R(e)})}function _y(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 vy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...R(e)})}function by(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(e)})}function wy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(e)})}function xy(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(e)})}function Sy(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 ky(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(e)})}function Ey(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...R(e)})}function zy(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(e)})}function Py(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...R(e)})}function Ty(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...R(e)})}function Cy(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(e)})}function Oy(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(e)})}function Iy(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(e)})}function Ry(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(e)})}function Dy(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(e)})}function Ay(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 jy(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...R(e)})}function My(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...R(e)})}function Ly(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 qy(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...R(e)})}function Fy(t,e){return new t({type:"string",format:"duration",check:"string_format",...R(e)})}function Uy(t,e){return new t({type:"number",checks:[],...R(e)})}function Vy(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...R(e)})}function By(t,e){return new t({type:"boolean",...R(e)})}function Hy(t,e){return new t({type:"null",...R(e)})}function Wy(t){return new t({type:"unknown"})}function Gy(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 Xh({check:"multiple_of",...R(e),value:t})}function Ei(t,e){return new tg({check:"max_length",...R(e),maximum:t})}function bn(t,e){return new rg({check:"min_length",...R(e),minimum:t})}function zi(t,e){return new ng({check:"length_equals",...R(e),length:t})}function Su(t,e){return new og({check:"string_format",format:"regex",...R(e),pattern:t})}function $u(t){return new sg({check:"string_format",format:"lowercase",...R(t)})}function ku(t){return new ig({check:"string_format",format:"uppercase",...R(t)})}function Eu(t,e){return new ag({check:"string_format",format:"includes",...R(e),includes:t})}function zu(t,e){return new cg({check:"string_format",format:"starts_with",...R(e),prefix:t})}function Pu(t,e){return new ug({check:"string_format",format:"ends_with",...R(e),suffix:t})}function sr(t){return new lg({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 Jy(t,e,r){return new t({type:"array",element:e,...R(r)})}function Ky(t,e,r){let n=R(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Yy(t,e,r){return new t({type:"custom",check:"custom",fn:e,...R(r)})}function Qy(t,e){let r=$P(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 $P(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??Fr,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 $e(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),$e(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 Au(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
156
 
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):
157
+ 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 Nu(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 Xy=(t,e={})=>r=>{let n=Du({...r,processors:e});return $e(t,n),Au(n,t),Nu(n,t)},Co=(t,e,r={})=>n=>{let{libraryOptions:o,target:s}=n??{},i=Du({...o??{},target:s,io:e,processors:r});return $e(t,i),Au(i,t),Nu(i,t)};var kP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},e_=(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=kP[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}))])}},t_=(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)},r_=(t,e,r,n)=>{r.type="boolean"};var n_=(t,e,r,n)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"};var o_=(t,e,r,n)=>{r.not={}};var s_=(t,e,r,n)=>{};var i_=(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},a_=(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 c_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};var u_=(t,e,r,n)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};var l_=(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=$e(s.element,e,{...n,path:[...n.path,"items"]})},d_=(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]=$e(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=$e(s.catchall,e,{...n,path:[...n.path,"additionalProperties"]})):e.io==="output"&&(o.additionalProperties=!1)},f_=(t,e,r,n)=>{let o=t._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>$e(a,e,{...n,path:[...n.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=i:r.anyOf=i},p_=(t,e,r,n)=>{let o=t._zod.def,s=$e(o.left,e,{...n,path:[...n.path,"allOf",0]}),i=$e(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 m_=(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=$e(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=$e(s.keyType,e,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=$e(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)}},h_=(t,e,r,n)=>{let o=t._zod.def,s=$e(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"}]},g_=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType},y_=(t,e,r,n)=>{let o=t._zod.def;$e(o.innerType,e,n);let s=e.seen.get(t);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},__=(t,e,r,n)=>{let o=t._zod.def;$e(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)))},v_=(t,e,r,n)=>{let o=t._zod.def;$e(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},b_=(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;$e(i,e,n);let a=e.seen.get(t);a.ref=i},w_=(t,e,r,n)=>{let o=t._zod.def;$e(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;$e(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 x_(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={};ff(Io,{ZodISODate:()=>$_,ZodISODateTime:()=>S_,ZodISODuration:()=>E_,ZodISOTime:()=>k_,date:()=>Lu,datetime:()=>Mu,duration:()=>qu,time:()=>Zu});var S_=v("ZodISODateTime",(t,e)=>{Ig.init(t,e),ge.init(t,e)});function Mu(t){return Ly(S_,t)}var $_=v("ZodISODate",(t,e)=>{Rg.init(t,e),ge.init(t,e)});function Lu(t){return Zy($_,t)}var k_=v("ZodISOTime",(t,e)=>{Dg.init(t,e),ge.init(t,e)});function Zu(t){return qy(k_,t)}var E_=v("ZodISODuration",(t,e)=>{Ag.init(t,e),ge.init(t,e)});function qu(t){return Fy(E_,t)}var DP=(t,e)=>{mi.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>hh(t,r)},flatten:{value:r=>mh(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",DP,{Parent:Error});var z_=hi(rt),P_=gi(rt),T_=$o(rt),C_=Eo(rt),O_=gh(rt),I_=yh(rt),R_=_h(rt),D_=vh(rt),A_=bh(rt),N_=wh(rt),j_=xh(rt),M_=Sh(rt);var L_=new WeakMap;function Ro(t,e,r){let n=Object.getPrototypeOf(t),o=L_.get(n);if(o||(o=new Set,L_.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=Xy(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,n)=>z_(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>T_(t,r,n),t.parseAsync=async(r,n)=>P_(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>C_(t,r,n),t.spa=t.safeParseAsync,t.encode=(r,n)=>O_(t,r,n),t.decode=(r,n)=>I_(t,r,n),t.encodeAsync=async(r,n)=>R_(t,r,n),t.decodeAsync=async(r,n)=>D_(t,r,n),t.safeEncode=(r,n)=>A_(t,r,n),t.safeDecode=(r,n)=>N_(t,r,n),t.safeEncodeAsync=async(r,n)=>j_(t,r,n),t.safeDecodeAsync=async(r,n)=>M_(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($T(r,n))},superRefine(r,n){return this.check(kT(r,n))},overwrite(r){return this.check(sr(r))},optional(){return we(this)},exactOptional(){return fT(this)},nullable(){return U_(this)},nullish(){return we(U_(this))},nonoptional(r){return _T(this,r)},array(){return J(this)},or(r){return ce([this,r])},and(r){return Ci(this,r)},transform(r){return V_(this,J_(r))},default(r){return hT(this,r)},prefault(r){return yT(this,r)},catch(r){return bT(this,r)},pipe(r){return V_(this,r)},readonly(){return ST(this)},describe(r){let n=this.clone();return Fr.add(n,{description:r}),n},meta(...r){if(r.length===0)return Fr.get(this);let n=this.clone();return Fr.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 Fr.get(t)?.description},configurable:!0}),t)),B_=v("_ZodString",(t,e)=>{xi.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>e_(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),B_.init(t,e),t.email=r=>t.check(_y(jP,r)),t.url=r=>t.check(Sy(MP,r)),t.jwt=r=>t.check(My(XP,r)),t.emoji=r=>t.check($y(LP,r)),t.guid=r=>t.check(xu(Z_,r)),t.uuid=r=>t.check(vy(Ti,r)),t.uuidv4=r=>t.check(by(Ti,r)),t.uuidv6=r=>t.check(wy(Ti,r)),t.uuidv7=r=>t.check(xy(Ti,r)),t.nanoid=r=>t.check(ky(ZP,r)),t.guid=r=>t.check(xu(Z_,r)),t.cuid=r=>t.check(Ey(qP,r)),t.cuid2=r=>t.check(zy(FP,r)),t.ulid=r=>t.check(Py(UP,r)),t.base64=r=>t.check(Ay(KP,r)),t.base64url=r=>t.check(Ny(YP,r)),t.xid=r=>t.check(Ty(VP,r)),t.ksuid=r=>t.check(Cy(BP,r)),t.ipv4=r=>t.check(Oy(HP,r)),t.ipv6=r=>t.check(Iy(WP,r)),t.cidrv4=r=>t.check(Ry(GP,r)),t.cidrv6=r=>t.check(Dy(JP,r)),t.e164=r=>t.check(jy(QP,r)),t.datetime=r=>t.check(Mu(r)),t.date=r=>t.check(Lu(r)),t.time=r=>t.check(Zu(r)),t.duration=r=>t.check(qu(r))});function y(t){return yy(NP,t)}var ge=v("ZodStringFormat",(t,e)=>{de.init(t,e),B_.init(t,e)}),jP=v("ZodEmail",(t,e)=>{Sg.init(t,e),ge.init(t,e)});var Z_=v("ZodGUID",(t,e)=>{wg.init(t,e),ge.init(t,e)});var Ti=v("ZodUUID",(t,e)=>{xg.init(t,e),ge.init(t,e)});var MP=v("ZodURL",(t,e)=>{$g.init(t,e),ge.init(t,e)});var LP=v("ZodEmoji",(t,e)=>{kg.init(t,e),ge.init(t,e)});var ZP=v("ZodNanoID",(t,e)=>{Eg.init(t,e),ge.init(t,e)});var qP=v("ZodCUID",(t,e)=>{zg.init(t,e),ge.init(t,e)});var FP=v("ZodCUID2",(t,e)=>{Pg.init(t,e),ge.init(t,e)});var UP=v("ZodULID",(t,e)=>{Tg.init(t,e),ge.init(t,e)});var VP=v("ZodXID",(t,e)=>{Cg.init(t,e),ge.init(t,e)});var BP=v("ZodKSUID",(t,e)=>{Og.init(t,e),ge.init(t,e)});var HP=v("ZodIPv4",(t,e)=>{Ng.init(t,e),ge.init(t,e)});var WP=v("ZodIPv6",(t,e)=>{jg.init(t,e),ge.init(t,e)});var GP=v("ZodCIDRv4",(t,e)=>{Mg.init(t,e),ge.init(t,e)});var JP=v("ZodCIDRv6",(t,e)=>{Lg.init(t,e),ge.init(t,e)});var KP=v("ZodBase64",(t,e)=>{qg.init(t,e),ge.init(t,e)});var YP=v("ZodBase64URL",(t,e)=>{Fg.init(t,e),ge.init(t,e)});var QP=v("ZodE164",(t,e)=>{Ug.init(t,e),ge.init(t,e)});var XP=v("ZodJWT",(t,e)=>{Vg.init(t,e),ge.init(t,e)});var H_=v("ZodNumber",(t,e)=>{yu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>t_(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(q_(n))},safe(n){return this.check(q_(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 Uy(H_,t)}var eT=v("ZodNumberFormat",(t,e)=>{Bg.init(t,e),H_.init(t,e)});function q_(t){return Vy(eT,t)}var tT=v("ZodBoolean",(t,e)=>{Hg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>r_(t,r,n,o)});function ze(t){return By(tT,t)}var rT=v("ZodNull",(t,e)=>{Wg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>n_(t,r,n,o)});function Uu(t){return Hy(rT,t)}var nT=v("ZodUnknown",(t,e)=>{Gg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>s_(t,r,n,o)});function ye(){return Wy(nT)}var oT=v("ZodNever",(t,e)=>{Jg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>o_(t,r,n,o)});function sT(t){return Gy(oT,t)}var iT=v("ZodArray",(t,e)=>{Kg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>l_(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 Jy(iT,t,e)}var W_=v("ZodObject",(t,e)=>{Xg.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>d_(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:sT()})},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(K_,this,r[0])},required(...r){return Y.required(Y_,this,r[0])}})});function P(t,e){let r={type:"object",shape:t??{},...Y.normalizeParams(e)};return new W_(r)}function Fe(t,e){return new W_({type:"object",shape:t,catchall:ye(),...Y.normalizeParams(e)})}var G_=v("ZodUnion",(t,e)=>{_u.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>f_(t,r,n,o),t.options=e.options});function ce(t,e){return new G_({type:"union",options:t,...Y.normalizeParams(e)})}var aT=v("ZodDiscriminatedUnion",(t,e)=>{G_.init(t,e),ey.init(t,e)});function Vu(t,e,r){return new aT({type:"union",options:e,discriminator:t,...Y.normalizeParams(r)})}var cT=v("ZodIntersection",(t,e)=>{ty.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>p_(t,r,n,o)});function Ci(t,e){return new cT({type:"intersection",left:t,right:e})}var F_=v("ZodRecord",(t,e)=>{ry.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>m_(t,r,n,o),t.keyType=e.keyType,t.valueType=e.valueType});function ve(t,e,r){return!e||!e._zod?new F_({type:"record",keyType:y(),valueType:t,...Y.normalizeParams(e)}):new F_({type:"record",keyType:t,valueType:e,...Y.normalizeParams(r)})}var Fu=v("ZodEnum",(t,e)=>{ny.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(n,o,s)=>i_(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 uT=v("ZodLiteral",(t,e)=>{oy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>a_(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 uT({type:"literal",values:Array.isArray(t)?t:[t],...Y.normalizeParams(e)})}var lT=v("ZodTransform",(t,e)=>{sy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>u_(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 J_(t){return new lT({type:"transform",transform:t})}var K_=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 K_({type:"optional",innerType:t})}var dT=v("ZodExactOptional",(t,e)=>{iy.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 fT(t){return new dT({type:"optional",innerType:t})}var pT=v("ZodNullable",(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 U_(t){return new pT({type:"nullable",innerType:t})}var mT=v("ZodDefault",(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,t.removeDefault=t.unwrap});function hT(t,e){return new mT({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var gT=v("ZodPrefault",(t,e)=>{uy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>__(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function yT(t,e){return new gT({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Y.shallowClone(e)}})}var Y_=v("ZodNonOptional",(t,e)=>{ly.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>g_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function _T(t,e){return new Y_({type:"nonoptional",innerType:t,...Y.normalizeParams(e)})}var vT=v("ZodCatch",(t,e)=>{dy.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>v_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function bT(t,e){return new vT({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var Q_=v("ZodPipe",(t,e)=>{bu.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>b_(t,r,n,o),t.in=e.in,t.out=e.out});function V_(t,e){return new Q_({type:"pipe",in:t,out:e})}var wT=v("ZodPreprocess",(t,e)=>{Q_.init(t,e),fy.init(t,e)}),xT=v("ZodReadonly",(t,e)=>{py.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>w_(t,r,n,o),t.unwrap=()=>t._zod.def.innerType});function ST(t){return new xT({type:"readonly",innerType:t})}var X_=v("ZodCustom",(t,e)=>{my.init(t,e),_e.init(t,e),t._zod.processJSONSchema=(r,n,o)=>c_(t,r,n,o)});function ev(t,e){return Ky(X_,t??(()=>!0),e)}function $T(t,e={}){return Yy(X_,t,e)}function kT(t,e){return Qy(t,e)}function Bu(t,e){return new wT({type:"pipe",in:J_(t),out:e})}tt(hy());var Wu="2025-11-25";var tv=[Wu,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],ar="io.modelcontextprotocol/related-task",Ii="2.0",Te=ev(t=>t!==null&&(typeof t=="object"||typeof t=="function")),rv=ce([y(),se().int()]),nv=y(),xq=Fe({ttl:ce([se(),Uu()]).optional(),pollInterval:se().optional()}),ET=P({ttl:se().optional()}),zT=P({taskId:y()}),Gu=Fe({progressToken:rv.optional(),[ar]:zT.optional()}),nt=P({_meta:Gu.optional()}),Do=nt.extend({task:ET.optional()}),ov=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()]),sv=P({jsonrpc:C(Ii),id:Ri,...Ce.shape}).strict(),Ju=t=>sv.safeParse(t).success,iv=P({jsonrpc:C(Ii),...lt.shape}).strict(),av=t=>iv.safeParse(t).success,Ku=P({jsonrpc:C(Ii),id:Ri,result:Oe}).strict(),Ao=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 cv=t=>Yu.safeParse(t).success;var uv=ce([sv,iv,Ku,Yu]),Sq=ce([Ku,Yu]),Di=Oe.strict(),PT=ut.extend({requestId:Ri.optional(),reason:y().optional()}),Ai=lt.extend({method:C("notifications/cancelled"),params:PT}),TT=P({src:y(),mimeType:y().optional(),sizes:J(y()).optional(),theme:We(["light","dark"]).optional()}),No=P({icons:J(TT).optional()}),xn=P({name:y(),title:y().optional()}),lv=xn.extend({...xn.shape,...No.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),CT=Ci(P({applyDefaults:ze().optional()}),ve(y(),ye())),OT=Bu(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Ci(P({form:CT.optional(),url:Te.optional()}),ve(y(),ye()).optional())),IT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({sampling:Fe({createMessage:Te.optional()}).optional(),elicitation:Fe({create:Te.optional()}).optional()}).optional()}),RT=Fe({list:Te.optional(),cancel:Te.optional(),requests:Fe({tools:Fe({call:Te.optional()}).optional()}).optional()}),DT=P({experimental:ve(y(),Te).optional(),sampling:P({context:Te.optional(),tools:Te.optional()}).optional(),elicitation:OT.optional(),roots:P({listChanged:ze().optional()}).optional(),tasks:IT.optional()}),AT=nt.extend({protocolVersion:y(),capabilities:DT,clientInfo:lv}),Qu=Ce.extend({method:C("initialize"),params:AT});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:RT.optional()}),jT=Oe.extend({protocolVersion:y(),capabilities:NT,serverInfo:lv,instructions:y().optional()}),Xu=lt.extend({method:C("notifications/initialized"),params:ut.optional()});var Ni=Ce.extend({method:C("ping"),params:nt.optional()}),MT=P({progress:se(),total:we(se()),message:we(y())}),LT=P({...ut.shape,...MT.shape,progressToken:rv}),ji=lt.extend({method:C("notifications/progress"),params:LT}),ZT=nt.extend({cursor:nv.optional()}),jo=Ce.extend({params:ZT.optional()}),Mo=Oe.extend({nextCursor:nv.optional()}),qT=We(["working","input_required","completed","failed","cancelled"]),Lo=P({taskId:y(),status:qT,ttl:ce([se(),Uu()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:we(se()),statusMessage:we(y())}),Sn=Oe.extend({task:Lo}),FT=ut.merge(Lo),Zo=lt.extend({method:C("notifications/tasks/status"),params:FT}),Mi=Ce.extend({method:C("tasks/get"),params:nt.extend({taskId:y()})}),Li=Oe.merge(Lo),Zi=Ce.extend({method:C("tasks/result"),params:nt.extend({taskId:y()})}),$q=Oe.loose(),qi=jo.extend({method:C("tasks/list")}),Fi=Mo.extend({tasks:J(Lo)}),Ui=Ce.extend({method:C("tasks/cancel"),params:nt.extend({taskId:y()})}),dv=Oe.merge(Lo),fv=P({uri:y(),mimeType:we(y()),_meta:ve(y(),ye()).optional()}),pv=fv.extend({text:y()}),el=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),mv=fv.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()}),hv=P({...xn.shape,...No.shape,uri:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),UT=P({...xn.shape,...No.shape,uriTemplate:y(),description:we(y()),mimeType:we(y()),annotations:$n.optional(),_meta:we(Fe({}))}),VT=jo.extend({method:C("resources/list")}),BT=Mo.extend({resources:J(hv)}),HT=jo.extend({method:C("resources/templates/list")}),WT=Mo.extend({resourceTemplates:J(UT)}),tl=nt.extend({uri:y()}),GT=tl,JT=Ce.extend({method:C("resources/read"),params:GT}),KT=Oe.extend({contents:J(ce([pv,mv]))}),YT=lt.extend({method:C("notifications/resources/list_changed"),params:ut.optional()}),QT=tl,XT=Ce.extend({method:C("resources/subscribe"),params:QT}),eC=tl,tC=Ce.extend({method:C("resources/unsubscribe"),params:eC}),rC=ut.extend({uri:y()}),nC=lt.extend({method:C("notifications/resources/updated"),params:rC}),oC=P({name:y(),description:we(y()),required:we(ze())}),sC=P({...xn.shape,...No.shape,description:we(y()),arguments:we(J(oC)),_meta:we(Fe({}))}),iC=jo.extend({method:C("prompts/list")}),aC=Mo.extend({prompts:J(sC)}),cC=nt.extend({name:y(),arguments:ve(y(),y()).optional()}),uC=Ce.extend({method:C("prompts/get"),params:cC}),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()}),lC=P({type:C("tool_use"),name:y(),id:y(),input:ve(y(),ye()),_meta:ve(y(),ye()).optional()}),dC=P({type:C("resource"),resource:ce([pv,mv]),annotations:$n.optional(),_meta:ve(y(),ye()).optional()}),fC=hv.extend({type:C("resource_link")}),sl=ce([rl,nl,ol,fC,dC]),pC=P({role:qo,content:sl}),mC=Oe.extend({description:y().optional(),messages:J(pC)}),hC=lt.extend({method:C("notifications/prompts/list_changed"),params:ut.optional()}),gC=P({title:y().optional(),readOnlyHint:ze().optional(),destructiveHint:ze().optional(),idempotentHint:ze().optional(),openWorldHint:ze().optional()}),yC=P({taskSupport:We(["required","optional","forbidden"]).optional()}),gv=P({...xn.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:gC.optional(),execution:yC.optional(),_meta:ve(y(),ye()).optional()}),il=jo.extend({method:C("tools/list")}),_C=Mo.extend({tools:J(gv)}),Vi=Oe.extend({content:J(sl).default([]),structuredContent:ve(y(),ye()).optional(),isError:ze().optional()}),kq=Vi.or(Oe.extend({toolResult:ye()})),vC=Do.extend({name:y(),arguments:ve(y(),ye()).optional()}),Fo=Ce.extend({method:C("tools/call"),params:vC}),bC=lt.extend({method:C("notifications/tools/list_changed"),params:ut.optional()}),Eq=P({autoRefresh:ze().default(!0),debounceMs:se().int().nonnegative().default(300)}),Uo=We(["debug","info","notice","warning","error","critical","alert","emergency"]),wC=nt.extend({level:Uo}),al=Ce.extend({method:C("logging/setLevel"),params:wC}),xC=ut.extend({level:Uo,logger:y().optional(),data:ye()}),SC=lt.extend({method:C("notifications/message"),params:xC}),$C=P({name:y().optional()}),kC=P({hints:J($C).optional(),costPriority:se().min(0).max(1).optional(),speedPriority:se().min(0).max(1).optional(),intelligencePriority:se().min(0).max(1).optional()}),EC=P({mode:We(["auto","required","none"]).optional()}),zC=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()}),PC=Vu("type",[rl,nl,ol]),Oi=Vu("type",[rl,nl,ol,lC,zC]),TC=P({role:qo,content:ce([Oi,J(Oi)]),_meta:ve(y(),ye()).optional()}),CC=Do.extend({messages:J(TC),modelPreferences:kC.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(gv).optional(),toolChoice:EC.optional()}),OC=Ce.extend({method:C("sampling/createMessage"),params:CC}),cl=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens"]).or(y())),role:qo,content:PC}),ul=Oe.extend({model:y(),stopReason:we(We(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:qo,content:ce([Oi,J(Oi)])}),IC=P({type:C("boolean"),title:y().optional(),description:y().optional(),default:ze().optional()}),RC=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()}),DC=P({type:We(["number","integer"]),title:y().optional(),description:y().optional(),minimum:se().optional(),maximum:se().optional(),default:se().optional()}),AC=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()}),jC=P({type:C("string"),title:y().optional(),description:y().optional(),enum:J(y()),enumNames:J(y()).optional(),default:y().optional()}),MC=ce([AC,NC]),LC=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()}),qC=ce([LC,ZC]),FC=ce([jC,MC,qC]),UC=ce([FC,IC,RC,DC]),VC=Do.extend({mode:C("form").optional(),message:y(),requestedSchema:P({type:C("object"),properties:ve(y(),UC),required:J(y()).optional()})}),BC=Do.extend({mode:C("url"),message:y(),elicitationId:y(),url:y().url()}),HC=ce([VC,BC]),WC=Ce.extend({method:C("elicitation/create"),params:HC}),GC=ut.extend({elicitationId:y()}),JC=lt.extend({method:C("notifications/elicitation/complete"),params:GC}),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())}),KC=P({type:C("ref/resource"),uri:y()});var YC=P({type:C("ref/prompt"),name:y()}),QC=nt.extend({ref:ce([YC,KC]),argument:P({name:y(),value:y()}),context:P({arguments:ve(y(),y()).optional()}).optional()}),XC=Ce.extend({method:C("completion/complete"),params:QC});var eO=Oe.extend({completion:Fe({values:J(y()).max(100),total:we(se().int()),hasMore:we(ze())})}),tO=P({uri:y().startsWith("file://"),name:y().optional(),_meta:ve(y(),ye()).optional()}),rO=Ce.extend({method:C("roots/list"),params:nt.optional()}),ll=Oe.extend({roots:J(tO)}),nO=lt.extend({method:C("notifications/roots/list_changed"),params:ut.optional()}),zq=ce([Ni,Qu,XC,al,uC,iC,VT,HT,JT,XT,tC,Fo,il,Mi,Zi,qi,Ui]),Pq=ce([Ai,ji,Xu,nO,Zo]),Tq=ce([Di,cl,ul,Bi,ll,Li,Fi,Sn]),Cq=ce([Ni,OC,WC,rO,Mi,Zi,qi,Ui]),Oq=ce([Ai,ji,SC,nC,YT,bC,hC,Zo,JC]),Iq=ce([Di,jT,eO,mC,aC,BT,WT,KT,Vi,_C,Li,Fi,Sn]),Z=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 Z{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 d2=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dl(t){let r=Pi(t)?.method;if(!r)throw new Error("Schema is missing a method literal");let n=x_(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 uO=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(Ai,r=>{this._oncancel(r)}),this.setNotificationHandler(ji,r=>{this._onprogress(r)}),this.setRequestHandler(Ni,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 Z(G.InvalidParams,"Failed to retrieve task: Task not found");return{...o}}),this.setRequestHandler(Zi,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 Z(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 Z(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 Z(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 Z(G.InvalidParams,`Task not found: ${r.params.taskId}`);if(cr(o.status))throw new Z(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 Z(G.InvalidParams,`Task not found after cancellation: ${r.params.taskId}`);return{_meta:{},...s}}catch(o){throw o instanceof Z?o:new Z(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),Z.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),Ao(s)||cv(s)?this._onresponse(s):Ju(s)?this._onrequest(s,i):av(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=Z.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=ov(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 Z(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),Ao(e))n(e);else{let i=new Z(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(Ao(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),Ao(e))o(e);else{let i=Z.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 Z?i:new Z(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 Z(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 Z(G.InternalError,`Task ${s} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new Z(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 Z?i:new Z(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 Z?x:new Z(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??uO,g=()=>f(Z.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},Li,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},dv,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 Z(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 Z(G.InvalidRequest,"Request cancelled"));return}let i=setTimeout(o,n);r.addEventListener("abort",()=>{clearTimeout(i),s(new Z(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 Z(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=Zo.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 Z(G.InvalidParams,`Task "${o}" not found - it may have been cleaned up`);if(cr(a.status))throw new Z(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=Zo.parse({method:"notifications/tasks/status",params:c});await this.notification(u),cr(c.status)&&this._cleanupTaskProgressHandler(o)}},listTasks:o=>n.listTasks(o,r)}}};function yv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function _v(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];yv(i)&&yv(s)?r[o]={...i,...s}:r[o]=s}return r}var cx=gt(Xd(),1),ux=gt(ax(),1);function g1(){let t=new cx.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ux.default)(t),t}var Ca=class{constructor(e){this._ajv=e??g1()}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 lx(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 dx(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=_v(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 Z(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 Z(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 Z(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){dx(this._clientCapabilities?.tasks?.requests,e,"Client")}assertTaskHandlerCapability(e){this._capabilities&&lx(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:tv.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 Z(G.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(i){throw i instanceof Z?i:new Z(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(`
158
+ `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),y1(r)}clear(){this._buffer=void 0}};function y1(t){return uv.parse(JSON.parse(t))}function fx(t){return JSON.stringify(t)+`
159
+ `}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=fx(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 Aa=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
160
 
156
161
  `;for(let[s,i]of Object.entries(n)){o+=`## ${s.charAt(0).toUpperCase()+s.slice(1)}s
157
162
 
@@ -170,7 +175,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
170
175
 
171
176
  `),e.replacementSuggestion&&(r+=`**Recommended replacement**: ${e.replacementSuggestion}
172
177
 
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
178
+ `),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"]}}}};function _1(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 Wn=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)return{componentName:r.trim(),examples:[]};let n=_1(r.trim()),o=r.trim().toLowerCase(),s=this.data.find(i=>i.component===n)??this.data.find(i=>i.component===`eui-${n}`)??this.data.find(i=>i.component===`ecl-${n}`)??this.data.find(i=>i.component===`eds-${n}`)??this.data.find(i=>i.component===o);return{componentName:s?.component??r.trim(),examples:s?.examples??[]}}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 Na=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 Na}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:v1,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:{}}}}},v1=`# Getting Started with EUI CLI
174
179
 
175
180
  The EUI CLI is a command-line tool for scaffolding and managing EUI applications.
176
181
 
@@ -295,7 +300,7 @@ my-app/
295
300
  \`\`\`
296
301
 
297
302
  The application will be available at \`http://localhost:4200\`
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
303
+ `;var Xn=class{execute(e={}){return Promise.resolve({content:b1,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:{}}}}},b1=`# eUI CLI - Complete Options Report
299
304
 
300
305
  ## Overview
301
306
 
@@ -635,9 +640,9 @@ eui-cli serve-app --maxSpaceSize
635
640
 
636
641
  - **Node.js**: >=24.0.0
637
642
  - **Yarn**: >=1.22.4 <2
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
- `),t.errors&&t.errors.forEach(c=>process.stderr.write(` - ${c}
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}
643
+ `;function w1(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=w1(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;examplesData;tools;isRunning=!1;constructor(e,r,n,o){this.index=r,this.accessibilityData=n??null,this.examplesData=o??null,this.query=new bs(r),this.searchEngine=new ws(r),this.formatter=new Aa,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.examplesData),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)}updateExamplesData(e){this.examplesData=e;let r=this.tools.get("get-component-examples");r&&r.updateData(e)}};var uf=gt(require("fs")),yr=null,Ma=null,px=!1;async function x1(t,e){let r=Zt.detect(t);if(r.type==="local"){let s=uf.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Zr({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 S1(t,e){let r=Zt.detect(t);if(r.type==="local"){let s=uf.readFileSync(r.normalizedPath,"utf-8");return JSON.parse(s)}let o=await new Zr({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 $1(){try{let t=Wa();(!t.success||!t.config)&&(process.stderr.write(`Failed to load configuration
644
+ `),t.errors&&t.errors.forEach(u=>process.stderr.write(` - ${u}
645
+ `)),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:k1,onError:E1});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 u=o.getStatistics(s);r.info("Index built successfully",{totalCount:u.totalCount,components:u.componentCount,directives:u.directiveCount,pipes:u.pipeCount,services:u.serviceCount})}catch(u){r.error("Failed to build index",u instanceof Error?u:new Error(String(u))),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 x1(e.accessibility.path,e.documentation.timeout),r.info("Accessibility data loaded successfully",{entries:i.length})}catch(u){r.warn("Failed to load accessibility data - tool will be unavailable",{error:u instanceof Error?u.message:String(u)})}}else r.info("No accessibility path configured - get-component-accessibility tool will report not configured");let a=null;if(e.examples?.path){r.info("Loading examples data...",{path:e.examples.path});try{a=await S1(e.examples.path,e.documentation.timeout),r.info("Examples data loaded successfully",{entries:a.length})}catch(u){r.warn("Failed to load examples data - get-component-examples will return empty results",{error:u instanceof Error?u.message:String(u)})}}else r.info("No examples path configured - get-component-examples will return empty results");yr=new xs({name:e.server.name,version:e.server.version},s,i,a),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 c=yr.getStats();r.debug("Server statistics",c),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 k1(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 E1(t){ne().error("Documentation loader error",t)}async function ja(t){if(px)return;px=!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 z1(){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")})}z1();$1().catch(t=>{process.stderr.write(`Fatal error: ${t}
641
646
  `),process.exit(1)});
642
647
  /*! Bundled license information:
643
648