var p=(e,t,n)=>(Object.defineProperty(e,t,{value:n}),n),m=e=>({get value(){let t=e();return p(this,"value",t)}}),E=Array.isArray,I=e=>typeof e=="object"&&e!==null&&!E(e),O=m(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});var $=(e,t)=>e?{ok:!1,code:"join",left:e,right:t}:t,y=(e,t)=>({ok:!1,code:"prepend",key:e,tree:t}),j=e=>({ok:!0,value:e}),L=0,h=1,G=2,M=(e,t)=>{let{ok:n,msg:u,...r}=e;return{...r,path:t}},U=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{U(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push(M(e,t)),n}},R=e=>{let t=0;for(;;)switch(e.code){case"join":{t+=R(e.left),e=e.right;continue}case"prepend":{e=e.tree;continue}default:return t+1}};var Y=e=>{let t="",n=0;for(;;){switch(e.code){case"join":{n+=R(e.right),e=e.left;continue}case"prepend":{t+=`.${e.key}`,e=e.tree;continue}}break}let u=e.msg(),r=`${e.code} at ${t||"."} (${u})`;return n>0&&(r+=` (+${n} other issue(s))`),r},T=class extends Error{name="ValidationError";#e;constructor(t){super(),this.#e=t}get message(){return Y(this.#e)}get issues(){return U(this.#e)}};var w=(e,t,n)=>{let u=L;n?.strict&&(u|=G);let r=e["~run"](t,u);if(r===void 0)return t;if(r.ok)return r.value;throw new T(r)},B=(e,t=[],n=[])=>{for(;;)switch(e.code){case"join":{B(e.left,t.slice(),n),e=e.right;continue}case"prepend":{t.push(e.key),e=e.tree;continue}default:return n.push({message:e.msg(),path:t.length>0?t:void 0}),n}},x=e=>({version:1,vendor:"@atcute/lexicons",validate(t){let n=e["~run"](t,L);return n===void 0?{value:t}:n.ok?{value:n.value}:{issues:B(n)}}});var P={ok:!1,code:"invalid_type",expected:"integer",msg(){return"expected integer"}},D={kind:"schema",type:"integer","~run"(e,t){if(typeof e!="number"||!Number.isSafeInteger(e))return P},get"~standard"(){return p(this,"~standard",x(this))}},A=()=>D;var F={ok:!1,code:"invalid_type",expected:"string",msg(){return"expected string"}},H={kind:"schema",type:"string",format:null,"~run"(e,t){if(typeof e!="string")return F},get"~standard"(){return p(this,"~standard",x(this))}},_=()=>H;var K=e=>e.type==="optional",W={ok:!1,code:"invalid_type",expected:"array",msg(){return"expected array"}},k=e=>{let t=m(()=>typeof e=="function"?e():e);return{kind:"schema",type:"array",get item(){return p(this,"item",t.value)},get"~run"(){let n=t.value;return p(this,"~run",(r,v)=>{if(!E(r))return W;let o,s;for(let i=0,a=r.length;i{t==="__proto__"?Object.defineProperty(e,t,{value:n}):e[t]=n},b=e=>{let t=m(()=>{let n=[];for(let u in e){let r=e[u];n.push({key:u,schema:r,optional:K(r),missing:y(u,J)})}return n});return{kind:"schema",type:"object",get shape(){let n=t.value,u={};for(let r of n)u[r.key]=r.schema;return p(this,"shape",u)},get"~run"(){let n=t.value,u=n.length,r=()=>{let o=[["$ok",j],["$joinIssues",$],["$prependPath",y]],s="let $iss,$out;";for(let a=0;aa).join(",")}]`,`return function matcher($in,$flags){${s}}`)(o.map(([,a])=>a))};if(O.value){let o=r();return p(this,"~run",(i,a)=>I(i)?o(i,a):C)}return p(this,"~run",(o,s)=>{if(!I(o))return C;let i,a;for(let d=0;dw(Q,e),ne=e=>w(Z,e);export{ne as parseSourceDetails,te as parseSources};