thenomad 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nomad.js +1253 -272
- package/package.json +2 -2
- package/web/404.html +1 -1
- package/web/__next.__PAGE__.txt +23 -22
- package/web/__next._full.txt +23 -22
- package/web/__next._tree.txt +1 -1
- package/web/_next/static/chunks/25ks-kwg9va83.js +1 -0
- package/web/_next/static/chunks/294sy_-iu03pf.js +1 -0
- package/web/_next/static/chunks/2m8g429r9sjgz.js +7 -0
- package/web/_next/static/chunks/{2itrx72tv-gct.js → 3-sl52vw828p-.js} +16 -16
- package/web/_not-found/__next._full.txt +2 -2
- package/web/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/web/_not-found/__next._tree.txt +1 -1
- package/web/_not-found.html +1 -1
- package/web/_not-found.txt +2 -2
- package/web/app/__next._full.txt +3 -3
- package/web/app/__next._tree.txt +1 -1
- package/web/app/__next.app.__PAGE__.txt +3 -3
- package/web/app/agents/__next._full.txt +3 -3
- package/web/app/agents/__next._tree.txt +1 -1
- package/web/app/agents/__next.app.agents.__PAGE__.txt +3 -3
- package/web/app/agents/view/__next._full.txt +3 -3
- package/web/app/agents/view/__next._tree.txt +1 -1
- package/web/app/agents/view/__next.app.agents.view.__PAGE__.txt +3 -3
- package/web/app/agents/view.html +1 -1
- package/web/app/agents/view.txt +3 -3
- package/web/app/agents.html +1 -1
- package/web/app/agents.txt +3 -3
- package/web/app/backups/__next._full.txt +3 -3
- package/web/app/backups/__next._tree.txt +1 -1
- package/web/app/backups/__next.app.backups.__PAGE__.txt +3 -3
- package/web/app/backups.html +1 -1
- package/web/app/backups.txt +3 -3
- package/web/app/compatibility/__next._full.txt +5 -5
- package/web/app/compatibility/__next._tree.txt +1 -1
- package/web/app/compatibility/__next.app.compatibility.__PAGE__.txt +5 -5
- package/web/app/compatibility.html +1 -1
- package/web/app/compatibility.txt +5 -5
- package/web/app/export/__next._full.txt +5 -5
- package/web/app/export/__next._tree.txt +1 -1
- package/web/app/export/__next.app.export.__PAGE__.txt +5 -5
- package/web/app/export.html +1 -1
- package/web/app/export.txt +5 -5
- package/web/app/history/__next._full.txt +5 -5
- package/web/app/history/__next._tree.txt +1 -1
- package/web/app/history/__next.app.history.__PAGE__.txt +5 -5
- package/web/app/history.html +1 -1
- package/web/app/history.txt +5 -5
- package/web/app/import/__next._full.txt +3 -3
- package/web/app/import/__next._tree.txt +1 -1
- package/web/app/import/__next.app.import.__PAGE__.txt +3 -3
- package/web/app/import.html +1 -1
- package/web/app/import.txt +3 -3
- package/web/app/migrate/__next._full.txt +5 -5
- package/web/app/migrate/__next._tree.txt +1 -1
- package/web/app/migrate/__next.app.migrate.__PAGE__.txt +5 -5
- package/web/app/migrate.html +1 -1
- package/web/app/migrate.txt +5 -5
- package/web/app/settings/__next._full.txt +3 -3
- package/web/app/settings/__next._tree.txt +1 -1
- package/web/app/settings/__next.app.settings.__PAGE__.txt +3 -3
- package/web/app/settings.html +1 -1
- package/web/app/settings.txt +3 -3
- package/web/app/versions/__next._full.txt +3 -3
- package/web/app/versions/__next._tree.txt +1 -1
- package/web/app/versions/__next.app.versions.__PAGE__.txt +3 -3
- package/web/app/versions.html +1 -1
- package/web/app/versions.txt +3 -3
- package/web/app.html +1 -1
- package/web/app.txt +3 -3
- package/web/docs/__next._full.txt +4 -4
- package/web/docs/__next._tree.txt +1 -1
- package/web/docs/__next.docs.__PAGE__.txt +2 -2
- package/web/docs/adapters/__next._full.txt +57 -53
- package/web/docs/adapters/__next._tree.txt +1 -1
- package/web/docs/adapters/__next.docs.adapters.__PAGE__.txt +55 -51
- package/web/docs/adapters.html +1 -1
- package/web/docs/adapters.txt +57 -53
- package/web/docs/format/__next._full.txt +4 -4
- package/web/docs/format/__next._tree.txt +1 -1
- package/web/docs/format/__next.docs.format.__PAGE__.txt +2 -2
- package/web/docs/format.html +1 -1
- package/web/docs/format.txt +4 -4
- package/web/docs/security/__next._full.txt +5 -5
- package/web/docs/security/__next._tree.txt +1 -1
- package/web/docs/security/__next.docs.security.__PAGE__.txt +3 -3
- package/web/docs/security.html +1 -1
- package/web/docs/security.txt +5 -5
- package/web/docs.html +1 -1
- package/web/docs.txt +4 -4
- package/web/index.html +5 -5
- package/web/index.txt +23 -22
- package/web/inspect/__next._full.txt +8 -8
- package/web/inspect/__next._tree.txt +1 -1
- package/web/inspect/__next.inspect.__PAGE__.txt +8 -8
- package/web/inspect.html +1 -1
- package/web/inspect.txt +8 -8
- package/web/privacy/__next._full.txt +3 -3
- package/web/privacy/__next._tree.txt +1 -1
- package/web/privacy/__next.privacy.__PAGE__.txt +29 -30
- package/web/privacy.html +1 -1
- package/web/privacy.txt +3 -3
- package/web/terms/__next._full.txt +28 -27
- package/web/terms/__next._tree.txt +1 -1
- package/web/terms/__next.terms.__PAGE__.txt +3 -3
- package/web/terms.html +1 -1
- package/web/terms.txt +28 -27
- package/web/_next/static/chunks/0pa_vjzo6qbn_.js +0 -1
- package/web/_next/static/chunks/2-s_pll2nvnpu.js +0 -7
- package/web/_next/static/chunks/245h302r_8ful.js +0 -1
- /package/web/_next/static/{iPPtzTmZOHZrEFsNQeVmA → 5B6R6zkMOO-jMrOE_HKge}/_buildManifest.js +0 -0
- /package/web/_next/static/{iPPtzTmZOHZrEFsNQeVmA → 5B6R6zkMOO-jMrOE_HKge}/_clientMiddlewareManifest.js +0 -0
- /package/web/_next/static/{iPPtzTmZOHZrEFsNQeVmA → 5B6R6zkMOO-jMrOE_HKge}/_ssgManifest.js +0 -0
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73906,2969,64221,20125,e=>{"use strict";var t=e.i(21229),n=e.i(33892);e.i(73187),e.i(89089);let r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",i=-1,s=[];function o(e=Date.now()){let t,n="",a=e;for(let e=0;e<10;e++)n=r[a%32]+n,a=Math.floor(a/32);if(e===i){t=[...s];for(let e=t.length-1;e>=0;e--){if(t[e]<31){t[e]++;break}t[e]=0}}else{let e;t=Array.from((e=new Uint8Array(16),globalThis.crypto.getRandomValues(e),e),e=>e%32)}return i=e,s=t,n+t.map(e=>r[e]).join("")}function a(e,t){switch(t){case"identity":return e.identity.persona||e.identity.description||e.identity.tone?1:+!!e.identity.name;case"instructions":return e.instructions.filter(e=>e.content.trim()).length;case"memory":return e.memory.length;case"skills":return e.skills.length;case"tools":return e.tools.length;case"integrations":return e.integrations.length;case"models":return e.models.preferred||e.models.fallbacks.length?1:0;case"permissions":return e.permissions.rules.length+ +("ask"!==e.permissions.mode);case"workflows":return e.workflows.length;case"knowledge":return e.knowledge.length+e.files.length;case"project":return Object.keys(e.extensions).length}}e.s(["P",0,function(e){return"string"==typeof e&&/^[0-9A-HJKMNP-TV-Z]{26}$/.test(e)},"A",0,function(e,t="agent"){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||t},"v",0,o],2969),e.s(["q",0,a,"F",0,function(e){let r=(e.now??new Date).toISOString(),i={schemaVersion:n.S,id:e.id??o(),name:e.name,description:e.description,createdAt:r,updatedAt:r,source:{platform:e.platform,readAt:r},identity:{name:e.name,description:e.description}};return(0,t.r)(i)},"K",0,function(e){return{...e,workflows:e.workflows.map(e=>({...e,enabled:!1}))}}],64221),e.s(["f",0,"0.1.0"],20125);let l={full:"Fully supported",convert:"Supported with conversion",manual:"Requires manual setup",unsupported:"Unsupported","not-applicable":"Not applicable"},u={identity:"Identity",instructions:"Instructions",memory:"Memory",skills:"Skills",tools:"Tools",integrations:"Integrations",models:"Models",permissions:"Permissions",workflows:"Workflows",knowledge:"Knowledge files",project:"Project configuration"},c={identity:2,instructions:3,memory:3,skills:2,tools:2,integrations:1,models:1,permissions:2,workflows:1,knowledge:1,project:1},f={full:1,convert:.75,manual:.4,unsupported:0},d=["full","convert","manual","unsupported"],p=["instructions","memory","skills","tools","permissions","workflows"];e.s(["A",0,u,"i",0,l,"Y",0,function(e,t,r){let i=[],s=0,o=0,h=[];for(let m of n.R){let n,g=e?a(e,m):1,y=t?t.capabilities[m].read:null,b=r.capabilities[m].write;if(0===g)n="not-applicable";else n=y?d[Math.max(d.indexOf(y),d.indexOf(b))]:b;"not-applicable"!==n&&(s+=c[m]*f[n],o+=c[m]);let v=g>0&&("unsupported"===n||"manual"===n&&p.includes(m));v&&h.push("unsupported"===n?`${u[m]}: ${r.displayName} cannot store ${g} item(s). They stay in the package.`:`${u[m]}: ${g} item(s) need manual setup in ${r.displayName}.`),i.push({category:m,label:u[m],status:n,statusLabel:l[n],items:g,sourceRead:y,destinationWrite:b,explanation:function(e,t,n,r,i){let s=n.capabilities[e].notes,o=(()=>{switch(t){case"not-applicable":return"The agent has nothing in this category.";case"full":return`${n.displayName} stores this natively.`;case"convert":return`${n.displayName} stores this in a different structure, so Nomad converts it.`;case"manual":return`Nomad keeps the definition, but you finish setup in ${n.displayName}.`;case"unsupported":return`${n.displayName} has no equivalent. The data is kept in the package and listed in the report.`}})(),a="";if("permissions"===e&&i&&"full"!==t&&"not-applicable"!==t){let e=i.permissions.rules.filter(e=>"allow"!==e.effect).length;e&&(a=` ${e} restriction(s) may not be enforced by the destination.`)}return"workflows"===e&&r&&(a+=" Imported routines always start disabled."),[o,s,a.trim()].filter(Boolean).join(" ")}(m,n,r,g,e),attention:v})}let m=o?Math.round(s/o*100):null;return{source:t?.id??null,destination:r.id,categories:i,score:m,scoreExplanation:"Each category the agent uses counts with a weight (instructions and memory 3, identity, skills, tools and permissions 2, the rest 1). Fully supported counts 100%, converted 75%, manual setup 40%, unsupported 0%. The score is the weighted average. Categories the agent does not use are left out. Items flagged for attention matter even when the score is high.",attention:h}}],73906)},73187,89089,e=>{"use strict";let t,n=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),r=new TextEncoder,i=new TextDecoder("utf-8",{fatal:!1});function s(e){return r.encode(e)}e.s(["B",0,function(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},"w",0,function(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)},"Z",0,function(e){return JSON.stringify(function e(t){if(Array.isArray(t))return t.map(e);if(t&&"object"==typeof t){let n={};for(let r of Object.keys(t).sort()){let i=t[r];void 0!==i&&(n[r]=e(i))}return n}return t}(e))},"r",0,function(e){return i.decode(e)},"E",0,function(e){let t="string"==typeof e?s(e):e,r=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),i=8*t.length,o=new Uint8Array(t.length+9+63>>6<<6);o.set(t),o[t.length]=128;let a=new DataView(o.buffer);a.setUint32(o.length-8,Math.floor(i/0x100000000)),a.setUint32(o.length-4,i>>>0);let l=new Uint32Array(64);for(let e=0;e<o.length;e+=64){for(let t=0;t<16;t++)l[t]=a.getUint32(e+4*t);for(let e=16;e<64;e++){let t=l[e-15],n=l[e-2],r=(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3,i=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10;l[e]=l[e-16]+r+l[e-7]+i>>>0}let t=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],f=r[6],d=r[7];for(let e=0;e<64;e++){let r=d+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&c^~u&f)+n[e]+l[e]>>>0,a=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&i^t&s^i&s)>>>0;d=f,f=c,c=u,u=o+r>>>0,o=s,s=i,i=t,t=r+a>>>0}r[0]=r[0]+t>>>0,r[1]=r[1]+i>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+o>>>0,r[4]=r[4]+u>>>0,r[5]=r[5]+c>>>0,r[6]=r[6]+f>>>0,r[7]=r[7]+d>>>0}return Array.from(r,e=>e.toString(16).padStart(8,"0")).join("")},"J",0,s],73187);let o=Symbol.for("yaml.alias"),a=Symbol.for("yaml.document"),l=Symbol.for("yaml.map"),u=Symbol.for("yaml.pair"),c=Symbol.for("yaml.scalar"),f=Symbol.for("yaml.seq"),d=Symbol.for("yaml.node.type"),p=e=>!!e&&"object"==typeof e&&e[d]===o,h=e=>!!e&&"object"==typeof e&&e[d]===a,m=e=>!!e&&"object"==typeof e&&e[d]===l,g=e=>!!e&&"object"==typeof e&&e[d]===u,y=e=>!!e&&"object"==typeof e&&e[d]===c,b=e=>!!e&&"object"==typeof e&&e[d]===f;function v(e){if(e&&"object"==typeof e)switch(e[d]){case l:case f:return!0}return!1}function k(e){if(e&&"object"==typeof e)switch(e[d]){case o:case l:case c:case f:return!0}return!1}let w=e=>(y(e)||v(e))&&!!e.anchor,_=Symbol("break visit"),S=Symbol("skip children"),O=Symbol("remove node");function x(e,t){let n=A(t);h(e)?$(null,e.contents,n,Object.freeze([e]))===O&&(e.contents=null):$(null,e,n,Object.freeze([]))}function $(e,t,n,r){let i=N(e,t,n,r);if(k(i)||g(i))return T(e,r,i),$(e,i,n,r);if("symbol"!=typeof i){if(v(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=$(e,t.items[e],n,r);if("number"==typeof i)e=i-1;else{if(i===_)return _;i===O&&(t.items.splice(e,1),e-=1)}}}else if(g(t)){r=Object.freeze(r.concat(t));let e=$("key",t.key,n,r);if(e===_)return _;e===O&&(t.key=null);let i=$("value",t.value,n,r);if(i===_)return _;i===O&&(t.value=null)}}return i}async function z(e,t){let n=A(t);h(e)?await E(null,e.contents,n,Object.freeze([e]))===O&&(e.contents=null):await E(null,e,n,Object.freeze([]))}async function E(e,t,n,r){let i=await N(e,t,n,r);if(k(i)||g(i))return T(e,r,i),E(e,i,n,r);if("symbol"!=typeof i){if(v(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await E(e,t.items[e],n,r);if("number"==typeof i)e=i-1;else{if(i===_)return _;i===O&&(t.items.splice(e,1),e-=1)}}}else if(g(t)){r=Object.freeze(r.concat(t));let e=await E("key",t.key,n,r);if(e===_)return _;e===O&&(t.key=null);let i=await E("value",t.value,n,r);if(i===_)return _;i===O&&(t.value=null)}}return i}function A(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function N(e,t,n,r){return"function"==typeof n?n(e,t,r):m(t)?n.Map?.(e,t,r):b(t)?n.Seq?.(e,t,r):g(t)?n.Pair?.(e,t,r):y(t)?n.Scalar?.(e,t,r):p(t)?n.Alias?.(e,t,r):void 0}function T(e,t,n){let r=t[t.length-1];if(v(r))r.items[e]=n;else if(g(r))"key"===e?r.key=n:r.value=n;else if(h(r))r.contents=n;else{let e=p(r)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}x.BREAK=_,x.SKIP=S,x.REMOVE=O,z.BREAK=_,z.SKIP=S,z.REMOVE=O;let I={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},j=e=>e.replace(/[!,[\]{}]/g,e=>I[e]);class P{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},P.defaultYaml,e),this.tags=Object.assign({},P.defaultTags,t)}clone(){let e=new P(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new P(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:P.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},P.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:P.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},P.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let n=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,n),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+j(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);if(e&&r.length>0&&k(e.contents)){let n={};x(e.contents,(e,t)=>{k(t)&&t.tag&&(n[t.tag]=!0)}),t=Object.keys(n)}else t=[];for(let[i,s]of r)("!!"!==i||"tag:yaml.org,2002:"!==s)&&(!e||t.some(e=>e.startsWith(s)))&&n.push(`%TAG ${i} ${s}`);return n.join("\n")}}function C(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function L(e){let t=new Set;return x(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function D(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function M(e,t,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=M(e,r,String(t),n);void 0===i?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=M(e,r,t,n);void 0===i?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=M(e,r,t,t);void 0===n?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=M(e,r,t,n);void 0===i?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function R(e,t,n){if(Array.isArray(e))return e.map((e,t)=>R(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!w(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof e||n?.keep?e:Number(e)}P.defaultYaml={explicit:!1,version:"1.2"},P.defaultTags={"!!":"tag:yaml.org,2002:"};class Z{constructor(e){Object.defineProperty(this,d,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!h(e))throw TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=R(this,"",s);if("function"==typeof r)for(let{count:e,res:t}of s.anchors.values())r(t,e);return"function"==typeof i?M(i,{"":o},"",o):o}}class B extends Z{constructor(e){super(o),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let n,r;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let i of(t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],x(e,{Node:(e,t)=>{(p(t)||w(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n)),n)){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,s=e.get(r);if(s||(R(r,null,t),s=e.get(r)),s?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=function e(t,n,r){if(p(n)){let e=n.resolve(t),i=r&&e&&r.get(e);return i?i.count*i.aliasCount:0}if(v(n)){let i=0;for(let s of n.items){let n=e(t,s,r);n>i&&(i=n)}return i}return g(n)?Math.max(e(t,n.key,r),e(t,n.value,r)):1}(n,r,e)),s.count*s.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(C(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${r} `}return r}}let U=e=>!e||"function"!=typeof e&&"object"!=typeof e;class F extends Z{constructor(e){super(c),this.value=e}toJSON(e,t){return t?.keep?this.value:R(this.value,e,t)}toString(){return String(this.value)}}function K(e,t,n){let r;if(h(e)&&(e=e.contents),k(e))return e;if(g(e)){let t=n.schema[l].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:s,onTagObj:o,schema:a,sourceObjects:u}=n;if(i&&e&&"object"==typeof e){if(r=u.get(e))return r.anchor??(r.anchor=s(e)),new B(r.anchor);r={anchor:null,node:null},u.set(e,r)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let c=function(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,a.tags);if(!c){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new F(e);return r&&(r.node=t),t}c=e instanceof Map?a[l]:Symbol.iterator in Object(e)?a[f]:a[l]}o&&(o(c),delete n.onTagObj);let d=c?.createNode?c.createNode(n.schema,e,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,e,n):new F(e);return t?d.tag=t:c.default||(d.tag=c.tag),r&&(r.node=d),d}function q(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return K(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}F.BLOCK_FOLDED="BLOCK_FOLDED",F.BLOCK_LITERAL="BLOCK_LITERAL",F.PLAIN="PLAIN",F.QUOTE_DOUBLE="QUOTE_DOUBLE",F.QUOTE_SINGLE="QUOTE_SINGLE";let J=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class V extends Z{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>k(t)||g(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(J(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(v(i))i.addIn(r,t);else if(void 0===i&&this.schema)this.set(n,q(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(0===n.length)return this.delete(t);let r=this.get(t,!0);if(v(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return 0===r.length?!t&&y(i)?i.value:i:v(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!g(t))return!1;let n=t.value;return null==n||e&&y(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(0===n.length)return this.has(t);let r=this.get(t,!0);return!!v(r)&&r.hasIn(n)}setIn(e,t){let[n,...r]=e;if(0===r.length)this.set(n,t);else{let e=this.get(n,!0);if(v(e))e.setIn(r,t);else if(void 0===e&&this.schema)this.set(n,q(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}}let W=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function G(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let Y=(e,t,n)=>e.endsWith("\n")?G(n,t):n.includes("\n")?"\n"+G(n,t):(e.endsWith(" ")?"":" ")+n,X="flow",H="block",Q="quoted";function ee(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){let l,u,c;if(!i||i<0)return e;i<s&&(s=0);let f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;let d=[],p={},h=i-t.length;"number"==typeof r&&(r>i-Math.max(2,s)?d.push(0):h=i-r);let m=!1,g=-1,y=-1,b=-1;for(n===H&&-1!==(g=et(e,g,t.length))&&(h=g+f);c=e[g+=1];){if(n===Q&&"\\"===c){switch(y=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if("\n"===c)n===H&&(g=et(e,g,t.length)),h=g+t.length+f,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[g+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=g)}if(g>=h)if(l)d.push(l),h=l+f,l=void 0;else if(n===Q){for(;" "===u||" "===u;)u=c,c=e[g+=1],m=!0;let t=g>b+1?g-2:y-1;if(p[t])return e;d.push(t),p[t]=!0,h=t+f,l=void 0}else m=!0}u=c}if(m&&a&&a(),0===d.length)return e;o&&o();let v=e.slice(0,d[0]);for(let r=0;r<d.length;++r){let i=d[r],s=d[r+1]||e.length;0===i?v=`
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,73906,2969,64221,20125,e=>{"use strict";var t=e.i(21229),n=e.i(33892);e.i(73187),e.i(89089);let r="0123456789ABCDEFGHJKMNPQRSTVWXYZ",i=-1,s=[];function o(e=Date.now()){let t,n="",a=e;for(let e=0;e<10;e++)n=r[a%32]+n,a=Math.floor(a/32);if(e===i){t=[...s];for(let e=t.length-1;e>=0;e--){if(t[e]<31){t[e]++;break}t[e]=0}}else{let e;t=Array.from((e=new Uint8Array(16),globalThis.crypto.getRandomValues(e),e),e=>e%32)}return i=e,s=t,n+t.map(e=>r[e]).join("")}function a(e,t){switch(t){case"identity":return e.identity.persona||e.identity.description||e.identity.tone?1:+!!e.identity.name;case"instructions":return e.instructions.filter(e=>e.content.trim()).length;case"memory":return e.memory.length;case"skills":return e.skills.length;case"tools":return e.tools.length;case"integrations":return e.integrations.length;case"models":return e.models.preferred||e.models.fallbacks.length?1:0;case"permissions":return e.permissions.rules.length+ +("ask"!==e.permissions.mode);case"workflows":return e.workflows.length;case"knowledge":return e.knowledge.length+e.files.length;case"project":return Object.keys(e.extensions).length}}e.s(["P",0,function(e){return"string"==typeof e&&/^[0-9A-HJKMNP-TV-Z]{26}$/.test(e)},"A",0,function(e,t="agent"){return e.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||t},"v",0,o],2969),e.s(["q",0,a,"F",0,function(e){let r=(e.now??new Date).toISOString(),i={schemaVersion:n.S,id:e.id??o(),name:e.name,description:e.description,createdAt:r,updatedAt:r,source:{platform:e.platform,readAt:r},identity:{name:e.name,description:e.description}};return(0,t.r)(i)},"K",0,function(e){return{...e,workflows:e.workflows.map(e=>({...e,enabled:!1}))}}],64221),e.s(["f",0,"0.2.0"],20125);let l={full:"Fully supported",convert:"Supported with conversion",manual:"Requires manual setup",unsupported:"Unsupported","not-applicable":"Not applicable"},u={identity:"Identity",instructions:"Instructions",memory:"Memory",skills:"Skills",tools:"Tools",integrations:"Integrations",models:"Models",permissions:"Permissions",workflows:"Workflows",knowledge:"Knowledge files",project:"Project configuration"},c={identity:2,instructions:3,memory:3,skills:2,tools:2,integrations:1,models:1,permissions:2,workflows:1,knowledge:1,project:1},f={full:1,convert:.75,manual:.4,unsupported:0},d=["full","convert","manual","unsupported"],p=["instructions","memory","skills","tools","permissions","workflows"];e.s(["A",0,u,"i",0,l,"Y",0,function(e,t,r){let i=[],s=0,o=0,h=[];for(let m of n.R){let n,g=e?a(e,m):1,y=t?t.capabilities[m].read:null,b=r.capabilities[m].write;if(0===g)n="not-applicable";else n=y?d[Math.max(d.indexOf(y),d.indexOf(b))]:b;"not-applicable"!==n&&(s+=c[m]*f[n],o+=c[m]);let v=g>0&&("unsupported"===n||"manual"===n&&p.includes(m));v&&h.push("unsupported"===n?`${u[m]}: ${r.displayName} has no place for ${1===g?"1 item":`${g} items`}, so ${1===g?"it is":"they are"} not moved. Nomad keeps a copy and gives you steps to set ${1===g?"it":"them"} up another way.`:`${u[m]}: you finish setting up ${1===g?"1 item":`${g} items`} in ${r.displayName} yourself. Nomad lists the steps.`),i.push({category:m,label:u[m],status:n,statusLabel:l[n],items:g,sourceRead:y,destinationWrite:b,explanation:function(e,t,n,r,i){let s=n.capabilities[e].notes,o=(()=>{switch(t){case"not-applicable":return"The agent has nothing in this category.";case"full":return`${n.displayName} stores this natively.`;case"convert":return`${n.displayName} stores this in a different structure, so Nomad converts it.`;case"manual":return`Nomad keeps the definition, but you finish setup in ${n.displayName}.`;case"unsupported":return`${n.displayName} has no equivalent. The data is kept in the package and listed in the report.`}})(),a="";if("permissions"===e&&i&&"full"!==t&&"not-applicable"!==t){let e=i.permissions.rules.filter(e=>"allow"!==e.effect).length;e&&(a=` ${e} restriction(s) may not be enforced by the destination.`)}return"workflows"===e&&r&&(a+=" Imported routines always start disabled."),[o,s,a.trim()].filter(Boolean).join(" ")}(m,n,r,g,e),attention:v})}let m=o?Math.round(s/o*100):null;return{source:t?.id??null,destination:r.id,categories:i,score:m,scoreExplanation:"Each category the agent uses counts with a weight (instructions and memory 3, identity, skills, tools and permissions 2, the rest 1). Fully supported counts 100%, converted 75%, manual setup 40%, unsupported 0%. The score is the weighted average. Categories the agent does not use are left out. Items flagged for attention matter even when the score is high.",attention:h}}],73906)},73187,89089,e=>{"use strict";let t,n=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),r=new TextEncoder,i=new TextDecoder("utf-8",{fatal:!1});function s(e){return r.encode(e)}e.s(["B",0,function(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n},"w",0,function(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode(...e.subarray(n,n+32768));return btoa(t)},"Z",0,function(e){return JSON.stringify(function e(t){if(Array.isArray(t))return t.map(e);if(t&&"object"==typeof t){let n={};for(let r of Object.keys(t).sort()){let i=t[r];void 0!==i&&(n[r]=e(i))}return n}return t}(e))},"r",0,function(e){return i.decode(e)},"E",0,function(e){let t="string"==typeof e?s(e):e,r=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),i=8*t.length,o=new Uint8Array(t.length+9+63>>6<<6);o.set(t),o[t.length]=128;let a=new DataView(o.buffer);a.setUint32(o.length-8,Math.floor(i/0x100000000)),a.setUint32(o.length-4,i>>>0);let l=new Uint32Array(64);for(let e=0;e<o.length;e+=64){for(let t=0;t<16;t++)l[t]=a.getUint32(e+4*t);for(let e=16;e<64;e++){let t=l[e-15],n=l[e-2],r=(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3,i=(n>>>17|n<<15)^(n>>>19|n<<13)^n>>>10;l[e]=l[e-16]+r+l[e-7]+i>>>0}let t=r[0],i=r[1],s=r[2],o=r[3],u=r[4],c=r[5],f=r[6],d=r[7];for(let e=0;e<64;e++){let r=d+((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&c^~u&f)+n[e]+l[e]>>>0,a=((t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10))+(t&i^t&s^i&s)>>>0;d=f,f=c,c=u,u=o+r>>>0,o=s,s=i,i=t,t=r+a>>>0}r[0]=r[0]+t>>>0,r[1]=r[1]+i>>>0,r[2]=r[2]+s>>>0,r[3]=r[3]+o>>>0,r[4]=r[4]+u>>>0,r[5]=r[5]+c>>>0,r[6]=r[6]+f>>>0,r[7]=r[7]+d>>>0}return Array.from(r,e=>e.toString(16).padStart(8,"0")).join("")},"J",0,s],73187);let o=Symbol.for("yaml.alias"),a=Symbol.for("yaml.document"),l=Symbol.for("yaml.map"),u=Symbol.for("yaml.pair"),c=Symbol.for("yaml.scalar"),f=Symbol.for("yaml.seq"),d=Symbol.for("yaml.node.type"),p=e=>!!e&&"object"==typeof e&&e[d]===o,h=e=>!!e&&"object"==typeof e&&e[d]===a,m=e=>!!e&&"object"==typeof e&&e[d]===l,g=e=>!!e&&"object"==typeof e&&e[d]===u,y=e=>!!e&&"object"==typeof e&&e[d]===c,b=e=>!!e&&"object"==typeof e&&e[d]===f;function v(e){if(e&&"object"==typeof e)switch(e[d]){case l:case f:return!0}return!1}function w(e){if(e&&"object"==typeof e)switch(e[d]){case o:case l:case c:case f:return!0}return!1}let k=e=>(y(e)||v(e))&&!!e.anchor,_=Symbol("break visit"),S=Symbol("skip children"),O=Symbol("remove node");function x(e,t){let n=A(t);h(e)?$(null,e.contents,n,Object.freeze([e]))===O&&(e.contents=null):$(null,e,n,Object.freeze([]))}function $(e,t,n,r){let i=N(e,t,n,r);if(w(i)||g(i))return T(e,r,i),$(e,i,n,r);if("symbol"!=typeof i){if(v(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=$(e,t.items[e],n,r);if("number"==typeof i)e=i-1;else{if(i===_)return _;i===O&&(t.items.splice(e,1),e-=1)}}}else if(g(t)){r=Object.freeze(r.concat(t));let e=$("key",t.key,n,r);if(e===_)return _;e===O&&(t.key=null);let i=$("value",t.value,n,r);if(i===_)return _;i===O&&(t.value=null)}}return i}async function z(e,t){let n=A(t);h(e)?await E(null,e.contents,n,Object.freeze([e]))===O&&(e.contents=null):await E(null,e,n,Object.freeze([]))}async function E(e,t,n,r){let i=await N(e,t,n,r);if(w(i)||g(i))return T(e,r,i),E(e,i,n,r);if("symbol"!=typeof i){if(v(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=await E(e,t.items[e],n,r);if("number"==typeof i)e=i-1;else{if(i===_)return _;i===O&&(t.items.splice(e,1),e-=1)}}}else if(g(t)){r=Object.freeze(r.concat(t));let e=await E("key",t.key,n,r);if(e===_)return _;e===O&&(t.key=null);let i=await E("value",t.value,n,r);if(i===_)return _;i===O&&(t.value=null)}}return i}function A(e){return"object"==typeof e&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function N(e,t,n,r){return"function"==typeof n?n(e,t,r):m(t)?n.Map?.(e,t,r):b(t)?n.Seq?.(e,t,r):g(t)?n.Pair?.(e,t,r):y(t)?n.Scalar?.(e,t,r):p(t)?n.Alias?.(e,t,r):void 0}function T(e,t,n){let r=t[t.length-1];if(v(r))r.items[e]=n;else if(g(r))"key"===e?r.key=n:r.value=n;else if(h(r))r.contents=n;else{let e=p(r)?"alias":"scalar";throw Error(`Cannot replace node with ${e} parent`)}}x.BREAK=_,x.SKIP=S,x.REMOVE=O,z.BREAK=_,z.SKIP=S,z.REMOVE=O;let I={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},j=e=>e.replace(/[!,[\]{}]/g,e=>I[e]);class P{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},P.defaultYaml,e),this.tags=Object.assign({},P.defaultTags,t)}clone(){let e=new P(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new P(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:P.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},P.defaultTags)}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:P.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},P.defaultTags),this.atNextDocument=!1);let n=e.trim().split(/[ \t]+/),r=n.shift();switch(r){case"%TAG":{if(2!==n.length&&(t(0,"%TAG directive should contain exactly two parts"),n.length<2))return!1;let[e,r]=n;return this.tags[e]=r,!0}case"%YAML":{if(this.yaml.explicit=!0,1!==n.length)return t(0,"%YAML directive should contain exactly one part"),!1;let[e]=n;if("1.1"===e||"1.2"===e)return this.yaml.version=e,!0;{let n=/^\d+\.\d+$/.test(e);return t(6,`Unsupported YAML version ${e}`,n),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if("!"===e)return"!";if("!"!==e[0])return t(`Not a valid tag: ${e}`),null;if("<"===e[1]){let n=e.slice(2,-1);return"!"===n||"!!"===n?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(">"!==e[e.length-1]&&t("Verbatim tags must end with a >"),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return"!"===n?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+j(e.substring(n.length));return"!"===e[0]?e:`!<${e}>`}toString(e){let t,n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);if(e&&r.length>0&&w(e.contents)){let n={};x(e.contents,(e,t)=>{w(t)&&t.tag&&(n[t.tag]=!0)}),t=Object.keys(n)}else t=[];for(let[i,s]of r)("!!"!==i||"tag:yaml.org,2002:"!==s)&&(!e||t.some(e=>e.startsWith(s)))&&n.push(`%TAG ${i} ${s}`);return n.join("\n")}}function C(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=JSON.stringify(e);throw Error(`Anchor must not contain whitespace or control characters: ${t}`)}return!0}function L(e){let t=new Set;return x(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function D(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function M(e,t,n,r){if(r&&"object"==typeof r)if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=M(e,r,String(t),n);void 0===i?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=M(e,r,t,n);void 0===i?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=M(e,r,t,t);void 0===n?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=M(e,r,t,n);void 0===i?delete r[t]:i!==n&&(r[t]=i)}return e.call(t,n,r)}function R(e,t,n){if(Array.isArray(e))return e.map((e,t)=>R(e,String(t),n));if(e&&"function"==typeof e.toJSON){if(!n||!k(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return"bigint"!=typeof e||n?.keep?e:Number(e)}P.defaultYaml={explicit:!1,version:"1.2"},P.defaultTags={"!!":"tag:yaml.org,2002:"};class Z{constructor(e){Object.defineProperty(this,d,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!h(e))throw TypeError("A document argument is required");let s={anchors:new Map,doc:e,keep:!0,mapAsMap:!0===t,mapKeyWarned:!1,maxAliasCount:"number"==typeof n?n:100},o=R(this,"",s);if("function"==typeof r)for(let{count:e,res:t}of s.anchors.values())r(t,e);return"function"==typeof i?M(i,{"":o},"",o):o}}class B extends Z{constructor(e){super(o),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){let n,r;if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");for(let i of(t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],x(e,{Node:(e,t)=>{(p(t)||k(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n)),n)){if(i===this)break;i.anchor===this.source&&(r=i)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,s=e.get(r);if(s||(R(r,null,t),s=e.get(r)),s?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(i>=0&&(s.count+=1,0===s.aliasCount&&(s.aliasCount=function e(t,n,r){if(p(n)){let e=n.resolve(t),i=r&&e&&r.get(e);return i?i.count*i.aliasCount:0}if(v(n)){let i=0;for(let s of n.items){let n=e(t,s,r);n>i&&(i=n)}return i}return g(n)?Math.max(e(t,n.key,r),e(t,n.value,r)):1}(n,r,e)),s.count*s.aliasCount>i))throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n)throw ReferenceError(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(C(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source))throw Error(`Unresolved alias (the anchor must be set before the alias): ${this.source}`);if(e.implicitKey)return`${r} `}return r}}let U=e=>!e||"function"!=typeof e&&"object"!=typeof e;class F extends Z{constructor(e){super(c),this.value=e}toJSON(e,t){return t?.keep?this.value:R(this.value,e,t)}toString(){return String(this.value)}}function K(e,t,n){let r;if(h(e)&&(e=e.contents),w(e))return e;if(g(e)){let t=n.schema[l].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||"u">typeof BigInt&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:i,onAnchor:s,onTagObj:o,schema:a,sourceObjects:u}=n;if(i&&e&&"object"==typeof e){if(r=u.get(e))return r.anchor??(r.anchor=s(e)),new B(r.anchor);r={anchor:null,node:null},u.set(e,r)}t?.startsWith("!!")&&(t="tag:yaml.org,2002:"+t.slice(2));let c=function(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}(e,t,a.tags);if(!c){if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),!e||"object"!=typeof e){let t=new F(e);return r&&(r.node=t),t}c=e instanceof Map?a[l]:Symbol.iterator in Object(e)?a[f]:a[l]}o&&(o(c),delete n.onTagObj);let d=c?.createNode?c.createNode(n.schema,e,n):"function"==typeof c?.nodeClass?.from?c.nodeClass.from(n.schema,e,n):new F(e);return t?d.tag=t:c.default||(d.tag=c.tag),r&&(r.node=d),d}function q(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if("number"==typeof n&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return K(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}F.BLOCK_FOLDED="BLOCK_FOLDED",F.BLOCK_LITERAL="BLOCK_LITERAL",F.PLAIN="PLAIN",F.QUOTE_DOUBLE="QUOTE_DOUBLE",F.QUOTE_SINGLE="QUOTE_SINGLE";let J=e=>null==e||"object"==typeof e&&!!e[Symbol.iterator]().next().done;class V extends Z{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>w(t)||g(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(J(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(v(i))i.addIn(r,t);else if(void 0===i&&this.schema)this.set(n,q(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(0===n.length)return this.delete(t);let r=this.get(t,!0);if(v(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return 0===r.length?!t&&y(i)?i.value:i:v(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!g(t))return!1;let n=t.value;return null==n||e&&y(n)&&null==n.value&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(0===n.length)return this.has(t);let r=this.get(t,!0);return!!v(r)&&r.hasIn(n)}setIn(e,t){let[n,...r]=e;if(0===r.length)this.set(n,t);else{let e=this.get(n,!0);if(v(e))e.setIn(r,t);else if(void 0===e&&this.schema)this.set(n,q(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}}let W=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function G(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}let Y=(e,t,n)=>e.endsWith("\n")?G(n,t):n.includes("\n")?"\n"+G(n,t):(e.endsWith(" ")?"":" ")+n,X="flow",H="block",Q="quoted";function ee(e,t,n="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){let l,u,c;if(!i||i<0)return e;i<s&&(s=0);let f=Math.max(1+s,1+i-t.length);if(e.length<=f)return e;let d=[],p={},h=i-t.length;"number"==typeof r&&(r>i-Math.max(2,s)?d.push(0):h=i-r);let m=!1,g=-1,y=-1,b=-1;for(n===H&&-1!==(g=et(e,g,t.length))&&(h=g+f);c=e[g+=1];){if(n===Q&&"\\"===c){switch(y=g,e[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if("\n"===c)n===H&&(g=et(e,g,t.length)),h=g+t.length+f,l=void 0;else{if(" "===c&&u&&" "!==u&&"\n"!==u&&" "!==u){let t=e[g+1];t&&" "!==t&&"\n"!==t&&" "!==t&&(l=g)}if(g>=h)if(l)d.push(l),h=l+f,l=void 0;else if(n===Q){for(;" "===u||" "===u;)u=c,c=e[g+=1],m=!0;let t=g>b+1?g-2:y-1;if(p[t])return e;d.push(t),p[t]=!0,h=t+f,l=void 0}else m=!0}u=c}if(m&&a&&a(),0===d.length)return e;o&&o();let v=e.slice(0,d[0]);for(let r=0;r<d.length;++r){let i=d[r],s=d[r+1]||e.length;0===i?v=`
|
|
2
2
|
${t}${e.slice(0,s)}`:(n===Q&&p[i]&&(v+=`${e[i]}\\`),v+=`
|
|
3
3
|
${t}${e.slice(i+1,s)}`)}return v}function et(e,t,n){let r=t,i=t+1,s=e[i];for(;" "===s||" "===s;)if(t<i+n)s=e[++t];else{do s=e[++t];while(s&&"\n"!==s)r=t,s=e[i=t+1]}return r}let en=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth});function er(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,s=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),o="",a=0;for(let e=0,t=n[e];t;t=n[++e])if(" "===t&&"\\"===n[e+1]&&"n"===n[e+2]&&(o+=n.slice(a,e)+"\\ ",e+=1,a=e,t="\\"),"\\"===t)switch(n[e+1]){case"u":{o+=n.slice(a,e);let t=n.substr(e+2,4);switch(t){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:"00"===t.substr(0,2)?o+="\\x"+t.substr(2):o+=n.substr(e,6)}e+=5,a=e+1}break;case"n":if(r||'"'===n[e+2]||n.length<i)e+=1;else{for(o+=n.slice(a,e)+"\n\n";"\\"===n[e+2]&&"n"===n[e+3]&&'"'!==n[e+4];)o+="\n",e+=2;o+=s," "===n[e+2]&&(o+="\\"),e+=1,a=e+1}break;default:e+=1}return o=a?o+n.slice(a):n,r?o:ee(o,s,Q,en(t,!1))}function ei(e,t){if(!1===t.options.singleQuote||t.implicitKey&&e.includes("\n")||/[ \t]\n|\n[ \t]/.test(e))return er(e,t);let n=t.indent||(/^(%|---|\.\.\.)/m.test(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
4
|
-
${n}`)+"'";return t.implicitKey?r:ee(r,n,X,en(t,!1))}function es(e,t){let n,{singleQuote:r}=t.options;if(!1===r)n=er;else{let t=e.includes('"'),i=e.includes("'");n=t&&!i?ei:i&&!t?er:r?ei:er}return n(e,t)}try{t=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{t=/\n+(?!\n|$)/g}function eo({comment:e,type:n,value:r},i,s,o){let a,l,u,c,{blockQuote:f,commentString:d,lineWidth:p}=i.options;if(!f||/\n[\t ]+$/.test(r))return es(r,i);let h=i.indent||(i.forceBlockIndent||(c=r,/^(%|---|\.\.\.)/m.test(c))?" ":""),m="literal"===f||"folded"!==f&&n!==F.BLOCK_FOLDED&&(n===F.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if("\n"===e[t]){if(t-n>r)return!0;if(i-(n=t+1)<=r)return!1}return!0}(r,p,h.length));if(!r)return m?"|\n":">\n";for(l=r.length;l>0;--l){let e=r[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let g=r.substring(l),y=g.indexOf("\n");-1===y?a="-":r===g||y!==g.length-1?(a="+",o&&o()):a="",g&&(r=r.slice(0,-g.length),"\n"===g[g.length-1]&&(g=g.slice(0,-1)),g=g.replace(t,`$&${h}`));let b=!1,v=-1;for(u=0;u<r.length;++u){let e=r[u];if(" "===e)b=!0;else if("\n"===e)v=u;else break}let
|
|
4
|
+
${n}`)+"'";return t.implicitKey?r:ee(r,n,X,en(t,!1))}function es(e,t){let n,{singleQuote:r}=t.options;if(!1===r)n=er;else{let t=e.includes('"'),i=e.includes("'");n=t&&!i?ei:i&&!t?er:r?ei:er}return n(e,t)}try{t=RegExp("(^|(?<!\n))\n+(?!\n|$)","g")}catch{t=/\n+(?!\n|$)/g}function eo({comment:e,type:n,value:r},i,s,o){let a,l,u,c,{blockQuote:f,commentString:d,lineWidth:p}=i.options;if(!f||/\n[\t ]+$/.test(r))return es(r,i);let h=i.indent||(i.forceBlockIndent||(c=r,/^(%|---|\.\.\.)/m.test(c))?" ":""),m="literal"===f||"folded"!==f&&n!==F.BLOCK_FOLDED&&(n===F.BLOCK_LITERAL||!function(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if("\n"===e[t]){if(t-n>r)return!0;if(i-(n=t+1)<=r)return!1}return!0}(r,p,h.length));if(!r)return m?"|\n":">\n";for(l=r.length;l>0;--l){let e=r[l-1];if("\n"!==e&&" "!==e&&" "!==e)break}let g=r.substring(l),y=g.indexOf("\n");-1===y?a="-":r===g||y!==g.length-1?(a="+",o&&o()):a="",g&&(r=r.slice(0,-g.length),"\n"===g[g.length-1]&&(g=g.slice(0,-1)),g=g.replace(t,`$&${h}`));let b=!1,v=-1;for(u=0;u<r.length;++u){let e=r[u];if(" "===e)b=!0;else if("\n"===e)v=u;else break}let w=r.substring(0,v<u?v+1:u);w&&(r=r.substring(w.length),w=w.replace(/\n+/g,`$&${h}`));let k=h?"2":"1",_=(b?k:"")+a;if(e&&(_+=" "+d(e.replace(/ ?[\r\n]+/g," ")),s&&s()),!m){let e=r.replace(/\n+/g,"\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`),t=!1,s=en(i,!0);"folded"!==f&&n!==F.BLOCK_FOLDED&&(s.onOverflow=()=>{t=!0});let o=ee(`${w}${e}${g}`,h,H,s);if(!t)return`>${_}
|
|
5
5
|
${h}${o}`}return r=r.replace(/\n+/g,`$&${h}`),`|${_}
|
|
6
|
-
${h}${
|
|
7
|
-
${l}`);if(o){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return es(s,t)}return a?f:ee(f,l,X,en(t,!1))}(o,t,n,r);default:return null}},u=l(a);if(null===u){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(null===(u=l(r)))throw Error(`Unsupported default string type ${r}`)}return u}function el(e,t){let n,r=Object.assign({blockQuote:!0,commentString:W,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:n,options:r}}function eu(e,t,n,r){let i;if(g(e))return e.toString(t,n,r);if(p(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s=
|
|
8
|
-
${t.indent}${a}`:a}function ec(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let ef={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new F(Symbol("<<")),{addToJSMap:ed}),stringify:()=>"<<"};function ed(e,t,n){let r=eh(e,n);if(b(r))for(let n of r.items)ep(e,t,n);else if(Array.isArray(r))for(let n of r)ep(e,t,n);else ep(e,t,r)}function ep(e,t,n){let r=eh(e,n);if(!m(r))throw Error("Merge sources must be maps or map aliases");for(let[n,i]of r.toJSON(null,e,Map))t instanceof Map?t.has(n)||t.set(n,i):t instanceof Set?t.add(n):Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function eh(e,t){return e&&p(t)?t.resolve(e.doc,e):t}function em(e,t,{key:n,value:r}){if(
|
|
9
|
-
${c}:`):(S=`${S}:`,m&&(S+=Y(S,n.indent,d(m)))),
|
|
6
|
+
${h}${w}${r}${g}`}function ea(e,t,n,r){let{implicitKey:i,inFlow:s}=t,o="string"==typeof e.value?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;a!==F.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=F.QUOTE_DOUBLE);let l=e=>{switch(e){case F.BLOCK_FOLDED:case F.BLOCK_LITERAL:return i||s?es(o.value,t):eo(o,t,n,r);case F.QUOTE_DOUBLE:return er(o.value,t);case F.QUOTE_SINGLE:return ei(o.value,t);case F.PLAIN:return function(e,t,n,r){let{type:i,value:s}=e,{actualString:o,implicitKey:a,indent:l,indentStep:u,inFlow:c}=t;if(a&&s.includes("\n")||c&&/[[\]{},]/.test(s))return es(s,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||c||!s.includes("\n")?es(s,t):eo(e,t,n,r);if(!a&&!c&&i!==F.PLAIN&&s.includes("\n"))return eo(e,t,n,r);if(/^(%|---|\.\.\.)/m.test(s)){if(""===l)return t.forceBlockIndent=!0,eo(e,t,n,r);else if(a&&l===u)return es(s,t)}let f=s.replace(/\n+/g,`$&
|
|
7
|
+
${l}`);if(o){let e=e=>e.default&&"tag:yaml.org,2002:str"!==e.tag&&e.test?.test(f),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return es(s,t)}return a?f:ee(f,l,X,en(t,!1))}(o,t,n,r);default:return null}},u=l(a);if(null===u){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(null===(u=l(r)))throw Error(`Unsupported default string type ${r}`)}return u}function el(e,t){let n,r=Object.assign({blockQuote:!0,commentString:W,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);switch(r.collectionStyle){case"block":n=!1;break;case"flow":n=!0;break;default:n=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:"number"==typeof r.indent?" ".repeat(r.indent):" ",inFlow:n,options:r}}function eu(e,t,n,r){let i;if(g(e))return e.toString(t,n,r);if(p(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let s=w(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??(i=function(e,t){let n,r;if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}if(y(t)){n=t.value;let i=e.filter(e=>e.identify?.(n));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}r=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else n=t,r=e.find(e=>e.nodeClass&&n instanceof e.nodeClass);if(!r){let e=n?.constructor?.name??(null===n?"null":typeof n);throw Error(`Tag not resolved for ${e} value`)}return r}(t.doc.schema.tags,s));let o=function(e,t,{anchors:n,doc:r}){if(!r.directives)return"";let i=[],s=(y(e)||v(e))&&e.anchor;s&&C(s)&&(n.add(s),i.push(`&${s}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}(s,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let a="function"==typeof i.stringify?i.stringify(s,t,n,r):y(s)?ea(s,t,n,r):s.toString(t,n,r);return o?y(s)||"{"===a[0]||"["===a[0]?`${o} ${a}`:`${o}
|
|
8
|
+
${t.indent}${a}`:a}function ec(e,t){("debug"===e||"warn"===e)&&console.warn(t)}let ef={identify:e=>"<<"===e||"symbol"==typeof e&&"<<"===e.description,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new F(Symbol("<<")),{addToJSMap:ed}),stringify:()=>"<<"};function ed(e,t,n){let r=eh(e,n);if(b(r))for(let n of r.items)ep(e,t,n);else if(Array.isArray(r))for(let n of r)ep(e,t,n);else ep(e,t,r)}function ep(e,t,n){let r=eh(e,n);if(!m(r))throw Error("Merge sources must be maps or map aliases");for(let[n,i]of r.toJSON(null,e,Map))t instanceof Map?t.has(n)||t.set(n,i):t instanceof Set?t.add(n):Object.prototype.hasOwnProperty.call(t,n)||Object.defineProperty(t,n,{value:i,writable:!0,enumerable:!0,configurable:!0});return t}function eh(e,t){return e&&p(t)?t.resolve(e.doc,e):t}function em(e,t,{key:n,value:r}){if(w(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if((ef.identify(n)||y(n)&&(!n.type||n.type===F.PLAIN)&&ef.identify(n.value))&&e?.doc.schema.tags.some(e=>e.tag===ef.tag&&e.default))ed(e,t,r);else{let i=R(n,"",e);if(t instanceof Map)t.set(i,R(r,i,e));else if(t instanceof Set)t.add(i);else{let s=function(e,t,n){if(null===t)return"";if("object"!=typeof t)return String(t);if(w(e)&&n?.doc){let t=el(n.doc,{});for(let e of(t.anchors=new Set,n.anchors.keys()))t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+'..."'),ec(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}(n,i,e),o=R(r,s,e);s in t?Object.defineProperty(t,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[s]=o}}return t}function eg(e,t,n){return new ey(K(e,void 0,n),K(t,void 0,n))}class ey{constructor(e,t=null){Object.defineProperty(this,d,{value:u}),this.key=e,this.value=t}clone(e){let{key:t,value:n}=this;return w(t)&&(t=t.clone(e)),w(n)&&(n=n.clone(e)),new ey(t,n)}toJSON(e,t){let n=t?.mapAsMap?new Map:{};return em(t,n,this)}toString(e,t,n){return e?.doc?function({key:e,value:t},n,r,i){let s,o,a,{allNullValues:l,doc:u,indent:c,indentStep:f,options:{commentString:d,indentSeq:p,simpleKeys:h}}=n,m=w(e)&&e.comment||null;if(h){if(m)throw Error("With simple keys, key nodes cannot have comments");if(v(e)||!w(e)&&"object"==typeof e)throw Error("With simple keys, collection cannot be used as a key value")}let g=!h&&(!e||m&&null==t&&!n.inFlow||v(e)||(y(e)?e.type===F.BLOCK_FOLDED||e.type===F.BLOCK_LITERAL:"object"==typeof e));n=Object.assign({},n,{allNullValues:!1,implicitKey:!g&&(h||!l),indent:c+f});let k=!1,_=!1,S=eu(e,n,()=>k=!0,()=>_=!0);if(!g&&!n.inFlow&&S.length>1024){if(h)throw Error("With simple keys, single line scalar must not span more than 1024 characters");g=!0}if(n.inFlow){if(l||null==t)return k&&r&&r(),""===S?"?":g?`? ${S}`:S}else if(l&&!h||null==t&&g)return S=`? ${S}`,m&&!k?S+=Y(S,n.indent,d(m)):_&&i&&i(),S;k&&(m=null),g?(m&&(S+=Y(S,n.indent,d(m))),S=`? ${S}
|
|
9
|
+
${c}:`):(S=`${S}:`,m&&(S+=Y(S,n.indent,d(m)))),w(t)?(s=!!t.spaceBefore,o=t.commentBefore,a=t.comment):(s=!1,o=null,a=null,t&&"object"==typeof t&&(t=u.createNode(t))),n.implicitKey=!1,!g&&!m&&y(t)&&(n.indentAtStart=S.length+1),_=!1,!(!p&&f.length>=2&&!n.inFlow&&!g&&b(t))||t.flow||t.tag||t.anchor||(n.indent=n.indent.substring(2));let O=!1,x=eu(t,n,()=>O=!0,()=>_=!0),$=" ";if(m||s||o){if($=s?"\n":"",o){let e=d(o);$+=`
|
|
10
10
|
${G(e,n.indent)}`}""!==x||n.inFlow?$+=`
|
|
11
11
|
${n.indent}`:"\n"===$&&a&&($="\n\n")}else if(!g&&v(t)){let e=x[0],r=x.indexOf("\n"),i=-1!==r,s=n.inFlow??t.flow??0===t.items.length;if(i||!s){let t=!1;if(i&&("&"===e||"!"===e)){let n=x.indexOf(" ");"&"===e&&-1!==n&&n<r&&"!"===x[n+1]&&(n=x.indexOf(" ",n+1)),(-1===n||r<n)&&(t=!0)}t||($=`
|
|
12
|
-
${n.indent}`)}}else(""===x||"\n"===x[0])&&($="");return S+=$+x,n.inFlow?O&&r&&r():a&&!O?S+=Y(S,n.indent,d(a)):_&&i&&i(),S}(this,e,t,n):JSON.stringify(this)}}function eb(e,t,n){return(t.inFlow??e.flow?function({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=t,l=Object.assign({},t,{indent:r+=s,inFlow:!0,type:null}),u=!1,c=0,f=[];for(let n=0;n<e.length;++n){let i=e[n],s=null;if(
|
|
12
|
+
${n.indent}`)}}else(""===x||"\n"===x[0])&&($="");return S+=$+x,n.inFlow?O&&r&&r():a&&!O?S+=Y(S,n.indent,d(a)):_&&i&&i(),S}(this,e,t,n):JSON.stringify(this)}}function eb(e,t,n){return(t.inFlow??e.flow?function({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=t,l=Object.assign({},t,{indent:r+=s,inFlow:!0,type:null}),u=!1,c=0,f=[];for(let n=0;n<e.length;++n){let i=e[n],s=null;if(w(i))i.spaceBefore&&f.push(""),ev(t,f,i.commentBefore,!1),i.comment&&(s=i.comment);else if(g(i)){let e=w(i.key)?i.key:null;e&&(e.spaceBefore&&f.push(""),ev(t,f,e.commentBefore,!1),e.comment&&(u=!0));let n=w(i.value)?i.value:null;n?(n.comment&&(s=n.comment),n.commentBefore&&(u=!0)):null==i.value&&e?.comment&&(s=e.comment)}s&&(u=!0);let o=eu(i,l,()=>s=null);u||(u=f.length>c||o.includes("\n")),n<e.length-1?o+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(u||(u=f.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth)),u&&(o+=",")),s&&(o+=Y(o,r,a(s))),f.push(o),c=f.length}let{start:d,end:p}=n;if(0===f.length)return d+p;if(!u){let e=f.reduce((e,t)=>e+t.length+2,2);u=t.options.lineWidth>0&&e>t.options.lineWidth}if(!u)return`${d}${o}${f.join(" ")}${o}${p}`;{let e=d;for(let t of f)e+=t?`
|
|
13
13
|
${s}${i}${t}`:"\n";return`${e}
|
|
14
|
-
${i}${p}`}}:function({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let l,{indent:u,options:{commentString:c}}=n,f=Object.assign({},n,{indent:s,type:null}),d=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(
|
|
15
|
-
${u}${t}`:"\n"}}return e?(l+="\n"+G(c(e),u),a&&a()):d&&o&&o(),l})(e,t,n)}function ev({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let i=G(t(r),e);n.push(i.trimStart())}}function
|
|
14
|
+
${i}${p}`}}:function({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){let l,{indent:u,options:{commentString:c}}=n,f=Object.assign({},n,{indent:s,type:null}),d=!1,p=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(w(i))!d&&i.spaceBefore&&p.push(""),ev(n,p,i.commentBefore,d),i.comment&&(o=i.comment);else if(g(i)){let e=w(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&p.push(""),ev(n,p,e.commentBefore,d))}d=!1;let a=eu(i,f,()=>o=null,()=>d=!0);o&&(a+=Y(a,s,c(o))),d&&o&&(d=!1),p.push(r+a)}if(0===p.length)l=i.start+i.end;else{l=p[0];for(let e=1;e<p.length;++e){let t=p[e];l+=t?`
|
|
15
|
+
${u}${t}`:"\n"}}return e?(l+="\n"+G(c(e),u),a&&a()):d&&o&&o(),l})(e,t,n)}function ev({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){let i=G(t(r),e);n.push(i.trimStart())}}function ew(e,t){let n=y(t)?t.value:t;for(let r of e)if(g(r)&&(r.key===t||r.key===n||y(r.key)&&r.key.value===n))return r}class ek extends V{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(l,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,s=new this(e),o=(e,o)=>{if("function"==typeof i)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(void 0!==o||r)&&s.items.push(eg(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&"object"==typeof t)for(let e of Object.keys(t))o(e,t[e]);return"function"==typeof e.sortMapEntries&&s.items.sort(e.sortMapEntries),s}add(e,t){let n;n=g(e)?e:e&&"object"==typeof e&&"key"in e?new ey(e.key,e.value):new ey(e,e?.value);let r=ew(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);y(r.value)&&U(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>0>i(n,e));-1===e?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=ew(this.items,e);return!!t&&this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let n=ew(this.items,e),r=n?.value;return(!t&&y(r)?r.value:r)??void 0}has(e){return!!ew(this.items,e)}set(e,t){this.add(new ey(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};for(let e of(t?.onCreate&&t.onCreate(r),this.items))em(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!g(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),eb(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:n,onComment:t})}}let e_={collection:"map",default:!0,nodeClass:ek,tag:"tag:yaml.org,2002:map",resolve:(e,t)=>(m(e)||t("Expected a mapping for this tag"),e),createNode:(e,t,n)=>ek.from(e,t,n)};class eS extends V{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(f,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=eO(e);return"number"==typeof t&&this.items.splice(t,1).length>0}get(e,t){let n=eO(e);if("number"!=typeof n)return;let r=this.items[n];return!t&&y(r)?r.value:r}has(e){let t=eO(e);return"number"==typeof t&&t<this.items.length}set(e,t){let n=eO(e);if("number"!=typeof n)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];y(r)&&U(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(R(e,String(r++),t));return n}toString(e,t,n){return e?eb(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let s of t){if("function"==typeof r){let n=t instanceof Set?s:String(e++);s=r.call(t,n,s)}i.items.push(K(s,void 0,n))}}return i}}function eO(e){let t=y(e)?e.value:e;return t&&"string"==typeof t&&(t=Number(t)),"number"==typeof t&&Number.isInteger(t)&&t>=0?t:null}let ex={collection:"seq",default:!0,nodeClass:eS,tag:"tag:yaml.org,2002:seq",resolve:(e,t)=>(b(e)||t("Expected a sequence for this tag"),e),createNode:(e,t,n)=>eS.from(e,t,n)},e$={identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:(e,t,n,r)=>ea(e,t=Object.assign({actualString:!0},t),n,r)},ez={identify:e=>null==e,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new F(null),stringify:({source:e},t)=>"string"==typeof e&&ez.test.test(e)?e:t.options.nullStr},eE={identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new F("t"===e[0]||"T"===e[0]),stringify:({source:e,value:t},n)=>e&&eE.test.test(e)&&t===("t"===e[0]||"T"===e[0])?e:t?n.options.trueStr:n.options.falseStr};function eA({format:e,minFractionDigits:t,tag:n,value:r}){if("bigint"==typeof r)return String(r);let i="number"==typeof r?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||"tag:yaml.org,2002:float"===n)&&/^-?\d/.test(s)&&!s.includes("e")){let e=s.indexOf(".");e<0&&(e=s.length,s+=".");let n=t-(s.length-e-1);for(;n-- >0;)s+="0"}return s}let eN={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:eA},eT={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eA(e)}},eI={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new F(parseFloat(e)),n=e.indexOf(".");return -1!==n&&"0"===e[e.length-1]&&(t.minFractionDigits=e.length-n-1),t},stringify:eA},ej=e=>"bigint"==typeof e||Number.isInteger(e),eP=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function eC(e,t,n){let{value:r}=e;return ej(r)&&r>=0?n+r.toString(t):eA(e)}let eL={identify:e=>ej(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>eP(e,2,8,n),stringify:e=>eC(e,8,"0o")},eD={identify:ej,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>eP(e,0,10,n),stringify:eA},eM={identify:e=>ej(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>eP(e,2,16,n),stringify:e=>eC(e,16,"0x")},eR=[e_,ex,e$,ez,eE,eL,eD,eM,eN,eT,eI];function eZ(e){return"bigint"==typeof e||Number.isInteger(e)}let eB=({value:e})=>JSON.stringify(e),eU=[e_,ex].concat([{identify:e=>"string"==typeof e,default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:eB},{identify:e=>null==e,createNode:()=>new F(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:eB},{identify:e=>"boolean"==typeof e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>"true"===e,stringify:eB},{identify:eZ,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>eZ(e)?e.toString():JSON.stringify(e)},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:eB}],{default:!0,tag:"",test:/^/,resolve:(e,t)=>(t(`Unresolved plain scalar ${JSON.stringify(e)}`),e)}),eF={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if("function"!=typeof atob)return t("This environment does not support reading binary tags; either Buffer or atob is required"),e;{let t=atob(e.replace(/[\n\r]/g,"")),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}},stringify({comment:e,type:t,value:n},r,i,s){let o;if(!n)return"";if("function"==typeof btoa){let e="";for(let t=0;t<n.length;++t)e+=String.fromCharCode(n[t]);o=btoa(e)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=F.BLOCK_LITERAL),t!==F.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(o.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=o.substr(r,e);o=i.join(t===F.BLOCK_LITERAL?"\n":" ")}return ea({comment:e,type:t,value:o},r,i,s)}};function eK(e,t){if(b(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!g(r)){if(m(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");let e=r.items[0]||new ey(new F(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}
|
|
16
16
|
${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}
|
|
17
|
-
${t.comment}`:r.comment}r=e}e.items[n]=g(r)?r:new ey(r)}}else t("Expected a sequence for this tag");return e}function eq(e,t,n){let{replacer:r}=n,i=new eS(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,a;if("function"==typeof r&&(e=r.call(t,String(s++),e)),Array.isArray(e))if(2===e.length)o=e[0],a=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)a=e[o=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(eg(o,a,n))}return i}let eJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eK,createNode:eq};class eV extends eS{constructor(){super(),this.add=ew.prototype.add.bind(this),this.delete=ew.prototype.delete.bind(this),this.get=ew.prototype.get.bind(this),this.has=ew.prototype.has.bind(this),this.set=ew.prototype.set.bind(this),this.tag=eV.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;for(let e of(t?.onCreate&&t.onCreate(n),this.items)){let r,i;if(g(e)?(r=R(e.key,"",t),i=R(e.value,r,t)):r=R(e,"",t),n.has(r))throw Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(e,t,n){let r=eq(e,t,n),i=new this;return i.items=r.items,i}}eV.tag="tag:yaml.org,2002:omap";let eW={collection:"seq",identify:e=>e instanceof Map,nodeClass:eV,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=eK(e,t),r=[];for(let{key:e}of n.items)y(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new eV,n)},createNode:(e,t,n)=>eV.from(e,t,n)};function eG({value:e,source:t},n){return t&&(e?eY:eX).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let eY={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new F(!0),stringify:eG},eX={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new F(!1),stringify:eG},eH=e=>"bigint"==typeof e||Number.isInteger(e);function eQ(e,t,n,{intAsBigInt:r}){let i=e[0];if(("-"===i||"+"===i)&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return"-"===i?BigInt(-1)*t:t}let s=parseInt(e,n);return"-"===i?-1*s:s}function e0(e,t,n){let{value:r}=e;if(eH(r)){let e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return eA(e)}class e1 extends ew{constructor(e){super(e),this.tag=e1.tag}add(e){let t;t=g(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new ey(e.key,null):new ey(e,null),ek(this.items,t.key)||this.items.push(t)}get(e,t){let n=ek(this.items,e);return!t&&g(n)?y(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ek(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ey(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof r&&(e=r.call(t,e,e)),i.items.push(eg(e,null,n));return i}}e1.tag="tag:yaml.org,2002:set";let e2={collection:"map",identify:e=>e instanceof Set,nodeClass:e1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>e1.from(e,t,n),resolve(e,t){if(m(e))if(e.hasAllNullValues(!0))return Object.assign(new e1,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function e9(e,t){let n=e[0],r="-"===n||"+"===n?e.substring(1):e,i=e=>t?BigInt(e):Number(e),s=r.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===n?i(-1)*s:s}function e4(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return eA(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let e6={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>e9(e,n),stringify:e4},e8={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>e9(e,!1),stringify:e4},e3={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(e3.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=t.map(Number),l=Date.UTC(n,r-1,i,s||0,o||0,a||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=e9(u,!1);30>Math.abs(e)&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},e5=[e_,ex,e$,ez,eY,eX,{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>eQ(e,2,2,n),stringify:e=>e0(e,2,"0b")},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>eQ(e,1,8,n),stringify:e=>e0(e,8,"0")},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>eQ(e,0,10,n),stringify:eA},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>eQ(e,2,16,n),stringify:e=>e0(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:eA},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eA(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new F(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){let r=e.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(t.minFractionDigits=r.length)}return t},stringify:eA},eF,ef,eW,eJ,e2,e6,e8,e3],e7=new Map([["core",eR],["failsafe",[e_,ex,e$]],["json",eU],["yaml11",e5],["yaml-1.1",e5]]),te={binary:eF,bool:eE,float:eI,floatExp:eT,floatNaN:eN,floatTime:e8,int:eD,intHex:eM,intOct:eL,intTime:e6,map:e_,merge:ef,null:ez,omap:eW,pairs:eJ,seq:ex,set:e2,timestamp:e3},tt={"tag:yaml.org,2002:binary":eF,"tag:yaml.org,2002:merge":ef,"tag:yaml.org,2002:omap":eW,"tag:yaml.org,2002:pairs":eJ,"tag:yaml.org,2002:set":e2,"tag:yaml.org,2002:timestamp":e3};function tn(e,t,n){let r=e7.get(t);if(r&&!e)return n&&!r.includes(ef)?r.concat(ef):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(e7.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return n&&(i=i.concat(ef)),i.reduce((e,t)=>{let n="string"==typeof t?te[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(te).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}let tr=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class ti{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:s,toStringDefaults:o}){this.compat=Array.isArray(e)?tn(e,"compat"):e?tn(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=r?tt:{},this.tags=tn(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,l,{value:e_}),Object.defineProperty(this,c,{value:e$}),Object.defineProperty(this,f,{value:ex}),this.sortMapEntries="function"==typeof s?s:!0===s?tr:null}clone(){let e=Object.create(ti.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class ts{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,d,{value:a});let r=null;"function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:s}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new P({version:s}),this.setSchema(s,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){let e=Object.create(ts.prototype,{[d]:{value:a}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=k(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){to(this.contents)&&this.contents.add(e)}addIn(e,t){to(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=L(this);e.anchor=!t||n.has(t)?D(t||"a",n):t}return new B(e.anchor)}createNode(e,t,n){var r,i;let s,o,a,l;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),s=t}else void 0===n&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:f,keepUndefined:d,onTagObj:p,tag:h}=n??{},{onAnchor:m,setAnchors:g,sourceObjects:b}=(r=this,i=c||"a",o=[],a=new Map,l=null,{onAnchor:e=>{o.push(e),l??(l=L(r));let t=D(i,l);return l.add(t),t},setAnchors:()=>{for(let e of o){let t=a.get(e);if("object"==typeof t&&t.anchor&&(y(t.node)||v(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:a}),k={aliasDuplicateObjects:u??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:p,replacer:s,schema:this.schema,sourceObjects:b},w=K(e,h,k);return f&&v(w)&&(w.flow=!0),g(),w}createPair(e,t,n={}){return new ey(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return!!to(this.contents)&&this.contents.delete(e)}deleteIn(e){return J(e)?null!=this.contents&&(this.contents=null,!0):!!to(this.contents)&&this.contents.deleteIn(e)}get(e,t){return v(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return J(e)?!t&&y(this.contents)?this.contents.value:this.contents:v(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!v(this.contents)&&this.contents.has(e)}hasIn(e){return J(e)?void 0!==this.contents:!!v(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=q(this.schema,[e],t):to(this.contents)&&this.contents.set(e,t)}setIn(e,t){J(e)?this.contents=t:null==this.contents?this.contents=q(this.schema,Array.from(e),t):to(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new P({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new P({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ti(Object.assign(n,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=R(this.contents,t??"",o);if("function"==typeof i)for(let{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof s?M(s,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let n=[],r=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=el(e,t),{commentString:s}=i.options;if(e.commentBefore){1!==n.length&&n.unshift("");let t=s(e.commentBefore);n.unshift(G(t,""))}let o=!1,a=null;if(e.contents){if(k(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let t=s(e.contents.commentBefore);n.push(G(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let t=a?void 0:()=>o=!0,l=eu(e.contents,i,()=>a=null,t);a&&(l+=Y(l,"",s(a))),("|"===l[0]||">"===l[0])&&"---"===n[n.length-1]?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(eu(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=s(e.comment);t.includes("\n")?(n.push("..."),n.push(G(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&((!o||a)&&""!==n[n.length-1]&&n.push(""),n.push(G(s(t),"")))}return n.join("\n")+"\n"}(this,e)}}function to(e){if(v(e))return!0;throw Error("Expected a YAML collection as document contents")}class ta extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}class tl extends ta{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class tu extends ta{constructor(e,t,n){super("YAMLWarning",e,t,n)}}let tc=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let e=Math.min(s-39,o.length-79);o="…"+o.substring(e),s-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-s)));let a=" ".repeat(s)+"^".repeat(e);n.message+=`:
|
|
17
|
+
${t.comment}`:r.comment}r=e}e.items[n]=g(r)?r:new ey(r)}}else t("Expected a sequence for this tag");return e}function eq(e,t,n){let{replacer:r}=n,i=new eS(e);i.tag="tag:yaml.org,2002:pairs";let s=0;if(t&&Symbol.iterator in Object(t))for(let e of t){let o,a;if("function"==typeof r&&(e=r.call(t,String(s++),e)),Array.isArray(e))if(2===e.length)o=e[0],a=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`);else if(e&&e instanceof Object){let t=Object.keys(e);if(1===t.length)a=e[o=t[0]];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(eg(o,a,n))}return i}let eJ={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:eK,createNode:eq};class eV extends eS{constructor(){super(),this.add=ek.prototype.add.bind(this),this.delete=ek.prototype.delete.bind(this),this.get=ek.prototype.get.bind(this),this.has=ek.prototype.has.bind(this),this.set=ek.prototype.set.bind(this),this.tag=eV.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;for(let e of(t?.onCreate&&t.onCreate(n),this.items)){let r,i;if(g(e)?(r=R(e.key,"",t),i=R(e.value,r,t)):r=R(e,"",t),n.has(r))throw Error("Ordered maps must not include duplicate keys");n.set(r,i)}return n}static from(e,t,n){let r=eq(e,t,n),i=new this;return i.items=r.items,i}}eV.tag="tag:yaml.org,2002:omap";let eW={collection:"seq",identify:e=>e instanceof Map,nodeClass:eV,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let n=eK(e,t),r=[];for(let{key:e}of n.items)y(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new eV,n)},createNode:(e,t,n)=>eV.from(e,t,n)};function eG({value:e,source:t},n){return t&&(e?eY:eX).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}let eY={identify:e=>!0===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new F(!0),stringify:eG},eX={identify:e=>!1===e,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new F(!1),stringify:eG},eH=e=>"bigint"==typeof e||Number.isInteger(e);function eQ(e,t,n,{intAsBigInt:r}){let i=e[0];if(("-"===i||"+"===i)&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return"-"===i?BigInt(-1)*t:t}let s=parseInt(e,n);return"-"===i?-1*s:s}function e0(e,t,n){let{value:r}=e;if(eH(r)){let e=r.toString(t);return r<0?"-"+n+e.substr(1):n+e}return eA(e)}class e1 extends ek{constructor(e){super(e),this.tag=e1.tag}add(e){let t;t=g(e)?e:e&&"object"==typeof e&&"key"in e&&"value"in e&&null===e.value?new ey(e.key,null):new ey(e,null),ew(this.items,t.key)||this.items.push(t)}get(e,t){let n=ew(this.items,e);return!t&&g(n)?y(n.key)?n.key.value:n.key:n}set(e,t){if("boolean"!=typeof t)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=ew(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ey(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error("Set items must all have null values")}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)"function"==typeof r&&(e=r.call(t,e,e)),i.items.push(eg(e,null,n));return i}}e1.tag="tag:yaml.org,2002:set";let e2={collection:"map",identify:e=>e instanceof Set,nodeClass:e1,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>e1.from(e,t,n),resolve(e,t){if(m(e))if(e.hasAllNullValues(!0))return Object.assign(new e1,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};function e9(e,t){let n=e[0],r="-"===n||"+"===n?e.substring(1):e,i=e=>t?BigInt(e):Number(e),s=r.replace(/_/g,"").split(":").reduce((e,t)=>e*i(60)+i(t),i(0));return"-"===n?i(-1)*s:s}function e4(e){let{value:t}=e,n=e=>e;if("bigint"==typeof t)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return eA(e);let r="";t<0&&(r="-",t*=n(-1));let i=n(60),s=[t%i];return t<60?s.unshift(0):(t=(t-s[0])/i,s.unshift(t%i),t>=60&&(t=(t-s[0])/i,s.unshift(t))),r+s.map(e=>String(e).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}let e6={identify:e=>"bigint"==typeof e||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>e9(e,n),stringify:e4},e8={identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>e9(e,!1),stringify:e4},e3={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(e3.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,n,r,i,s,o,a]=t.map(Number),l=Date.UTC(n,r-1,i,s||0,o||0,a||0,t[7]?Number((t[7]+"00").substr(1,3)):0),u=t[8];if(u&&"Z"!==u){let e=e9(u,!1);30>Math.abs(e)&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},e5=[e_,ex,e$,ez,eY,eX,{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>eQ(e,2,2,n),stringify:e=>e0(e,2,"0b")},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>eQ(e,1,8,n),stringify:e=>e0(e,8,"0")},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>eQ(e,0,10,n),stringify:eA},{identify:eH,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>eQ(e,2,16,n),stringify:e=>e0(e,16,"0x")},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>"nan"===e.slice(-3).toLowerCase()?0/0:"-"===e[0]?-1/0:1/0,stringify:eA},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():eA(e)}},{identify:e=>"number"==typeof e,default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new F(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(-1!==n){let r=e.substring(n+1).replace(/_/g,"");"0"===r[r.length-1]&&(t.minFractionDigits=r.length)}return t},stringify:eA},eF,ef,eW,eJ,e2,e6,e8,e3],e7=new Map([["core",eR],["failsafe",[e_,ex,e$]],["json",eU],["yaml11",e5],["yaml-1.1",e5]]),te={binary:eF,bool:eE,float:eI,floatExp:eT,floatNaN:eN,floatTime:e8,int:eD,intHex:eM,intOct:eL,intTime:e6,map:e_,merge:ef,null:ez,omap:eW,pairs:eJ,seq:ex,set:e2,timestamp:e3},tt={"tag:yaml.org,2002:binary":eF,"tag:yaml.org,2002:merge":ef,"tag:yaml.org,2002:omap":eW,"tag:yaml.org,2002:pairs":eJ,"tag:yaml.org,2002:set":e2,"tag:yaml.org,2002:timestamp":e3};function tn(e,t,n){let r=e7.get(t);if(r&&!e)return n&&!r.includes(ef)?r.concat(ef):r.slice();let i=r;if(!i)if(Array.isArray(e))i=[];else{let e=Array.from(e7.keys()).filter(e=>"yaml11"!==e).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}if(Array.isArray(e))for(let t of e)i=i.concat(t);else"function"==typeof e&&(i=e(i.slice()));return n&&(i=i.concat(ef)),i.reduce((e,t)=>{let n="string"==typeof t?te[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(te).map(e=>JSON.stringify(e)).join(", ");throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}let tr=(e,t)=>e.key<t.key?-1:+(e.key>t.key);class ti{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:s,toStringDefaults:o}){this.compat=Array.isArray(e)?tn(e,"compat"):e?tn(null,e):null,this.name="string"==typeof i&&i||"core",this.knownTags=r?tt:{},this.tags=tn(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,l,{value:e_}),Object.defineProperty(this,c,{value:e$}),Object.defineProperty(this,f,{value:ex}),this.sortMapEntries="function"==typeof s?s:!0===s?tr:null}clone(){let e=Object.create(ti.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}class ts{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,d,{value:a});let r=null;"function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},n);this.options=i;let{version:s}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(s=this.directives.yaml.version)):this.directives=new P({version:s}),this.setSchema(s,n),this.contents=void 0===e?null:this.createNode(e,r,n)}clone(){let e=Object.create(ts.prototype,{[d]:{value:a}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=w(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){to(this.contents)&&this.contents.add(e)}addIn(e,t){to(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=L(this);e.anchor=!t||n.has(t)?D(t||"a",n):t}return new B(e.anchor)}createNode(e,t,n){var r,i;let s,o,a,l;if("function"==typeof t)e=t.call({"":e},"",e),s=t;else if(Array.isArray(t)){let e=t.filter(e=>"number"==typeof e||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),s=t}else void 0===n&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:u,anchorPrefix:c,flow:f,keepUndefined:d,onTagObj:p,tag:h}=n??{},{onAnchor:m,setAnchors:g,sourceObjects:b}=(r=this,i=c||"a",o=[],a=new Map,l=null,{onAnchor:e=>{o.push(e),l??(l=L(r));let t=D(i,l);return l.add(t),t},setAnchors:()=>{for(let e of o){let t=a.get(e);if("object"==typeof t&&t.anchor&&(y(t.node)||v(t.node)))t.node.anchor=t.anchor;else{let t=Error("Failed to resolve repeated object (this should not happen)");throw t.source=e,t}}},sourceObjects:a}),w={aliasDuplicateObjects:u??!0,keepUndefined:d??!1,onAnchor:m,onTagObj:p,replacer:s,schema:this.schema,sourceObjects:b},k=K(e,h,w);return f&&v(k)&&(k.flow=!0),g(),k}createPair(e,t,n={}){return new ey(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return!!to(this.contents)&&this.contents.delete(e)}deleteIn(e){return J(e)?null!=this.contents&&(this.contents=null,!0):!!to(this.contents)&&this.contents.deleteIn(e)}get(e,t){return v(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return J(e)?!t&&y(this.contents)?this.contents.value:this.contents:v(this.contents)?this.contents.getIn(e,t):void 0}has(e){return!!v(this.contents)&&this.contents.has(e)}hasIn(e){return J(e)?void 0!==this.contents:!!v(this.contents)&&this.contents.hasIn(e)}set(e,t){null==this.contents?this.contents=q(this.schema,[e],t):to(this.contents)&&this.contents.set(e,t)}setIn(e,t){J(e)?this.contents=t:null==this.contents?this.contents=q(this.schema,Array.from(e),t):to(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){let n;switch("number"==typeof e&&(e=String(e)),e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new P({version:"1.1"}),n={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new P({version:e}),n={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ti(Object.assign(n,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:!0===n,mapKeyWarned:!1,maxAliasCount:"number"==typeof r?r:100},a=R(this.contents,t??"",o);if("function"==typeof i)for(let{count:e,res:t}of o.anchors.values())i(t,e);return"function"==typeof s?M(s,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||0>=Number(e.indent))){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return function(e,t){let n=[],r=!0===t.directives;if(!1!==t.directives&&e.directives){let t=e.directives.toString(e);t?(n.push(t),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");let i=el(e,t),{commentString:s}=i.options;if(e.commentBefore){1!==n.length&&n.unshift("");let t=s(e.commentBefore);n.unshift(G(t,""))}let o=!1,a=null;if(e.contents){if(w(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){let t=s(e.contents.commentBefore);n.push(G(t,""))}i.forceBlockIndent=!!e.comment,a=e.contents.comment}let t=a?void 0:()=>o=!0,l=eu(e.contents,i,()=>a=null,t);a&&(l+=Y(l,"",s(a))),("|"===l[0]||">"===l[0])&&"---"===n[n.length-1]?n[n.length-1]=`--- ${l}`:n.push(l)}else n.push(eu(e.contents,i));if(e.directives?.docEnd)if(e.comment){let t=s(e.comment);t.includes("\n")?(n.push("..."),n.push(G(t,""))):n.push(`... ${t}`)}else n.push("...");else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,"")),t&&((!o||a)&&""!==n[n.length-1]&&n.push(""),n.push(G(s(t),"")))}return n.join("\n")+"\n"}(this,e)}}function to(e){if(v(e))return!0;throw Error("Expected a YAML collection as document contents")}class ta extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}}class tl extends ta{constructor(e,t,n){super("YAMLParseError",e,t,n)}}class tu extends ta{constructor(e,t,n){super("YAMLWarning",e,t,n)}}let tc=(e,t)=>n=>{if(-1===n.pos[0])return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let s=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){let e=Math.min(s-39,o.length-79);o="…"+o.substring(e),s-=e-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+"…\n"),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-s)));let a=" ".repeat(s)+"^".repeat(e);n.message+=`:
|
|
18
18
|
|
|
19
19
|
${o}
|
|
20
20
|
${a}
|
|
21
|
-
`}};function tf(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,u=a,c=a,f="",d="",p=!1,h=!1,m=null,g=null,y=null,b=null,v=null,k=null,w=null;for(let i of e)switch(h&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),m&&(u&&"comment"!==i.type&&"newline"!==i.type&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":!t&&("doc-start"!==n||r?.type!=="flow-collection")&&i.source.includes(" ")&&(m=i),c=!0;break;case"comment":{c||s(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";f?f+=d+e:f=e,d="",u=!1;break}case"newline":u?f?f+=i.source:k&&"seq-item-ind"===n||(l=!0):d+=i.source,u=!0,p=!0,(g||y)&&(b=i),c=!0;break;case"anchor":g&&s(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&s(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=i,w??(w=i.offset),u=!1,c=!1,h=!0;break;case"tag":y&&s(i,"MULTIPLE_TAGS","A node can have at most one tag"),y=i,w??(w=i.offset),u=!1,c=!1,h=!0;break;case n:(g||y)&&s(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),k&&s(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),k=i,u="seq-item-ind"===n||"explicit-key-ind"===n,c=!1;break;case"comma":if(t){v&&s(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=i,u=!1,c=!1;break}default:s(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),u=!1,c=!1}let _=e[e.length-1],S=_?_.offset+_.source.length:i;return h&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:k,spaceBefore:l,comment:f,hasNewline:p,anchor:g,tag:y,newlineAfterProp:b,end:S,start:w??S}}function td(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(td(t.key)||td(t.value))return!0}return!1;default:return!0}}function tp(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&("]"===r.source||"}"===r.source)&&td(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function th(e,t,n){let{uniqueKeys:r}=e.options;if(!1===r)return!1;let i="function"==typeof r?r:(e,t)=>e===t||y(e)&&y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}let tm="All mapping items must start at the same column";function tg(e,t,n,r){let i="";if(e){let s=!1,o="";for(let a of e){let{source:e,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";i?i+=o+t:i=t,o="";break}case"newline":i&&(o+=e),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:i,offset:t}}let ty="Block collections are not allowed within flow collections",tb=e=>e&&("block-map"===e.type||"block-seq"===e.type);function tv(e,t,n,r,i,s){let o="block-map"===n.type?function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o=new(s?.nodeClass??ew)(n.schema);n.atRoot&&(n.atRoot=!1);let a=r.offset,l=null;for(let s of r.items){let{start:u,key:c,sep:f,value:d}=s,p=tf(u,{indicator:"explicit-key-ind",next:c??f?.[0],offset:a,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!p.found;if(h){if(c&&("block-seq"===c.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==r.indent&&i(a,"BAD_INDENT",tm)),!p.anchor&&!p.tag&&!f){l=p.end,p.comment&&(o.comment?o.comment+="\n"+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||td(c))&&i(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(a,"BAD_INDENT",tm);n.atKey=!0;let m=p.end,g=c?e(n,c,p,i):t(n,m,u,null,p,i);n.schema.compat&&tp(r.indent,c,i),n.atKey=!1,th(n,o.items,g)&&i(m,"DUPLICATE_KEY","Map keys must be unique");let y=tf(f??[],{indicator:"map-value-ind",next:d,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!c||"block-scalar"===c.type});if(a=y.end,y.found){h&&(d?.type!=="block-map"||y.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<y.found.offset-1024&&i(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=d?e(n,d,y,i):t(n,a,f,null,y,i);n.schema.compat&&tp(r.indent,d,i),a=l.range[2];let u=new ey(g,l);n.options.keepSourceTokens&&(u.srcToken=s),o.items.push(u)}else{h&&i(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let e=new ey(g);n.options.keepSourceTokens&&(e.srcToken=s),o.items.push(e)}}return l&&l<a&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,a,l??a],o}(e,t,n,r,s):"block-seq"===n.type?function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o=new(s?.nodeClass??eS)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=r.offset,l=null;for(let{start:s,value:u}of r.items){let c=tf(s,{indicator:"seq-item-ind",next:u,offset:a,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?i(c.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(o.comment=c.comment);continue}let f=u?e(n,u,c,i):t(n,c.end,s,null,c,i);n.schema.compat&&tp(r.indent,u,i),a=f.range[2],o.items.push(f)}return o.range=[r.offset,a,l??a],o}(e,t,n,r,s):function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o="{"===r.start.source,a=o?"flow map":"flow sequence",l=new(s?.nodeClass??(o?ew:eS))(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset+r.start.source.length;for(let s=0;s<r.items.length;++s){let u=r.items[s],{start:f,key:d,sep:p,value:h}=u,m=tf(f,{flow:a,indicator:"explicit-key-ind",next:d??p?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!m.found){if(!m.anchor&&!m.tag&&!p&&!h){0===s&&m.comma?i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):s<r.items.length-1&&i(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),m.comment&&(l.comment?l.comment+="\n"+m.comment:l.comment=m.comment),c=m.end;continue}!o&&n.options.strict&&td(d)&&i(d,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===s)m.comma&&i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(m.comma||i(m.start,"MISSING_CHAR",`Missing , between ${a} items`),m.comment){let e="";e:for(let t of f)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=l.items[l.items.length-1];g(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(o||p||m.found){n.atKey=!0;let s=m.end,g=d?e(n,d,m,i):t(n,s,f,null,m,i);tb(d)&&i(g.range,"BLOCK_IN_FLOW",ty),n.atKey=!1;let y=tf(p??[],{flow:a,indicator:"map-value-ind",next:h,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(y.found){if(!o&&!m.found&&n.options.strict){if(p)for(let e of p){if(e===y.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<y.found.offset-1024&&i(y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else h&&("source"in h&&h.source?.[0]===":"?i(h,"MISSING_CHAR",`Missing space after : in ${a}`):i(y.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let b=h?e(n,h,y,i):y.found?t(n,y.end,p,null,y,i):null;b?tb(h)&&i(b.range,"BLOCK_IN_FLOW",ty):y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let v=new ey(g,b);if(n.options.keepSourceTokens&&(v.srcToken=u),o)th(n,l.items,g)&&i(s,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(v);else{let e=new ew(n.schema);e.flow=!0,e.items.push(v);let t=(b??g).range;e.range=[g.range[0],t[1],t[2]],l.items.push(e)}c=b?b.range[2]:y.end}else{let r=h?e(n,h,m,i):t(n,m.end,p,null,m,i);l.items.push(r),c=r.range[2],tb(h)&&i(r.range,"BLOCK_IN_FLOW",ty)}}let f=o?"}":"]",[d,...p]=r.end,h=c;if(d?.source===f)h=d.offset+d.source.length;else{let e=a[0].toUpperCase()+a.substring(1),t=u?`${e} must end with a ${f}`:`${e} in block collection must be sufficiently indented and end with a ${f}`;i(c,u?"MISSING_CHAR":"BAD_INDENT",t),d&&1!==d.source.length&&p.unshift(d)}if(p.length>0){let e=tg(p,h,n.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[r.offset,h,e.offset]}else l.range=[r.offset,h,h];return l}(e,t,n,r,s),a=o.constructor;return"!"===i||i===a.tagName?o.tag=a.tagName:i&&(o.tag=i),o}function tk(e,t,n){let r=t.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],o=0,a="",l=-1;for(let t=1;t<i.length;++t){let n=i[t];if(a||"-"!==n&&"+"!==n){let r=Number(n);!o&&r?o=r:-1===l&&(l=e+t)}else a=n}-1!==l&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,c="",f=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":u=!0;case"newline":f+=i.source.length;break;case"comment":n&&!u&&r(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=i.source.length,c=i.source.substring(1);break;case"error":r(i,"UNEXPECTED_TOKEN",i.message),f+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;r(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(f+=t.length)}}}return{mode:s,indent:o,chomp:a,comment:c,length:f}}(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=">"===i.mode?F.BLOCK_FOLDED:F.BLOCK_LITERAL,o=t.source?function(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],a=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(""===t||"\r"===t)a=e;else break}if(0===a){let e="+"===i.chomp&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"",n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:s,comment:i.comment,range:[r,n,n]}}let l=t.indent+i.indent,u=t.offset+i.length,c=0;for(let t=0;t<a;++t){let[r,s]=o[t];if(""===s||"\r"===s)0===i.indent&&r.length>l&&(l=r.length);else{r.length<l&&n(u+r.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===i.indent&&(l=r.length),c=t,0!==l||e.atRoot||n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=r.length+s.length+1}for(let e=o.length-1;e>=a;--e)o[e][0].length>l&&(a=e+1);let f="",d="",p=!1;for(let e=0;e<c;++e)f+=o[e][0].slice(l)+"\n";for(let e=c;e<a;++e){let[t,r]=o[e];u+=t.length+r.length+1;let a="\r"===r[r.length-1];if(a&&(r=r.slice(0,-1)),r&&t.length<l){let e=i.indent?"explicit indentation indicator":"first line",s=`Block scalar lines must not be less indented than their ${e}`;n(u-r.length-(a?2:1),"BAD_INDENT",s),t=""}s===F.BLOCK_LITERAL?(f+=d+t.slice(l)+r,d="\n"):t.length>l||" "===r[0]?(" "===d?d="\n":p||"\n"!==d||(d="\n\n"),f+=d+t.slice(l)+r,d="\n",p=!0):""===r?"\n"===d?f+="\n":d="\n":(f+=d+r,d=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let e=a;e<o.length;++e)f+="\n"+o[e][0].slice(l);"\n"!==f[f.length-1]&&(f+="\n");break;default:f+="\n"}let h=r+i.length+t.source.length;return{value:f,type:s,comment:i.comment,range:[r,h,h]}}function tw(e,t,n){let r,i,{offset:s,type:o,source:a,end:l}=e,u=(e,t,r)=>n(s+e,t,r);switch(o){case"scalar":r=F.PLAIN,i=function(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),t_(e)}(a,u);break;case"single-quoted-scalar":var c,f;r=F.QUOTE_SINGLE,c=a,f=u,("'"!==c[c.length-1]||1===c.length)&&f(c.length,"MISSING_CHAR","Missing closing 'quote"),i=t_(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":r=F.QUOTE_DOUBLE,i=function(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if("\r"!==i||"\n"!==e[r+1])if("\n"===i){let{fold:t,offset:i}=function(e,t){let n="",r=e[t+1];for(;(" "===r||" "===r||"\n"===r||"\r"===r)&&("\r"!==r||"\n"===e[t+2]);)"\n"===r&&(n+="\n"),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}(e,r);n+=t,r=i}else if("\\"===i){let i=e[++r],s=tS[i];if(s)n+=s;else if("\n"===i)for(i=e[r+1];" "===i||" "===i;)i=e[++r+1];else if("\r"===i&&"\n"===e[r+1])for(i=e[++r+1];" "===i||" "===i;)i=e[++r+1];else if("x"===i||"u"===i||"U"===i){let s="x"===i?2:"u"===i?4:8;n+=function(e,t,n,r){let i=e.substr(t,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):0/0;try{return String.fromCodePoint(s)}catch{let i=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}(e,r+1,s,t),r+=s}else{let i=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),n+=i}}else if(" "===i||" "===i){let t=r,s=e[r+1];for(;" "===s||" "===s;)s=e[++r+1];"\n"!==s&&("\r"!==s||"\n"!==e[r+2])&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}let d=s+a.length,p=tg(l,d,t,n);return{value:i,type:r,comment:p.comment,range:[s,d,p.offset]}}function t_(e){let t,n,r=/(.*?)\r?\n/sy,i=r.exec(e);if(!i)return e;try{t=RegExp("(?<![ ])[ ]+$"),n=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,n=/^[ \t]+|[ \t]+$/g}let s=i[1].replace(t,""),o=" ",a=r.lastIndex;for(;i=r.exec(e);){let e=i[1].replace(n,"");""===e?"\n"===o?s+=o:o="\n":(s+=o+e,o=" "),a=r.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,i=l.exec(e),s+o+(i?.[1]??"")}let tS={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function tO(e,t,n,r){let i,s,{value:o,type:a,comment:l,range:u}="block-scalar"===t.type?tk(e,t,r):tw(t,e.options.strict,r),f=n?e.directives.tagName(n.source,e=>r(n,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[c]:f?function(e,t,n,r,i){if("!"===n)return e[c];let s=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(!t.default||!t.test)return t;else s.push(t);for(let e of s)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[c])}(e.schema,o,f,n,r):"scalar"===t.type?function({atKey:e,directives:t,schema:n},r,i,s){let o=n.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(r))||n[c];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[c];if(o.tag!==e.tag){let n=t.tagString(o.tag),r=t.tagString(e.tag);s(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n} or ${r}`,!0)}}return o}(e,o,t,r):e.schema[c];try{let a=i.resolve(o,e=>r(n??t,"TAG_RESOLVE_FAILED",e),e.options);s=y(a)?a:new F(a)}catch(e){r(n??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),s=new F(o)}return s.range=u,s.source=o,a&&(s.type=a),f&&(s.tag=f),i.format&&(s.format=i.format),l&&(s.comment=l),s}let tx={composeNode:t$,composeEmptyNode:tz};function t$(e,t,n,r){let i,s=e.atKey,{spaceBefore:o,comment:a,anchor:l,tag:u}=n,c=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:n,end:r},i){let s=new B(n.substring(1));""===s.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+n.length,a=tg(r,o,e.strict,i);return s.range=[t,o,a.offset],a.comment&&(s.comment=a.comment),s}(e,t,r),(l||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":i=tO(e,t,u,r),l&&(i.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,n,r,i){let s=r.tag,o=s?t.directives.tagName(s.source,e=>i(s,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===n.type){let{anchor:e,newlineAfterProp:t}=r,n=e&&s?e.offset>s.offset?e:s:e??s;n&&(!t||t.offset<n.offset)&&i(n,"MISSING_CHAR","Missing newline after block sequence props")}let a="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!s||!o||"!"===o||o===ew.tagName&&"map"===a||o===eS.tagName&&"seq"===a)return tv(e,t,n,i,o);let l=t.schema.tags.find(e=>e.tag===o&&e.collection===a);if(!l){let r=t.schema.knownTags[o];if(r?.collection!==a)return r?i(s,"BAD_COLLECTION_TYPE",`${r.tag} used for ${a} collection, but expects ${r.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),tv(e,t,n,i,o);t.schema.tags.push(Object.assign({},r,{default:!1})),l=r}let u=tv(e,t,n,i,o,l),c=l.resolve?.(u,e=>i(s,"TAG_RESOLVE_FAILED",e),t.options)??u,f=k(c)?c:new F(c);return f.range=u.range,f.tag=o,l?.format&&(f.format=l.format),f}(tx,e,t,n,r),l&&(i.anchor=l.source.substring(1))}catch(e){r(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",e),c=!1}}return i??(i=tz(e,t.offset,void 0,null,n,r)),l&&""===i.anchor&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!y(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(i.spaceBefore=!0),a&&("scalar"===t.type&&""===t.source?i.comment=a:i.commentBefore=a),e.options.keepSourceTokens&&c&&(i.srcToken=t),i}function tz(e,t,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},u){let c=tO(e,{type:"scalar",offset:function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++r];n?.type==="space";)e+=n.source.length,n=t[++r];break}}return e}(t,n,r),indent:-1,source:""},a,u);return o&&(c.anchor=o.source.substring(1),""===c.anchor&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(c.spaceBefore=!0),s&&(c.comment=s,c.range[2]=l),c}function tE(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function tA(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(""===t?"":r?"\n\n":"\n")+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class tN{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=tE(e);r?this.warnings.push(new tu(i,t,n)):this.errors.push(new tl(i,t,n))},this.directives=new P({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=tA(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
21
|
+
`}};function tf(e,{flow:t,indicator:n,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,u=a,c=a,f="",d="",p=!1,h=!1,m=null,g=null,y=null,b=null,v=null,w=null,k=null;for(let i of e)switch(h&&("space"!==i.type&&"newline"!==i.type&&"comma"!==i.type&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),h=!1),m&&(u&&"comment"!==i.type&&"newline"!==i.type&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),m=null),i.type){case"space":!t&&("doc-start"!==n||r?.type!=="flow-collection")&&i.source.includes(" ")&&(m=i),c=!0;break;case"comment":{c||s(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let e=i.source.substring(1)||" ";f?f+=d+e:f=e,d="",u=!1;break}case"newline":u?f?f+=i.source:w&&"seq-item-ind"===n||(l=!0):d+=i.source,u=!0,p=!0,(g||y)&&(b=i),c=!0;break;case"anchor":g&&s(i,"MULTIPLE_ANCHORS","A node can have at most one anchor"),i.source.endsWith(":")&&s(i.offset+i.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),g=i,k??(k=i.offset),u=!1,c=!1,h=!0;break;case"tag":y&&s(i,"MULTIPLE_TAGS","A node can have at most one tag"),y=i,k??(k=i.offset),u=!1,c=!1,h=!0;break;case n:(g||y)&&s(i,"BAD_PROP_ORDER",`Anchors and tags must be after the ${i.source} indicator`),w&&s(i,"UNEXPECTED_TOKEN",`Unexpected ${i.source} in ${t??"collection"}`),w=i,u="seq-item-ind"===n||"explicit-key-ind"===n,c=!1;break;case"comma":if(t){v&&s(i,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),v=i,u=!1,c=!1;break}default:s(i,"UNEXPECTED_TOKEN",`Unexpected ${i.type} token`),u=!1,c=!1}let _=e[e.length-1],S=_?_.offset+_.source.length:i;return h&&r&&"space"!==r.type&&"newline"!==r.type&&"comma"!==r.type&&("scalar"!==r.type||""!==r.source)&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m&&(u&&m.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(m,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:v,found:w,spaceBefore:l,comment:f,hasNewline:p,anchor:g,tag:y,newlineAfterProp:b,end:S,start:k??S}}function td(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes("\n"))return!0;if(e.end){for(let t of e.end)if("newline"===t.type)return!0}return!1;case"flow-collection":for(let t of e.items){for(let e of t.start)if("newline"===e.type)return!0;if(t.sep){for(let e of t.sep)if("newline"===e.type)return!0}if(td(t.key)||td(t.value))return!0}return!1;default:return!0}}function tp(e,t,n){if(t?.type==="flow-collection"){let r=t.end[0];r.indent===e&&("]"===r.source||"}"===r.source)&&td(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function th(e,t,n){let{uniqueKeys:r}=e.options;if(!1===r)return!1;let i="function"==typeof r?r:(e,t)=>e===t||y(e)&&y(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}let tm="All mapping items must start at the same column";function tg(e,t,n,r){let i="";if(e){let s=!1,o="";for(let a of e){let{source:e,type:l}=a;switch(l){case"space":s=!0;break;case"comment":{n&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let t=e.substring(1)||" ";i?i+=o+t:i=t,o="";break}case"newline":i&&(o+=e),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${l} at node end`)}t+=e.length}}return{comment:i,offset:t}}let ty="Block collections are not allowed within flow collections",tb=e=>e&&("block-map"===e.type||"block-seq"===e.type);function tv(e,t,n,r,i,s){let o="block-map"===n.type?function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o=new(s?.nodeClass??ek)(n.schema);n.atRoot&&(n.atRoot=!1);let a=r.offset,l=null;for(let s of r.items){let{start:u,key:c,sep:f,value:d}=s,p=tf(u,{indicator:"explicit-key-ind",next:c??f?.[0],offset:a,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!p.found;if(h){if(c&&("block-seq"===c.type?i(a,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in c&&c.indent!==r.indent&&i(a,"BAD_INDENT",tm)),!p.anchor&&!p.tag&&!f){l=p.end,p.comment&&(o.comment?o.comment+="\n"+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||td(c))&&i(c??u[u.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(a,"BAD_INDENT",tm);n.atKey=!0;let m=p.end,g=c?e(n,c,p,i):t(n,m,u,null,p,i);n.schema.compat&&tp(r.indent,c,i),n.atKey=!1,th(n,o.items,g)&&i(m,"DUPLICATE_KEY","Map keys must be unique");let y=tf(f??[],{indicator:"map-value-ind",next:d,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!c||"block-scalar"===c.type});if(a=y.end,y.found){h&&(d?.type!=="block-map"||y.hasNewline||i(a,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&p.start<y.found.offset-1024&&i(g.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));let l=d?e(n,d,y,i):t(n,a,f,null,y,i);n.schema.compat&&tp(r.indent,d,i),a=l.range[2];let u=new ey(g,l);n.options.keepSourceTokens&&(u.srcToken=s),o.items.push(u)}else{h&&i(g.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let e=new ey(g);n.options.keepSourceTokens&&(e.srcToken=s),o.items.push(e)}}return l&&l<a&&i(l,"IMPOSSIBLE","Map comment with trailing content"),o.range=[r.offset,a,l??a],o}(e,t,n,r,s):"block-seq"===n.type?function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o=new(s?.nodeClass??eS)(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let a=r.offset,l=null;for(let{start:s,value:u}of r.items){let c=tf(s,{indicator:"seq-item-ind",next:u,offset:a,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!c.found)if(c.anchor||c.tag||u)u?.type==="block-seq"?i(c.end,"BAD_INDENT","All sequence items must start at the same column"):i(a,"MISSING_CHAR","Sequence item without - indicator");else{l=c.end,c.comment&&(o.comment=c.comment);continue}let f=u?e(n,u,c,i):t(n,c.end,s,null,c,i);n.schema.compat&&tp(r.indent,u,i),a=f.range[2],o.items.push(f)}return o.range=[r.offset,a,l??a],o}(e,t,n,r,s):function({composeNode:e,composeEmptyNode:t},n,r,i,s){let o="{"===r.start.source,a=o?"flow map":"flow sequence",l=new(s?.nodeClass??(o?ek:eS))(n.schema);l.flow=!0;let u=n.atRoot;u&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let c=r.offset+r.start.source.length;for(let s=0;s<r.items.length;++s){let u=r.items[s],{start:f,key:d,sep:p,value:h}=u,m=tf(f,{flow:a,indicator:"explicit-key-ind",next:d??p?.[0],offset:c,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!m.found){if(!m.anchor&&!m.tag&&!p&&!h){0===s&&m.comma?i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):s<r.items.length-1&&i(m.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),m.comment&&(l.comment?l.comment+="\n"+m.comment:l.comment=m.comment),c=m.end;continue}!o&&n.options.strict&&td(d)&&i(d,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(0===s)m.comma&&i(m.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(m.comma||i(m.start,"MISSING_CHAR",`Missing , between ${a} items`),m.comment){let e="";e:for(let t of f)switch(t.type){case"comma":case"space":break;case"comment":e=t.source.substring(1);break e;default:break e}if(e){let t=l.items[l.items.length-1];g(t)&&(t=t.value??t.key),t.comment?t.comment+="\n"+e:t.comment=e,m.comment=m.comment.substring(e.length+1)}}if(o||p||m.found){n.atKey=!0;let s=m.end,g=d?e(n,d,m,i):t(n,s,f,null,m,i);tb(d)&&i(g.range,"BLOCK_IN_FLOW",ty),n.atKey=!1;let y=tf(p??[],{flow:a,indicator:"map-value-ind",next:h,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(y.found){if(!o&&!m.found&&n.options.strict){if(p)for(let e of p){if(e===y.found)break;if("newline"===e.type){i(e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}m.start<y.found.offset-1024&&i(y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else h&&("source"in h&&h.source?.[0]===":"?i(h,"MISSING_CHAR",`Missing space after : in ${a}`):i(y.start,"MISSING_CHAR",`Missing , or : between ${a} items`));let b=h?e(n,h,y,i):y.found?t(n,y.end,p,null,y,i):null;b?tb(h)&&i(b.range,"BLOCK_IN_FLOW",ty):y.comment&&(g.comment?g.comment+="\n"+y.comment:g.comment=y.comment);let v=new ey(g,b);if(n.options.keepSourceTokens&&(v.srcToken=u),o)th(n,l.items,g)&&i(s,"DUPLICATE_KEY","Map keys must be unique"),l.items.push(v);else{let e=new ek(n.schema);e.flow=!0,e.items.push(v);let t=(b??g).range;e.range=[g.range[0],t[1],t[2]],l.items.push(e)}c=b?b.range[2]:y.end}else{let r=h?e(n,h,m,i):t(n,m.end,p,null,m,i);l.items.push(r),c=r.range[2],tb(h)&&i(r.range,"BLOCK_IN_FLOW",ty)}}let f=o?"}":"]",[d,...p]=r.end,h=c;if(d?.source===f)h=d.offset+d.source.length;else{let e=a[0].toUpperCase()+a.substring(1),t=u?`${e} must end with a ${f}`:`${e} in block collection must be sufficiently indented and end with a ${f}`;i(c,u?"MISSING_CHAR":"BAD_INDENT",t),d&&1!==d.source.length&&p.unshift(d)}if(p.length>0){let e=tg(p,h,n.options.strict,i);e.comment&&(l.comment?l.comment+="\n"+e.comment:l.comment=e.comment),l.range=[r.offset,h,e.offset]}else l.range=[r.offset,h,h];return l}(e,t,n,r,s),a=o.constructor;return"!"===i||i===a.tagName?o.tag=a.tagName:i&&(o.tag=i),o}function tw(e,t,n){let r=t.offset,i=function({offset:e,props:t},n,r){if("block-scalar-header"!==t[0].type)return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:i}=t[0],s=i[0],o=0,a="",l=-1;for(let t=1;t<i.length;++t){let n=i[t];if(a||"-"!==n&&"+"!==n){let r=Number(n);!o&&r?o=r:-1===l&&(l=e+t)}else a=n}-1!==l&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let u=!1,c="",f=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case"space":u=!0;case"newline":f+=i.source.length;break;case"comment":n&&!u&&r(i,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=i.source.length,c=i.source.substring(1);break;case"error":r(i,"UNEXPECTED_TOKEN",i.message),f+=i.source.length;break;default:{let e=`Unexpected token in block scalar header: ${i.type}`;r(i,"UNEXPECTED_TOKEN",e);let t=i.source;t&&"string"==typeof t&&(f+=t.length)}}}return{mode:s,indent:o,chomp:a,comment:c,length:f}}(t,e.options.strict,n);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};let s=">"===i.mode?F.BLOCK_FOLDED:F.BLOCK_LITERAL,o=t.source?function(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}(t.source):[],a=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(""===t||"\r"===t)a=e;else break}if(0===a){let e="+"===i.chomp&&o.length>0?"\n".repeat(Math.max(1,o.length-1)):"",n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:s,comment:i.comment,range:[r,n,n]}}let l=t.indent+i.indent,u=t.offset+i.length,c=0;for(let t=0;t<a;++t){let[r,s]=o[t];if(""===s||"\r"===s)0===i.indent&&r.length>l&&(l=r.length);else{r.length<l&&n(u+r.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),0===i.indent&&(l=r.length),c=t,0!==l||e.atRoot||n(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=r.length+s.length+1}for(let e=o.length-1;e>=a;--e)o[e][0].length>l&&(a=e+1);let f="",d="",p=!1;for(let e=0;e<c;++e)f+=o[e][0].slice(l)+"\n";for(let e=c;e<a;++e){let[t,r]=o[e];u+=t.length+r.length+1;let a="\r"===r[r.length-1];if(a&&(r=r.slice(0,-1)),r&&t.length<l){let e=i.indent?"explicit indentation indicator":"first line",s=`Block scalar lines must not be less indented than their ${e}`;n(u-r.length-(a?2:1),"BAD_INDENT",s),t=""}s===F.BLOCK_LITERAL?(f+=d+t.slice(l)+r,d="\n"):t.length>l||" "===r[0]?(" "===d?d="\n":p||"\n"!==d||(d="\n\n"),f+=d+t.slice(l)+r,d="\n",p=!0):""===r?"\n"===d?f+="\n":d="\n":(f+=d+r,d=" ",p=!1)}switch(i.chomp){case"-":break;case"+":for(let e=a;e<o.length;++e)f+="\n"+o[e][0].slice(l);"\n"!==f[f.length-1]&&(f+="\n");break;default:f+="\n"}let h=r+i.length+t.source.length;return{value:f,type:s,comment:i.comment,range:[r,h,h]}}function tk(e,t,n){let r,i,{offset:s,type:o,source:a,end:l}=e,u=(e,t,r)=>n(s+e,t,r);switch(o){case"scalar":r=F.PLAIN,i=function(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":n=`block scalar indicator ${e[0]}`;break;case"@":case"`":n=`reserved character ${e[0]}`}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),t_(e)}(a,u);break;case"single-quoted-scalar":var c,f;r=F.QUOTE_SINGLE,c=a,f=u,("'"!==c[c.length-1]||1===c.length)&&f(c.length,"MISSING_CHAR","Missing closing 'quote"),i=t_(c.slice(1,-1)).replace(/''/g,"'");break;case"double-quoted-scalar":r=F.QUOTE_DOUBLE,i=function(e,t){let n="";for(let r=1;r<e.length-1;++r){let i=e[r];if("\r"!==i||"\n"!==e[r+1])if("\n"===i){let{fold:t,offset:i}=function(e,t){let n="",r=e[t+1];for(;(" "===r||" "===r||"\n"===r||"\r"===r)&&("\r"!==r||"\n"===e[t+2]);)"\n"===r&&(n+="\n"),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}(e,r);n+=t,r=i}else if("\\"===i){let i=e[++r],s=tS[i];if(s)n+=s;else if("\n"===i)for(i=e[r+1];" "===i||" "===i;)i=e[++r+1];else if("\r"===i&&"\n"===e[r+1])for(i=e[++r+1];" "===i||" "===i;)i=e[++r+1];else if("x"===i||"u"===i||"U"===i){let s="x"===i?2:"u"===i?4:8;n+=function(e,t,n,r){let i=e.substr(t,n),s=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):0/0;try{return String.fromCodePoint(s)}catch{let i=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}(e,r+1,s,t),r+=s}else{let i=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),n+=i}}else if(" "===i||" "===i){let t=r,s=e[r+1];for(;" "===s||" "===s;)s=e[++r+1];"\n"!==s&&("\r"!==s||"\n"!==e[r+2])&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}return('"'!==e[e.length-1]||1===e.length)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}(a,u);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[s,s+a.length,s+a.length]}}let d=s+a.length,p=tg(l,d,t,n);return{value:i,type:r,comment:p.comment,range:[s,d,p.offset]}}function t_(e){let t,n,r=/(.*?)\r?\n/sy,i=r.exec(e);if(!i)return e;try{t=RegExp("(?<![ ])[ ]+$"),n=RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{t=/[ \t]+$/,n=/^[ \t]+|[ \t]+$/g}let s=i[1].replace(t,""),o=" ",a=r.lastIndex;for(;i=r.exec(e);){let e=i[1].replace(n,"");""===e?"\n"===o?s+=o:o="\n":(s+=o+e,o=" "),a=r.lastIndex}let l=/[ \t]*(.*)/sy;return l.lastIndex=a,i=l.exec(e),s+o+(i?.[1]??"")}let tS={0:"\0",a:"\x07",b:"\b",e:"\x1b",f:"\f",n:"\n",r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function tO(e,t,n,r){let i,s,{value:o,type:a,comment:l,range:u}="block-scalar"===t.type?tw(e,t,r):tk(t,e.options.strict,r),f=n?e.directives.tagName(n.source,e=>r(n,"TAG_RESOLVE_FAILED",e)):null;i=e.options.stringKeys&&e.atKey?e.schema[c]:f?function(e,t,n,r,i){if("!"===n)return e[c];let s=[];for(let t of e.tags)if(!t.collection&&t.tag===n)if(!t.default||!t.test)return t;else s.push(t);for(let e of s)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,"tag:yaml.org,2002:str"!==n),e[c])}(e.schema,o,f,n,r):"scalar"===t.type?function({atKey:e,directives:t,schema:n},r,i,s){let o=n.tags.find(t=>(!0===t.default||e&&"key"===t.default)&&t.test?.test(r))||n[c];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[c];if(o.tag!==e.tag){let n=t.tagString(o.tag),r=t.tagString(e.tag);s(i,"TAG_RESOLVE_FAILED",`Value may be parsed as either ${n} or ${r}`,!0)}}return o}(e,o,t,r):e.schema[c];try{let a=i.resolve(o,e=>r(n??t,"TAG_RESOLVE_FAILED",e),e.options);s=y(a)?a:new F(a)}catch(e){r(n??t,"TAG_RESOLVE_FAILED",e instanceof Error?e.message:String(e)),s=new F(o)}return s.range=u,s.source=o,a&&(s.type=a),f&&(s.tag=f),i.format&&(s.format=i.format),l&&(s.comment=l),s}let tx={composeNode:t$,composeEmptyNode:tz};function t$(e,t,n,r){let i,s=e.atKey,{spaceBefore:o,comment:a,anchor:l,tag:u}=n,c=!0;switch(t.type){case"alias":i=function({options:e},{offset:t,source:n,end:r},i){let s=new B(n.substring(1));""===s.source&&i(t,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let o=t+n.length,a=tg(r,o,e.strict,i);return s.range=[t,o,a.offset],a.comment&&(s.comment=a.comment),s}(e,t,r),(l||u)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":i=tO(e,t,u,r),l&&(i.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{i=function(e,t,n,r,i){let s=r.tag,o=s?t.directives.tagName(s.source,e=>i(s,"TAG_RESOLVE_FAILED",e)):null;if("block-seq"===n.type){let{anchor:e,newlineAfterProp:t}=r,n=e&&s?e.offset>s.offset?e:s:e??s;n&&(!t||t.offset<n.offset)&&i(n,"MISSING_CHAR","Missing newline after block sequence props")}let a="block-map"===n.type?"map":"block-seq"===n.type?"seq":"{"===n.start.source?"map":"seq";if(!s||!o||"!"===o||o===ek.tagName&&"map"===a||o===eS.tagName&&"seq"===a)return tv(e,t,n,i,o);let l=t.schema.tags.find(e=>e.tag===o&&e.collection===a);if(!l){let r=t.schema.knownTags[o];if(r?.collection!==a)return r?i(s,"BAD_COLLECTION_TYPE",`${r.tag} used for ${a} collection, but expects ${r.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),tv(e,t,n,i,o);t.schema.tags.push(Object.assign({},r,{default:!1})),l=r}let u=tv(e,t,n,i,o,l),c=l.resolve?.(u,e=>i(s,"TAG_RESOLVE_FAILED",e),t.options)??u,f=w(c)?c:new F(c);return f.range=u.range,f.tag=o,l?.format&&(f.format=l.format),f}(tx,e,t,n,r),l&&(i.anchor=l.source.substring(1))}catch(e){r(t,"RESOURCE_EXHAUSTION",e instanceof Error?e.message:String(e))}break;default:{let e="error"===t.type?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",e),c=!1}}return i??(i=tz(e,t.offset,void 0,null,n,r)),l&&""===i.anchor&&r(l,"BAD_ALIAS","Anchor cannot be an empty string"),s&&e.options.stringKeys&&(!y(i)||"string"!=typeof i.value||i.tag&&"tag:yaml.org,2002:str"!==i.tag)&&r(u??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(i.spaceBefore=!0),a&&("scalar"===t.type&&""===t.source?i.comment=a:i.commentBefore=a),e.options.keepSourceTokens&&c&&(i.srcToken=t),i}function tz(e,t,n,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},u){let c=tO(e,{type:"scalar",offset:function(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}for(n=t[++r];n?.type==="space";)e+=n.source.length,n=t[++r];break}}return e}(t,n,r),indent:-1,source:""},a,u);return o&&(c.anchor=o.source.substring(1),""===c.anchor&&u(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(c.spaceBefore=!0),s&&(c.comment=s,c.range[2]=l),c}function tE(e){if("number"==typeof e)return[e,e+1];if(Array.isArray(e))return 2===e.length?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+("string"==typeof n?n.length:1)]}function tA(e){let t="",n=!1,r=!1;for(let i=0;i<e.length;++i){let s=e[i];switch(s[0]){case"#":t+=(""===t?"":r?"\n\n":"\n")+(s.substring(1)||" "),n=!0,r=!1;break;case"%":e[i+1]?.[0]!=="#"&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class tN{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=tE(e);r?this.warnings.push(new tu(i,t,n)):this.errors.push(new tl(i,t,n))},this.directives=new P({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=tA(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
22
22
|
${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(v(i)&&!i.flow&&i.items.length>0){let e=i.items[0];g(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}
|
|
23
23
|
${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}
|
|
24
24
|
${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tA(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,n,r)=>{let i=tE(e);i[0]+=t,this.onError(i,"BAD_DIRECTIVE",n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=function(e,t,{offset:n,start:r,value:i,end:s},o){let a=new ts(void 0,Object.assign({_directives:t},e)),l={atKey:!1,atRoot:!0,directives:a.directives,options:a.options,schema:a.schema},u=tf(r,{indicator:"doc-start",next:i??s?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(a.directives.docStart=!0,i&&("block-map"===i.type||"block-seq"===i.type)&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),a.contents=i?t$(l,i,u,o):tz(l,u.end,r,null,u,o);let c=a.contents.range[2],f=tg(s,c,!1,o);return f.comment&&(a.comment=f.comment),a.range=[n,c,f.offset],a}(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new tl(tE(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case"doc-end":{if(!this.doc){this.errors.push(new tl(tE(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=tg(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}
|
|
25
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new tl(tE(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new ts(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function tT(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function tI(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),r))t.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}let tj=Symbol("break visit"),tP=Symbol("skip children"),tC=Symbol("remove item");function tL(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,n,r){let i=r(n,t);if("symbol"==typeof i)return i;for(let s of["key","value"]){let o=n[s];if(o&&"items"in o){for(let n=0;n<o.items.length;++n){let i=e(Object.freeze(t.concat([[s,n]])),o.items[n],r);if("number"==typeof i)n=i-1;else{if(i===tj)return tj;i===tC&&(o.items.splice(n,1),n-=1)}}"function"==typeof i&&"key"===s&&(i=i(n,t))}}return"function"==typeof i?i(n,t):i}(Object.freeze([]),e,t)}function tD(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function tM(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=tM(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=tR(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=tR(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=tR(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function tR({start:e,key:t,sep:n,value:r}){let i="";for(let t of e)i+=t.source;if(t&&(i+=tM(t)),n)for(let e of n)i+=e.source;return r&&(i+=tM(r)),i}tL.BREAK=tj,tL.SKIP=tP,tL.REMOVE=tC,tL.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},tL.parentCollection=(e,t)=>{let n=tL.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=ea({type:o,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:r,source:"\n"}];switch(a[0]){case"|":case">":{let e=a.indexOf("\n"),t=a.substring(0,e),n=a.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:s,indent:r,source:t}];return tT(i,l)||i.push({type:"newline",offset:-1,indent:r,source:"\n"}),{type:"block-scalar",offset:s,indent:r,props:i,source:n}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,n){if(e){let r=(e,t,r)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(n)n(i,t,r);else throw new tl([i,i+1],t,r)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return tw(e,t,r);case"block-scalar":return tk({options:{strict:t}},e,r)}}return null},"setScalarValue",0,function(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in e?e.indent:null;if(r&&"number"==typeof a&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");o=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=ea({type:o,value:t},{implicitKey:i||null===a,indent:null!==a&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=r,e.source=i}else{let{offset:t}=e,n="indent"in e?e.indent:-1,s=[{type:"block-scalar-header",offset:t,indent:n,source:r}];for(let t of(tT(s,"end"in e?e.end:void 0)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:s,source:i})}}(e,l);break;case'"':tI(e,l,"double-quoted-scalar");break;case"'":tI(e,l,"single-quoted-scalar");break;default:tI(e,l,"scalar")}},"stringify",0,e=>"type"in e?tM(e):tR(e),"tokenType",0,tD,"visit",0,tL],91723);var tZ=e.i(91723);function tB(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let tU=new Set("0123456789ABCDEFabcdef"),tF=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tK=new Set(",[]{}"),tq=new Set(" ,[]{}\n\r "),tJ=e=>!e||tq.has(e);class tV{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){let t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"!==t&&!(n>=this.indentNext)&&(t||this.atEnd)?-1:e+n}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&tB(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,n=e.indexOf("#");for(;-1!==n;){let r=e[n-1];if(" "===r||" "===r){t=n-1;break}n=e.indexOf("#",n+1)}for(;;){let n=e[t-1];if(" "===n||" "===n)t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&tB(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!tB(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&tB(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(tJ),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n<this.indentNext&&"#"!==r[0]||0===n&&(r.startsWith("---")||r.startsWith("..."))&&tB(r[3]))&&(n!==this.indentNext-1||1!==this.flowLevel||"]"!==r[0]&&"}"!==r[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===r[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(tJ),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||tB(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){let e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>tB(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let r=this.pos;e=this.buffer[r];++r)switch(e){case" ":n+=1;break;case"\n":t=r,n=0;break;case"\r":{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(e=this.buffer[r];" "===e;)e=this.buffer[++r];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,r=this.buffer[e];"\r"===r&&(r=this.buffer[--e]);let i=e;for(;" "===r;)r=this.buffer[--e];if("\n"===r&&e>=this.pos&&e+1+n>i)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){let e=this.buffer[r+1];if(tB(e)||t&&tK.has(e))break;n=r}else if(tB(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&tK.has(i))break;if("\n"===e){let e=this.continueScalar(r+1);if(-1===e)break;r=Math.max(r,e-2)}}else{if(t&&tK.has(e))break;n=r}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(tJ),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(tB(n)||t&&tK.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!tB(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(tF.has(t))t=this.buffer[++e];else if("%"===t&&tU.has(this.buffer[e+1])&&tU.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do t=this.buffer[++n];while(" "===t||e&&" "===t)let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function tW(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function tG(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function tY(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tX(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function tH(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function tQ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function t0(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||tW(t.start,"explicit-key-ind")||tW(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,tY(t.value)?t.value.end?tQ(t.value.end,t.sep):t.value.end=t.sep:tQ(t.start,t.sep),delete t.sep)}class t1{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new tV,this.onNewLine=e}*parse(e,t=!1){for(let n of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=tD(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&t0(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===tG(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==tG(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,n=tH(tX(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){tQ(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case"newline":n.push(r);break;case"space":break;case"comment":i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(tW(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tY(t.key)&&!tW(t.sep,"newline")){let e=tH(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(tW(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=tH(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):tW(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if("block-seq"===r.type){if(!t.explicitKey&&t.sep&&!tW(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){tQ(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||tW(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let n=tH(tX(t));t0(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=tH(tX(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tH(tX(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}class t2{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function t9(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new t2||null,prettyErrors:t}}function t4(e,t={}){let{lineCounter:n,prettyErrors:r}=t9(t),i=new t1(n?.addNewLine),s=new tN(t),o=null;for(let t of s.compose(i.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new tl(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=t;return r&&n&&(o.errors.forEach(tc(e,n)),o.warnings.forEach(tc(e,n))),o}function t6(e,t,n){let r;"function"==typeof t?r=t:void 0===n&&t&&"object"==typeof t&&(n=t);let i=t4(e,n);if(!i)return null;if(i.warnings.forEach(e=>ec(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:r},n))}function t8(e,t,n){let r=null;if("function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=n??t??{};if(!e)return}return h(e)&&!r?e.toString(n):new ts(e,r,n).toString(n)}function t3(e){return e.endsWith("\n")?e:e+"\n"}e.s(["Alias",0,B,"CST",0,tZ,"Composer",0,tN,"Document",0,ts,"Lexer",0,tV,"LineCounter",0,t2,"Pair",0,ey,"Parser",0,t1,"Scalar",0,F,"Schema",0,ti,"YAMLError",0,ta,"YAMLMap",0,ew,"YAMLParseError",0,tl,"YAMLSeq",0,eS,"YAMLWarning",0,tu,"isAlias",0,p,"isCollection",0,v,"isDocument",0,h,"isMap",0,m,"isNode",0,k,"isPair",0,g,"isScalar",0,y,"isSeq",0,b,"parse",0,t6,"parseAllDocuments",0,function(e,t={}){let{lineCounter:n,prettyErrors:r}=t9(t),i=new t1(n?.addNewLine),s=new tN(t),o=Array.from(s.compose(i.parse(e)));if(r&&n)for(let t of o)t.errors.forEach(tc(e,n)),t.warnings.forEach(tc(e,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())},"parseDocument",0,t4,"stringify",0,t8,"visit",0,x,"visitAsync",0,z],32861),e.i(32861),e.s(["_",0,function(e){let t=e.replace(/^/,""),n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(t);if(!n)return{data:{},body:t,hasFrontmatter:!1};try{let e=t6(n[1]);if(e&&"object"==typeof e&&!Array.isArray(e))return{data:e,body:t.slice(n[0].length),hasFrontmatter:!0}}catch{}return{data:{},body:t,hasFrontmatter:!1}},"A",0,function(e,t){let n={};for(let[t,r]of Object.entries(e))!(void 0===r||Array.isArray(r)&&0===r.length)&&(!r||"object"!=typeof r||Array.isArray(r)||0!==Object.keys(r).length)&&(n[t]=r);if(0===Object.keys(n).length)return t3(t);let r=t8(n,{lineWidth:0}).trimEnd();return`---
|
|
25
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new tl(tE(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new ts(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),e.range=[0,t,t],this.decorate(e,!1),yield e}}}function tT(e,t){if(t)for(let n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function tI(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{let r=e.props.slice(1),i=t.length;for(let t of("block-scalar-header"===e.props[0].type&&(i-=e.props[0].source.length),r))t.offset+=i;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{let r={type:"newline",offset:e.offset+t.length,indent:e.indent,source:"\n"};delete e.items,Object.assign(e,{type:n,source:t,end:[r]});break}default:{let r="indent"in e?e.indent:-1,i="end"in e&&Array.isArray(e.end)?e.end.filter(e=>"space"===e.type||"comment"===e.type||"newline"===e.type):[];for(let t of Object.keys(e))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:n,indent:r,source:t,end:i})}}}let tj=Symbol("break visit"),tP=Symbol("skip children"),tC=Symbol("remove item");function tL(e,t){"type"in e&&"document"===e.type&&(e={start:e.start,value:e.value}),function e(t,n,r){let i=r(n,t);if("symbol"==typeof i)return i;for(let s of["key","value"]){let o=n[s];if(o&&"items"in o){for(let n=0;n<o.items.length;++n){let i=e(Object.freeze(t.concat([[s,n]])),o.items[n],r);if("number"==typeof i)n=i-1;else{if(i===tj)return tj;i===tC&&(o.items.splice(n,1),n-=1)}}"function"==typeof i&&"key"===s&&(i=i(n,t))}}return"function"==typeof i?i(n,t):i}(Object.freeze([]),e,t)}function tD(e){switch(e){case"\uFEFF":return"byte-order-mark";case"\x02":return"doc-mode";case"\x18":return"flow-error-end";case"\x1f":return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case"\n":case"\r\n":return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function tM(e){switch(e.type){case"block-scalar":{let t="";for(let n of e.props)t+=tM(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(let n of e.items)t+=tR(n);return t}case"flow-collection":{let t=e.start.source;for(let n of e.items)t+=tR(n);for(let n of e.end)t+=n.source;return t}case"document":{let t=tR(e);if(e.end)for(let n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let n of e.end)t+=n.source;return t}}}function tR({start:e,key:t,sep:n,value:r}){let i="";for(let t of e)i+=t.source;if(t&&(i+=tM(t)),n)for(let e of n)i+=e.source;return r&&(i+=tM(r)),i}tL.BREAK=tj,tL.SKIP=tP,tL.REMOVE=tC,tL.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(!t||!("items"in t))return;n=t.items[r]}return n},tL.parentCollection=(e,t)=>{let n=tL.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&"items"in i)return i;throw Error("Parent collection not found")},e.s(["BOM",0,"\uFEFF","DOCUMENT",0,"\x02","FLOW_END",0,"\x18","SCALAR",0,"\x1f","createScalarToken",0,function(e,t){let{implicitKey:n=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=t,a=ea({type:o,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=t.end??[{type:"newline",offset:-1,indent:r,source:"\n"}];switch(a[0]){case"|":case">":{let e=a.indexOf("\n"),t=a.substring(0,e),n=a.substring(e+1)+"\n",i=[{type:"block-scalar-header",offset:s,indent:r,source:t}];return tT(i,l)||i.push({type:"newline",offset:-1,indent:r,source:"\n"}),{type:"block-scalar",offset:s,indent:r,props:i,source:n}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}},"isCollection",0,e=>!!e&&"items"in e,"isScalar",0,e=>!!e&&("scalar"===e.type||"single-quoted-scalar"===e.type||"double-quoted-scalar"===e.type||"block-scalar"===e.type),"prettyToken",0,function(e){switch(e){case"\uFEFF":return"<BOM>";case"\x02":return"<DOC>";case"\x18":return"<FLOW_END>";case"\x1f":return"<SCALAR>";default:return JSON.stringify(e)}},"resolveAsScalar",0,function(e,t=!0,n){if(e){let r=(e,t,r)=>{let i="number"==typeof e?e:Array.isArray(e)?e[0]:e.offset;if(n)n(i,t,r);else throw new tl([i,i+1],t,r)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return tk(e,t,r);case"block-scalar":return tw({options:{strict:t}},e,r)}}return null},"setScalarValue",0,function(e,t,n={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=n,a="indent"in e?e.indent:null;if(r&&"number"==typeof a&&(a+=2),!o)switch(e.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");o=">"===t.source[0]?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}let l=ea({type:o,value:t},{implicitKey:i||null===a,indent:null!==a&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":!function(e,t){let n=t.indexOf("\n"),r=t.substring(0,n),i=t.substring(n+1)+"\n";if("block-scalar"===e.type){let t=e.props[0];if("block-scalar-header"!==t.type)throw Error("Invalid block scalar header");t.source=r,e.source=i}else{let{offset:t}=e,n="indent"in e?e.indent:-1,s=[{type:"block-scalar-header",offset:t,indent:n,source:r}];for(let t of(tT(s,"end"in e?e.end:void 0)||s.push({type:"newline",offset:-1,indent:n,source:"\n"}),Object.keys(e)))"type"!==t&&"offset"!==t&&delete e[t];Object.assign(e,{type:"block-scalar",indent:n,props:s,source:i})}}(e,l);break;case'"':tI(e,l,"double-quoted-scalar");break;case"'":tI(e,l,"single-quoted-scalar");break;default:tI(e,l,"scalar")}},"stringify",0,e=>"type"in e?tM(e):tR(e),"tokenType",0,tD,"visit",0,tL],91723);var tZ=e.i(91723);function tB(e){switch(e){case void 0:case" ":case"\n":case"\r":case" ":return!0;default:return!1}}let tU=new Set("0123456789ABCDEFabcdef"),tF=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),tK=new Set(",[]{}"),tq=new Set(" ,[]{}\n\r "),tJ=e=>!e||tq.has(e);class tV{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if("string"!=typeof e)throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??"stream";for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;" "===t||" "===t;)t=this.buffer[++e];return!t||"#"===t||"\n"===t||"\r"===t&&"\n"===this.buffer[e+1]}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;" "===t;)t=this.buffer[++n+e];if("\r"===t){let t=this.buffer[n+e+1];if("\n"===t||!t&&!this.atEnd)return e+n+1}return"\n"!==t&&!(n>=this.indentNext)&&(t||this.atEnd)?-1:e+n}if("-"===t||"."===t){let t=this.buffer.substr(e,3);if(("---"===t||"..."===t)&&tB(this.buffer[e+3]))return -1}return e}getLine(){let e=this.lineEndPos;return(("number"!=typeof e||-1!==e&&e<this.pos)&&(e=this.buffer.indexOf("\n",this.pos),this.lineEndPos=e),-1===e)?this.atEnd?this.buffer.substring(this.pos):null:("\r"===this.buffer[e-1]&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(null===e)return this.setNext("stream");if("\uFEFF"===e[0]&&(yield*this.pushCount(1),e=e.substring(1)),"%"===e[0]){let t=e.length,n=e.indexOf("#");for(;-1!==n;){let r=e[n-1];if(" "===r||" "===r){t=n-1;break}n=e.indexOf("#",n+1)}for(;;){let n=e[t-1];if(" "===n||" "===n)t-=1;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield"\x02",yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if("-"===e||"."===e){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let e=this.peek(3);if(("---"===e||"..."===e)&&tB(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,"---"===e?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!tB(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if(("-"===e||"?"===e||":"===e)&&tB(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(null===e)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(tJ),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do(e=yield*this.pushNewline())>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0)let r=this.getLine();if(null===r)return this.setNext("flow");if((-1!==n&&n<this.indentNext&&"#"!==r[0]||0===n&&(r.startsWith("---")||r.startsWith("..."))&&tB(r[3]))&&(n!==this.indentNext-1||1!==this.flowLevel||"]"!==r[0]&&"}"!==r[0]))return this.flowLevel=0,yield"\x18",yield*this.parseLineStart();let i=0;for(;","===r[i];)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(r[i+=yield*this.pushIndicators()]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-i),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(tJ),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let e=this.charAt(1);if(this.flowKey||tB(e)||","===e)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if("'"===e)for(;-1!==t&&"'"===this.buffer[t+1];)t=this.buffer.indexOf("'",t+2);else for(;-1!==t;){let e=0;for(;"\\"===this.buffer[t-1-e];)e+=1;if(e%2==0)break;t=this.buffer.indexOf('"',t+1)}let n=this.buffer.substring(0,t),r=n.indexOf("\n",this.pos);if(-1!==r){for(;-1!==r;){let e=this.continueScalar(r+1);if(-1===e)break;r=n.indexOf("\n",e)}-1!==r&&(t=r-("\r"===n[r-1]?2:1))}if(-1===t){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if("+"===t)this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if("-"!==t)break}return yield*this.pushUntil(e=>tB(e)||"#"===e)}*parseBlockScalar(){let e,t=this.pos-1,n=0;e:for(let r=this.pos;e=this.buffer[r];++r)switch(e){case" ":n+=1;break;case"\n":t=r,n=0;break;case"\r":{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext("block-scalar");if("\n"===e)break}default:break e}if(!e&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){-1===this.blockScalarIndent?this.indentNext=n:this.indentNext=this.blockScalarIndent+(0===this.indentNext?1:this.indentNext);do{let e=this.continueScalar(t+1);if(-1===e)break;t=this.buffer.indexOf("\n",e)}while(-1!==t)if(-1===t){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let r=t+1;for(e=this.buffer[r];" "===e;)e=this.buffer[++r];if(" "===e){for(;" "===e||" "===e||"\r"===e||"\n"===e;)e=this.buffer[++r];t=r-1}else if(!this.blockScalarKeep)for(;;){let e=t-1,r=this.buffer[e];"\r"===r&&(r=this.buffer[--e]);let i=e;for(;" "===r;)r=this.buffer[--e];if("\n"===r&&e>=this.pos&&e+1+n>i)t=e;else break}return yield"\x1f",yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e,t=this.flowLevel>0,n=this.pos-1,r=this.pos-1;for(;e=this.buffer[++r];)if(":"===e){let e=this.buffer[r+1];if(tB(e)||t&&tK.has(e))break;n=r}else if(tB(e)){let i=this.buffer[r+1];if("\r"===e&&("\n"===i?(r+=1,e="\n",i=this.buffer[r+1]):n=r),"#"===i||t&&tK.has(i))break;if("\n"===e){let e=this.continueScalar(r+1);if(-1===e)break;r=Math.max(r,e-2)}}else{if(t&&tK.has(e))break;n=r}return e||this.atEnd?(yield"\x1f",yield*this.pushToIndex(n+1,!0),t?"flow":"doc"):this.setNext("plain-scalar")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield""),0)}*pushIndicators(){let e=0;for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue;case"&":e+=yield*this.pushUntil(tJ),e+=yield*this.pushSpaces(!0);continue;case"-":case"?":case":":{let t=this.flowLevel>0,n=this.charAt(1);if(tB(n)||t&&tK.has(n)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue}}}break}return e}*pushTag(){if("<"===this.charAt(1)){let e=this.pos+2,t=this.buffer[e];for(;!tB(t)&&">"!==t;)t=this.buffer[++e];return yield*this.pushToIndex(">"===t?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(tF.has(t))t=this.buffer[++e];else if("%"===t&&tU.has(this.buffer[e+1])&&tU.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return"\n"===e?yield*this.pushCount(1):"\r"===e&&"\n"===this.charAt(1)?yield*this.pushCount(2):0}*pushSpaces(e){let t,n=this.pos-1;do t=this.buffer[++n];while(" "===t||e&&" "===t)let r=n-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=n),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}function tW(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function tG(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return -1}function tY(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function tX(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function tH(e){if(0===e.length)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++t]?.type==="space";);return e.splice(t,e.length)}function tQ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function t0(e){if("flow-seq-start"===e.start.type)for(let t of e.items)!t.sep||t.value||tW(t.start,"explicit-key-ind")||tW(t.sep,"map-value-ind")||(t.key&&(t.value=t.key),delete t.key,tY(t.value)?t.value.end?tQ(t.value.end,t.sep):t.value.end=t.sep:tQ(t.start,t.sep),delete t.sep)}class t1{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new tV,this.onNewLine=e}*parse(e,t=!1){for(let n of(this.onNewLine&&0===this.offset&&this.onNewLine(0),this.lexer.lex(e,t)))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=tD(e);if(t)if("scalar"===t)this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&" "===e[0]&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{let t=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:t,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if("doc-end"===this.type&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(t)if(0===this.stack.length)yield t;else{let e=this.peek(1);switch("block-scalar"===t.type?t.indent="indent"in e?e.indent:0:"flow-collection"===t.type&&"document"===e.type&&(t.indent=0),"flow-collection"===t.type&&t0(t),e.type){case"document":e.value=t;break;case"block-scalar":e.props.push(t);break;case"block-map":{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case"block-seq":{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case"flow-collection":{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if(("document"===e.type||"block-map"===e.type||"block-seq"===e.type)&&("block-map"===t.type||"block-seq"===t.type)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&-1===tG(n.start)&&(0===t.indent||n.start.every(e=>"comment"!==e.type||e.indent<t.indent))&&("document"===e.type?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}else yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};"doc-start"===this.type&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":-1!==tG(e.start)?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return;case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if("map-value-ind"===this.type){let t,n=tH(tX(this.peek(2)));e.end?((t=e.end).push(this.sourceToken),delete e.end):t=[this.sourceToken];let r={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:t}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){tQ(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&"seq-item-ind"!==this.type,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case"newline":n.push(r);break;case"space":break;case"comment":i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":t.sep||t.explicitKey?r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}):(t.start.push(this.sourceToken),t.explicitKey=!0),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(tW(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(tY(t.key)&&!tW(t.sep,"newline")){let e=tH(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken);else if(tW(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=tH(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):tW(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if("block-seq"===r.type){if(!t.explicitKey&&t.sep&&!tW(t.sep,"newline"))return void(yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source}))}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let n="end"in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;r?.type==="comment"?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2],r=n?.value?.end;if(Array.isArray(r)){tQ(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||tW(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t)return void this.stack.push(t)}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if("flow-error-end"===this.type){let e;do yield*this.pop(),e=this.peek(1);while(e?.type==="flow-collection")}else if(0===e.end.length){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if("block-map"!==t.type||("map-value-ind"!==this.type||t.indent!==e.indent)&&("newline"!==this.type||t.items[t.items.length-1].sep))if("map-value-ind"===this.type&&"flow-collection"!==t.type){let n=tH(tX(t));t0(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e);else yield*this.pop(),yield*this.step()}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf("\n")+1;for(;0!==e;)this.onNewLine(this.offset+e),e=this.source.indexOf("\n",e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=tH(tX(e));return t.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=tH(tX(e));return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return"comment"===this.type&&!(this.indent<=t)&&e.every(e=>"newline"===e.type||"space"===e.type)}*documentEnd(e){"doc-mode"!==this.type&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],"newline"===this.type&&(yield*this.pop())}}}class t2{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(0===t)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function t9(e){let t=!1!==e.prettyErrors;return{lineCounter:e.lineCounter||t&&new t2||null,prettyErrors:t}}function t4(e,t={}){let{lineCounter:n,prettyErrors:r}=t9(t),i=new t1(n?.addNewLine),s=new tN(t),o=null;for(let t of s.compose(i.parse(e),!0,e.length))if(o){if("silent"!==o.options.logLevel){o.errors.push(new tl(t.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}}else o=t;return r&&n&&(o.errors.forEach(tc(e,n)),o.warnings.forEach(tc(e,n))),o}function t6(e,t,n){let r;"function"==typeof t?r=t:void 0===n&&t&&"object"==typeof t&&(n=t);let i=t4(e,n);if(!i)return null;if(i.warnings.forEach(e=>ec(i.options.logLevel,e)),i.errors.length>0)if("silent"!==i.options.logLevel)throw i.errors[0];else i.errors=[];return i.toJS(Object.assign({reviver:r},n))}function t8(e,t,n){let r=null;if("function"==typeof t||Array.isArray(t)?r=t:void 0===n&&t&&(n=t),"string"==typeof n&&(n=n.length),"number"==typeof n){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(void 0===e){let{keepUndefined:e}=n??t??{};if(!e)return}return h(e)&&!r?e.toString(n):new ts(e,r,n).toString(n)}function t3(e){return e.endsWith("\n")?e:e+"\n"}e.s(["Alias",0,B,"CST",0,tZ,"Composer",0,tN,"Document",0,ts,"Lexer",0,tV,"LineCounter",0,t2,"Pair",0,ey,"Parser",0,t1,"Scalar",0,F,"Schema",0,ti,"YAMLError",0,ta,"YAMLMap",0,ek,"YAMLParseError",0,tl,"YAMLSeq",0,eS,"YAMLWarning",0,tu,"isAlias",0,p,"isCollection",0,v,"isDocument",0,h,"isMap",0,m,"isNode",0,w,"isPair",0,g,"isScalar",0,y,"isSeq",0,b,"parse",0,t6,"parseAllDocuments",0,function(e,t={}){let{lineCounter:n,prettyErrors:r}=t9(t),i=new t1(n?.addNewLine),s=new tN(t),o=Array.from(s.compose(i.parse(e)));if(r&&n)for(let t of o)t.errors.forEach(tc(e,n)),t.warnings.forEach(tc(e,n));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())},"parseDocument",0,t4,"stringify",0,t8,"visit",0,x,"visitAsync",0,z],32861),e.i(32861),e.s(["_",0,function(e){let t=e.replace(/^/,""),n=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/.exec(t);if(!n)return{data:{},body:t,hasFrontmatter:!1};try{let e=t6(n[1]);if(e&&"object"==typeof e&&!Array.isArray(e))return{data:e,body:t.slice(n[0].length),hasFrontmatter:!0}}catch{}return{data:{},body:t,hasFrontmatter:!1}},"A",0,function(e,t){let n={};for(let[t,r]of Object.entries(e))!(void 0===r||Array.isArray(r)&&0===r.length)&&(!r||"object"!=typeof r||Array.isArray(r)||0!==Object.keys(r).length)&&(n[t]=r);if(0===Object.keys(n).length)return t3(t);let r=t8(n,{lineWidth:0}).trimEnd();return`---
|
|
26
26
|
${r}
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
-
${t3(t.replace(/^\n+/,""))}`}],89089)},21229,33892,e=>{"use strict";let t,n,r,i,s,o,a,l,u,c;function f(e){return e}function d(e){return e}function p(){return e=>e}function h(e){}function m(e){throw Error("Unexpected value in exhaustive check")}function g(e){}function y(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function b(e,t="|"){return e.map(e=>ee(e)).join(t)}function v(e,t){return"bigint"==typeof t?t.toString():t}e.s(["BIGINT_FORMAT_RANGES",()=>er,"CONSTANT_CATCH",()=>eU,"Class",()=>ej,"NUMBER_FORMAT_RANGES",()=>en,"aborted",()=>ep,"allowsEval",()=>F,"assert",()=>g,"assertEqual",()=>f,"assertIs",()=>h,"assertNever",()=>m,"assertNotEqual",()=>d,"assignProp",()=>E,"attachSchema",()=>eb,"base64ToUint8Array",()=>ez,"base64urlToUint8Array",()=>eA,"cached",()=>w,"captureStackTrace",()=>B,"cleanEnum",()=>e$,"cleanRegex",()=>S,"clone",()=>X,"cloneDef",()=>C,"codePointLength",()=>e_,"constantCatch",()=>eF,"createTransparentProxy",()=>Q,"defineLazy",()=>$,"defineLazyInternal",()=>eZ,"derived",()=>eD,"esc",()=>R,"escapeRegex",()=>Y,"explicitlyAborted",()=>eh,"extend",()=>ea,"finalizeIssue",()=>ev,"floatSafeRemainder",()=>O,"getElementAtPath",()=>L,"getEnumValues",()=>y,"getLengthableOrigin",()=>eS,"getParsedType",()=>V,"getSizableOrigin",()=>ek,"hexToUint8Array",()=>eT,"hide",()=>eL,"installLazyProp",()=>eB,"isObject",()=>U,"isPlainObject",()=>K,"issue",()=>ex,"joinValues",()=>b,"jsonStringifyReplacer",()=>v,"members",()=>eP,"merge",()=>ec,"mergeDefs",()=>P,"normalizeParams",()=>H,"nullish",()=>_,"numKeys",()=>J,"objectClone",()=>z,"omit",()=>eo,"optionalKeys",()=>et,"own",()=>eC,"parsedType",()=>eO,"partial",()=>ef,"pick",()=>ei,"prefixIssues",()=>em,"primitiveTypes",()=>G,"promiseAllObject",()=>D,"propertyKeyTypes",()=>W,"randomString",()=>M,"rawShape",()=>A,"required",()=>ed,"safeExtend",()=>eu,"shallowClone",()=>q,"sizeCaps",()=>ey,"slugify",()=>Z,"stringifyPrimitive",()=>ee,"toZod",()=>p,"uint8ArrayToBase64",()=>eE,"uint8ArrayToBase64url",()=>eN,"uint8ArrayToHex",()=>eI,"unwrapMessage",()=>eg],22210);class k{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function w(e){return new k(e)}function _(e){return null==e}function S(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function O(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}let x=Symbol("evaluating");function $(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==x)return void 0===r&&(r=x,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function z(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function A(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function N(e){return A(e._zod.def)??e._zod.def.shape}function T(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return E(this,t,e),e},enumerable:!0,configurable:!0})}function I(e,t,n){t in e?E(e,t,n):e[t]=n}function j(e,t,n,r){let i=N(t);for(let s of n){let n=Object.getOwnPropertyDescriptor(i,s);n.enumerable&&(n.get?T(e,s,()=>{let e=t._zod.def.shape[s];return r?r(e,s):e}):I(e,s,r?r(n.value,s):n.value))}}function P(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function C(e){return P(e._zod.def)}function L(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function D(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function M(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function R(e){return JSON.stringify(e)}function Z(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let B="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function U(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let F=w(()=>{if(eG.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function K(e){if(!1===U(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==U(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function q(e){return K(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function J(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}let V=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},W=new Set(["string","number","symbol"]),G=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function Q(e){let t;return new Proxy({},{get:(n,r,i)=>(t??(t=e()),Reflect.get(t,r,i)),set:(n,r,i,s)=>(t??(t=e()),Reflect.set(t,r,i,s)),has:(n,r)=>(t??(t=e()),Reflect.has(t,r)),deleteProperty:(n,r)=>(t??(t=e()),Reflect.deleteProperty(t,r)),ownKeys:n=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(n,r)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)),defineProperty:(n,r,i)=>(t??(t=e()),Reflect.defineProperty(t,r,i))})}function ee(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function et(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let en={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},er={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ei(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return j(i,e,es(e,t)),X(e,P(n,{shape:i,checks:[]}))}function es(e,t){let n=N(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function eo(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(es(e,t)),s={};return j(s,e,Reflect.ownKeys(N(e)).filter(e=>!i.has(e))),X(e,P(n,{shape:s,checks:[]}))}function ea(e,t){if(!K(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=N(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return X(e,P(e._zod.def,{shape:el(e,t)}))}function el(e,t){let n={};j(n,e,Reflect.ownKeys(N(e)));for(let e of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,e);r.enumerable&&(r.get?T(n,e,()=>t[e]):I(n,e,r.value))}return n}function eu(e,t){if(!K(t))throw Error("Invalid input to safeExtend: expected a plain object");return X(e,P(e._zod.def,{shape:el(e,t)}))}function ec(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};j(n,e,Reflect.ownKeys(N(e))),j(n,t,Reflect.ownKeys(N(t)));let r=P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return X(e,r)}function ef(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let s=n?new Set(es(t,n)):void 0,o={};return j(o,t,Reflect.ownKeys(N(t)),e&&((t,n)=>s&&!s.has(n)?t:new e({type:"optional",innerType:t}))),X(t,P(t._zod.def,{shape:o,checks:[]}))}function ed(e,t,n){let r=n?new Set(es(t,n)):void 0,i={};return j(i,t,Reflect.ownKeys(N(t)),(t,n)=>r&&!r.has(n)?t:new e({type:"nonoptional",innerType:t})),X(t,P(t._zod.def,{shape:i}))}function ep(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function eh(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function em(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eg(e){return"string"==typeof e?e:e?.message}function ey(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function eb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ev(e,t,n){let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:eg(e.inst?._zod.def?.error?.(e))??eg(i?.(e))??eg(t?.error?.(e))??eg(n.customError?.(e))??eg(n.localeError?.(e))??"Invalid input",o={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(o[t]=e[t]);return o.path??(o.path=[]),o.message=s,t?.reportInput&&(o.input=e.input),o}function ek(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let ew=/[\uD800-\uDBFF]/;function e_(e){let t=e.length;if(!ew.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(64512&e.charCodeAt(r))==55296&&(64512&e.charCodeAt(r+1))==56320&&(n--,r++);return n}function eS(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eO(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function ex(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function e$(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ez(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function eE(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function eA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return ez(t+n)}function eN(e){return eE(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eT(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function eI(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class ej{constructor(...e){}}function eP(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:eC(this,t,n.bind(this))},set(e){eC(this,t,e)}})}(e,n,r.value)}}function eC(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function eL(e,t,n){return eC(e,t,n,!1)}function eD(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return eC(this,n,r(this))},set(e){eC(this,n,e)}})}return t}let eM=!1,eR={configurable:!0,get(){eM=!0}};function eZ(e,n,r){let i=Object.getPrototypeOf(e._zod);if(n in i&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(i,n,{configurable:!0,get(){Object.defineProperty(this,n,eR);let e=eM;eM=!1;try{let t=r(this);return eM?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t}),eM=eM||e,t}catch(t){throw delete this[n],eM=eM||e,t}},set(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})}function eB(e,t,n,r){let i,s=t in(i=Object.getPrototypeOf(e))?void 0:i;s&&Object.defineProperty(s,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}let eU="~constantCatch";function eF(e){let t=()=>e;return t[eU]=!0,t}let eK={value:void 0,enumerable:!1},eq="captureStackTrace"in Error?Error:null;function eJ(e,t,n,r){function i(e){this.def=e,this.constr=u,this.traits=new Set}i.prototype={};let s=n&&new WeakSet;function o(r,o){if(r._zod){if(r._zod.traits.has(e))return}else{eK.value=new i(o);try{Object.defineProperty(r,"_zod",eK)}finally{eK.value=void 0}}if(r._zod.traits.add(e),t(r,o),s){let e=Object.getPrototypeOf(r),t=r._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let o=i??e;s.has(o)||(s.add(o),eP(o,n))}let a=u.prototype;for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&(e in r||(r[e]=a[e].bind(r)))}let a=r?.Parent??Object;class l extends a{}function u(e){let t=r?.Parent?function(e){let t=eq;if(t){let n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return eq=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(l):this;o(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class eV extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eW extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(ir=globalThis).__zod_globalConfig??(ir.__zod_globalConfig={});let eG=globalThis.__zod_globalConfig;function eY(e){return e&&Object.assign(eG,e),eG}class eX extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eH="~memo",eQ=[];function e0(e){return null!==e&&"object"==typeof e}function e1(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let e2=new WeakMap,e9=[],e4={alloc(e,t,r){let i=n;if(!i)return r;n=void 0;let s={value:r,issues:null};return i.set(t.value,s),e9.push(s),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{var r,i;let s;if("backward"!==n.direction&&(r=n,i=e.value,void 0!==(s=r[eH]?.backEdges)&&e0(i)&&s.has(i)))throw new eX;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let r,i,s,o=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(l,u)=>{let c;if(void 0===r){let n=function e(t,n,r){var i,s;let o=e2.get(t);if(void 0!==o)return 2*!!o;if(n.has(t))return 2;n.add(t);let a=0,l=t=>{if(2!==a&&t?._zod){let i=e(t,n,r);i>a&&(a=i)}},u=e=>{e>a&&(a=e)},c=t._zod.def;switch(c.type){case"object":{let t=A(c);u(t?((t,i)=>{let s=0;for(let o of Reflect.ownKeys(t)){let a=Object.getOwnPropertyDescriptor(t,o);if(i&&!a.enumerable)continue;let l=a.get?1:a.value?._zod?e(a.value,n,r):0;l>s&&(s=l)}return s})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let i=c._cachedInner??(r?t._zod.innerType:void 0);u(i?e(i,n,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&"object"==typeof n){if(n._zod)l(n);else if(Array.isArray(n))for(let e of n)l(e)}}}return n.delete(t),i=t,1!==(s=a)&&e2.set(i,2===s),s}(e,new Set,!1);if(0===n)return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(l,u);2===n||o?r=!0:o=!0}let f=l.value;if(!e0(f))return t(l,u);let d=u[eH];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[eH]=d),i===u)c=s;else{var p;let t;(t=(p=d).buckets.get(e))||(t=new WeakMap,p.buckets.set(e,t)),c=t,i=u,s=c}let h=c.get(f);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...e1(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;n=c;let m=e9.length,g=t(l,u);n=void 0;let y=e9.length>m?e9.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?e1(e.issues):eQ),e)):(y&&(y.issues=g.issues.length?e1(g.issues):eQ),g)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};(ii=globalThis).__zod_globalRegistry??(ii.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let e6=globalThis.__zod_globalRegistry,e8=/^[cC][0-9a-z]{6,}$/,e3=/^[0-9a-z]+$/,e5=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,e7=/^[0-9a-vA-V]{20}$/,te=/^[A-Za-z0-9]{27}$/,tt=/^[a-zA-Z0-9_-]{21}$/;function tn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ti=/^([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})$/,ts=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,to=ts(4),ta=ts(6),tl=ts(7),tu=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tf(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let td=/^(?:(?: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])$/,tp=/^(([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}|:))$/,th=e=>{let t=Y(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tm=/^((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])$/,tg=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ty=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tv=/^https?$/,tk=/^\+[1-9]\d{6,14}$/,tw=/^\d(?:[ -]?\d){11,18}$/,t_=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tS="(?:(?:\\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])))",tO=RegExp(`^${tS}$`);function tx(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function t$(e){return RegExp(`^${tx(e)}$`)}function tz(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${tx({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${tx({precision:e.precision})}`:n;return RegExp(`^${tS}T(?:${r})$`)}let tE=/^[\s\S]{0,}$/,tA=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tN=/^-?\d+n?$/,tT=/^-?\d+$/,tI=/^-?\d+(?:\.\d+)?$/,tj=/^(?:true|false)$/i,tP=/^null$/i,tC=/^undefined$/i,tL=/^[^A-Z]*$/,tD=/^[^a-z]*$/;function tM(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tR(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let tZ=tM(22,"=="),tB=tR(22),tU=tM(27,"="),tF=tR(27),tK=tM(43,"="),tq=tR(43),tJ=tM(64,""),tV=tR(64),tW=tM(86,"=="),tG=tR(86);e.s(["anyString",0,tE,"base64",0,ty,"base64url",0,tb,"bigint",0,tN,"boolean",0,tj,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tm,"cidrv6",0,tg,"creditCard",0,tw,"cuid",0,e8,"cuid2",0,e3,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tO,"datetime",0,tz,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tr,"e164",0,tk,"email",0,tu,"emoji",0,tf,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,ti,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tv,"iban",0,t_,"idnEmail",0,tc,"integer",0,tT,"ipv4",0,td,"ipv6",0,tp,"ksuid",0,te,"lowercase",0,tL,"mac",0,th,"md5_base64",0,tZ,"md5_base64url",0,tB,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tt,"nanoidOfLength",0,tn,"null",0,tP,"number",0,tI,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,tU,"sha1_base64url",0,tF,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tK,"sha256_base64url",0,tq,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,tJ,"sha384_base64url",0,tV,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tW,"sha512_base64url",0,tG,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tA,"time",0,t$,"ulid",0,e5,"undefined",0,tC,"unicodeEmail",0,tc,"uppercase",0,tD,"uuid",0,ts,"uuid4",0,to,"uuid6",0,ta,"uuid7",0,tl,"xid",0,e7],79692);let tY=eJ("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tX=e=>{let t=e.value;return!_(t)&&void 0!==t.size},tH=e=>{let t=e.value;return!_(t)&&void 0!==t.length},tQ={number:"number",bigint:"bigint",object:"date"},t0=eJ("$ZodCheckLessThan",(e,t)=>{tY.init(e,t);let n=tQ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:tQ[typeof r.value]??n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t1=eJ("$ZodCheckGreaterThan",(e,t)=>{tY.init(e,t);let n=tQ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:tQ[typeof r.value]??n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t2=eJ("$ZodCheckMultipleOf",(e,t)=>{tY.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):0===O(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),t9=eJ("$ZodCheckNumberFormat",(e,t)=>{tY.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,s]=en[t.format];e._zod.check=o=>{let a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<i&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),t4=eJ("$ZodCheckBigIntFormat",(e,t)=>{tY.init(e,t);let[n,r]=er[t.format];e._zod.check=i=>{let s=i.value;s<n&&i.issues.push({origin:"bigint",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>r&&i.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),t6=eJ("$ZodCheckMaxSize",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ek(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t8=eJ("$ZodCheckMinSize",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ek(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t3=eJ("$ZodCheckSizeEquals",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:ek(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),t5=eJ("$ZodCheckMaxLength",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>t.maximum?e_(r):i)<=t.maximum)return;let s=eS(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t7=eJ("$ZodCheckMinLength",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>=t.minimum&&i<2*t.minimum?e_(r):i)>=t.minimum)return;let s=eS(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ne=eJ("$ZodCheckLengthEquals",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length,s="string"==typeof r&&i>=t.length&&i<=2*t.length?e_(r):i;if(s===t.length)return;let o=eS(r),a=s>t.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nt=eJ("$ZodCheckStringFormat",(e,t)=>{var n,r;tY.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nn=eJ("$ZodCheckRegex",(e,t)=>{nt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nr=eJ("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tL),nt.init(e,t)}),ni=eJ("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tD),nt.init(e,t)}),ns=eJ("$ZodCheckIncludes",(e,t)=>{tY.init(e,t);let n=Y(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),no=eJ("$ZodCheckStartsWith",(e,t)=>{tY.init(e,t);let n=RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),na=eJ("$ZodCheckEndsWith",(e,t)=>{tY.init(e,t);let n=RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function nl(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues))}(e,t)=>{let n;tY.init(e,t),eL(e,Symbol.iterator,function*(){yield e}),e._zod.check=r=>{let i;if(null==r.value)return void r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});n??(n=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let s=r.value;for(let[e,t]of n){let n=t._zod.run({value:s[e],issues:[]},{});n instanceof Promise?(i??(i=[]),i.push(n.then(t=>nl(t,r,e)))):nl(n,r,e)}if(i)return Promise.all(i).then(()=>void 0)}},(e,t)=>{tY.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}};let nu=eJ("$ZodCheckOverwrite",(e,t)=>{tY.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class nc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
29
|
+
${t3(t.replace(/^\n+/,""))}`}],89089)},21229,33892,e=>{"use strict";let t,n,r,i,s,o,a,l,u,c;function f(e){return e}function d(e){return e}function p(){return e=>e}function h(e){}function m(e){throw Error("Unexpected value in exhaustive check")}function g(e){}function y(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function b(e,t="|"){return e.map(e=>ee(e)).join(t)}function v(e,t){return"bigint"==typeof t?t.toString():t}e.s(["BIGINT_FORMAT_RANGES",()=>er,"CONSTANT_CATCH",()=>eU,"Class",()=>ej,"NUMBER_FORMAT_RANGES",()=>en,"aborted",()=>ep,"allowsEval",()=>F,"assert",()=>g,"assertEqual",()=>f,"assertIs",()=>h,"assertNever",()=>m,"assertNotEqual",()=>d,"assignProp",()=>E,"attachSchema",()=>eb,"base64ToUint8Array",()=>ez,"base64urlToUint8Array",()=>eA,"cached",()=>k,"captureStackTrace",()=>B,"cleanEnum",()=>e$,"cleanRegex",()=>S,"clone",()=>X,"cloneDef",()=>C,"codePointLength",()=>e_,"constantCatch",()=>eF,"createTransparentProxy",()=>Q,"defineLazy",()=>$,"defineLazyInternal",()=>eZ,"derived",()=>eD,"esc",()=>R,"escapeRegex",()=>Y,"explicitlyAborted",()=>eh,"extend",()=>ea,"finalizeIssue",()=>ev,"floatSafeRemainder",()=>O,"getElementAtPath",()=>L,"getEnumValues",()=>y,"getLengthableOrigin",()=>eS,"getParsedType",()=>V,"getSizableOrigin",()=>ew,"hexToUint8Array",()=>eT,"hide",()=>eL,"installLazyProp",()=>eB,"isObject",()=>U,"isPlainObject",()=>K,"issue",()=>ex,"joinValues",()=>b,"jsonStringifyReplacer",()=>v,"members",()=>eP,"merge",()=>ec,"mergeDefs",()=>P,"normalizeParams",()=>H,"nullish",()=>_,"numKeys",()=>J,"objectClone",()=>z,"omit",()=>eo,"optionalKeys",()=>et,"own",()=>eC,"parsedType",()=>eO,"partial",()=>ef,"pick",()=>ei,"prefixIssues",()=>em,"primitiveTypes",()=>G,"promiseAllObject",()=>D,"propertyKeyTypes",()=>W,"randomString",()=>M,"rawShape",()=>A,"required",()=>ed,"safeExtend",()=>eu,"shallowClone",()=>q,"sizeCaps",()=>ey,"slugify",()=>Z,"stringifyPrimitive",()=>ee,"toZod",()=>p,"uint8ArrayToBase64",()=>eE,"uint8ArrayToBase64url",()=>eN,"uint8ArrayToHex",()=>eI,"unwrapMessage",()=>eg],22210);class w{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return void 0!==e&&(this._value=e(),this._getter=void 0),this._value}}function k(e){return new w(e)}function _(e){return null==e}function S(e){let t=+!!e.startsWith("^"),n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function O(e,t){let n=e/t,r=Math.round(n),i=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}let x=Symbol("evaluating");function $(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==x)return void 0===r&&(r=x,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function z(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function E(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function A(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function N(e){return A(e._zod.def)??e._zod.def.shape}function T(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return E(this,t,e),e},enumerable:!0,configurable:!0})}function I(e,t,n){t in e?E(e,t,n):e[t]=n}function j(e,t,n,r){let i=N(t);for(let s of n){let n=Object.getOwnPropertyDescriptor(i,s);n.enumerable&&(n.get?T(e,s,()=>{let e=t._zod.def.shape[s];return r?r(e,s):e}):I(e,s,r?r(n.value,s):n.value))}}function P(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function C(e){return P(e._zod.def)}function L(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function D(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function M(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function R(e){return JSON.stringify(e)}function Z(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let B="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function U(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let F=k(()=>{if(eG.jitless||"u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function K(e){if(!1===U(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let n=t.prototype;return!1!==U(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function q(e){return K(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function J(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}let V=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},W=new Set(["string","number","symbol"]),G=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function X(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function H(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function Q(e){let t;return new Proxy({},{get:(n,r,i)=>(t??(t=e()),Reflect.get(t,r,i)),set:(n,r,i,s)=>(t??(t=e()),Reflect.set(t,r,i,s)),has:(n,r)=>(t??(t=e()),Reflect.has(t,r)),deleteProperty:(n,r)=>(t??(t=e()),Reflect.deleteProperty(t,r)),ownKeys:n=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(n,r)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)),defineProperty:(n,r,i)=>(t??(t=e()),Reflect.defineProperty(t,r,i))})}function ee(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function et(e){return Object.keys(e).filter(t=>void 0!==e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let en={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},er={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ei(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return j(i,e,es(e,t)),X(e,P(n,{shape:i,checks:[]}))}function es(e,t){let n=N(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function eo(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(es(e,t)),s={};return j(s,e,Reflect.ownKeys(N(e)).filter(e=>!i.has(e))),X(e,P(n,{shape:s,checks:[]}))}function ea(e,t){if(!K(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let n=N(e);for(let e of Reflect.ownKeys(t))if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return X(e,P(e._zod.def,{shape:el(e,t)}))}function el(e,t){let n={};j(n,e,Reflect.ownKeys(N(e)));for(let e of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,e);r.enumerable&&(r.get?T(n,e,()=>t[e]):I(n,e,r.value))}return n}function eu(e,t){if(!K(t))throw Error("Invalid input to safeExtend: expected a plain object");return X(e,P(e._zod.def,{shape:el(e,t)}))}function ec(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};j(n,e,Reflect.ownKeys(N(e))),j(n,t,Reflect.ownKeys(N(t)));let r=P(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return X(e,r)}function ef(e,t,n,r="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let s=n?new Set(es(t,n)):void 0,o={};return j(o,t,Reflect.ownKeys(N(t)),e&&((t,n)=>s&&!s.has(n)?t:new e({type:"optional",innerType:t}))),X(t,P(t._zod.def,{shape:o,checks:[]}))}function ed(e,t,n){let r=n?new Set(es(t,n)):void 0,i={};return j(i,t,Reflect.ownKeys(N(t)),(t,n)=>r&&!r.has(n)?t:new e({type:"nonoptional",innerType:t})),X(t,P(t._zod.def,{shape:i}))}function ep(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function eh(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function em(e,t){return t.map(t=>(t.path??(t.path=[]),t.path.unshift(e),t))}function eg(e){return"string"==typeof e?e:e?.message}function ey(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function eb(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function ev(e,t,n){let r=e.inst?._zod?.traits;r?.has("$ZodType")&&(r.has("$ZodCheck")?e.schema??(e.schema=e.inst):e.schema=e.inst);let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:eg(e.inst?._zod.def?.error?.(e))??eg(i?.(e))??eg(t?.error?.(e))??eg(n.customError?.(e))??eg(n.localeError?.(e))??"Invalid input",o={};for(let t of Object.keys(e))"inst"!==t&&"schema"!==t&&"continue"!==t&&"input"!==t&&"__proto__"!==t&&(o[t]=e[t]);return o.path??(o.path=[]),o.message=s,t?.reportInput&&(o.input=e.input),o}function ew(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}let ek=/[\uD800-\uDBFF]/;function e_(e){let t=e.length;if(!ek.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(64512&e.charCodeAt(r))==55296&&(64512&e.charCodeAt(r+1))==56320&&(n--,r++);return n}function eS(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eO(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":if(null===e)return"null";if(Array.isArray(e))return"array";if(e&&Object.getPrototypeOf(e)!==Object.prototype&&"constructor"in e&&e.constructor)return e.constructor.name}return t}function ex(...e){let[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}function e$(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function ez(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}function eE(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function eA(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return ez(t+n)}function eN(e){return eE(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eT(e){let t=e.replace(/^0x/,"");if(t.length%2!=0)throw Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2)n[e/2]=Number.parseInt(t.slice(e,e+2),16);return n}function eI(e){return Array.from(e).map(e=>e.toString(16).padStart(2,"0")).join("")}class ej{constructor(...e){}}function eP(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):function(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:eC(this,t,n.bind(this))},set(e){eC(this,t,e)}})}(e,n,r.value)}}function eC(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function eL(e,t,n){return eC(e,t,n,!1)}function eD(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return eC(this,n,r(this))},set(e){eC(this,n,e)}})}return t}let eM=!1,eR={configurable:!0,get(){eM=!0}};function eZ(e,n,r){let i=Object.getPrototypeOf(e._zod);if(n in i&&t!==e._zod){t=void 0;return}t=e._zod,Object.defineProperty(i,n,{configurable:!0,get(){Object.defineProperty(this,n,eR);let e=eM;eM=!1;try{let t=r(this);return eM?delete this[n]:Object.defineProperty(this,n,{configurable:!0,writable:!0,value:t}),eM=eM||e,t}catch(t){throw delete this[n],eM=eM||e,t}},set(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})}function eB(e,t,n,r){let i,s=t in(i=Object.getPrototypeOf(e))?void 0:i;s&&Object.defineProperty(s,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}let eU="~constantCatch";function eF(e){let t=()=>e;return t[eU]=!0,t}let eK={value:void 0,enumerable:!1},eq="captureStackTrace"in Error?Error:null;function eJ(e,t,n,r){function i(e){this.def=e,this.constr=u,this.traits=new Set}i.prototype={};let s=n&&new WeakSet;function o(r,o){if(r._zod){if(r._zod.traits.has(e))return}else{eK.value=new i(o);try{Object.defineProperty(r,"_zod",eK)}finally{eK.value=void 0}}if(r._zod.traits.add(e),t(r,o),s){let e=Object.getPrototypeOf(r),t=r._zod.constr.prototype,i=e;for(;i&&i!==t;)i=Object.getPrototypeOf(i);let o=i??e;s.has(o)||(s.add(o),eP(o,n))}let a=u.prototype;for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&(e in r||(r[e]=a[e].bind(r)))}let a=r?.Parent??Object;class l extends a{}function u(e){let t=r?.Parent?function(e){let t=eq;if(t){let n=t.stackTraceLimit;if("number"==typeof n){try{t.stackTraceLimit=0}catch{return eq=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}(l):this;o(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(l,"name",{value:e}),Object.defineProperty(u,"init",{value:o}),Object.defineProperty(u,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(u,"name",{value:e}),u}class eV extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class eW extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(ir=globalThis).__zod_globalConfig??(ir.__zod_globalConfig={});let eG=globalThis.__zod_globalConfig;function eY(e){return e&&Object.assign(eG,e),eG}class eX extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}}let eH="~memo",eQ=[];function e0(e){return null!==e&&"object"==typeof e}function e1(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}let e2=new WeakMap,e9=[],e4={alloc(e,t,r){let i=n;if(!i)return r;n=void 0;let s={value:r,issues:null};return i.set(t.value,s),e9.push(s),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{var r,i;let s;if("backward"!==n.direction&&(r=n,i=e.value,void 0!==(s=r[eH]?.backEdges)&&e0(i)&&s.has(i)))throw new eX;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let r,i,s,o=!1;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(l,u)=>{let c;if(void 0===r){let n=function e(t,n,r){var i,s;let o=e2.get(t);if(void 0!==o)return 2*!!o;if(n.has(t))return 2;n.add(t);let a=0,l=t=>{if(2!==a&&t?._zod){let i=e(t,n,r);i>a&&(a=i)}},u=e=>{e>a&&(a=e)},c=t._zod.def;switch(c.type){case"object":{let t=A(c);u(t?((t,i)=>{let s=0;for(let o of Reflect.ownKeys(t)){let a=Object.getOwnPropertyDescriptor(t,o);if(i&&!a.enumerable)continue;let l=a.get?1:a.value?._zod?e(a.value,n,r):0;l>s&&(s=l)}return s})(t,!0):1),l(c.catchall);break}case"array":l(c.element);break;case"tuple":for(let e of c.items)l(e);l(c.rest);break;case"record":case"map":l(c.keyType),l(c.valueType);break;case"set":l(c.valueType);break;case"union":for(let e of c.options)l(e);break;case"intersection":l(c.left),l(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":l(c.innerType);break;case"pipe":l(c.in),l(c.out);break;case"function":l(c.input),l(c.output);break;case"lazy":{let i=c._cachedInner??(r?t._zod.innerType:void 0);u(i?e(i,n,!1):1);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&"object"==typeof n){if(n._zod)l(n);else if(Array.isArray(n))for(let e of n)l(e)}}}return n.delete(t),i=t,1!==(s=a)&&e2.set(i,2===s),s}(e,new Set,!1);if(0===n)return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(l,u);2===n||o?r=!0:o=!0}let f=l.value;if(!e0(f))return t(l,u);let d=u[eH];if(d||(d={buckets:new WeakMap,backEdges:void 0},u[eH]=d),i===u)c=s;else{var p;let t;(t=(p=d).buckets.get(e))||(t=new WeakMap,p.buckets.set(e,t)),c=t,i=u,s=c}let h=c.get(f);if(h)return l.value=h.value,h.issues?h.issues.length&&l.issues.push(...e1(h.issues)):(l.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value)),l;n=c;let m=e9.length,g=t(l,u);n=void 0;let y=e9.length>m?e9.pop():void 0;return g instanceof Promise?g.then(e=>(y&&(y.issues=e.issues.length?e1(e.issues):eQ),e)):(y&&(y.issues=g.issues.length?e1(g.issues):eQ),g)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};(ii=globalThis).__zod_globalRegistry??(ii.__zod_globalRegistry=new class e{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}});let e6=globalThis.__zod_globalRegistry,e8=/^[cC][0-9a-z]{6,}$/,e3=/^[0-9a-z]+$/,e5=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,e7=/^[0-9a-vA-V]{20}$/,te=/^[A-Za-z0-9]{27}$/,tt=/^[a-zA-Z0-9_-]{21}$/;function tn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}let tr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ti=/^([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})$/,ts=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,to=ts(4),ta=ts(6),tl=ts(7),tu=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,tc=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u;function tf(){return RegExp("^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$","u")}let td=/^(?:(?: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])$/,tp=/^(([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}|:))$/,th=e=>{let t=Y(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},tm=/^((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])$/,tg=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ty=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tb=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,tv=/^https?$/,tw=/^\+[1-9]\d{6,14}$/,tk=/^\d(?:[ -]?\d){11,18}$/,t_=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,tS="(?:(?:\\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])))",tO=RegExp(`^${tS}$`);function tx(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function t$(e){return RegExp(`^${tx(e)}$`)}function tz(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${tx({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${tx({precision:e.precision})}`:n;return RegExp(`^${tS}T(?:${r})$`)}let tE=/^[\s\S]{0,}$/,tA=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},tN=/^-?\d+n?$/,tT=/^-?\d+$/,tI=/^-?\d+(?:\.\d+)?$/,tj=/^(?:true|false)$/i,tP=/^null$/i,tC=/^undefined$/i,tL=/^[^A-Z]*$/,tD=/^[^a-z]*$/;function tM(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function tR(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let tZ=tM(22,"=="),tB=tR(22),tU=tM(27,"="),tF=tR(27),tK=tM(43,"="),tq=tR(43),tJ=tM(64,""),tV=tR(64),tW=tM(86,"=="),tG=tR(86);e.s(["anyString",0,tE,"base64",0,ty,"base64url",0,tb,"bigint",0,tN,"boolean",0,tj,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,tm,"cidrv6",0,tg,"creditCard",0,tk,"cuid",0,e8,"cuid2",0,e3,"currencyCode",0,/^(?:AED|AFN|ALL|AMD|AOA|ARS|AUD|AWG|AZN|BAM|BBD|BDT|BHD|BIF|BMD|BND|BOB|BOV|BRL|BSD|BTN|BWP|BYN|BZD|CAD|CDF|CHE|CHF|CHW|CLF|CLP|CNY|COP|COU|CRC|CUP|CVE|CZK|DJF|DKK|DOP|DZD|EGP|ERN|ETB|EUR|FJD|FKP|GBP|GEL|GHS|GIP|GMD|GNF|GTQ|GYD|HKD|HNL|HTG|HUF|IDR|ILS|INR|IQD|IRR|ISK|JMD|JOD|JPY|KES|KGS|KHR|KMF|KPW|KRW|KWD|KYD|KZT|LAK|LBP|LKR|LRD|LSL|LYD|MAD|MDL|MGA|MKD|MMK|MNT|MOP|MRU|MUR|MVR|MWK|MXN|MXV|MYR|MZN|NAD|NGN|NIO|NOK|NPR|NZD|OMR|PAB|PEN|PGK|PHP|PKR|PLN|PYG|QAR|RON|RSD|RUB|RWF|SAR|SBD|SCR|SDG|SEK|SGD|SHP|SLE|SOS|SRD|SSP|STN|SVC|SYP|SZL|THB|TJS|TMT|TND|TOP|TRY|TTD|TWD|TZS|UAH|UGX|USD|USN|UYI|UYU|UYW|UZS|VED|VES|VND|VUV|WST|XAD|XAF|XAG|XAU|XBA|XBB|XBC|XBD|XCD|XCG|XDR|XOF|XPD|XPF|XPT|XSU|XTS|XUA|XXX|YER|ZAR|ZMW|ZWG)$/,"date",0,tO,"datetime",0,tz,"domain",0,/^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,63}$/,"duration",0,tr,"e164",0,tw,"email",0,tu,"emoji",0,tf,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,ti,"hex",0,/^[0-9a-fA-F]*$/,"hostname",0,/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"httpProtocol",0,tv,"iban",0,t_,"idnEmail",0,tc,"integer",0,tT,"ipv4",0,td,"ipv6",0,tp,"ksuid",0,te,"lowercase",0,tL,"mac",0,th,"md5_base64",0,tZ,"md5_base64url",0,tB,"md5_hex",0,/^[0-9a-fA-F]{32}$/,"nanoid",0,tt,"nanoidOfLength",0,tn,"null",0,tP,"number",0,tI,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"sha1_base64",0,tU,"sha1_base64url",0,tF,"sha1_hex",0,/^[0-9a-fA-F]{40}$/,"sha256_base64",0,tK,"sha256_base64url",0,tq,"sha256_hex",0,/^[0-9a-fA-F]{64}$/,"sha384_base64",0,tJ,"sha384_base64url",0,tV,"sha384_hex",0,/^[0-9a-fA-F]{96}$/,"sha512_base64",0,tW,"sha512_base64url",0,tG,"sha512_hex",0,/^[0-9a-fA-F]{128}$/,"string",0,tA,"time",0,t$,"ulid",0,e5,"undefined",0,tC,"unicodeEmail",0,tc,"uppercase",0,tD,"uuid",0,ts,"uuid4",0,to,"uuid6",0,ta,"uuid7",0,tl,"xid",0,e7],79692);let tY=eJ("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),tX=e=>{let t=e.value;return!_(t)&&void 0!==t.size},tH=e=>{let t=e.value;return!_(t)&&void 0!==t.length},tQ={number:"number",bigint:"bigint",object:"date"},t0=eJ("$ZodCheckLessThan",(e,t)=>{tY.init(e,t);let n=tQ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:tQ[typeof r.value]??n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t1=eJ("$ZodCheckGreaterThan",(e,t)=>{tY.init(e,t);let n=tQ[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:tQ[typeof r.value]??n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),t2=eJ("$ZodCheckMultipleOf",(e,t)=>{tY.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):0===O(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),t9=eJ("$ZodCheckNumberFormat",(e,t)=>{tY.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[i,s]=en[t.format];e._zod.check=o=>{let a=o.value;if(n){if(!Number.isInteger(a))return void o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}))}a<i&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),t4=eJ("$ZodCheckBigIntFormat",(e,t)=>{tY.init(e,t);let[n,r]=er[t.format];e._zod.check=i=>{let s=i.value;s<n&&i.issues.push({origin:"bigint",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>r&&i.issues.push({origin:"bigint",input:s,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),t6=eJ("$ZodCheckMaxSize",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:ew(r),code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t8=eJ("$ZodCheckMinSize",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:ew(r),code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t3=eJ("$ZodCheckSizeEquals",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tX),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let s=i>t.size;n.issues.push({origin:ew(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),t5=eJ("$ZodCheckMaxLength",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>t.maximum?e_(r):i)<=t.maximum)return;let s=eS(r);n.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),t7=eJ("$ZodCheckMinLength",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length;if(("string"==typeof r&&i>=t.minimum&&i<2*t.minimum?e_(r):i)>=t.minimum)return;let s=eS(r);n.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ne=eJ("$ZodCheckLengthEquals",(e,t)=>{var n;tY.init(e,t),(n=e._zod.def).when??(n.when=tH),e._zod.check=n=>{let r=n.value,i=r.length,s="string"==typeof r&&i>=t.length&&i<=2*t.length?e_(r):i;if(s===t.length)return;let o=eS(r),a=s>t.length;n.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),nt=eJ("$ZodCheckStringFormat",(e,t)=>{var n,r;tY.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nn=eJ("$ZodCheckRegex",(e,t)=>{nt.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nr=eJ("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tL),nt.init(e,t)}),ni=eJ("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=tD),nt.init(e,t)}),ns=eJ("$ZodCheckIncludes",(e,t)=>{tY.init(e,t);let n=Y(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),no=eJ("$ZodCheckStartsWith",(e,t)=>{tY.init(e,t);let n=RegExp(`^${Y(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),na=eJ("$ZodCheckEndsWith",(e,t)=>{tY.init(e,t);let n=RegExp(`.*${Y(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function nl(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues))}(e,t)=>{let n;tY.init(e,t),eL(e,Symbol.iterator,function*(){yield e}),e._zod.check=r=>{let i;if(null==r.value)return void r.issues.push({expected:"object",code:"invalid_type",input:r.value,inst:e});n??(n=Reflect.ownKeys(t.shape).map(e=>[e,t.shape[e]]));let s=r.value;for(let[e,t]of n){let n=t._zod.run({value:s[e],issues:[]},{});n instanceof Promise?(i??(i=[]),i.push(n.then(t=>nl(t,r,e)))):nl(n,r,e)}if(i)return Promise.all(i).then(()=>void 0)}},(e,t)=>{tY.init(e,t);let n=new Set(t.mime);e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}};let nu=eJ("$ZodCheckOverwrite",(e,t)=>{tY.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class nc{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
30
30
|
${t.join("\n")}
|
|
31
|
-
};`)(...Object.values(this.closed))}}let nf={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,v,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nd={value:void 0,enumerable:!1},np=new WeakSet([Object.prototype,Error.prototype]),nh=(e,t)=>{e.name="$ZodError",nd.value=t,Object.defineProperty(e,"issues",nd),nd.value=void 0,Object.defineProperty(e,"message",nf);let n=Object.getPrototypeOf(e);np.has(n)||(np.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nm=eJ("$ZodError",nh),ng=eJ("$ZodError",nh,void 0,{Parent:Error});function ny(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nb=e=>{let t=(n,r,i,s)=>{let o=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new eV;if(a.issues.length){let n=new(s?.Err??e)(a.issues.map(e=>ev(e,o,eY())));throw B(n,s?.callee??t),n}return a.value};return t},nv=nb(ng),nk=e=>{let t=async(n,r,i,s)=>{let o=i?{...i,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let n=new(s?.Err??e)(a.issues.map(e=>ev(e,o,eY())));throw B(n,s?.callee??t),n}return a.value};return t},nw=nk(ng),n_=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new eV;return s.issues.length?nS(e,s.issues,i):{success:!0,data:s.value}};function nS(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ev(e,n,eY()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let nO=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?nS(e,s.issues,i):{success:!0,data:s.value}},nx=Symbol.for("zod.compile.invalid"),n$=Symbol.for("zod.compile.fallback"),nz=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),0===i.issues.length},nE={major:4,minor:6,patch:7},nA=eJ("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nE;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{let i;if(t.memo)return t;let s=ep(t);for(let o of n){if(o._zod.def.when){if(eh(t)||!o._zod.def.when(t))continue}else if(s)continue;let n=t.issues.length,a=o._zod.check(t);if(a instanceof Promise&&r?.async===!1)throw new eV;if(i||a instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await a,t.issues.length!==n&&(eb(t.issues,n,e),s||(s=ep(t,n)))});else{if(t.issues.length===n)continue;eb(t.issues,n,e),s||(s=ep(t,n))}}return i?i.then(()=>t):t},n=(n,r,s)=>{if(ep(n))return n.aborted=!0,n;let o=t(r,i,s);if(o instanceof Promise){if(!1===s.async)throw new eV;return o.then(t=>e._zod.parse(t,s))}return e._zod.parse(o,s)};e._zod.run=(r,s)=>{if(s.skipChecks)return e._zod.parse(r,s);if("backward"===s.direction){let t=e._zod.parse({value:r.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,s)):n(t,r,s)}let o=e._zod.parse(r,s);if(o instanceof Promise){if(!1===s.async)throw new eV;return o.then(e=>t(e,i,s))}return t(o,i,s)}}},{get"~standard"(){return eL(this,"~standard",nI(this))},set"~standard"(e){eC(this,"~standard",e)}}),nN=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ev(e,t,eY()))}:{value:e.value};async function nT(e,t){let n={async:!0};return nN(await e._zod.run({value:t,issues:[]},n),n)}function nI(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return nN(r,n)}catch(e){}return nT(e,t)},vendor:"zod",version:1}}let nj=eJ("$ZodString",(e,t)=>{nA.init(e,t),e._zod.pattern=t.pattern??tE,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),nP=eJ("$ZodStringFormat",(e,t)=>{nt.init(e,t),nj.init(e,t)}),nC=eJ("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ti),nP.init(e,t)}),nL=eJ("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ts(e))}else t.pattern??(t.pattern=ts());nP.init(e,t)}),nD=eJ("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tu),nP.init(e,t)});function nM(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let nR=/[\t\n\r]/g;function nZ(e){return e.replace(nR,"")}let nB=eJ("$ZodURL",(e,t)=>{nP.init(e,t),e._zod.check=n=>{try{var r,i;let s=n.value.trim(),o="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===tv.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(s,t):nM(s)||2;if(1===o)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});if(2===o)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});if(!0===o){n.value=nZ(s);return}t.hostname&&((r=t.hostname).lastIndex=0,!r.test(o.hostname))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:nZ(s);return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),nU=eJ("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tf()),nP.init(e,t)}),nF=eJ("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?tt:tn(t.length)),nP.init(e,t)}),nK=eJ("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=e8),nP.init(e,t)}),nq=eJ("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=e3),nP.init(e,t)}),nJ=eJ("$ZodULID",(e,t)=>{t.pattern??(t.pattern=e5),nP.init(e,t)}),nV=eJ("$ZodXID",(e,t)=>{t.pattern??(t.pattern=e7),nP.init(e,t)}),nW=eJ("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=te),nP.init(e,t)}),nG=eJ("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tz(t)),nP.init(e,t)}),nY=eJ("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tO),nP.init(e,t)}),nX=eJ("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=t$(t)),nP.init(e,t)}),nH=eJ("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tr),nP.init(e,t)}),nQ=eJ("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=td),nP.init(e,t)}),n0=/^[0-9a-fA-F:.]+$/;function n1(e){return!!n0.test(e)&&nM(`http://[${e}]`)}let n2=eJ("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tp),nP.init(e,t),e._zod.check=n=>{n1(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),n9=((e,t)=>{t.pattern??(t.pattern=th(t.delimiter)),nP.init(e,t)},eJ("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tm),nP.init(e,t)})),n4=eJ("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tg),nP.init(e,t),e._zod.check=n=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`===r&&!(i<0)&&!(i>128)&&n1(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function n6(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let n8=/^[0-9a-zA-Z+/]*={0,2}$/,n3=eJ("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=n8),nP.init(e,t),e._zod.check=n=>{n6(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),n5=/^[A-Za-z0-9_-]*$/,n7=eJ("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=n5),nP.init(e,t),e._zod.check=n=>{!function(e){if(!n5.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return n6(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),re=eJ("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tk),nP.init(e,t)}),rt=/[- ]/g,rn=((e,t)=>{t.pattern??(t.pattern=tw),nP.init(e,t),e._zod.check=n=>{var r;r=n.value,tw.test(r)&&function(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}(r.replace(rt,""))||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}},eJ("$ZodJWT",(e,t)=>{nP.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),rr=((e,t)=>{nP.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}},eJ("$ZodNumber",(e,t)=>{nA.init(e,t),e._zod.pattern=tI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}})),ri=eJ("$ZodNumberFormat",(e,t)=>{t9.init(e,t),rr.init(e,t)}),rs=eJ("$ZodBoolean",(e,t)=>{nA.init(e,t),e._zod.pattern=tj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),ro=eJ("$ZodBigInt",(e,t)=>{nA.init(e,t),e._zod.pattern=tN,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),ra=((e,t)=>{t4.init(e,t),ro.init(e,t)},eJ("$ZodUnknown",(e,t)=>{nA.init(e,t),e._zod.parse=e=>e})),rl=eJ("$ZodNever",(e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ru(e,t){let n=ey(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,s)=>{let o=t(n.value);if(o>r&&!s?.skipChecks&&s?.direction!=="backward"){for(let[t,r]of ey(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,eb(n.issues,t,e),n}}return i(n,s)}}(e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}},(e,t)=>{nA.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),n}};let rc=e=>Array.isArray(e)?e.length:-1,rf=e=>e instanceof Map?e.size:-1,rd=e=>e instanceof Set?e.size:-1;function rp(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues)),t.value[n]=e.value}let rh=eJ("$ZodArray",(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),i):Array(s.length);let o=[],a=i?.abortEarly;for(let e=0;e<s.length;e++){let n=s[e],l=t.element._zod.run({value:n,issues:[]},i);if(l instanceof Promise)o.push(l.then(t=>rp(t,r,e)));else if(rp(l,r,e),a&&0!==l.issues.length&&ep(l))break}return o.length?Promise.all(o).then(()=>r):r},ru(e,rc)});function rm(e,t,n,r,i,s){let o=n in r,a="optional"===s;if(o||!a||"optional"!==i){if(e.issues.length){if(void 0!==i&&a&&!o)return;t.issues.push(...em(n,e.issues))}if(!o&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?(o||"defaulted"===i&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}let rg=[];function ry(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:rg,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let s=et(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rb(e,t,n,r,i,s,o){let a=[],l=i.keySet,u=i.catchall._zod,c=u.def.type,f=u.optin,d=u.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(ep(n,p))break;p=n.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===c&&a.push(i);continue}if("never"===c){a.push(i);continue}let s=u.run({value:t[i],issues:[]},r);s instanceof Promise?e.push(s.then(e=>rm(e,n,i,t,f,d))):rm(s,n,i,t,f,d)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length)?Promise.all(e).then(()=>n):n}let rv=eJ("$ZodObject",(e,t)=>{let n;nA.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),i=r?.get?r.get.raw:t.shape??{};if(i){let e=()=>{let n={...i};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let s=w(()=>ry(t));eZ(e,"propValues",e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){for(let t of(Object.prototype.hasOwnProperty.call(n,e)||E(n,e,new Set),r.values))n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});let o=t.catchall,a=eG.memoizer;a?.attach(e),e._zod.parse=(t,r)=>{n??(n=s.value);let i=t.value;if(!U(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=a?a.alloc(e,t,{},r):{};let l=[],u=n.shape,c=r?.abortEarly,f=t.issues.length;for(let e of n.allKeys){if(c&&t.issues.length!==f){if(ep(t,f))break;f=t.issues.length}if("__proto__"===e)continue;let n=u[e],s=n._zod.optin,o=n._zod.optout,a=n._zod.run({value:i[e],issues:[]},r);a instanceof Promise?l.push(a.then(n=>rm(n,t,e,i,s,o))):rm(a,t,e,i,s,o)}return o?rb(l,i,t,r,s.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),rk=eJ("$ZodObjectJIT",(e,t)=>{let n,r;rv.init(e,t);let i=e._zod.parse,s=w(()=>ry(t)),o=eG.memoizer,a=!eG.jitless,l=a&&F.value,u=t.catchall;e._zod.parse=(c,f)=>{r??(r=s.value);let d=c.value;return U(d)?a&&l&&f?.async===!1&&!0!==f.jitless?(n||(n=(t=>{let n=s.value,r=n.symbolKeys,i=new nc(["payload","ctx"],{shape:t,inst:e,memo:o,syms:r}),a=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
31
|
+
};`)(...Object.values(this.closed))}}let nf={get:function(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,v,2)),e.message},set:function(e){this._zod.message=e},enumerable:!0,configurable:!0},nd={value:void 0,enumerable:!1},np=new WeakSet([Object.prototype,Error.prototype]),nh=(e,t)=>{e.name="$ZodError",nd.value=t,Object.defineProperty(e,"issues",nd),nd.value=void 0,Object.defineProperty(e,"message",nf);let n=Object.getPrototypeOf(e);np.has(n)||(np.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},nm=eJ("$ZodError",nh),ng=eJ("$ZodError",nh,void 0,{Parent:Error});function ny(e,t){return{callee:t?.callee??e,Err:t?.Err}}let nb=e=>{let t=(n,r,i,s)=>{let o=i?{...i,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new eV;if(a.issues.length){let n=new(s?.Err??e)(a.issues.map(e=>ev(e,o,eY())));throw B(n,s?.callee??t),n}return a.value};return t},nv=nb(ng),nw=e=>{let t=async(n,r,i,s)=>{let o=i?{...i,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let n=new(s?.Err??e)(a.issues.map(e=>ev(e,o,eY())));throw B(n,s?.callee??t),n}return a.value};return t},nk=nw(ng),n_=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new eV;return s.issues.length?nS(e,s.issues,i):{success:!0,data:s.value}};function nS(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>ev(e,n,eY()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}let nO=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?nS(e,s.issues,i):{success:!0,data:s.value}},nx=Symbol.for("zod.compile.invalid"),n$=Symbol.for("zod.compile.fallback"),nz=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),0===i.issues.length},nE={major:4,minor:6,patch:7},nA=eJ("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nE;let r=e._zod.def.checks,i=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{let i;if(t.memo)return t;let s=ep(t);for(let o of n){if(o._zod.def.when){if(eh(t)||!o._zod.def.when(t))continue}else if(s)continue;let n=t.issues.length,a=o._zod.check(t);if(a instanceof Promise&&r?.async===!1)throw new eV;if(i||a instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await a,t.issues.length!==n&&(eb(t.issues,n,e),s||(s=ep(t,n)))});else{if(t.issues.length===n)continue;eb(t.issues,n,e),s||(s=ep(t,n))}}return i?i.then(()=>t):t},n=(n,r,s)=>{if(ep(n))return n.aborted=!0,n;let o=t(r,i,s);if(o instanceof Promise){if(!1===s.async)throw new eV;return o.then(t=>e._zod.parse(t,s))}return e._zod.parse(o,s)};e._zod.run=(r,s)=>{if(s.skipChecks)return e._zod.parse(r,s);if("backward"===s.direction){let t=e._zod.parse({value:r.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,s)):n(t,r,s)}let o=e._zod.parse(r,s);if(o instanceof Promise){if(!1===s.async)throw new eV;return o.then(e=>t(e,i,s))}return t(o,i,s)}}},{get"~standard"(){return eL(this,"~standard",nI(this))},set"~standard"(e){eC(this,"~standard",e)}}),nN=(e,t)=>e.issues.length?{issues:e.issues.map(e=>ev(e,t,eY()))}:{value:e.value};async function nT(e,t){let n={async:!0};return nN(await e._zod.run({value:t,issues:[]},n),n)}function nI(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return nN(r,n)}catch(e){}return nT(e,t)},vendor:"zod",version:1}}let nj=eJ("$ZodString",(e,t)=>{nA.init(e,t),e._zod.pattern=t.pattern??tE,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(e){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),nP=eJ("$ZodStringFormat",(e,t)=>{nt.init(e,t),nj.init(e,t)}),nC=eJ("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ti),nP.init(e,t)}),nL=eJ("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ts(e))}else t.pattern??(t.pattern=ts());nP.init(e,t)}),nD=eJ("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tu),nP.init(e,t)});function nM(e){try{if("u">typeof URL&&"function"==typeof URL.canParse)return URL.canParse(e);return new URL(e),!0}catch{return!1}}let nR=/[\t\n\r]/g;function nZ(e){return e.replace(nR,"")}let nB=eJ("$ZodURL",(e,t)=>{nP.init(e,t),e._zod.check=n=>{try{var r,i;let s=n.value.trim(),o="normalize"in t||"hostname"in t||"protocol"in t?function(e,t){if(!t.normalize&&t.protocol?.source===tv.source&&!/^https?:\/\//i.test(e))return 1;try{if("u">typeof URL){let t=URL;if("function"==typeof t.parse)return t.parse(e)??2}return new URL(e)}catch{return 2}}(s,t):nM(s)||2;if(1===o)return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});if(2===o)return void n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});if(!0===o){n.value=nZ(s);return}t.hostname&&((r=t.hostname).lastIndex=0,!r.test(o.hostname))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&((i=t.protocol).lastIndex=0,!i.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol))&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:nZ(s);return}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),nU=eJ("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=tf()),nP.init(e,t)}),nF=eJ("$ZodNanoID",(e,t)=>{if(void 0!==t.length&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=void 0===t.length?tt:tn(t.length)),nP.init(e,t)}),nK=eJ("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=e8),nP.init(e,t)}),nq=eJ("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=e3),nP.init(e,t)}),nJ=eJ("$ZodULID",(e,t)=>{t.pattern??(t.pattern=e5),nP.init(e,t)}),nV=eJ("$ZodXID",(e,t)=>{t.pattern??(t.pattern=e7),nP.init(e,t)}),nW=eJ("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=te),nP.init(e,t)}),nG=eJ("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=tz(t)),nP.init(e,t)}),nY=eJ("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=tO),nP.init(e,t)}),nX=eJ("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=t$(t)),nP.init(e,t)}),nH=eJ("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=tr),nP.init(e,t)}),nQ=eJ("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=td),nP.init(e,t)}),n0=/^[0-9a-fA-F:.]+$/;function n1(e){return!!n0.test(e)&&nM(`http://[${e}]`)}let n2=eJ("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=tp),nP.init(e,t),e._zod.check=n=>{n1(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}),n9=((e,t)=>{t.pattern??(t.pattern=th(t.delimiter)),nP.init(e,t)},eJ("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=tm),nP.init(e,t)})),n4=eJ("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tg),nP.init(e,t),e._zod.check=n=>{!function(e){let t=e.split("/");if(2!==t.length)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`===r&&!(i<0)&&!(i>128)&&n1(n)}(n.value)&&n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function n6(e){if(""===e)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let n8=/^[0-9a-zA-Z+/]*={0,2}$/,n3=eJ("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=n8),nP.init(e,t),e._zod.check=n=>{n6(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),n5=/^[A-Za-z0-9_-]*$/,n7=eJ("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=n5),nP.init(e,t),e._zod.check=n=>{!function(e){if(!n5.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return n6(t.padEnd(4*Math.ceil(t.length/4),"="))}(n.value)&&n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),re=eJ("$ZodE164",(e,t)=>{t.pattern??(t.pattern=tw),nP.init(e,t)}),rt=/[- ]/g,rn=((e,t)=>{t.pattern??(t.pattern=tk),nP.init(e,t),e._zod.check=n=>{var r;r=n.value,tk.test(r)&&function(e){let t=e.length,n=1,r=0;for(;t;){let i=e.charCodeAt(--t)-48;n^=1,r+=n?[0,2,4,6,8,1,3,5,7,9][i]:i}return r%10==0}(r.replace(rt,""))||n.issues.push({code:"invalid_format",format:"credit_card",input:n.value,inst:e,continue:!t.abort})}},eJ("$ZodJWT",(e,t)=>{nP.init(e,t),e._zod.check=n=>{!function(e,t=null){try{let n=e.split(".");if(3!==n.length)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}(n.value,t.alg)&&n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),rr=((e,t)=>{nP.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}},eJ("$ZodNumber",(e,t)=>{nA.init(e,t),e._zod.pattern=tI,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}let i=n.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return n;let s="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}})),ri=eJ("$ZodNumberFormat",(e,t)=>{t9.init(e,t),rr.init(e,t)}),rs=eJ("$ZodBoolean",(e,t)=>{nA.init(e,t),e._zod.pattern=tj,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch(e){}let i=n.value;return"boolean"==typeof i||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),ro=eJ("$ZodBigInt",(e,t)=>{nA.init(e,t),e._zod.pattern=tN,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),ra=((e,t)=>{t4.init(e,t),ro.init(e,t)},eJ("$ZodUnknown",(e,t)=>{nA.init(e,t),e._zod.parse=e=>e})),rl=eJ("$ZodNever",(e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function ru(e,t){let n=ey(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,s)=>{let o=t(n.value);if(o>r&&!s?.skipChecks&&s?.direction!=="backward"){for(let[t,r]of ey(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,eb(n.issues,t,e),n}}return i(n,s)}}(e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return void 0===r||t.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),t}},(e,t)=>{nA.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(e){}let i=n.value,s=i instanceof Date;return s&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...s?{received:"Invalid Date"}:{},inst:e}),n}};let rc=e=>Array.isArray(e)?e.length:-1,rf=e=>e instanceof Map?e.size:-1,rd=e=>e instanceof Set?e.size:-1;function rp(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues)),t.value[n]=e.value}let rh=eJ("$ZodArray",(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),i):Array(s.length);let o=[],a=i?.abortEarly;for(let e=0;e<s.length;e++){let n=s[e],l=t.element._zod.run({value:n,issues:[]},i);if(l instanceof Promise)o.push(l.then(t=>rp(t,r,e)));else if(rp(l,r,e),a&&0!==l.issues.length&&ep(l))break}return o.length?Promise.all(o).then(()=>r):r},ru(e,rc)});function rm(e,t,n,r,i,s){let o=n in r,a="optional"===s;if(o||!a||"optional"!==i){if(e.issues.length){if(void 0!==i&&a&&!o)return;t.issues.push(...em(n,e.issues))}if(!o&&void 0===i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}void 0===e.value?(o||"defaulted"===i&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}let rg=[];function ry(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:rg,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let s=et(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function rb(e,t,n,r,i,s,o){let a=[],l=i.keySet,u=i.catchall._zod,c=u.def.type,f=u.optin,d=u.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(ep(n,p))break;p=n.issues.length}if(l.has(i))continue;if("__proto__"===i){"never"===c&&a.push(i);continue}if("never"===c){a.push(i);continue}let s=u.run({value:t[i],issues:[]},r);s instanceof Promise?e.push(s.then(e=>rm(e,n,i,t,f,d))):rm(s,n,i,t,f,d)}return(a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length)?Promise.all(e).then(()=>n):n}let rv=eJ("$ZodObject",(e,t)=>{let n;nA.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),i=r?.get?r.get.raw:t.shape??{};if(i){let e=()=>{let n={...i};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=i,Object.defineProperty(t,"shape",{get:e})}let s=k(()=>ry(t));eZ(e,"propValues",e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){for(let t of(Object.prototype.hasOwnProperty.call(n,e)||E(n,e,new Set),r.values))n[e].add(t);void 0!==r.optin&&n[e].add(void 0)}}return n});let o=t.catchall,a=eG.memoizer;a?.attach(e),e._zod.parse=(t,r)=>{n??(n=s.value);let i=t.value;if(!U(i))return t.issues.push({expected:"object",code:"invalid_type",input:i,inst:e}),t;t.value=a?a.alloc(e,t,{},r):{};let l=[],u=n.shape,c=r?.abortEarly,f=t.issues.length;for(let e of n.allKeys){if(c&&t.issues.length!==f){if(ep(t,f))break;f=t.issues.length}if("__proto__"===e)continue;let n=u[e],s=n._zod.optin,o=n._zod.optout,a=n._zod.run({value:i[e],issues:[]},r);a instanceof Promise?l.push(a.then(n=>rm(n,t,e,i,s,o))):rm(a,t,e,i,s,o)}return o?rb(l,i,t,r,s.value,e,!0===c):l.length?Promise.all(l).then(()=>t):t}}),rw=eJ("$ZodObjectJIT",(e,t)=>{let n,r;rv.init(e,t);let i=e._zod.parse,s=k(()=>ry(t)),o=eG.memoizer,a=!eG.jitless,l=a&&F.value,u=t.catchall;e._zod.parse=(c,f)=>{r??(r=s.value);let d=c.value;return U(d)?a&&l&&f?.async===!1&&!0!==f.jitless?(n||(n=(t=>{let n=s.value,r=n.symbolKeys,i=new nc(["payload","ctx"],{shape:t,inst:e,memo:o,syms:r}),a=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,l=(e,t)=>`
|
|
32
32
|
let ${e}_ab = false;
|
|
33
33
|
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
34
34
|
const iss = ${e}.issues[i];
|
|
@@ -78,6 +78,6 @@ ${t.join("\n")}
|
|
|
78
78
|
newResult[${s}] = ${n}.value;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=n(c,f),u)?rb([],d,c,f,r,e,f?.abortEarly===!0):c:i(c,f):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function rw(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!ep(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ev(e,r,eY())))}),t)}let r_=eJ("$ZodUnion",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eZ(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eZ(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eZ(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>S(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),s=!0;else{if(0===t.issues.length)return t;o.push(t)}}return s?Promise.all(o).then(t=>rw(t,r,e,i)):rw(o,r,e,i)}});function rS(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ev(e,r,eY())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{r_.init(e,t),t.inclusive=!1;let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),s=!0):o.push(t)}return s?Promise.all(o).then(t=>rS(t,r,e,i)):rS(o,r,e,i)}};let rO=eJ("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,r_.init(e,t);let n=e._zod.parse;eZ(e,"propValues",e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);for(let[r,s]of(i[e.def.discriminator]?.has(void 0)&&n++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,r)||E(t,r,new Set),s))t[r].add(e)}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=A(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=w(()=>(function(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||0===r.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t})(t));e._zod.parse=(i,s)=>{let o=i.value;if(!U(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;let a=o?.[t.discriminator],l=r.value.get(a);return l&&(void 0!==a||"backward"!==s.direction)?l._zod.run(i,s):t.unionFallback||"backward"===s.direction?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>null!==r.value.get(e)),input:o,path:[t.discriminator],inst:e}),i)}}),rx=eJ("$ZodIntersection",(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,n])=>r$(e,t,n)):r$(e,i,s)}});function r$(e,t,n){let r,i=new Map,s=new Map,o=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);s.has(t)||s.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,"l")||e.issues.push(n);for(let t of n.issues)o(t,"r")||e.issues.push(t);let a=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length){let t=r?a.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),a))!t.includes(n)&&s.has(n)&&e.issues.push(s.get(n))}let l=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(K(t)&&K(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),s={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};s[r]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let s=e(t[i],n[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!l.valid){if(ep(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rz=eJ("$ZodTuple",(e,t)=>{nA.init(e,t);let n=t.items,r=eG.memoizer;r?.attach(e),e._zod.parse=(i,s)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],s):[];let a=[],l=rE(n,"optin"),u=rE(n,"optout");if(!t.rest){if(o.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:o,inst:e,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}let c=Array(n.length),f=t.rest?s?.abortEarly:void 0,d=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},s);t instanceof Promise?a.push(t.then(t=>{c[e]=t})):(c[e]=t,f&&!d&&t.issues.length&&(d=ep(t)))}if(t.rest&&!d){let e=n.length-1,r=o.slice(n.length),l=i.issues.length;for(let n of r){if(f&&i.issues.length!==l){if(ep(i,l))break;l=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},s);r instanceof Promise?a.push(r.then(t=>rA(t,i,e))):rA(r,i,e)}}return a.length?Promise.all(a).then(()=>rN(c,i,n,o,u)):rN(c,i,n,o,u)}});function rE(e,t){for(let n=e.length-1;n>=0;n--)if(!("optin"===t?void 0!==e[n]._zod.optin:"optional"===e[n]._zod.optout))return n+1;return 0}function rA(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues)),t.value[n]=e.value}function rN(e,t,n,r,i){for(let s=0;s<n.length;s++){let o=e[s],a=s<r.length;if(!a&&s>=i&&"optional"===n[s]._zod.optin){t.value.length=s;break}if(o.issues.length){if(!a&&s>=i){t.value.length=s;break}t.issues.push(...em(s,o.issues))}t.value[s]=o.value}for(let e=t.value.length-1;e>=r.length;e--)if("optional"===n[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let rT=eJ("$ZodRecord",(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!K(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let o=[],a=t.keyType._zod.values;if(a&&!t.partial){let l;r.value=n?n.alloc(e,r,{},i):{};let u=new Set;for(let n of a)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(u.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let a=t.keyType._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ev(e,i,eY())),input:n,path:[n],inst:e});continue}let l=a.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:s[n],issues:[]},i);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&r.issues.push(...em(n,e.issues)),r.value[l]=e.value})):(c.issues.length&&r.issues.push(...em(n,c.issues)),r.value[l]=c.value)}for(let e in s)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=s[e]}else(l=l??[]).push(e);l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}else{let l;for(let u of(r.value=n?n.alloc(e,r,{},i):{},Reflect.ownKeys(s))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let n=t.keyType._zod.run({value:u,issues:[]},i);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&tI.test(u)&&n.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[u]=s[u]:a?(l=l??[]).push(u):r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>ev(e,i,eY())),input:u,path:[u],inst:e});continue}let c=n.value;if("__proto__"===c)continue;let f=t.valueType._zod.run({value:s[u],issues:[]},i);f instanceof Promise?o.push(f.then(e=>{e.issues.length&&r.issues.push(...em(u,e.issues)),r.value[c]=e.value})):(f.issues.length&&r.issues.push(...em(u,f.issues)),r.value[c]=f.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}});function rI(e,t,n,r,i,s,o){e.issues.length&&(W.has(typeof r)?n.issues.push(...em(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:e.issues.map(e=>ev(e,o,eY()))})),t.issues.length&&(W.has(typeof r)?n.issues.push(...em(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:r,issues:t.issues.map(e=>ev(e,o,eY()))})),n.value.set(e.value,t.value)}function rj(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!(s instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let a=i?.abortEarly,l=r.issues.length;for(let[n,u]of s){if(a&&r.issues.length!==l){if(ep(r,l))break;l=r.issues.length}let c=t.keyType._zod.run({value:n,issues:[]},i),f=t.valueType._zod.run({value:u,issues:[]},i);c instanceof Promise||f instanceof Promise?o.push(Promise.all([c,f]).then(([t,o])=>{rI(t,o,r,n,s,e,i)})):rI(c,f,r,n,s,e,i)}return o.length?Promise.all(o).then(()=>r):r},ru(e,rf)},(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!(s instanceof Set))return r.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let a=i?.abortEarly,l=r.issues.length;for(let e of s){if(a&&r.issues.length!==l){if(ep(r,l))break;l=r.issues.length}let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?o.push(n.then(e=>rj(e,r))):rj(n,r)}return o.length?Promise.all(o).then(()=>r):r},ru(e,rd)};let rP=eJ("$ZodEnum",(e,t)=>{nA.init(e,t);let n=y(t.entries),r=new Set(n);e._zod.values=r,eZ(e,"pattern",e=>{let t=y(e.def.entries).filter(e=>W.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>Y(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),rC=eJ("$ZodLiteral",(e,t)=>{nA.init(e,t);let n=new Set(t.values);e._zod.values=n,eZ(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?Y(e):e?Y(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),rL=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}},eJ("$ZodTransform",(e,t)=>{nA.init(e,t),e._zod.optin="optional",eG.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eW(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new eV;return n.value=i,n}}));function rD(e,t){return e.value=t.issues.length?void 0:t.value,e}let rM=eJ("$ZodOptional",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eZ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eZ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${S(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>rD(e,t)):rD(e,r)}return t.innerType._zod.run(e,n)}}),rR=eJ("$ZodExactOptional",(e,t)=>{rM.init(e,t),eZ(e,"values",e=>e.def.innerType._zod.values),eZ(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),rZ=eJ("$ZodNullable",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>e.def.innerType._zod.optin),eZ(e,"optout",e=>e.def.innerType._zod.optout),eZ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${S(t.source)}|null)$`):void 0}),eZ(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),rB=eJ("$ZodDefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>rU(e,t)):rU(r,t)}});function rU(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rF=eJ("$ZodPrefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rK=eJ("$ZodNonOptional",(e,t)=>{nA.init(e,t),eZ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rq(t,e)):rq(i,e)}});function rq(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rJ(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ev(e,r,eY()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new eW("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}};let rV=eJ("$ZodCatch",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eZ(e,"optout",e=>e.def.innerType._zod.optout),eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>rJ(e,r,t,n)):rJ(e,r,t,n)}}),rW=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},eJ("$ZodPipe",(e,t)=>{nA.init(e,t),eZ(e,"values",e=>e.def.in._zod.values),eZ(e,"optin",e=>e.def.in._zod.optin),eZ(e,"optout",e=>e.def.out._zod.optout),eZ(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.in,n)):rG(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.out,n)):rG(r,t.out,n)}}));function rG(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function rY(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.out,n)):rX(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.in,n)):rX(e,r,t.in,n)}}function rX(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}(e,t)=>{nA.init(e,t),eZ(e,"values",e=>e.def.in._zod.values),eZ(e,"optin",e=>e.def.in._zod.optin),eZ(e,"optout",e=>e.def.out._zod.optout),eZ(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rY(e,t,n)):rY(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rY(e,t,n)):rY(r,t,n)}}},(e,t)=>{rW.init(e,t)};let rH=eJ("$ZodReadonly",(e,t)=>{nA.init(e,t),eZ(e,"propValues",e=>e.def.innerType._zod.propValues),eZ(e,"values",e=>e.def.innerType._zod.values),eZ(e,"optin",e=>e.def.innerType?._zod?.optin),eZ(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(rQ):rQ(r)}});function rQ(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{nA.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let n=t._zod.def,r=t._zod.pattern?.source,i=n.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,n=e(i);return r&&t&&n&&n!==t?r.replace(S(t),()=>S(n)):r}if(n.options){let t=n.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>S(e)).join("|")})$`}return function(e){let t,n,r=e._zod.def,i=r.pattern,s=!!r.format?.includes("int");for(let e of r.checks??[]){let r=e._zod.def;r.pattern&&(i=r.pattern),s||(s=!!r.format?.includes("int"));let o=r.minimum??r.length,a=r.maximum??r.length;void 0!==o&&(void 0===t||o>t)&&(t=o),void 0!==a&&(void 0===n||a<n)&&(n=a)}if(i)return i.source;if(void 0!==t&&void 0!==n&&t>n)return"(?!)";if(void 0!==t||void 0!==n)return tA({minimum:t,maximum:n}).source;let o=e._zod.pattern;return(s&&o===tI?tT:o)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(S(t))}else if(null===e||G.has(typeof e))n.push(Y(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)},(e,t)=>{nA.init(e,t),$(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eZ(e,"pattern",e=>e.innerType?._zod?.pattern),eZ(e,"propValues",e=>e.innerType?._zod?.propValues),eZ(e,"optin",e=>e.innerType?._zod?.optin??void 0),eZ(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)};let r0=eJ("$ZodCustom",(e,t)=>{tY.init(e,t),nA.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>r1(t,n,r,e));r1(i,n,r,e)}});function r1(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ex(e))}}function r2(e){return e.checks&&(e.checks=[...e.checks]),e}function r9(e,t){return new t0({check:"less_than",...H(t),value:e,inclusive:!1})}function r4(e,t){return new t0({check:"less_than",...H(t),value:e,inclusive:!0})}function r6(e,t){return new t1({check:"greater_than",...H(t),value:e,inclusive:!1})}function r8(e,t){return new t1({check:"greater_than",...H(t),value:e,inclusive:!0})}function r3(e,t){return new t2({check:"multiple_of",...H(t),value:e})}function r5(e,t){return new t5({check:"max_length",...H(t),maximum:e})}function r7(e,t){return new t7({check:"min_length",...H(t),minimum:e})}function ie(e,t){return new ne({check:"length_equals",...H(t),length:e})}function it(e){return new nu({check:"overwrite",tx:e})}e.i(79692);var ir,ii,is=e.i(22210),is=is,io=is,ia=is,il=is,iu=is,ic=is,id=is,ip=is,ih=is,im=is,ig=is,iy=is,ib=is,iv=is,ik=is,iw=is;function i_(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&E(e,t,n[t]);return e}function iS(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??e6,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function iO(e,t,n,r,i){let s="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(i);return Object.assign(n,s),!0}function ix(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,s=t.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,n,r)}let s=e._zod.parent;s&&(o.ref||(o.ref=s),ix(s,t,r),t.seen.get(s).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&i_(o.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function i$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function iz(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:s}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let s=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${r}/${i$(s)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:i+i$(s)}})(t);r.def={...r.schema},s&&(r.defId=s);let o=r.schema;for(let e in o)delete o[e];o.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
81
|
+
`)}return i.write("payload.value = newResult;"),i.write("return payload;"),i.compile()})(t.shape)),c=n(c,f),u)?rb([],d,c,f,r,e,f?.abortEarly===!0):c:i(c,f):(c.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),c)}});function rk(e,t,n,r){for(let n of e)if(0===n.issues.length)return t.value=n.value,t;let i=e.filter(e=>!ep(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ev(e,r,eY())))}),t)}let r_=eJ("$ZodUnion",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>e.def.options.some(e=>"defaulted"===e._zod.optin)?"defaulted":e.def.options.some(e=>void 0!==e._zod.optin)?"optional":void 0),eZ(e,"optout",e=>e.def.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eZ(e,"values",e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),eZ(e,"pattern",e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>S(e.source)).join("|")})$`)}});let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),s=!0;else{if(0===t.issues.length)return t;o.push(t)}}return s?Promise.all(o).then(t=>rk(t,r,e,i)):rk(o,r,e,i)}});function rS(e,t,n,r){let i=[];for(let t=0;t<e.length;t++)0===e[t].issues.length&&i.push(t);return 1===i.length?t.value=e[i[0]].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ev(e,r,eY())))}):t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:[],inclusive:!1,matches:i}),t}(e,t)=>{r_.init(e,t),t.inclusive=!1;let n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);t instanceof Promise?(o.push(t),s=!0):o.push(t)}return s?Promise.all(o).then(t=>rS(t,r,e,i)):rS(o,r,e,i)}};let rO=eJ("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,r_.init(e,t);let n=e._zod.parse;eZ(e,"propValues",e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||0===Object.keys(i).length)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);for(let[r,s]of(i[e.def.discriminator]?.has(void 0)&&n++,Object.entries(i)))for(let e of(Object.prototype.hasOwnProperty.call(t,r)||E(t,r,new Set),s))t[r].add(e)}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=A(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=k(()=>(function(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||0===r.size)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(void 0!==e)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t})(t));e._zod.parse=(i,s)=>{let o=i.value;if(!U(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;let a=o?.[t.discriminator],l=r.value.get(a);return l&&(void 0!==a||"backward"!==s.direction)?l._zod.run(i,s):t.unionFallback||"backward"===s.direction?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>null!==r.value.get(e)),input:o,path:[t.discriminator],inst:e}),i)}}),rx=eJ("$ZodIntersection",(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),s=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([t,n])=>r$(e,t,n)):r$(e,i,s)}});function r$(e,t,n){let r,i=new Map,s=new Map,o=(e,t)=>{let n;if("unrecognized_keys"!==e.code||e.path?.length)if("invalid_key"!==e.code||"record"!==e.origin||e.path?.length!==1)return!1;else{let t=String(e.path[0]);s.has(t)||s.set(t,e),n=[t]}else r??(r=e),n=e.keys;for(let e of n)i.has(e)||i.set(e,{}),i.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,"l")||e.issues.push(n);for(let t of n.issues)o(t,"r")||e.issues.push(t);let a=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length){let t=r?a.filter(e=>r.keys.includes(e)):[];for(let n of(t.length&&e.issues.push({...r,keys:t}),a))!t.includes(n)&&s.has(n)&&e.issues.push(s.get(n))}let l=function e(t,n){if(t===n||t instanceof Date&&n instanceof Date&&+t==+n)return{valid:!0,data:t};if(K(t)&&K(n)){let r=Object.keys(n),i=Object.keys(t).filter(e=>-1!==r.indexOf(e)),s={...t,...n};for(let r of(Object.prototype.hasOwnProperty.call(s,"__proto__")&&delete s.__proto__,i)){if("__proto__"===r)continue;let i=e(t[r],n[r]);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};s[r]=i.data}return{valid:!0,data:s}}if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let s=e(t[i],n[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}(t.value,n.value);if(!l.valid){if(ep(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(l.mergeErrorPath)}`)}return e.value=l.data,e}let rz=eJ("$ZodTuple",(e,t)=>{nA.init(e,t);let n=t.items,r=eG.memoizer;r?.attach(e),e._zod.parse=(i,s)=>{let o=i.value;if(!Array.isArray(o))return i.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),i;i.value=r?r.alloc(e,i,[],s):[];let a=[],l=rE(n,"optin"),u=rE(n,"optout");if(!t.rest){if(o.length<l)return i.issues.push({code:"too_small",minimum:l,inclusive:!0,input:o,inst:e,origin:"array"}),i;o.length>n.length&&i.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:o,inst:e,origin:"array"})}let c=Array(n.length),f=t.rest?s?.abortEarly:void 0,d=!1;for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},s);t instanceof Promise?a.push(t.then(t=>{c[e]=t})):(c[e]=t,f&&!d&&t.issues.length&&(d=ep(t)))}if(t.rest&&!d){let e=n.length-1,r=o.slice(n.length),l=i.issues.length;for(let n of r){if(f&&i.issues.length!==l){if(ep(i,l))break;l=i.issues.length}e++;let r=t.rest._zod.run({value:n,issues:[]},s);r instanceof Promise?a.push(r.then(t=>rA(t,i,e))):rA(r,i,e)}}return a.length?Promise.all(a).then(()=>rN(c,i,n,o,u)):rN(c,i,n,o,u)}});function rE(e,t){for(let n=e.length-1;n>=0;n--)if(!("optin"===t?void 0!==e[n]._zod.optin:"optional"===e[n]._zod.optout))return n+1;return 0}function rA(e,t,n){e.issues.length&&t.issues.push(...em(n,e.issues)),t.value[n]=e.value}function rN(e,t,n,r,i){for(let s=0;s<n.length;s++){let o=e[s],a=s<r.length;if(!a&&s>=i&&"optional"===n[s]._zod.optin){t.value.length=s;break}if(o.issues.length){if(!a&&s>=i){t.value.length=s;break}t.issues.push(...em(s,o.issues))}t.value[s]=o.value}for(let e=t.value.length-1;e>=r.length;e--)if("optional"===n[e]._zod.optout&&void 0===t.value[e])t.value.length=e;else break;return t}let rT=eJ("$ZodRecord",(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!K(s))return r.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),r;let o=[],a=t.keyType._zod.values;if(a&&!t.partial){let l;r.value=n?n.alloc(e,r,{},i):{};let u=new Set;for(let n of a)if("string"==typeof n||"number"==typeof n||"symbol"==typeof n){if(u.add("number"==typeof n?n.toString():n),"__proto__"===n)continue;let a=t.keyType._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ev(e,i,eY())),input:n,path:[n],inst:e});continue}let l=a.value;if("__proto__"===l)continue;let c=t.valueType._zod.run({value:s[n],issues:[]},i);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&r.issues.push(...em(n,e.issues)),r.value[l]=e.value})):(c.issues.length&&r.issues.push(...em(n,c.issues)),r.value[l]=c.value)}for(let e in s)if(!u.has(e))if("loose"===t.mode){if("__proto__"===e)continue;r.value[e]=s[e]}else(l=l??[]).push(e);l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}else{let l;for(let u of(r.value=n?n.alloc(e,r,{},i):{},Reflect.ownKeys(s))){if("__proto__"===u||!Object.prototype.propertyIsEnumerable.call(s,u))continue;let n=t.keyType._zod.run({value:u,issues:[]},i);if(n instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof u&&tI.test(u)&&n.issues.length){let e=t.keyType._zod.run({value:Number(u),issues:[]},i);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(n=e)}if(n.issues.length){"loose"===t.mode?r.value[u]=s[u]:a?(l=l??[]).push(u):r.issues.push({code:"invalid_key",origin:"record",issues:n.issues.map(e=>ev(e,i,eY())),input:u,path:[u],inst:e});continue}let c=n.value;if("__proto__"===c)continue;let f=t.valueType._zod.run({value:s[u],issues:[]},i);f instanceof Promise?o.push(f.then(e=>{e.issues.length&&r.issues.push(...em(u,e.issues)),r.value[c]=e.value})):(f.issues.length&&r.issues.push(...em(u,f.issues)),r.value[c]=f.value)}l&&l.length>0&&r.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:l,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}});function rI(e,t,n,r,i,s,o){e.issues.length&&(W.has(typeof r)?n.issues.push(...em(r,e.issues)):n.issues.push({code:"invalid_key",origin:"map",input:i,inst:s,issues:e.issues.map(e=>ev(e,o,eY()))})),t.issues.length&&(W.has(typeof r)?n.issues.push(...em(r,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:i,inst:s,key:r,issues:t.issues.map(e=>ev(e,o,eY()))})),n.value.set(e.value,t.value)}function rj(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!(s instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:s,inst:e}),r;let o=[];r.value=n?n.alloc(e,r,new Map,i):new Map;let a=i?.abortEarly,l=r.issues.length;for(let[n,u]of s){if(a&&r.issues.length!==l){if(ep(r,l))break;l=r.issues.length}let c=t.keyType._zod.run({value:n,issues:[]},i),f=t.valueType._zod.run({value:u,issues:[]},i);c instanceof Promise||f instanceof Promise?o.push(Promise.all([c,f]).then(([t,o])=>{rI(t,o,r,n,s,e,i)})):rI(c,f,r,n,s,e,i)}return o.length?Promise.all(o).then(()=>r):r},ru(e,rf)},(e,t)=>{nA.init(e,t);let n=eG.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let s=r.value;if(!(s instanceof Set))return r.issues.push({input:s,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];r.value=n?n.alloc(e,r,new Set,i):new Set;let a=i?.abortEarly,l=r.issues.length;for(let e of s){if(a&&r.issues.length!==l){if(ep(r,l))break;l=r.issues.length}let n=t.valueType._zod.run({value:e,issues:[]},i);n instanceof Promise?o.push(n.then(e=>rj(e,r))):rj(n,r)}return o.length?Promise.all(o).then(()=>r):r},ru(e,rd)};let rP=eJ("$ZodEnum",(e,t)=>{nA.init(e,t);let n=y(t.entries),r=new Set(n);e._zod.values=r,eZ(e,"pattern",e=>{let t=y(e.def.entries).filter(e=>W.has(typeof e));return new RegExp(t.length?`^(${t.map(e=>Y(e.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(t,i)=>{let s=t.value;return r.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),rC=eJ("$ZodLiteral",(e,t)=>{nA.init(e,t);let n=new Set(t.values);e._zod.values=n,eZ(e,"pattern",e=>{let t=e.def.values;return new RegExp(t.length?`^(${t.map(e=>"string"==typeof e?Y(e):e?Y(e.toString()):String(e)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(r,i)=>{let s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),rL=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>{let r=t.value;return r instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),t}},eJ("$ZodTransform",(e,t)=>{nA.init(e,t),e._zod.optin="optional",eG.memoizer?.guard(e),e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eW(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new eV;return n.value=i,n}}));function rD(e,t){return e.value=t.issues.length?void 0:t.value,e}let rM=eJ("$ZodOptional",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),e._zod.optout="optional",eZ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),eZ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${S(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(void 0===e.value){if("defaulted"!==t.innerType._zod.optin)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>rD(e,t)):rD(e,r)}return t.innerType._zod.run(e,n)}}),rR=eJ("$ZodExactOptional",(e,t)=>{rM.init(e,t),eZ(e,"values",e=>e.def.innerType._zod.values),eZ(e,"pattern",e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),rZ=eJ("$ZodNullable",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>e.def.innerType._zod.optin),eZ(e,"optout",e=>e.def.innerType._zod.optout),eZ(e,"pattern",e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${S(t.source)}|null)$`):void 0}),eZ(e,"values",e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),rB=eJ("$ZodDefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>rU(e,t)):rU(r,t)}});function rU(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let rF=eJ("$ZodPrefault",(e,t)=>{nA.init(e,t),e._zod.optin="defaulted",eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rK=eJ("$ZodNonOptional",(e,t)=>{nA.init(e,t),eZ(e,"values",e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>rq(t,e)):rq(i,e)}});function rq(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function rJ(e,t,n,r){return t.issues.length?e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>ev(e,r,eY()))},input:e.value}):(e.value=t.value,t.memo&&(e.memo=!0)),e}(e,t)=>{nA.init(e,t),e._zod.parse=(e,n)=>{if("backward"===n.direction)throw new eW("ZodSuccess");let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===r.issues.length,e)}};let rV=eJ("$ZodCatch",(e,t)=>{nA.init(e,t),eZ(e,"optin",e=>"defaulted"===e.def.innerType._zod.optin?"defaulted":"optional"),eZ(e,"optout",e=>e.def.innerType._zod.optout),eZ(e,"values",e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>rJ(e,r,t,n)):rJ(e,r,t,n)}}),rW=((e,t)=>{nA.init(e,t),e._zod.parse=(t,n)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)},eJ("$ZodPipe",(e,t)=>{nA.init(e,t),eZ(e,"values",e=>e.def.in._zod.values),eZ(e,"optin",e=>e.def.in._zod.optin),eZ(e,"optout",e=>e.def.out._zod.optout),eZ(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.in,n)):rG(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rG(e,t.out,n)):rG(r,t.out,n)}}));function rG(e,t,n){return e.issues.some(e=>"unrecognized_keys"!==e.code)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}function rY(e,t,n){if(e.issues.length)return e.aborted=!0,e;if("forward"===(n.direction||"forward")){let r=t.transform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.out,n)):rX(e,r,t.out,n)}{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(r=>rX(e,r,t.in,n)):rX(e,r,t.in,n)}}function rX(e,t,n,r){return e.issues.length?(e.aborted=!0,e):n._zod.run({value:t,issues:e.issues},r)}(e,t)=>{nA.init(e,t),eZ(e,"values",e=>e.def.in._zod.values),eZ(e,"optin",e=>e.def.in._zod.optin),eZ(e,"optout",e=>e.def.out._zod.optout),eZ(e,"propValues",e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if("forward"===(n.direction||"forward")){let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>rY(e,t,n)):rY(r,t,n)}{let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>rY(e,t,n)):rY(r,t,n)}}},(e,t)=>{rW.init(e,t)};let rH=eJ("$ZodReadonly",(e,t)=>{nA.init(e,t),eZ(e,"propValues",e=>e.def.innerType._zod.propValues),eZ(e,"values",e=>e.def.innerType._zod.values),eZ(e,"optin",e=>e.def.innerType?._zod?.optin),eZ(e,"optout",e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(rQ):rQ(r)}});function rQ(e){return e.memo||(e.value=Object.freeze(e.value)),e}(e,t)=>{nA.init(e,t);let n=[];for(let e of t.parts)if("object"==typeof e&&null!==e){let t=function e(t){let n=t._zod.def,r=t._zod.pattern?.source,i=n.innerType??t._zod.innerType;if(i){let t=i._zod.pattern?.source,n=e(i);return r&&t&&n&&n!==t?r.replace(S(t),()=>S(n)):r}if(n.options){let t=n.options.map(e);if(t.every(Boolean))return`^(${t.map(e=>S(e)).join("|")})$`}return function(e){let t,n,r=e._zod.def,i=r.pattern,s=!!r.format?.includes("int");for(let e of r.checks??[]){let r=e._zod.def;r.pattern&&(i=r.pattern),s||(s=!!r.format?.includes("int"));let o=r.minimum??r.length,a=r.maximum??r.length;void 0!==o&&(void 0===t||o>t)&&(t=o),void 0!==a&&(void 0===n||a<n)&&(n=a)}if(i)return i.source;if(void 0!==t&&void 0!==n&&t>n)return"(?!)";if(void 0!==t||void 0!==n)return tA({minimum:t,maximum:n}).source;let o=e._zod.pattern;return(s&&o===tI?tT:o)?.source}(t)}(e);if(!t)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);n.push(S(t))}else if(null===e||G.has(typeof e))n.push(Y(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${n.join("")}$`),e._zod.parse=(n,r)=>("string"!=typeof n.value?n.issues.push({input:n.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),n)},(e,t)=>{nA.init(e,t),$(e._zod,"innerType",()=>(t._cachedInner||(t._cachedInner=t.getter()),t._cachedInner)),eZ(e,"pattern",e=>e.innerType?._zod?.pattern),eZ(e,"propValues",e=>e.innerType?._zod?.propValues),eZ(e,"optin",e=>e.innerType?._zod?.optin??void 0),eZ(e,"optout",e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)};let r0=eJ("$ZodCustom",(e,t)=>{tY.init(e,t),nA.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>r1(t,n,r,e));r1(i,n,r,e)}});function r1(e,t,n,r){if(!e){let e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ex(e))}}function r2(e){return e.checks&&(e.checks=[...e.checks]),e}function r9(e,t){return new t0({check:"less_than",...H(t),value:e,inclusive:!1})}function r4(e,t){return new t0({check:"less_than",...H(t),value:e,inclusive:!0})}function r6(e,t){return new t1({check:"greater_than",...H(t),value:e,inclusive:!1})}function r8(e,t){return new t1({check:"greater_than",...H(t),value:e,inclusive:!0})}function r3(e,t){return new t2({check:"multiple_of",...H(t),value:e})}function r5(e,t){return new t5({check:"max_length",...H(t),maximum:e})}function r7(e,t){return new t7({check:"min_length",...H(t),minimum:e})}function ie(e,t){return new ne({check:"length_equals",...H(t),length:e})}function it(e){return new nu({check:"overwrite",tx:e})}e.i(79692);var ir,ii,is=e.i(22210),is=is,io=is,ia=is,il=is,iu=is,ic=is,id=is,ip=is,ih=is,im=is,ig=is,iy=is,ib=is,iv=is,iw=is,ik=is;function i_(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&E(e,t,n[t]);return e}function iS(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??e6,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function iO(e,t,n,r,i){let s="function"==typeof t.unrepresentable?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if("any"===s)return!1;if(void 0===s||"throw"===s)throw Error(i);return Object.assign(n,s),!0}function ix(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)o.schema=a;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,s=t.processors[i.type];if(!s)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);s(e,t,n,r)}let s=e._zod.parent;s&&(o.ref||(o.ref=s),ix(s,t,r),t.seen.get(s).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&i_(o.schema,l),"input"===t.io&&function e(t,n){let r=n??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let i=t._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return e(i.element,r);if("set"===i.type)return e(i.valueType,r);if("lazy"===i.type)return e(i.getter(),r);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type||"catch"===i.type)return e(i.innerType,r);if("intersection"===i.type)return e(i.left,r)||e(i.right,r);if("record"===i.type||"map"===i.type)return e(i.keyType,r)||e(i.valueType,r);if("pipe"===i.type)return!!t._zod.traits.has("$ZodCodec")||e(i.in,r)||e(i.out,r);if("object"===i.type){for(let t in i.shape)if(e(i.shape[t],r))return!0;return!1}if("union"===i.type){for(let t of i.options)if(e(t,r))return!0;return!1}if("tuple"===i.type){for(let t of i.items)if(e(t,r))return!0;if(i.rest&&e(i.rest,r))return!0}return!1}(e)&&(delete o.schema.examples,delete o.schema.default),"input"===t.io&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function i$(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function iz(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{if(t[1].schema.$ref)return;let r=t[1],{ref:i,defId:s}=(t=>{let r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let s=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=s,{defId:s,ref:`${i("__shared")}#/${r}/${i$(s)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:"#"};let s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:i+i$(s)}})(t);r.def={...r.schema},s&&(r.defId=s);let o=r.schema;for(let e in o)delete o[e];o.$ref=i};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
|
|
82
82
|
|
|
83
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let iE=new Set(["type","properties","required","additionalProperties"]),iA=["oneOf","anyOf"];function iN(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function iT(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!iE.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??iN(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}E(n,r,1===e.length?e[0]:iT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=iN(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function iI(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,s={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),a=n.schema;if(a.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(a)):i_(i,a),i_(i,s),t._zod.parent===o)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(a.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let a=t._zod.parent;if(a&&a!==o){r(a);let t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iE)if(t in e)return;let n=t.filter(e=>iA.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=iA.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let s=t.filter(t=>t!==e),o=e[i].map(e=>iT([...s,e]));if(o.some(e=>!e))return;r={[i]:o}}else r=iT(t);r&&(delete e.allOf,i_(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}i_(i,n.defId?n.schema:n.def??n.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,E(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:ij(t,"input",e.processors),output:ij(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let ij=(e,t,n={})=>r=>{let{libraryOptions:i,target:s}=r??{},o=iS({...i??{},target:s,io:t,processors:n});return ix(e,o),iz(o,e),iI(o,e)},iP=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},iC=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},iL=(e,t)=>{iP(e,"minimum",t),iC(e,"maximum",t)},iD=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},iM=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},iR=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},iZ=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},iB=(e,t)=>iP(e,"minimum",t.minimum),iU=(e,t)=>iC(e,"maximum",t.maximum),iF=e=>(t,n)=>{iZ(t,n.format);let[r,i]=e[n.format];iP(t,"minimum",r),iC(t,"maximum",i)},iK={greater_than:(e,t)=>iP(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>iC(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>iD(e,t.value),number_format:iF(en),bigint_format:iF(er),min_length:iB,max_length:iU,length_equals:(e,t)=>iL(e,t.length),min_size:iB,max_size:iU,size_equals:(e,t)=>iL(e,t.size),string_format:(e,t)=>{iZ(e,t.format),t.pattern&&iM(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>iR(e,t.mime)};function iq(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])iK[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&iP(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&iP(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&iC(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&iC(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&iD(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&iR(t,r.mime),r.patterns??[]))iM(t,e);return t}let iJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iV=new Map([[n8,ty],[n5,tb]]),iW=e=>iV.get(e)??e;function iG(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?iG(t.out):"catch"===t.type?iG(t.innerType):e._zod.optin}let iY=new WeakMap,iX=Symbol();function iH(e,t,n,r,i){let s=!1,o=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(s=!0,null));return s?(iO(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),iX):JSON.parse(o)}let iQ=(e,t,n,r)=>{let i=e._zod.def;ix(i.innerType,t,r),t.seen.get(e).ref=i.innerType},i0=new WeakSet([Object.prototype,Error.prototype]);function i1(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let i2=eJ("ZodError",(e,t)=>{nm.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);i0.has(n)||(i0.add(n),i1(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)r({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)n._errors.push(t(s));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if("_errors"===n){o&&r._errors.push(t(s)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let a=r[n];o&&a._errors.push(t(s)),r=a,i++}}}};return r(e),n})(e,t)),i1(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let o of e.issues)if(o.path.length>0){var i,s;(i=o.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:s(),writable:!0,enumerable:!0,configurable:!0}):n[i]=s()),n[i]).push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}})(e,t)),i1(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v,2)}),i1(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,i2],75214);let i9=nb(i2),i4=nk(i2),i6=n_(i2),i8=nO(i2),i3=(r=nb(i2),i=(e,t,n,s)=>r(e,t,n?{...n,direction:"backward"}:{direction:"backward"},ny(i,s))),i5=(s=nb(i2),o=(e,t,n,r)=>s(e,t,n,ny(o,r))),i7=(a=nk(i2),l=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await a(e,t,i,ny(l,r))}),se=(u=nk(i2),c=async(e,t,n,r)=>await u(e,t,n,ny(c,r))),st=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return n_(i2)(e,t,r)},sn=(e,t,n)=>n_(i2)(e,t,n),sr=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return nO(i2)(e,t,r)},si=async(e,t,n)=>nO(i2)(e,t,n);function ss(){eG.memoizer||eY({memoizer:e4})}let so=eJ("ZodType",(e,t)=>(eG.localeError||eY({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(eO(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${ee(n.values[0])}`;return`Invalid option: expected one of ${b(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),nA.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(io.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return X(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new oa({type:"custom",check:"custom",fn:e,...H(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ex(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ex(e)))},e(t.value,t)),(i=new tY({check:"custom",...H(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(it(e))},optional(){return s8(this)},exactOptional(){var e;return e=this,new s3({type:"optional",innerType:e})},nullable(){return s7(this)},nullish(){return s8(s7(this))},nonoptional(e){var t,n;return t=this,n=e,new on({type:"nonoptional",innerType:t,...ic.normalizeParams(n)})},array(){return sK(this)},or(e){return sW([this,e])},and(e){var t;return t=this,new sX({type:"intersection",left:t,right:e})},transform(e){return os(this,new s4({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new oe({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():iw.shallowClone(n)}})},prefault(e){var t,n;return t=this,n=e,new ot({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():iw.shallowClone(n)}})},catch(e){var t,n;return t=this,new or({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:is.constantCatch(n)})},pipe(e){return os(this,e)},readonly(){var e;return e=this,new oo({type:"readonly",innerType:e})},describe(e){let t=this.clone();return e6.add(t,{description:e}),t},meta(...e){if(0===e.length)return e6.get(this);let t=this.clone();return e6.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ia.hide(this,"~standard",{...nI(this),jsonSchema:{input:ij(this,"input"),output:ij(this,"output")}})},set"~standard"(e){il.own(this,"~standard",e)},parse:function e(t,n){return i9(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i4(this,t,n,{callee:e})},safeParse(e,t){return i6(this,e,t)},async safeParseAsync(e,t){return i8(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){il.own(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==nx)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;if(s?(i[n$]=!0,r=s({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new eV;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return nz(this,e,t)},encode:function e(t,n){return i3(this,t,n,{callee:e})},decode:function e(t,n){return i5(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await i7(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await se(this,t,n,{callee:e})},safeEncode(e,t){return st(this,e,t)},safeDecode(e,t){return sn(this,e,t)},async safeEncodeAsync(e,t){return sr(this,e,t)},async safeDecodeAsync(e,t){return si(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=iS({...n,processors:t});return ix(e,r),iz(r,e),iI(r,e)})(this,{})(e)},get description(){return e6.get(this)?.description},get _def(){return this._zod.def}}),sa=eJ("_ZodString",(e,t)=>{nj.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:s,patterns:o,contentEncoding:a,laxFormat:l}=iq(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),s&&(n.format=iJ[s]??s,""===n.format&&delete n.format,("time"===s||l)&&delete n.format),a&&(n.contentEncoding=a),o&&o.size>0){let e=[...o].map(iW);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},iu.derived({format:e=>iq(e).format??null,minLength:e=>iq(e).minimum??null,maxLength:e=>iq(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nn({check:"string_format",format:"regex",...H(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new ns({check:"string_format",format:"includes",...H(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new no({check:"string_format",format:"starts_with",...H(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new na({check:"string_format",format:"ends_with",...H(t),suffix:e})}(...e))},min(...e){return this.check(r7(...e))},max(...e){return this.check(r5(...e))},length(...e){return this.check(ie(...e))},nonempty(...e){return this.check(r7(1,...e))},lowercase(e){return this.check(new nr({check:"string_format",format:"lowercase",...H(e)}))},uppercase(e){return this.check(new ni({check:"string_format",format:"uppercase",...H(e)}))},trim(){return this.check(it(e=>e.trim()))},normalize(...e){return this.check(function(e){return it(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(it(e=>e.toLowerCase()))},toUpperCase(){return this.check(it(e=>e.toUpperCase()))},slugify(){return this.check(it(e=>Z(e)))}})),sl=eJ("ZodString",(e,t)=>{nj.init(e,t),sa.init(e,t)},{email(e){return this.check(new sm({type:"string",format:"email",check:"string_format",abort:!1,...H(e)}))},url(e){return this.check(new sb({type:"string",format:"url",check:"string_format",abort:!1,...H(e)}))},jwt(e){return this.check(new sj({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)}))},emoji(e){return this.check(new sv({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)}))},guid(e){return this.check(new sg({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)}))},uuid(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)}))},uuidv4(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)}))},uuidv6(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)}))},uuidv7(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)}))},nanoid(e){return this.check(new sk({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)}))},cuid(e){return this.check(new sw({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)}))},cuid2(e){return this.check(new s_({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)}))},ulid(e){return this.check(new sS({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)}))},base64(e){return this.check(new sN({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)}))},base64url(e){return this.check(new sT({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)}))},xid(e){return this.check(new sO({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)}))},ksuid(e){return this.check(new sx({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)}))},ipv4(e){return this.check(new s$({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)}))},ipv6(e){return this.check(new sz({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)}))},cidrv4(e){return this.check(new sE({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)}))},cidrv6(e){return this.check(new sA({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)}))},e164(e){return this.check(new sI({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)}))},datetime(e){return this.check(new sf({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)}))},date(e){return this.check(new sd({type:"string",format:"date",check:"string_format",...H(e)}))},time(e){return this.check(new sp({type:"string",format:"time",check:"string_format",precision:null,...H(e)}))},duration(e){return this.check(new sh({type:"string",format:"duration",check:"string_format",...H(e)}))}});function su(e){return new sl(r2({type:"string",...H(e)}))}let sc=eJ("ZodStringFormat",(e,t)=>{nP.init(e,t),sa.init(e,t)}),sf=eJ("ZodISODateTime",(e,t)=>{nG.init(e,t),sc.init(e,t)}),sd=eJ("ZodISODate",(e,t)=>{nY.init(e,t),sc.init(e,t)}),sp=eJ("ZodISOTime",(e,t)=>{nX.init(e,t),sc.init(e,t)}),sh=eJ("ZodISODuration",(e,t)=>{nH.init(e,t),sc.init(e,t)}),sm=eJ("ZodEmail",(e,t)=>{nD.init(e,t),sc.init(e,t)}),sg=eJ("ZodGUID",(e,t)=>{nC.init(e,t),sc.init(e,t)}),sy=eJ("ZodUUID",(e,t)=>{nL.init(e,t),sc.init(e,t)}),sb=eJ("ZodURL",(e,t)=>{nB.init(e,t),sc.init(e,t)}),sv=eJ("ZodEmoji",(e,t)=>{nU.init(e,t),sc.init(e,t)}),sk=eJ("ZodNanoID",(e,t)=>{nF.init(e,t),sc.init(e,t)}),sw=eJ("ZodCUID",(e,t)=>{nK.init(e,t),sc.init(e,t)}),s_=eJ("ZodCUID2",(e,t)=>{nq.init(e,t),sc.init(e,t)}),sS=eJ("ZodULID",(e,t)=>{nJ.init(e,t),sc.init(e,t)}),sO=eJ("ZodXID",(e,t)=>{nV.init(e,t),sc.init(e,t)}),sx=eJ("ZodKSUID",(e,t)=>{nW.init(e,t),sc.init(e,t)}),s$=eJ("ZodIPv4",(e,t)=>{nQ.init(e,t),sc.init(e,t)}),sz=eJ("ZodIPv6",(e,t)=>{n2.init(e,t),sc.init(e,t)}),sE=eJ("ZodCIDRv4",(e,t)=>{n9.init(e,t),sc.init(e,t)}),sA=eJ("ZodCIDRv6",(e,t)=>{n4.init(e,t),sc.init(e,t)}),sN=eJ("ZodBase64",(e,t)=>{n3.init(e,t),sc.init(e,t)}),sT=eJ("ZodBase64URL",(e,t)=>{n7.init(e,t),sc.init(e,t)}),sI=eJ("ZodE164",(e,t)=>{re.init(e,t),sc.init(e,t)}),sj=eJ("ZodJWT",(e,t)=>{rn.init(e,t),sc.init(e,t)}),sP=eJ("ZodNumber",(e,t)=>{rr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:s,multipleOf:o,exclusiveMaximum:a,exclusiveMinimum:l,isInt:u}=iq(e);n.type=u?"integer":"number";let c="number"==typeof l&&l>=(i??-1/0),f="number"==typeof a&&a<=(s??1/0),d="draft-04"===t.target||"openapi-3.0"===t.target;if(c?d?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:"number"==typeof i&&(n.minimum=i),f?d?(n.maximum=a,n.exclusiveMaximum=!0):n.exclusiveMaximum=a:"number"==typeof s&&(n.maximum=s),o){let i=new Set;for(let s of o)Number.isFinite(s)&&0!==s?i.add(Math.abs(s)):iO(e,t,n,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...a]=i;void 0!==s&&(n.multipleOf=s),a.length&&(n.allOf=[...n.allOf??[],...a.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},iu.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=iq(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=iq(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=iq(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>iq(e).format??null},{gt(e,t){return this.check(r6(e,t))},gte(e,t){return this.check(r8(e,t))},min(e,t){return this.check(r8(e,t))},lt(e,t){return this.check(r9(e,t))},lte(e,t){return this.check(r4(e,t))},max(e,t){return this.check(r4(e,t))},int(e){return this.check(sD(e))},safe(e){return this.check(sD(e))},positive(e){return this.check(r6(0,e))},nonnegative(e){return this.check(r8(0,e))},negative(e){return this.check(r9(0,e))},nonpositive(e){return this.check(r4(0,e))},multipleOf(e,t){return this.check(r3(e,t))},step(e,t){return this.check(r3(e,t))},finite(){return this}}));function sC(e){return new sP(r2({type:"number",checks:[],...H(e)}))}let sL=eJ("ZodNumberFormat",(e,t)=>{ri.init(e,t),sP.init(e,t)});function sD(e){return new sL({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}let sM=eJ("ZodBoolean",(e,t)=>{rs.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function sR(e){return new sM({type:"boolean",...H(e)})}(e,t)=>{ro.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"BigInt cannot be represented in JSON Schema")}};let sZ=eJ("ZodUnknown",(e,t)=>{ra.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function sB(){return new sZ({type:"unknown"})}let sU=eJ("ZodNever",(e,t)=>{rl.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),sF=eJ("ZodArray",(e,t)=>{ss(),rh.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:s,maximum:o}=iq(e);"number"==typeof s&&(n.minItems=s),"number"==typeof o&&(n.maxItems=o),n.type="array",n.items=ix(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(r7(e,t))},nonempty(e){return this.check(r7(1,e))},max(e,t){return this.check(r5(e,t))},length(e,t){return this.check(ie(e,t))},unwrap(){return this.element}});function sK(e,t){return new sF({type:"array",element:e,...H(t)})}let sq=eJ("ZodObject",(e,t)=>{ss(),rk.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&iO(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},s)E(n.properties,e,ix(s[e],t,{...r,path:[...r.path,"properties",e]}));let o=[];for(let e of Object.keys(s)){let n=i.shape[e];("input"===t.io?void 0===iG(n):void 0===n._zod.optout)&&o.push(e)}o.length>0&&(n.required=o),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ix(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),iv.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return s1(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(io.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(io.mergeDefs(this._zod.def,{catchall:sB()}))},loose(){return this.clone(io.mergeDefs(this._zod.def,{catchall:sB()}))},strict(){return this.clone(io.mergeDefs(this._zod.def,{catchall:new sU({type:"never",...H(void 0)})}))},strip(){return this.clone(io.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return id.extend(this,e)},safeExtend(e){return ip.safeExtend(this,e)},merge(e){return ih.merge(this,e)},pick(e){return im.pick(this,e)},omit(e){return ig.omit(this,e)},partial(...e){return iy.partial(s6,this,e[0])},exactPartial(...e){return iy.partial(s3,this,e[0],"exactPartial")},required(...e){return ib.required(on,this,e[0])}});function sJ(e,t){return new sq({type:"object",shape:e??{},...ic.normalizeParams(t)})}let sV=eJ("ZodUnion",(e,t)=>{r_.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{var i,s,o,a;let l,u,c;return i=e,s=t,o=n,a=r,u=!1===(l=i._zod.def).inclusive,c=l.options.map((e,t)=>ix(e,s,{...a,path:[...a.path,u?"oneOf":"anyOf",t]})),void(u?o.oneOf=c:o.anyOf=c)},e.options=t.options});function sW(e,t){return new sV({type:"union",options:e,...ic.normalizeParams(t)})}let sG=eJ("ZodDiscriminatedUnion",(e,t)=>{sV.init(e,t),rO.init(e,t)});function sY(e,t,n){return new sG({type:"union",options:t,discriminator:e,...ic.normalizeParams(n)})}let sX=eJ("ZodIntersection",(e,t)=>{rx.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o,a,l;return s=ix((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),o=ix(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=l=[...(a=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...a(o)?o.allOf:[o]],t.intersections.push(l))}}),sH=eJ("ZodRecord",(e,t)=>{ss(),rT.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let s=i.keyType,o=iq(s).patterns;if("loose"===i.mode&&o&&o.size>0){let e=ix(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},o))E(n.patternProperties,iW(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){n.propertyNames=ix(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let s=iY.get(t);s||(s=[],iY.set(t,s),t.deferred.push(()=>(function(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of iY.get(e)??[]){let i=e.seen.get(r),s=(i?.def??i?.schema)?.propertyNames;if(!s||!0===s||n.has(s))continue;let o=function e(t,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);let i=t.get(n)?.def;if(!i)return n;let s=e(t,i,r);return s===i?n:s}for(let i of["anyOf","oneOf"]){let s=n[i];if(!Array.isArray(s))continue;let o=s.map(n=>e(t,n,r));o.some((e,t)=>e!==s[t])&&(n={...n,[i]:o})}let i=Array.isArray(n.type)?n.type:[n.type],s=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),o=n.enum??(void 0!==n.const?[n.const]:void 0);if(!s&&!o?.some(e=>"number"==typeof e))return n;let{minimum:a,maximum:l,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:f,format:d,id:p,...h}=n;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),s&&(h.type="string",o||(h.pattern=(i.includes("number")?tI:tT).source)),h}(t,s,new Set);o!==s&&n.set(s,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),s.push(e)}n.additionalProperties=ix(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let a=s._zod.values,l="input"===t.io&&void 0!==iG(i.valueType);if(a&&!i.partial&&!l){let e=[...a].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function sQ(e,t,n){return new sH(t&&t._zod?{type:"record",keyType:e,valueType:t,...ic.normalizeParams(n)}:{type:"record",keyType:su(),valueType:e,...ic.normalizeParams(t)})}let s0=eJ("ZodEnum",(e,t)=>{rP.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=y(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new s0({...t,checks:[],...ic.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new s0({...t,checks:[],...ic.normalizeParams(r),entries:i})}});function s1(e,t){return new s0({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ic.normalizeParams(t)})}let s2=eJ("ZodLiteral",(e,t)=>{rC.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(0===i.values.length){n.not={};return}let s=[];for(let o of i.values)if(void 0===o){if(iO(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof o){if(iO(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(o))}else s.push(o);if(0===s.length);else if(1===s.length){let e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function s9(e,t){return new s2({type:"literal",values:Array.isArray(e)?e:[e],...ic.normalizeParams(t)})}let s4=eJ("ZodTransform",(e,t)=>{ss(),rL.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eW(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(ik.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(ik.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),s6=eJ("ZodOptional",(e,t)=>{rM.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function s8(e){return new s6({type:"optional",innerType:e})}let s3=eJ("ZodExactOptional",(e,t)=>{rR.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),s5=eJ("ZodNullable",(e,t)=>{rZ.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o;return s=ix((i=e._zod.def).innerType,t,r),o=t.seen.get(e),void("openapi-3.0"===t.target?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function s7(e){return new s5({type:"nullable",innerType:e})}let oe=eJ("ZodDefault",(e,t)=>{rB.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s;return ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((s=iH(i.defaultValue,e,t,n,r))!==iX&&(n.default=s))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ot=eJ("ZodPrefault",(e,t)=>{rF.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(ix(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let s=iH(i.defaultValue,e,t,n,r);s!==iX&&(n._prefault=s)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),on=eJ("ZodNonOptional",(e,t)=>{rK.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),or=eJ("ZodCatch",(e,t)=>{rV.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,s=e._zod.def;ix(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{iO(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),oi=eJ("ZodPipe",(e,t)=>{rW.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(ix(o="input"===t.io?s?i.out:i.in:i.out,t,r),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function os(e,t){return new oi({type:"pipe",in:e,out:t})}let oo=eJ("ZodReadonly",(e,t)=>{rH.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),oa=eJ("ZodCustom",(e,t)=>{r0.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,sK,"boolean",0,sR,"discriminatedUnion",0,sY,"enum",0,s1,"literal",0,s9,"number",0,sC,"object",0,sJ,"record",0,sQ,"string",0,su,"union",0,sW,"unknown",0,sB],86752),e.i(86752),e.s([],4435),e.i(4435),e.i(75214),e.s([],68959),e.i(68959),e.s([],38220),e.i(38220),e.s(["array",0,sK,"boolean",0,sR,"discriminatedUnion",0,sY,"enum",0,s1,"literal",0,s9,"number",0,sC,"object",0,sJ,"record",0,sQ,"string",0,su,"union",0,sW,"unknown",0,sB],77698);var ol=e.i(77698),ol=ol,ou=ol,oc=ol,of=ol,od=ol,op=ol,oh=ol,om=ol,og=ol,oy=ol,ob=ol;let ov=["1.0"],ok=ol.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/,"Agent identifiers are ULIDs"),ow=ol.string().refine(e=>!Number.isNaN(Date.parse(e)),"Expected an ISO 8601 date"),o_=ou.record(ol.string().regex(/^x-[a-z0-9][a-z0-9._-]*$/i,"Extension keys must look like x-<namespace>"),oc.unknown()).default({}),oS=of.object({platform:ol.string(),path:ol.string().optional(),line:od.number().int().nonnegative().optional(),note:ol.string().optional()}).passthrough(),oO=of.object({name:ol.string().min(1),description:ol.string().optional(),persona:ol.string().optional(),tone:ol.string().optional(),emoji:ol.string().optional(),avatar:ol.string().optional().describe("Path of the avatar inside files/"),extensions:o_}).passthrough(),ox=of.object({preferred:ol.string().optional(),provider:ol.string().optional(),fallbacks:op.array(ol.string()).default([]),reasoningEffort:ol.string().optional(),notes:ol.string().optional()}).passthrough(),o$=oh.enum(["system","agent","custom","user-context","conventions","heartbeat","bootstrap","command"]),oz=of.object({id:ol.string().min(1),kind:o$,title:ol.string().optional(),content:ol.string(),source:oS.optional()}).passthrough(),oE=oh.enum(["profile","preference","fact","project","instruction","note","summary","daily-log","document"]),oA=oh.enum(["user","agent","project"]),oN=of.object({id:ol.string().min(1),kind:oE,scope:oA.default("agent"),title:ol.string().optional(),content:ol.string(),date:ol.string().optional(),tags:op.array(ol.string()).default([]),source:oS.optional()}).passthrough(),oT=of.object({path:ol.string().min(1),encoding:oh.enum(["utf8","base64"]).default("utf8"),content:ol.string(),mediaType:ol.string().optional(),executable:om.boolean().default(!1)}).passthrough(),oI=of.object({name:ol.string().min(1),description:ol.string().default(""),instructions:ol.string().default(""),version:ol.string().optional(),author:ol.string().optional(),dependencies:op.array(ol.string()).default([]),platforms:op.array(ol.string()).default([]),allowedTools:op.array(ol.string()).default([]),installation:ol.string().optional(),config:ou.record(ol.string(),oc.unknown()).default({}),references:op.array(ol.string()).default([]),files:op.array(oT).default([]),frontmatter:ou.record(ol.string(),oc.unknown()).default({}),invocation:oh.enum(["auto","manual"]).default("auto"),source:oS.optional()}).passthrough(),oj=og.union([of.object({value:ol.string()}).strict(),of.object({secretRef:ol.string(),redacted:oy.literal(!0)}).strict()]),oP=of.object({transport:oh.enum(["stdio","http","sse"]),command:ol.string().optional(),args:op.array(ol.string()).default([]),url:ol.string().optional(),env:ou.record(ol.string(),oj).default({}),headers:ou.record(ol.string(),oj).default({}),cwd:ol.string().optional()}).passthrough(),oC=of.object({name:ol.string().min(1),description:ol.string().optional(),kind:oh.enum(["mcp","builtin","function"]),mcp:oP.optional(),inputSchema:ou.record(ol.string(),oc.unknown()).optional(),output:ol.string().optional(),auth:of.object({required:om.boolean().default(!1),kind:ol.string().optional(),envVars:op.array(ol.string()).default([])}).optional(),permissions:op.array(ol.string()).default([]),platforms:op.array(ol.string()).default([]),enabled:om.boolean().default(!0),source:oS.optional()}).passthrough(),oL=of.object({name:ol.string().min(1),kind:ol.string(),description:ol.string().optional(),requiresAuth:om.boolean().default(!1),config:ou.record(ol.string(),oc.unknown()).default({}),notes:ol.string().optional(),source:oS.optional()}).passthrough(),oD=ob.discriminatedUnion("kind",[of.object({kind:oy.literal("cron"),expr:ol.string()}),of.object({kind:oy.literal("interval"),everyMs:od.number().int().positive()}),of.object({kind:oy.literal("once"),at:ol.string()}),of.object({kind:oy.literal("event"),event:ol.string()}),of.object({kind:oy.literal("manual")})]),oM=ob.discriminatedUnion("kind",[of.object({kind:oy.literal("prompt"),text:ol.string()}),of.object({kind:oy.literal("skill"),name:ol.string()}),of.object({kind:oy.literal("script"),path:ol.string()})]),oR=of.object({id:ol.string().min(1),name:ol.string().min(1),description:ol.string().optional(),trigger:oD,timezone:ol.string().optional(),actions:op.array(oM).min(1),requiredTools:op.array(ol.string()).default([]),dependencies:op.array(ol.string()).default([]),conditions:op.array(ol.string()).default([]),delivery:ol.string().optional(),sourceEnabled:om.boolean().default(!1),enabled:om.boolean().default(!1),source:oS.optional()}).passthrough(),oZ=oh.enum(["read","write","file","shell","network","browser","computer","schedule","tool","integration"]),oB=oh.enum(["allow","ask","deny"]),oU=of.object({capability:oZ,effect:oB,pattern:ol.string().optional(),source:ol.string().optional().describe("The native rule this was derived from")}).passthrough(),oF=oh.enum(["ask","auto","read-only"]),oK=of.object({mode:oF.default("ask"),rules:op.array(oU).default([]),notes:op.array(ol.string()).default([])}).passthrough(),oq=of.object({path:ol.string(),title:ol.string().optional(),mediaType:ol.string().optional(),size:od.number().int().nonnegative().optional(),sha256:ol.string().optional()}).passthrough(),oJ=of.object({platform:ol.string(),adapterVersion:ol.string().optional(),platformVersion:ol.string().optional(),nativeId:ol.string().optional(),location:ol.string().optional(),readAt:ol.string().optional()}).passthrough(),oV=of.object({operationId:ol.string(),kind:oh.enum(["export","import","migrate","restore","sync","duplicate"]),from:ol.string().optional(),to:ol.string().optional(),at:ol.string(),note:ol.string().optional()}).passthrough(),oW=of.object({schemaVersion:oh.enum(ov),id:ok,name:ol.string().min(1),description:ol.string().optional(),createdAt:ow,updatedAt:ow,packageVersion:od.number().int().positive().default(1),source:oJ,identity:oO,models:ox.default({fallbacks:[]}),instructions:op.array(oz).default([]),memory:op.array(oN).default([]),skills:op.array(oI).default([]),tools:op.array(oC).default([]),integrations:op.array(oL).default([]),workflows:op.array(oR).default([]),permissions:oK.default({mode:"ask",rules:[],notes:[]}),knowledge:op.array(oq).default([]),files:op.array(oT).default([]),history:op.array(oV).default([]),extensions:o_}).passthrough(),oG=oh.enum(["identity","instructions","memory","skills","tools","integrations","models","permissions","workflows","knowledge","project"]).options;e.s(["D",0,oW,"m",0,ok,"R",0,oG,"F",0,o_,"_",0,ow,"e",0,ox,"L",0,ov,"$",0,oJ,"S",0,"1.0"],33892);var ol=ol,of=ol,oy=ol,oh=ol,od=ol,op=ol,om=ol,ou=ol;let oY=ol.string().min(1),oX=of.object({format:oy.literal("nomad.agentpack"),schemaVersion:oh.enum(ov),id:ok,name:ol.string().min(1),description:ol.string().optional(),createdAt:ow,updatedAt:ow,exportedAt:ow,packageVersion:od.number().int().positive(),generator:of.object({name:ol.string(),version:ol.string()}).passthrough(),source:oJ,capabilities:op.array(ol.string()).default([]),models:ox.optional(),identity:oY.optional(),instructions:op.array(of.object({id:ol.string(),kind:ol.string(),title:ol.string().optional(),path:oY}).passthrough()).default([]),memory:of.object({index:oY,count:od.number().int().nonnegative()}).passthrough().optional(),skills:op.array(of.object({name:ol.string(),path:oY}).passthrough()).default([]),tools:op.array(of.object({name:ol.string(),path:oY}).passthrough()).default([]),integrations:oY.optional(),workflows:op.array(of.object({id:ol.string(),name:ol.string(),path:oY}).passthrough()).default([]),permissions:oY.optional(),knowledge:oY.optional(),files:op.array(of.object({path:oY,sha256:ol.string(),size:od.number().int().nonnegative()}).passthrough()).default([]),history:oY.optional(),secrets:of.object({included:om.boolean(),redactedCount:od.number().int().nonnegative(),references:op.array(ol.string()).default([])}).passthrough().default({included:!1,redactedCount:0,references:[]}),integrity:of.object({algorithm:oy.literal("sha256"),files:ou.record(ol.string(),ol.string())}).passthrough().optional(),extensions:o_}).passthrough();function oH(e){return e.issues.map(e=>({path:e.path.map(String).join(".")||"(root)",message:e.message}))}function oQ(e){if(!e||"object"!=typeof e)return e;let t={...e};return void 0===t.schemaVersion&&(t.schemaVersion="1.0"),"1"===t.schemaVersion&&(t.schemaVersion="1.0"),t}function o0(e){let t=oQ(e);if(t&&"string"==typeof t.schemaVersion&&!ov.includes(t.schemaVersion))return{ok:!1,issues:[{path:"schemaVersion",message:`Schema version ${t.schemaVersion} is newer than this version of Nomad supports (${ov.join(", ")}). Update Nomad to read it.`}]};let n=oW.safeParse(t);return n.success?{ok:!0,value:n.data,issues:[]}:{ok:!1,issues:oH(n.error)}}e.s(["r",0,function(e){let t=o0(e);if(!t.ok)throw Error("Invalid agent document: "+t.issues.map(e=>`${e.path}: ${e.message}`).join("; "));return t.value},"h",0,o0,"B",0,function(e){let t=oX.safeParse(oQ(e));return t.success?{ok:!0,value:t.data,issues:[]}:{ok:!1,issues:oH(t.error)}}],21229)}]);
|
|
83
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){i(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){i(n);continue}}if(e.metadataRegistry.get(n[0])?.id||r.cycle){i(n);continue}r.count>1&&"ref"===e.reused&&i(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}let iE=new Set(["type","properties","required","additionalProperties"]),iA=["oneOf","anyOf"];function iN(e){let t=e.additionalProperties;return void 0===t||!1===t||"object"!=typeof t||null===t?null:Object.keys(t).length?t:null}function iT(e){let t=[];for(let n of e){if("object"!=typeof n||"object"!==n.type)return null;for(let e in n)if(!iE.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??iN(n);null!=t&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}E(n,r,1===e.length?e[0]:iT(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:"object",properties:n};if(r.size&&(i.required=[...r]),t.every(e=>!1===e.additionalProperties))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=iN(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}1===e.length?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function iI(e,t){let n=e.seen.get(t);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let r=t=>{let n=e.seen.get(t);if(null===n.ref)return;let i=n.def??n.schema,s={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),a=n.schema;if(a.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(a)):i_(i,a),i_(i,s),t._zod.parent===o)for(let e in i)"$ref"!==e&&"allOf"!==e&&(e in s||delete i[e]);if(a.$ref&&n.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let a=t._zod.parent;if(a&&a!==o){r(a);let t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if("openapi-3.0"!==e.target)for(let t of e.seen.entries())!function e(t){let n=t.anyOf;if(!Array.isArray(n)||0===n.length||void 0!==t.type)return;let r=[];for(let t of n){if(!t||"object"!=typeof t)return;e(t);let n=Object.keys(t);if(1!==n.length||"type"!==n[0])return;let i=t.type;for(let e of Array.isArray(i)?i:[i]){if("string"!=typeof e)return;r.includes(e)||r.push(e)}}delete t.anyOf,t.type=1===r.length?r[0]:r}(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])!function(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of iE)if(t in e)return;let n=t.filter(e=>iA.some(t=>Array.isArray(e[t]))),r=null;if(n.length){let e=n[0],i=iA.find(t=>Array.isArray(e[t]));if(1!==Object.keys(e).length)return;let s=t.filter(t=>t!==e),o=e[i].map(e=>iT([...s,e]));if(o.some(e=>!e))return;r={[i]:o}}else r=iT(t);r&&(delete e.allOf,i_(e,r))}(e)}}let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}i_(i,n.defId?n.schema:n.def??n.schema);let s=e.metadataRegistry.get(t)?.id;void 0!==s&&i.id===s&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,E(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:ij(t,"input",e.processors),output:ij(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw Error("Error converting schema to JSON.")}}let ij=(e,t,n={})=>r=>{let{libraryOptions:i,target:s}=r??{},o=iS({...i??{},target:s,io:t,processors:n});return ix(e,o),iz(o,e),iI(o,e)},iP=(e,t,n)=>{(void 0===e[t]||n>e[t])&&(e[t]=n)},iC=(e,t,n)=>{(void 0===e[t]||n<e[t])&&(e[t]=n)},iL=(e,t)=>{iP(e,"minimum",t),iC(e,"maximum",t)},iD=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},iM=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},iR=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},iZ=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},iB=(e,t)=>iP(e,"minimum",t.minimum),iU=(e,t)=>iC(e,"maximum",t.maximum),iF=e=>(t,n)=>{iZ(t,n.format);let[r,i]=e[n.format];iP(t,"minimum",r),iC(t,"maximum",i)},iK={greater_than:(e,t)=>iP(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>iC(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>iD(e,t.value),number_format:iF(en),bigint_format:iF(er),min_length:iB,max_length:iU,length_equals:(e,t)=>iL(e,t.length),min_size:iB,max_size:iU,size_equals:(e,t)=>iL(e,t.size),string_format:(e,t)=>{iZ(e,t.format),t.pattern&&iM(e,t.pattern),("base64"===t.format||"base64url"===t.format)&&(e.contentEncoding=t.format),(t.local||-1===t.precision)&&(e.laxFormat=!0)},mime_type:(e,t)=>iR(e,t.mime)};function iq(e){let t={},n=e._zod.def;for(let r of e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[])iK[r._zod.def.check]?.(t,r._zod.def);let r=e._zod.bag;for(let e of(void 0!==r.minimum&&iP(t,"minimum",r.minimum),void 0!==r.exclusiveMinimum&&iP(t,"exclusiveMinimum",r.exclusiveMinimum),void 0!==r.maximum&&iC(t,"maximum",r.maximum),void 0!==r.exclusiveMaximum&&iC(t,"exclusiveMaximum",r.exclusiveMaximum),void 0!==r.multipleOf&&iD(t,r.multipleOf),void 0!==r.format&&(t.format??(t.format=r.format),r.format.includes("int")&&(t.isInt=!0)),r.mime&&iR(t,r.mime),r.patterns??[]))iM(t,e);return t}let iJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},iV=new Map([[n8,ty],[n5,tb]]),iW=e=>iV.get(e)??e;function iG(e){let t=e._zod.def;return"pipe"===t.type&&t.in._zod.traits.has("$ZodTransform")?iG(t.out):"catch"===t.type?iG(t.innerType):e._zod.optin}let iY=new WeakMap,iX=Symbol();function iH(e,t,n,r,i){let s=!1,o=JSON.stringify(e,(e,t)=>"bigint"!=typeof t?t:(s=!0,null));return s?(iO(t,n,r,i,"BigInt defaults cannot be represented in JSON Schema"),iX):JSON.parse(o)}let iQ=(e,t,n,r)=>{let i=e._zod.def;ix(i.innerType,t,r),t.seen.get(e).ref=i.innerType},i0=new WeakSet([Object.prototype,Error.prototype]);function i1(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}let i2=eJ("ZodError",(e,t)=>{nm.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);i0.has(n)||(i0.add(n),i1(n,"format",e=>t=>(function(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>r({issues:e},[...i,...s.path]));else if("invalid_key"===s.code)r({issues:s.issues},[...i,...s.path]);else if("invalid_element"===s.code)r({issues:s.issues},[...i,...s.path]);else{let e=[...i,...s.path];if(0===e.length)n._errors.push(t(s));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if("_errors"===n){o&&r._errors.push(t(s)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let a=r[n];o&&a._errors.push(t(s)),r=a,i++}}}};return r(e),n})(e,t)),i1(n,"flatten",e=>t=>(function(e,t=e=>e.message){let n={},r=[];for(let o of e.issues)if(o.path.length>0){var i,s;(i=o.path[0],s=()=>[],!Object.prototype.hasOwnProperty.call(n,i)&&("__proto__"===i?Object.defineProperty(n,i,{value:s(),writable:!0,enumerable:!0,configurable:!0}):n[i]=s()),n[i]).push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}})(e,t)),i1(n,"addIssue",e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,v,2)}),i1(n,"addIssues",e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,v,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return 0===this.issues.length}}))},void 0,{Parent:Error});e.s(["ZodRealError",0,i2],75214);let i9=nb(i2),i4=nw(i2),i6=n_(i2),i8=nO(i2),i3=(r=nb(i2),i=(e,t,n,s)=>r(e,t,n?{...n,direction:"backward"}:{direction:"backward"},ny(i,s))),i5=(s=nb(i2),o=(e,t,n,r)=>s(e,t,n,ny(o,r))),i7=(a=nw(i2),l=async(e,t,n,r)=>{let i=n?{...n,direction:"backward"}:{direction:"backward"};return await a(e,t,i,ny(l,r))}),se=(u=nw(i2),c=async(e,t,n,r)=>await u(e,t,n,ny(c,r))),st=(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return n_(i2)(e,t,r)},sn=(e,t,n)=>n_(i2)(e,t,n),sr=async(e,t,n)=>{let r=n?{...n,direction:"backward"}:{direction:"backward"};return nO(i2)(e,t,r)},si=async(e,t,n)=>nO(i2)(e,t,n);function ss(){eG.memoizer||eY({memoizer:e4})}let so=eJ("ZodType",(e,t)=>(eG.localeError||eY({localeError:(()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}},t={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",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};function r(e,t){return"number"!==e||"number"!=typeof t||Number.isFinite(t)?n[e]??e:String(t)}return n=>{switch(n.code){case"invalid_type":{let e=r(n.expected),t=r(eO(n.input),n.input);return`Invalid input: expected ${e}, received ${t}`}case"invalid_value":if(1===n.values.length)return`Invalid input: expected ${ee(n.values[0])}`;return`Invalid option: expected one of ${b(n.values,"|")}`;case"too_big":{let t=n.exact?"exactly ":n.inclusive?"<=":"<",r=e[n.origin]??null;if(r)return`Too big: expected ${n.origin??"value"} to have ${t}${n.maximum.toString()} ${r.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${t}${n.maximum.toString()}`}case"too_small":{let t=n.exact?"exactly ":n.inclusive?">=":">",r=e[n.origin]??null;if(r)return`Too small: expected ${n.origin} to have ${t}${n.minimum.toString()} ${r.unit}`;return`Too small: expected ${n.origin} to be ${t}${n.minimum.toString()}`}case"invalid_format":if("starts_with"===n.format)return`Invalid string: must start with "${n.prefix}"`;if("ends_with"===n.format)return`Invalid string: must end with "${n.suffix}"`;if("includes"===n.format)return`Invalid string: must include "${n.includes}"`;if("regex"===n.format)return`Invalid string: must match pattern ${n.pattern}`;return`Invalid ${t[n.format]??n.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${b(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0){let e=n.options.map(e=>`'${e}'`).join(" | ");return`Invalid discriminator value. Expected ${e}`}if(!1===n.inclusive)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}})()}),nA.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(io.mergeDefs(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return X(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return new oa({type:"custom",check:"custom",fn:e,...H(t)})}(e,t))},superRefine(e,t){return this.check(function(e,t){var n;let r,i;return n=t=>(t.addIssue=e=>{"string"==typeof e?t.issues.push(ex(e,t.value,r._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),"input"in e||(e.input=t.value),e.inst??(e.inst=r),e.continue??(e.continue=!r._zod.def.abort),t.issues.push(ex(e)))},e(t.value,t)),(i=new tY({check:"custom",...H(t)}))._zod.check=n,r=i}(e,t))},overwrite(e){return this.check(it(e))},optional(){return s8(this)},exactOptional(){var e;return e=this,new s3({type:"optional",innerType:e})},nullable(){return s7(this)},nullish(){return s8(s7(this))},nonoptional(e){var t,n;return t=this,n=e,new on({type:"nonoptional",innerType:t,...ic.normalizeParams(n)})},array(){return sK(this)},or(e){return sW([this,e])},and(e){var t;return t=this,new sX({type:"intersection",left:t,right:e})},transform(e){return os(this,new s4({type:"transform",transform:e}))},default(e){var t,n;return t=this,n=e,new oe({type:"default",innerType:t,get defaultValue(){return"function"==typeof n?n():ik.shallowClone(n)}})},prefault(e){var t,n;return t=this,n=e,new ot({type:"prefault",innerType:t,get defaultValue(){return"function"==typeof n?n():ik.shallowClone(n)}})},catch(e){var t,n;return t=this,new or({type:"catch",innerType:t,catchValue:"function"==typeof(n=e)?n:is.constantCatch(n)})},pipe(e){return os(this,e)},readonly(){var e;return e=this,new oo({type:"readonly",innerType:e})},describe(e){let t=this.clone();return e6.add(t,{description:e}),t},meta(...e){if(0===e.length)return e6.get(this);let t=this.clone();return e6.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return 0===t.length?e(this):e(this,...t)},get"~standard"(){return ia.hide(this,"~standard",{...nI(this),jsonSchema:{input:ij(this,"input"),output:ij(this,"output")}})},set"~standard"(e){il.own(this,"~standard",e)},parse:function e(t,n){return i9(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i4(this,t,n,{callee:e})},safeParse(e,t){return i6(this,e,t)},async safeParseAsync(e,t){return i8(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){il.own(this,"spa",e)},validate(e,t){let n=this._zod.bag.validator;if(void 0!==n){if(n(e)!==nx)return!0;if(!0===n.definite&&void 0===t)return!1}return function(e,t,n){let r,i=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},s=e._zod.bag.fallbackRun;if(s?(i[n$]=!0,r=s({value:t,issues:[]},i)):r=e._zod.run({value:t,issues:[]},i),r instanceof Promise)throw new eV;return 0===r.issues.length}(this,e,t)},validateAsync(e,t){return nz(this,e,t)},encode:function e(t,n){return i3(this,t,n,{callee:e})},decode:function e(t,n){return i5(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await i7(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await se(this,t,n,{callee:e})},safeEncode(e,t){return st(this,e,t)},safeDecode(e,t){return sn(this,e,t)},async safeEncodeAsync(e,t){return sr(this,e,t)},async safeDecodeAsync(e,t){return si(this,e,t)},toJSONSchema(e){return((e,t={})=>n=>{let r=iS({...n,processors:t});return ix(e,r),iz(r,e),iI(r,e)})(this,{})(e)},get description(){return e6.get(this)?.description},get _def(){return this._zod.def}}),sa=eJ("_ZodString",(e,t)=>{nj.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{n.type="string";let{minimum:r,maximum:i,format:s,patterns:o,contentEncoding:a,laxFormat:l}=iq(e);if("number"==typeof r&&(n.minLength=r),"number"==typeof i&&(n.maxLength=i),s&&(n.format=iJ[s]??s,""===n.format&&delete n.format,("time"===s||l)&&delete n.format),a&&(n.contentEncoding=a),o&&o.size>0){let e=[...o].map(iW);1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n)},iu.derived({format:e=>iq(e).format??null,minLength:e=>iq(e).minimum??null,maxLength:e=>iq(e).maximum??null},{regex(...e){return this.check(function(e,t){return new nn({check:"string_format",format:"regex",...H(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new ns({check:"string_format",format:"includes",...H(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new no({check:"string_format",format:"starts_with",...H(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new na({check:"string_format",format:"ends_with",...H(t),suffix:e})}(...e))},min(...e){return this.check(r7(...e))},max(...e){return this.check(r5(...e))},length(...e){return this.check(ie(...e))},nonempty(...e){return this.check(r7(1,...e))},lowercase(e){return this.check(new nr({check:"string_format",format:"lowercase",...H(e)}))},uppercase(e){return this.check(new ni({check:"string_format",format:"uppercase",...H(e)}))},trim(){return this.check(it(e=>e.trim()))},normalize(...e){return this.check(function(e){return it(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(it(e=>e.toLowerCase()))},toUpperCase(){return this.check(it(e=>e.toUpperCase()))},slugify(){return this.check(it(e=>Z(e)))}})),sl=eJ("ZodString",(e,t)=>{nj.init(e,t),sa.init(e,t)},{email(e){return this.check(new sm({type:"string",format:"email",check:"string_format",abort:!1,...H(e)}))},url(e){return this.check(new sb({type:"string",format:"url",check:"string_format",abort:!1,...H(e)}))},jwt(e){return this.check(new sj({type:"string",format:"jwt",check:"string_format",abort:!1,...H(e)}))},emoji(e){return this.check(new sv({type:"string",format:"emoji",check:"string_format",abort:!1,...H(e)}))},guid(e){return this.check(new sg({type:"string",format:"guid",check:"string_format",abort:!1,...H(e)}))},uuid(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,...H(e)}))},uuidv4(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...H(e)}))},uuidv6(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...H(e)}))},uuidv7(e){return this.check(new sy({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...H(e)}))},nanoid(e){return this.check(new sw({type:"string",format:"nanoid",check:"string_format",abort:!1,...H(e)}))},cuid(e){return this.check(new sk({type:"string",format:"cuid",check:"string_format",abort:!1,...H(e)}))},cuid2(e){return this.check(new s_({type:"string",format:"cuid2",check:"string_format",abort:!1,...H(e)}))},ulid(e){return this.check(new sS({type:"string",format:"ulid",check:"string_format",abort:!1,...H(e)}))},base64(e){return this.check(new sN({type:"string",format:"base64",check:"string_format",abort:!1,...H(e)}))},base64url(e){return this.check(new sT({type:"string",format:"base64url",check:"string_format",abort:!1,...H(e)}))},xid(e){return this.check(new sO({type:"string",format:"xid",check:"string_format",abort:!1,...H(e)}))},ksuid(e){return this.check(new sx({type:"string",format:"ksuid",check:"string_format",abort:!1,...H(e)}))},ipv4(e){return this.check(new s$({type:"string",format:"ipv4",check:"string_format",abort:!1,...H(e)}))},ipv6(e){return this.check(new sz({type:"string",format:"ipv6",check:"string_format",abort:!1,...H(e)}))},cidrv4(e){return this.check(new sE({type:"string",format:"cidrv4",check:"string_format",abort:!1,...H(e)}))},cidrv6(e){return this.check(new sA({type:"string",format:"cidrv6",check:"string_format",abort:!1,...H(e)}))},e164(e){return this.check(new sI({type:"string",format:"e164",check:"string_format",abort:!1,...H(e)}))},datetime(e){return this.check(new sf({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...H(e)}))},date(e){return this.check(new sd({type:"string",format:"date",check:"string_format",...H(e)}))},time(e){return this.check(new sp({type:"string",format:"time",check:"string_format",precision:null,...H(e)}))},duration(e){return this.check(new sh({type:"string",format:"duration",check:"string_format",...H(e)}))}});function su(e){return new sl(r2({type:"string",...H(e)}))}let sc=eJ("ZodStringFormat",(e,t)=>{nP.init(e,t),sa.init(e,t)}),sf=eJ("ZodISODateTime",(e,t)=>{nG.init(e,t),sc.init(e,t)}),sd=eJ("ZodISODate",(e,t)=>{nY.init(e,t),sc.init(e,t)}),sp=eJ("ZodISOTime",(e,t)=>{nX.init(e,t),sc.init(e,t)}),sh=eJ("ZodISODuration",(e,t)=>{nH.init(e,t),sc.init(e,t)}),sm=eJ("ZodEmail",(e,t)=>{nD.init(e,t),sc.init(e,t)}),sg=eJ("ZodGUID",(e,t)=>{nC.init(e,t),sc.init(e,t)}),sy=eJ("ZodUUID",(e,t)=>{nL.init(e,t),sc.init(e,t)}),sb=eJ("ZodURL",(e,t)=>{nB.init(e,t),sc.init(e,t)}),sv=eJ("ZodEmoji",(e,t)=>{nU.init(e,t),sc.init(e,t)}),sw=eJ("ZodNanoID",(e,t)=>{nF.init(e,t),sc.init(e,t)}),sk=eJ("ZodCUID",(e,t)=>{nK.init(e,t),sc.init(e,t)}),s_=eJ("ZodCUID2",(e,t)=>{nq.init(e,t),sc.init(e,t)}),sS=eJ("ZodULID",(e,t)=>{nJ.init(e,t),sc.init(e,t)}),sO=eJ("ZodXID",(e,t)=>{nV.init(e,t),sc.init(e,t)}),sx=eJ("ZodKSUID",(e,t)=>{nW.init(e,t),sc.init(e,t)}),s$=eJ("ZodIPv4",(e,t)=>{nQ.init(e,t),sc.init(e,t)}),sz=eJ("ZodIPv6",(e,t)=>{n2.init(e,t),sc.init(e,t)}),sE=eJ("ZodCIDRv4",(e,t)=>{n9.init(e,t),sc.init(e,t)}),sA=eJ("ZodCIDRv6",(e,t)=>{n4.init(e,t),sc.init(e,t)}),sN=eJ("ZodBase64",(e,t)=>{n3.init(e,t),sc.init(e,t)}),sT=eJ("ZodBase64URL",(e,t)=>{n7.init(e,t),sc.init(e,t)}),sI=eJ("ZodE164",(e,t)=>{re.init(e,t),sc.init(e,t)}),sj=eJ("ZodJWT",(e,t)=>{rn.init(e,t),sc.init(e,t)}),sP=eJ("ZodNumber",(e,t)=>{rr.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let{minimum:i,maximum:s,multipleOf:o,exclusiveMaximum:a,exclusiveMinimum:l,isInt:u}=iq(e);n.type=u?"integer":"number";let c="number"==typeof l&&l>=(i??-1/0),f="number"==typeof a&&a<=(s??1/0),d="draft-04"===t.target||"openapi-3.0"===t.target;if(c?d?(n.minimum=l,n.exclusiveMinimum=!0):n.exclusiveMinimum=l:"number"==typeof i&&(n.minimum=i),f?d?(n.maximum=a,n.exclusiveMaximum=!0):n.exclusiveMaximum=a:"number"==typeof s&&(n.maximum=s),o){let i=new Set;for(let s of o)Number.isFinite(s)&&0!==s?i.add(Math.abs(s)):iO(e,t,n,r,`A multipleOf divisor of ${s} cannot be represented in JSON Schema`);let[s,...a]=i;void 0!==s&&(n.multipleOf=s),a.length&&(n.allOf=[...n.allOf??[],...a.map(e=>({multipleOf:e}))])}})(e,t,n,r),e.isFinite=!0},iu.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=iq(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=iq(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=iq(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>iq(e).format??null},{gt(e,t){return this.check(r6(e,t))},gte(e,t){return this.check(r8(e,t))},min(e,t){return this.check(r8(e,t))},lt(e,t){return this.check(r9(e,t))},lte(e,t){return this.check(r4(e,t))},max(e,t){return this.check(r4(e,t))},int(e){return this.check(sD(e))},safe(e){return this.check(sD(e))},positive(e){return this.check(r6(0,e))},nonnegative(e){return this.check(r8(0,e))},negative(e){return this.check(r9(0,e))},nonpositive(e){return this.check(r4(0,e))},multipleOf(e,t){return this.check(r3(e,t))},step(e,t){return this.check(r3(e,t))},finite(){return this}}));function sC(e){return new sP(r2({type:"number",checks:[],...H(e)}))}let sL=eJ("ZodNumberFormat",(e,t)=>{ri.init(e,t),sP.init(e,t)});function sD(e){return new sL({type:"number",check:"number_format",abort:!1,format:"safeint",...H(e)})}let sM=eJ("ZodBoolean",(e,t)=>{rs.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.type="boolean"}});function sR(e){return new sM({type:"boolean",...H(e)})}(e,t)=>{ro.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"BigInt cannot be represented in JSON Schema")}};let sZ=eJ("ZodUnknown",(e,t)=>{ra.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function sB(){return new sZ({type:"unknown"})}let sU=eJ("ZodNever",(e,t)=>{rl.init(e,t),so.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{t.not={}}}),sF=eJ("ZodArray",(e,t)=>{ss(),rh.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,{minimum:s,maximum:o}=iq(e);"number"==typeof s&&(n.minItems=s),"number"==typeof o&&(n.maxItems=o),n.type="array",n.items=ix(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element},{min(e,t){return this.check(r7(e,t))},nonempty(e){return this.check(r7(1,e))},max(e,t){return this.check(r5(e,t))},length(e,t){return this.check(ie(e,t))},unwrap(){return this.element}});function sK(e,t){return new sF({type:"array",element:e,...H(t)})}let sq=eJ("ZodObject",(e,t)=>{ss(),rw.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def,s=i.shape;if(Object.getOwnPropertySymbols(s).length&&iO(e,t,n,r,"Symbol keys cannot be represented in JSON Schema"))return;for(let e in n.type="object",n.properties={},s)E(n.properties,e,ix(s[e],t,{...r,path:[...r.path,"properties",e]}));let o=[];for(let e of Object.keys(s)){let n=i.shape[e];("input"===t.io?void 0===iG(n):void 0===n._zod.optout)&&o.push(e)}o.length>0&&(n.required=o),i.catchall?._zod.def.type==="never"?n.additionalProperties=!1:i.catchall?i.catchall&&(n.additionalProperties=ix(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(n.additionalProperties=!1)})(e,t,n,r),iv.installLazyProp(e,"shape",e=>e._zod.def.shape,!1)},{keyof(){return s1(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(io.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(io.mergeDefs(this._zod.def,{catchall:sB()}))},loose(){return this.clone(io.mergeDefs(this._zod.def,{catchall:sB()}))},strict(){return this.clone(io.mergeDefs(this._zod.def,{catchall:new sU({type:"never",...H(void 0)})}))},strip(){return this.clone(io.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return id.extend(this,e)},safeExtend(e){return ip.safeExtend(this,e)},merge(e){return ih.merge(this,e)},pick(e){return im.pick(this,e)},omit(e){return ig.omit(this,e)},partial(...e){return iy.partial(s6,this,e[0])},exactPartial(...e){return iy.partial(s3,this,e[0],"exactPartial")},required(...e){return ib.required(on,this,e[0])}});function sJ(e,t){return new sq({type:"object",shape:e??{},...ic.normalizeParams(t)})}let sV=eJ("ZodUnion",(e,t)=>{r_.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{var i,s,o,a;let l,u,c;return i=e,s=t,o=n,a=r,u=!1===(l=i._zod.def).inclusive,c=l.options.map((e,t)=>ix(e,s,{...a,path:[...a.path,u?"oneOf":"anyOf",t]})),void(u?o.oneOf=c:o.anyOf=c)},e.options=t.options});function sW(e,t){return new sV({type:"union",options:e,...ic.normalizeParams(t)})}let sG=eJ("ZodDiscriminatedUnion",(e,t)=>{sV.init(e,t),rO.init(e,t)});function sY(e,t,n){return new sG({type:"union",options:t,discriminator:e,...ic.normalizeParams(n)})}let sX=eJ("ZodIntersection",(e,t)=>{rx.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o,a,l;return s=ix((i=e._zod.def).left,t,{...r,path:[...r.path,"allOf",0]}),o=ix(i.right,t,{...r,path:[...r.path,"allOf",1]}),void(n.allOf=l=[...(a=e=>"allOf"in e&&1===Object.keys(e).length)(s)?s.allOf:[s],...a(o)?o.allOf:[o]],t.intersections.push(l))}}),sH=eJ("ZodRecord",(e,t)=>{ss(),rT.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;n.type="object";let s=i.keyType,o=iq(s).patterns;if("loose"===i.mode&&o&&o.size>0){let e=ix(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});for(let t of(n.patternProperties={},o))E(n.patternProperties,iW(t).source,e)}else{if("draft-07"===t.target||"draft-2020-12"===t.target){n.propertyNames=ix(i.keyType,t,{...r,path:[...r.path,"propertyNames"]});let s=iY.get(t);s||(s=[],iY.set(t,s),t.deferred.push(()=>(function(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of iY.get(e)??[]){let i=e.seen.get(r),s=(i?.def??i?.schema)?.propertyNames;if(!s||!0===s||n.has(s))continue;let o=function e(t,n,r){if(n.$ref){if(r.has(n))return n;r.add(n);let i=t.get(n)?.def;if(!i)return n;let s=e(t,i,r);return s===i?n:s}for(let i of["anyOf","oneOf"]){let s=n[i];if(!Array.isArray(s))continue;let o=s.map(n=>e(t,n,r));o.some((e,t)=>e!==s[t])&&(n={...n,[i]:o})}let i=Array.isArray(n.type)?n.type:[n.type],s=!i.includes("string")&&i.some(e=>"number"===e||"integer"===e),o=n.enum??(void 0!==n.const?[n.const]:void 0);if(!s&&!o?.some(e=>"number"==typeof e))return n;let{minimum:a,maximum:l,exclusiveMinimum:u,exclusiveMaximum:c,multipleOf:f,format:d,id:p,...h}=n;return h.enum?h.enum=h.enum.map(e=>"number"==typeof e?String(e):e):"number"==typeof h.const&&(h.const=String(h.const)),s&&(h.type="string",o||(h.pattern=(i.includes("number")?tI:tT).source)),h}(t,s,new Set);o!==s&&n.set(s,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}})(t))),s.push(e)}n.additionalProperties=ix(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]})}let a=s._zod.values,l="input"===t.io&&void 0!==iG(i.valueType);if(a&&!i.partial&&!l){let e=[...a].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(n.required=e.map(String))}})(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function sQ(e,t,n){return new sH(t&&t._zod?{type:"record",keyType:e,valueType:t,...ic.normalizeParams(n)}:{type:"record",keyType:su(),valueType:e,...ic.normalizeParams(t)})}let s0=eJ("ZodEnum",(e,t)=>{rP.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t)=>{let n=y(e._zod.def.entries);if(0===n.length){t.not={};return}n.every(e=>"number"==typeof e)&&(t.type="number"),n.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=n})(e,n),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new s0({...t,checks:[],...ic.normalizeParams(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new s0({...t,checks:[],...ic.normalizeParams(r),entries:i})}});function s1(e,t){return new s0({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ic.normalizeParams(t)})}let s2=eJ("ZodLiteral",(e,t)=>{rC.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(0===i.values.length){n.not={};return}let s=[];for(let o of i.values)if(void 0===o){if(iO(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if("bigint"==typeof o){if(iO(e,t,n,r,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(o))}else s.push(o);if(0===s.length);else if(1===s.length){let e=s[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else s.every(e=>"number"==typeof e)&&(n.type="number"),s.every(e=>"string"==typeof e)&&(n.type="string"),s.every(e=>"boolean"==typeof e)&&(n.type="boolean"),s.every(e=>null===e)&&(n.type="null"),n.enum=s})(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function s9(e,t){return new s2({type:"literal",values:Array.isArray(e)?e:[e],...ic.normalizeParams(t)})}let s4=eJ("ZodTransform",(e,t)=>{ss(),rL.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"Transforms cannot be represented in JSON Schema")},e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new eW(e.constructor.name);n.addIssue=r=>{"string"==typeof r?n.issues.push(iw.issue(r,n.value,t)):(r.fatal&&(r.continue=!1),r.code??(r.code="custom"),"input"in r||(r.input=n.value),r.inst??(r.inst=e),n.issues.push(iw.issue(r)))};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}}),s6=eJ("ZodOptional",(e,t)=>{rM.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function s8(e){return new s6({type:"optional",innerType:e})}let s3=eJ("ZodExactOptional",(e,t)=>{rR.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iQ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),s5=eJ("ZodNullable",(e,t)=>{rZ.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o;return s=ix((i=e._zod.def).innerType,t,r),o=t.seen.get(e),void("openapi-3.0"===t.target?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}])},e.unwrap=()=>e._zod.def.innerType});function s7(e){return new s5({type:"nullable",innerType:e})}let oe=eJ("ZodDefault",(e,t)=>{rB.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s;return ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,void((s=iH(i.defaultValue,e,t,n,r))!==iX&&(n.default=s))},e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}),ot=eJ("ZodPrefault",(e,t)=>{rF.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i=e._zod.def;if(ix(i.innerType,t,r),t.seen.get(e).ref=i.innerType,"input"!==t.io)return;let s=iH(i.defaultValue,e,t,n,r);s!==iX&&(n._prefault=s)})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType}),on=eJ("ZodNonOptional",(e,t)=>{rK.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType},e.unwrap=()=>e._zod.def.innerType}),or=eJ("ZodCatch",(e,t)=>{rV.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{let i,s=e._zod.def;ix(s.innerType,t,r),t.seen.get(e).ref=s.innerType;try{i=s.catchValue(void 0)}catch{iO(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}),oi=eJ("ZodPipe",(e,t)=>{rW.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i,s,o;return s=(i=e._zod.def).in._zod.traits.has("$ZodTransform"),void(ix(o="input"===t.io?s?i.out:i.in:i.out,t,r),t.seen.get(e).ref=o)},e.in=t.in,e.out=t.out});function os(e,t){return new oi({type:"pipe",in:e,out:t})}let oo=eJ("ZodReadonly",(e,t)=>{rH.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{let i;ix((i=e._zod.def).innerType,t,r),t.seen.get(e).ref=i.innerType,n.readOnly=!0},e.unwrap=()=>e._zod.def.innerType}),oa=eJ("ZodCustom",(e,t)=>{r0.init(e,t),so.init(e,t),e._zod.processJSONSchema=(t,n,r)=>{iO(e,t,n,r,"Custom types cannot be represented in JSON Schema")}});e.s(["array",0,sK,"boolean",0,sR,"discriminatedUnion",0,sY,"enum",0,s1,"literal",0,s9,"number",0,sC,"object",0,sJ,"record",0,sQ,"string",0,su,"union",0,sW,"unknown",0,sB],86752),e.i(86752),e.s([],4435),e.i(4435),e.i(75214),e.s([],68959),e.i(68959),e.s([],38220),e.i(38220),e.s(["array",0,sK,"boolean",0,sR,"discriminatedUnion",0,sY,"enum",0,s1,"literal",0,s9,"number",0,sC,"object",0,sJ,"record",0,sQ,"string",0,su,"union",0,sW,"unknown",0,sB],77698);var ol=e.i(77698),ol=ol,ou=ol,oc=ol,of=ol,od=ol,op=ol,oh=ol,om=ol,og=ol,oy=ol,ob=ol;let ov=["1.0"],ow=ol.string().regex(/^[0-9A-HJKMNP-TV-Z]{26}$/,"Agent identifiers are ULIDs"),ok=ol.string().refine(e=>!Number.isNaN(Date.parse(e)),"Expected an ISO 8601 date"),o_=ou.record(ol.string().regex(/^x-[a-z0-9][a-z0-9._-]*$/i,"Extension keys must look like x-<namespace>"),oc.unknown()).default({}),oS=of.object({platform:ol.string(),path:ol.string().optional(),line:od.number().int().nonnegative().optional(),note:ol.string().optional()}).passthrough(),oO=of.object({name:ol.string().min(1),description:ol.string().optional(),persona:ol.string().optional(),tone:ol.string().optional(),emoji:ol.string().optional(),avatar:ol.string().optional().describe("Path of the avatar inside files/"),extensions:o_}).passthrough(),ox=of.object({preferred:ol.string().optional(),provider:ol.string().optional(),fallbacks:op.array(ol.string()).default([]),reasoningEffort:ol.string().optional(),notes:ol.string().optional()}).passthrough(),o$=oh.enum(["system","agent","custom","user-context","conventions","heartbeat","bootstrap","command"]),oz=of.object({id:ol.string().min(1),kind:o$,title:ol.string().optional(),content:ol.string(),source:oS.optional()}).passthrough(),oE=oh.enum(["profile","preference","fact","project","instruction","note","summary","daily-log","document"]),oA=oh.enum(["user","agent","project"]),oN=of.object({id:ol.string().min(1),kind:oE,scope:oA.default("agent"),title:ol.string().optional(),content:ol.string(),date:ol.string().optional(),tags:op.array(ol.string()).default([]),source:oS.optional()}).passthrough(),oT=of.object({path:ol.string().min(1),encoding:oh.enum(["utf8","base64"]).default("utf8"),content:ol.string(),mediaType:ol.string().optional(),executable:om.boolean().default(!1)}).passthrough(),oI=of.object({name:ol.string().min(1),description:ol.string().default(""),instructions:ol.string().default(""),version:ol.string().optional(),author:ol.string().optional(),dependencies:op.array(ol.string()).default([]),platforms:op.array(ol.string()).default([]),allowedTools:op.array(ol.string()).default([]),installation:ol.string().optional(),config:ou.record(ol.string(),oc.unknown()).default({}),references:op.array(ol.string()).default([]),files:op.array(oT).default([]),frontmatter:ou.record(ol.string(),oc.unknown()).default({}),invocation:oh.enum(["auto","manual"]).default("auto"),source:oS.optional()}).passthrough(),oj=og.union([of.object({value:ol.string()}).strict(),of.object({secretRef:ol.string(),redacted:oy.literal(!0)}).strict()]),oP=of.object({transport:oh.enum(["stdio","http","sse"]),command:ol.string().optional(),args:op.array(ol.string()).default([]),url:ol.string().optional(),env:ou.record(ol.string(),oj).default({}),headers:ou.record(ol.string(),oj).default({}),cwd:ol.string().optional()}).passthrough(),oC=of.object({name:ol.string().min(1),description:ol.string().optional(),kind:oh.enum(["mcp","builtin","function"]),mcp:oP.optional(),inputSchema:ou.record(ol.string(),oc.unknown()).optional(),output:ol.string().optional(),auth:of.object({required:om.boolean().default(!1),kind:ol.string().optional(),envVars:op.array(ol.string()).default([])}).optional(),permissions:op.array(ol.string()).default([]),platforms:op.array(ol.string()).default([]),enabled:om.boolean().default(!0),source:oS.optional()}).passthrough(),oL=of.object({name:ol.string().min(1),kind:ol.string(),description:ol.string().optional(),requiresAuth:om.boolean().default(!1),config:ou.record(ol.string(),oc.unknown()).default({}),notes:ol.string().optional(),source:oS.optional()}).passthrough(),oD=ob.discriminatedUnion("kind",[of.object({kind:oy.literal("cron"),expr:ol.string()}),of.object({kind:oy.literal("interval"),everyMs:od.number().int().positive()}),of.object({kind:oy.literal("once"),at:ol.string()}),of.object({kind:oy.literal("event"),event:ol.string()}),of.object({kind:oy.literal("manual")})]),oM=ob.discriminatedUnion("kind",[of.object({kind:oy.literal("prompt"),text:ol.string()}),of.object({kind:oy.literal("skill"),name:ol.string()}),of.object({kind:oy.literal("script"),path:ol.string()})]),oR=of.object({id:ol.string().min(1),name:ol.string().min(1),description:ol.string().optional(),trigger:oD,timezone:ol.string().optional(),actions:op.array(oM).min(1),requiredTools:op.array(ol.string()).default([]),dependencies:op.array(ol.string()).default([]),conditions:op.array(ol.string()).default([]),delivery:ol.string().optional(),sourceEnabled:om.boolean().default(!1),enabled:om.boolean().default(!1),source:oS.optional()}).passthrough(),oZ=oh.enum(["read","write","file","shell","network","browser","computer","schedule","tool","integration"]),oB=oh.enum(["allow","ask","deny"]),oU=of.object({capability:oZ,effect:oB,pattern:ol.string().optional(),source:ol.string().optional().describe("The native rule this was derived from")}).passthrough(),oF=oh.enum(["ask","auto","read-only"]),oK=of.object({mode:oF.default("ask"),rules:op.array(oU).default([]),notes:op.array(ol.string()).default([])}).passthrough(),oq=of.object({path:ol.string(),title:ol.string().optional(),mediaType:ol.string().optional(),size:od.number().int().nonnegative().optional(),sha256:ol.string().optional()}).passthrough(),oJ=of.object({platform:ol.string(),adapterVersion:ol.string().optional(),platformVersion:ol.string().optional(),nativeId:ol.string().optional(),location:ol.string().optional(),readAt:ol.string().optional()}).passthrough(),oV=of.object({operationId:ol.string(),kind:oh.enum(["export","import","migrate","restore","sync","duplicate"]),from:ol.string().optional(),to:ol.string().optional(),at:ol.string(),note:ol.string().optional()}).passthrough(),oW=of.object({schemaVersion:oh.enum(ov),id:ow,name:ol.string().min(1),description:ol.string().optional(),createdAt:ok,updatedAt:ok,packageVersion:od.number().int().positive().default(1),source:oJ,identity:oO,models:ox.default({fallbacks:[]}),instructions:op.array(oz).default([]),memory:op.array(oN).default([]),skills:op.array(oI).default([]),tools:op.array(oC).default([]),integrations:op.array(oL).default([]),workflows:op.array(oR).default([]),permissions:oK.default({mode:"ask",rules:[],notes:[]}),knowledge:op.array(oq).default([]),files:op.array(oT).default([]),history:op.array(oV).default([]),extensions:o_}).passthrough(),oG=oh.enum(["identity","instructions","memory","skills","tools","integrations","models","permissions","workflows","knowledge","project"]).options;e.s(["D",0,oW,"m",0,ow,"R",0,oG,"F",0,o_,"_",0,ok,"e",0,ox,"L",0,ov,"$",0,oJ,"S",0,"1.0"],33892);var ol=ol,of=ol,oy=ol,oh=ol,od=ol,op=ol,om=ol,ou=ol;let oY=ol.string().min(1),oX=of.object({format:oy.literal("nomad.agentpack"),schemaVersion:oh.enum(ov),id:ow,name:ol.string().min(1),description:ol.string().optional(),createdAt:ok,updatedAt:ok,exportedAt:ok,packageVersion:od.number().int().positive(),generator:of.object({name:ol.string(),version:ol.string()}).passthrough(),source:oJ,capabilities:op.array(ol.string()).default([]),models:ox.optional(),identity:oY.optional(),instructions:op.array(of.object({id:ol.string(),kind:ol.string(),title:ol.string().optional(),path:oY}).passthrough()).default([]),memory:of.object({index:oY,count:od.number().int().nonnegative()}).passthrough().optional(),skills:op.array(of.object({name:ol.string(),path:oY}).passthrough()).default([]),tools:op.array(of.object({name:ol.string(),path:oY}).passthrough()).default([]),integrations:oY.optional(),workflows:op.array(of.object({id:ol.string(),name:ol.string(),path:oY}).passthrough()).default([]),permissions:oY.optional(),knowledge:oY.optional(),files:op.array(of.object({path:oY,sha256:ol.string(),size:od.number().int().nonnegative()}).passthrough()).default([]),history:oY.optional(),secrets:of.object({included:om.boolean(),redactedCount:od.number().int().nonnegative(),references:op.array(ol.string()).default([])}).passthrough().default({included:!1,redactedCount:0,references:[]}),integrity:of.object({algorithm:oy.literal("sha256"),files:ou.record(ol.string(),ol.string())}).passthrough().optional(),extensions:o_}).passthrough();function oH(e){return e.issues.map(e=>({path:e.path.map(String).join(".")||"(root)",message:e.message}))}function oQ(e){if(!e||"object"!=typeof e)return e;let t={...e};return void 0===t.schemaVersion&&(t.schemaVersion="1.0"),"1"===t.schemaVersion&&(t.schemaVersion="1.0"),t}function o0(e){let t=oQ(e);if(t&&"string"==typeof t.schemaVersion&&!ov.includes(t.schemaVersion))return{ok:!1,issues:[{path:"schemaVersion",message:`Schema version ${t.schemaVersion} is newer than this version of Nomad supports (${ov.join(", ")}). Update Nomad to read it.`}]};let n=oW.safeParse(t);return n.success?{ok:!0,value:n.data,issues:[]}:{ok:!1,issues:oH(n.error)}}e.s(["r",0,function(e){let t=o0(e);if(!t.ok)throw Error("Invalid agent document: "+t.issues.map(e=>`${e.path}: ${e.message}`).join("; "));return t.value},"h",0,o0,"B",0,function(e){let t=oX.safeParse(oQ(e));return t.success?{ok:!0,value:t.data,issues:[]}:{ok:!1,issues:oH(t.error)}}],21229)}]);
|