woml-cli 1.0.6 → 1.0.7

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.
@@ -1,19 +1,21 @@
1
1
  #!/usr/bin/env bun
2
2
  // @bun
3
- var Xb=Object.create;var{getPrototypeOf:Yb,defineProperty:mo,getOwnPropertyNames:Qb}=Object;var Ab=Object.prototype.hasOwnProperty;function zb(i){return this[i]}var Gb,Hb,Db=(i,t,o)=>{var r=i!=null&&typeof i==="object";if(r){var $=t?Gb??=new WeakMap:Hb??=new WeakMap,l=$.get(i);if(l)return l}o=i!=null?Xb(Yb(i)):{};let f=t||!i||!i.__esModule?mo(o,"default",{value:i,enumerable:!0}):o;for(let s of Qb(i))if(!Ab.call(f,s))mo(f,s,{get:zb.bind(i,s),enumerable:!0});if(r)$.set(i,f);return f};var V=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var di=V((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.regexpCode=rr.getEsmExportName=rr.getProperty=rr.safeStringify=rr.stringify=rr.strConcat=rr.addCodeArg=rr.str=rr._=rr.nil=rr._Code=rr.Name=rr.IDENTIFIER=rr._CodeOrName=void 0;class ot{}rr._CodeOrName=ot;rr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class ji extends ot{constructor(i){super();if(!rr.IDENTIFIER.test(i))throw Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}rr.Name=ji;class C extends ot{constructor(i){super();this._items=typeof i==="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let i=this._items[0];return i===""||i==='""'}get str(){var i;return(i=this._str)!==null&&i!==void 0?i:this._str=this._items.reduce((t,o)=>`${t}${o}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((t,o)=>{if(o instanceof ji)t[o.str]=(t[o.str]||0)+1;return t},{})}}rr._Code=C;rr.nil=new C("");function tr(i,...t){let o=[i[0]],r=0;while(r<t.length)Ct(o,t[r]),o.push(i[++r]);return new C(o)}rr._=tr;var kt=new C("+");function or(i,...t){let o=[Di(i[0])],r=0;while(r<t.length)o.push(kt),Ct(o,t[r]),o.push(kt,Di(i[++r]));return vb(o),new C(o)}rr.str=or;function Ct(i,t){if(t instanceof C)i.push(...t._items);else if(t instanceof ji)i.push(t);else i.push(Eb(t))}rr.addCodeArg=Ct;function vb(i){let t=1;while(t<i.length-1){if(i[t]===kt){let o=Ub(i[t-1],i[t+1]);if(o!==void 0){i.splice(t-1,3,o);continue}i[t++]="+"}t++}}function Ub(i,t){if(t==='""')return i;if(i==='""')return t;if(typeof i=="string"){if(t instanceof ji||i[i.length-1]!=='"')return;if(typeof t!="string")return`${i.slice(0,-1)}${t}"`;if(t[0]==='"')return i.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(i instanceof ji))return`"${i}${t.slice(1)}`;return}function Nb(i,t){return t.emptyStr()?i:i.emptyStr()?t:or`${i}${t}`}rr.strConcat=Nb;function Eb(i){return typeof i=="number"||typeof i=="boolean"||i===null?i:Di(Array.isArray(i)?i.join(","):i)}function pb(i){return new C(Di(i))}rr.stringify=pb;function Di(i){return JSON.stringify(i).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rr.safeStringify=Di;function Pb(i){return typeof i=="string"&&rr.IDENTIFIER.test(i)?new C(`.${i}`):tr`[${i}]`}rr.getProperty=Pb;function cb(i){if(typeof i=="string"&&rr.IDENTIFIER.test(i))return new C(`${i}`);throw Error(`CodeGen: invalid export name: ${i}, use explicit $id name mapping`)}rr.getEsmExportName=cb;function Rb(i){return new C(i.toString())}rr.regexpCode=Rb});var xt=V((sr)=>{Object.defineProperty(sr,"__esModule",{value:!0});sr.ValueScope=sr.ValueScopeName=sr.Scope=sr.varKinds=sr.UsedValueState=void 0;var U=di();class lr extends Error{constructor(i){super(`CodeGen: "code" for ${i} not defined`);this.value=i.value}}var $t;(function(i){i[i.Started=0]="Started",i[i.Completed=1]="Completed"})($t||(sr.UsedValueState=$t={}));sr.varKinds={const:new U.Name("const"),let:new U.Name("let"),var:new U.Name("var")};class ht{constructor({prefixes:i,parent:t}={}){this._names={},this._prefixes=i,this._parent=t}toName(i){return i instanceof U.Name?i:this.name(i)}name(i){return new U.Name(this._newName(i))}_newName(i){let t=this._names[i]||this._nameGroup(i);return`${i}${t.index++}`}_nameGroup(i){var t,o;if(((o=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||o===void 0?void 0:o.has(i))||this._prefixes&&!this._prefixes.has(i))throw Error(`CodeGen: prefix "${i}" is not allowed in this scope`);return this._names[i]={prefix:i,index:0}}}sr.Scope=ht;class gt extends U.Name{constructor(i,t){super(t);this.prefix=i}setValue(i,{property:t,itemIndex:o}){this.value=i,this.scopePath=U._`.${new U.Name(t)}[${o}]`}}sr.ValueScopeName=gt;var rn=U._`\n`;class fr extends ht{constructor(i){super(i);this._values={},this._scope=i.scope,this.opts={...i,_n:i.lines?rn:U.nil}}get(){return this._scope}name(i){return new gt(i,this._newName(i))}value(i,t){var o;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(i),{prefix:$}=r,l=(o=t.key)!==null&&o!==void 0?o:t.ref,f=this._values[$];if(f){let n=f.get(l);if(n)return n}else f=this._values[$]=new Map;f.set(l,r);let s=this._scope[$]||(this._scope[$]=[]),b=s.length;return s[b]=t.ref,r.setValue(t,{property:$,itemIndex:b}),r}getValue(i,t){let o=this._values[i];if(!o)return;return o.get(t)}scopeRefs(i,t=this._values){return this._reduceValues(t,(o)=>{if(o.scopePath===void 0)throw Error(`CodeGen: name "${o}" has no value`);return U._`${i}${o.scopePath}`})}scopeCode(i=this._values,t,o){return this._reduceValues(i,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,o)}_reduceValues(i,t,o={},r){let $=U.nil;for(let l in i){let f=i[l];if(!f)continue;let s=o[l]=o[l]||new Map;f.forEach((b)=>{if(s.has(b))return;s.set(b,$t.Started);let n=t(b);if(n){let u=this.opts.es5?sr.varKinds.var:sr.varKinds.const;$=U._`${$}${u} ${b} = ${n};${this.opts._n}`}else if(n=r===null||r===void 0?void 0:r(b))$=U._`${$}${n}${this.opts._n}`;else throw new lr(b);s.set(b,$t.Completed)})}return $}}sr.ValueScope=fr});var F=V((N)=>{Object.defineProperty(N,"__esModule",{value:!0});N.or=N.and=N.not=N.CodeGen=N.operators=N.varKinds=N.ValueScopeName=N.ValueScope=N.Scope=N.Name=N.regexpCode=N.stringify=N.getProperty=N.nil=N.strConcat=N.str=N._=void 0;var X=di(),e=xt(),li=di();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return li._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return li.str}});Object.defineProperty(N,"strConcat",{enumerable:!0,get:function(){return li.strConcat}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return li.nil}});Object.defineProperty(N,"getProperty",{enumerable:!0,get:function(){return li.getProperty}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return li.stringify}});Object.defineProperty(N,"regexpCode",{enumerable:!0,get:function(){return li.regexpCode}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return li.Name}});var ut=xt();Object.defineProperty(N,"Scope",{enumerable:!0,get:function(){return ut.Scope}});Object.defineProperty(N,"ValueScope",{enumerable:!0,get:function(){return ut.ValueScope}});Object.defineProperty(N,"ValueScopeName",{enumerable:!0,get:function(){return ut.ValueScopeName}});Object.defineProperty(N,"varKinds",{enumerable:!0,get:function(){return ut.varKinds}});N.operators={GT:new X._Code(">"),GTE:new X._Code(">="),LT:new X._Code("<"),LTE:new X._Code("<="),EQ:new X._Code("==="),NEQ:new X._Code("!=="),NOT:new X._Code("!"),OR:new X._Code("||"),AND:new X._Code("&&"),ADD:new X._Code("+")};class fi{optimizeNodes(){return this}optimizeNames(i,t){return this}}class nr extends fi{constructor(i,t,o){super();this.varKind=i,this.name=t,this.rhs=o}render({es5:i,_n:t}){let o=i?e.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${r};`+t}optimizeNames(i,t){if(!i[this.name.str])return;if(this.rhs)this.rhs=Zi(this.rhs,i,t);return this}get names(){return this.rhs instanceof X._CodeOrName?this.rhs.names:{}}}class at extends fi{constructor(i,t,o){super();this.lhs=i,this.rhs=t,this.sideEffects=o}render({_n:i}){return`${this.lhs} = ${this.rhs};`+i}optimizeNames(i,t){if(this.lhs instanceof X.Name&&!i[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Zi(this.rhs,i,t),this}get names(){let i=this.lhs instanceof X.Name?{}:{...this.lhs.names};return nt(i,this.rhs)}}class ur extends at{constructor(i,t,o,r){super(i,o,r);this.op=t}render({_n:i}){return`${this.lhs} ${this.op}= ${this.rhs};`+i}}class Ir extends fi{constructor(i){super();this.label=i,this.names={}}render({_n:i}){return`${this.label}:`+i}}class yr extends fi{constructor(i){super();this.label=i,this.names={}}render({_n:i}){return`break${this.label?` ${this.label}`:""};`+i}}class Mr extends fi{constructor(i){super();this.error=i}render({_n:i}){return`throw ${this.error};`+i}get names(){return this.error.names}}class Vr extends fi{constructor(i){super();this.code=i}render({_n:i}){return`${this.code};`+i}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(i,t){return this.code=Zi(this.code,i,t),this}get names(){return this.code instanceof X._CodeOrName?this.code.names:{}}}class It extends fi{constructor(i=[]){super();this.nodes=i}render(i){return this.nodes.reduce((t,o)=>t+o.render(i),"")}optimizeNodes(){let{nodes:i}=this,t=i.length;while(t--){let o=i[t].optimizeNodes();if(Array.isArray(o))i.splice(t,1,...o);else if(o)i[t]=o;else i.splice(t,1)}return i.length>0?this:void 0}optimizeNames(i,t){let{nodes:o}=this,r=o.length;while(r--){let $=o[r];if($.optimizeNames(i,t))continue;sn(i,$.names),o.splice(r,1)}return o.length>0?this:void 0}get names(){return this.nodes.reduce((i,t)=>Mi(i,t.names),{})}}class si extends It{render(i){return"{"+i._n+super.render(i)+"}"+i._n}}class Lr extends It{}class Ki extends si{}Ki.kind="else";class ti extends si{constructor(i,t){super(t);this.condition=i}render(i){let t=`if(${this.condition})`+super.render(i);if(this.else)t+="else "+this.else.render(i);return t}optimizeNodes(){super.optimizeNodes();let i=this.condition;if(i===!0)return this.nodes;let t=this.else;if(t){let o=t.optimizeNodes();t=this.else=Array.isArray(o)?new Ki(o):o}if(t){if(i===!1)return t instanceof ti?t:t.nodes;if(this.nodes.length)return this;return new ti(wr(i),t instanceof ti?[t]:t.nodes)}if(i===!1||!this.nodes.length)return;return this}optimizeNames(i,t){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(i,t),!(super.optimizeNames(i,t)||this.else))return;return this.condition=Zi(this.condition,i,t),this}get names(){let i=super.names;if(nt(i,this.condition),this.else)Mi(i,this.else.names);return i}}ti.kind="if";class Fi extends si{}Fi.kind="for";class qr extends Fi{constructor(i){super();this.iteration=i}render(i){return`for(${this.iteration})`+super.render(i)}optimizeNames(i,t){if(!super.optimizeNames(i,t))return;return this.iteration=Zi(this.iteration,i,t),this}get names(){return Mi(super.names,this.iteration.names)}}class Tr extends Fi{constructor(i,t,o,r){super();this.varKind=i,this.name=t,this.from=o,this.to=r}render(i){let t=i.es5?e.varKinds.var:this.varKind,{name:o,from:r,to:$}=this;return`for(${t} ${o}=${r}; ${o}<${$}; ${o}++)`+super.render(i)}get names(){let i=nt(super.names,this.from);return nt(i,this.to)}}class mt extends Fi{constructor(i,t,o,r){super();this.loop=i,this.varKind=t,this.name=o,this.iterable=r}render(i){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(i)}optimizeNames(i,t){if(!super.optimizeNames(i,t))return;return this.iterable=Zi(this.iterable,i,t),this}get names(){return Mi(super.names,this.iterable.names)}}class lt extends si{constructor(i,t,o){super();this.name=i,this.args=t,this.async=o}render(i){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(i)}}lt.kind="func";class ft extends It{render(i){return"return "+super.render(i)}}ft.kind="return";class Wr extends si{render(i){let t="try"+super.render(i);if(this.catch)t+=this.catch.render(i);if(this.finally)t+=this.finally.render(i);return t}optimizeNodes(){var i,t;return super.optimizeNodes(),(i=this.catch)===null||i===void 0||i.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(i,t){var o,r;return super.optimizeNames(i,t),(o=this.catch)===null||o===void 0||o.optimizeNames(i,t),(r=this.finally)===null||r===void 0||r.optimizeNames(i,t),this}get names(){let i=super.names;if(this.catch)Mi(i,this.catch.names);if(this.finally)Mi(i,this.finally.names);return i}}class st extends si{constructor(i){super();this.error=i}render(i){return`catch(${this.error})`+super.render(i)}}st.kind="catch";class bt extends si{render(i){return"finally"+super.render(i)}}bt.kind="finally";class Or{constructor(i,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
4
- `:""},this._extScope=i,this._scope=new e.Scope({parent:i}),this._nodes=[new Lr]}toString(){return this._root.render(this.opts)}name(i){return this._scope.name(i)}scopeName(i){return this._extScope.name(i)}scopeValue(i,t){let o=this._extScope.value(i,t);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(i,t){return this._extScope.getValue(i,t)}scopeRefs(i){return this._extScope.scopeRefs(i,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(i,t,o,r){let $=this._scope.toName(t);if(o!==void 0&&r)this._constants[$.str]=o;return this._leafNode(new nr(i,$,o)),$}const(i,t,o){return this._def(e.varKinds.const,i,t,o)}let(i,t,o){return this._def(e.varKinds.let,i,t,o)}var(i,t,o){return this._def(e.varKinds.var,i,t,o)}assign(i,t,o){return this._leafNode(new at(i,t,o))}add(i,t){return this._leafNode(new ur(i,N.operators.ADD,t))}code(i){if(typeof i=="function")i();else if(i!==X.nil)this._leafNode(new Vr(i));return this}object(...i){let t=["{"];for(let[o,r]of i){if(t.length>1)t.push(",");if(t.push(o),o!==r||this.opts.es5)t.push(":"),(0,X.addCodeArg)(t,r)}return t.push("}"),new X._Code(t)}if(i,t,o){if(this._blockNode(new ti(i)),t&&o)this.code(t).else().code(o).endIf();else if(t)this.code(t).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(i){return this._elseNode(new ti(i))}else(){return this._elseNode(new Ki)}endIf(){return this._endBlockNode(ti,Ki)}_for(i,t){if(this._blockNode(i),t)this.code(t).endFor();return this}for(i,t){return this._for(new qr(i),t)}forRange(i,t,o,r,$=this.opts.es5?e.varKinds.var:e.varKinds.let){let l=this._scope.toName(i);return this._for(new Tr($,l,t,o),()=>r(l))}forOf(i,t,o,r=e.varKinds.const){let $=this._scope.toName(i);if(this.opts.es5){let l=t instanceof X.Name?t:this.var("_arr",t);return this.forRange("_i",0,X._`${l}.length`,(f)=>{this.var($,X._`${l}[${f}]`),o($)})}return this._for(new mt("of",r,$,t),()=>o($))}forIn(i,t,o,r=this.opts.es5?e.varKinds.var:e.varKinds.const){if(this.opts.ownProperties)return this.forOf(i,X._`Object.keys(${t})`,o);let $=this._scope.toName(i);return this._for(new mt("in",r,$,t),()=>o($))}endFor(){return this._endBlockNode(Fi)}label(i){return this._leafNode(new Ir(i))}break(i){return this._leafNode(new yr(i))}return(i){let t=new ft;if(this._blockNode(t),this.code(i),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(ft)}try(i,t,o){if(!t&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new Wr;if(this._blockNode(r),this.code(i),t){let $=this.name("e");this._currNode=r.catch=new st($),t($)}if(o)this._currNode=r.finally=new bt,this.code(o);return this._endBlockNode(st,bt)}throw(i){return this._leafNode(new Mr(i))}block(i,t){if(this._blockStarts.push(this._nodes.length),i)this.code(i).endBlock(t);return this}endBlock(i){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-t;if(o<0||i!==void 0&&o!==i)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${i} expected`);return this._nodes.length=t,this}func(i,t=X.nil,o,r){if(this._blockNode(new lt(i,t,o)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(lt)}optimize(i=1){while(i-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(i){return this._currNode.nodes.push(i),this}_blockNode(i){this._currNode.nodes.push(i),this._nodes.push(i)}_endBlockNode(i,t){let o=this._currNode;if(o instanceof i||t&&o instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${i.kind}/${t.kind}`:i.kind}"`)}_elseNode(i){let t=this._currNode;if(!(t instanceof ti))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=i,this}get _root(){return this._nodes[0]}get _currNode(){let i=this._nodes;return i[i.length-1]}set _currNode(i){let t=this._nodes;t[t.length-1]=i}}N.CodeGen=Or;function Mi(i,t){for(let o in t)i[o]=(i[o]||0)+(t[o]||0);return i}function nt(i,t){return t instanceof X._CodeOrName?Mi(i,t.names):i}function Zi(i,t,o){if(i instanceof X.Name)return r(i);if(!$(i))return i;return new X._Code(i._items.reduce((l,f)=>{if(f instanceof X.Name)f=r(f);if(f instanceof X._Code)l.push(...f._items);else l.push(f);return l},[]));function r(l){let f=o[l.str];if(f===void 0||t[l.str]!==1)return l;return delete t[l.str],f}function $(l){return l instanceof X._Code&&l._items.some((f)=>f instanceof X.Name&&t[f.str]===1&&o[f.str]!==void 0)}}function sn(i,t){for(let o in t)i[o]=(i[o]||0)-(t[o]||0)}function wr(i){return typeof i=="boolean"||typeof i=="number"||i===null?!i:X._`!${_t(i)}`}N.not=wr;var bn=jr(N.operators.AND);function nn(...i){return i.reduce(bn)}N.and=nn;var un=jr(N.operators.OR);function In(...i){return i.reduce(un)}N.or=In;function jr(i){return(t,o)=>t===X.nil?o:o===X.nil?t:X._`${_t(t)} ${i} ${_t(o)}`}function _t(i){return i instanceof X.Name?i:X._`(${i})`}});var B=V((zr)=>{Object.defineProperty(zr,"__esModule",{value:!0});zr.checkStrictMode=zr.getErrorPath=zr.Type=zr.useFunc=zr.setEvaluated=zr.evaluatedPropsToName=zr.mergeEvaluated=zr.eachItem=zr.unescapeJsonPointer=zr.escapeJsonPointer=zr.escapeFragment=zr.unescapeFragment=zr.schemaRefOrVal=zr.schemaHasRulesButRef=zr.schemaHasRules=zr.checkUnknownRules=zr.alwaysValidSchema=zr.toHash=void 0;var A=F(),Ln=di();function qn(i){let t={};for(let o of i)t[o]=!0;return t}zr.toHash=qn;function Tn(i,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Jr(i,t),!Xr(t,i.self.RULES.all)}zr.alwaysValidSchema=Tn;function Jr(i,t=i.schema){let{opts:o,self:r}=i;if(!o.strictSchema)return;if(typeof t==="boolean")return;let $=r.RULES.keywords;for(let l in t)if(!$[l])Ar(i,`unknown keyword: "${l}"`)}zr.checkUnknownRules=Jr;function Xr(i,t){if(typeof i=="boolean")return!i;for(let o in i)if(t[o])return!0;return!1}zr.schemaHasRules=Xr;function Wn(i,t){if(typeof i=="boolean")return!i;for(let o in i)if(o!=="$ref"&&t.all[o])return!0;return!1}zr.schemaHasRulesButRef=Wn;function On({topSchemaRef:i,schemaPath:t},o,r,$){if(!$){if(typeof o=="number"||typeof o=="boolean")return o;if(typeof o=="string")return A._`${o}`}return A._`${i}${t}${(0,A.getProperty)(r)}`}zr.schemaRefOrVal=On;function wn(i){return Yr(decodeURIComponent(i))}zr.unescapeFragment=wn;function jn(i){return encodeURIComponent(to(i))}zr.escapeFragment=jn;function to(i){if(typeof i=="number")return`${i}`;return i.replace(/~/g,"~0").replace(/\//g,"~1")}zr.escapeJsonPointer=to;function Yr(i){return i.replace(/~1/g,"/").replace(/~0/g,"~")}zr.unescapeJsonPointer=Yr;function Fn(i,t){if(Array.isArray(i))for(let o of i)t(o);else t(i)}zr.eachItem=Fn;function Zr({mergeNames:i,mergeToName:t,mergeValues:o,resultToName:r}){return($,l,f,s)=>{let b=f===void 0?l:f instanceof A.Name?(l instanceof A.Name?i($,l,f):t($,l,f),f):l instanceof A.Name?(t($,f,l),l):o(l,f);return s===A.Name&&!(b instanceof A.Name)?r($,b):b}}zr.mergeEvaluated={props:Zr({mergeNames:(i,t,o)=>i.if(A._`${o} !== true && ${t} !== undefined`,()=>{i.if(A._`${t} === true`,()=>i.assign(o,!0),()=>i.assign(o,A._`${o} || {}`).code(A._`Object.assign(${o}, ${t})`))}),mergeToName:(i,t,o)=>i.if(A._`${o} !== true`,()=>{if(t===!0)i.assign(o,!0);else i.assign(o,A._`${o} || {}`),oo(i,o,t)}),mergeValues:(i,t)=>i===!0?!0:{...i,...t},resultToName:Qr}),items:Zr({mergeNames:(i,t,o)=>i.if(A._`${o} !== true && ${t} !== undefined`,()=>i.assign(o,A._`${t} === true ? true : ${o} > ${t} ? ${o} : ${t}`)),mergeToName:(i,t,o)=>i.if(A._`${o} !== true`,()=>i.assign(o,t===!0?!0:A._`${o} > ${t} ? ${o} : ${t}`)),mergeValues:(i,t)=>i===!0?!0:Math.max(i,t),resultToName:(i,t)=>i.var("items",t)})};function Qr(i,t){if(t===!0)return i.var("props",!0);let o=i.var("props",A._`{}`);if(t!==void 0)oo(i,o,t);return o}zr.evaluatedPropsToName=Qr;function oo(i,t,o){Object.keys(o).forEach((r)=>i.assign(A._`${t}${(0,A.getProperty)(r)}`,!0))}zr.setEvaluated=oo;var Br={};function Zn(i,t){return i.scopeValue("func",{ref:t,code:Br[t.code]||(Br[t.code]=new Ln._Code(t.code))})}zr.useFunc=Zn;var io;(function(i){i[i.Num=0]="Num",i[i.Str=1]="Str"})(io||(zr.Type=io={}));function Bn(i,t,o){if(i instanceof A.Name){let r=t===io.Num;return o?r?A._`"[" + ${i} + "]"`:A._`"['" + ${i} + "']"`:r?A._`"/" + ${i}`:A._`"/" + ${i}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,A.getProperty)(i).toString():"/"+to(i)}zr.getErrorPath=Bn;function Ar(i,t,o=i.opts.strictSchema){if(!o)return;if(t=`strict mode: ${t}`,o===!0)throw Error(t);i.self.logger.warn(t)}zr.checkStrictMode=Ar});var c=V((Hr)=>{Object.defineProperty(Hr,"__esModule",{value:!0});var d=F(),cn={data:new d.Name("data"),valCxt:new d.Name("valCxt"),instancePath:new d.Name("instancePath"),parentData:new d.Name("parentData"),parentDataProperty:new d.Name("parentDataProperty"),rootData:new d.Name("rootData"),dynamicAnchors:new d.Name("dynamicAnchors"),vErrors:new d.Name("vErrors"),errors:new d.Name("errors"),this:new d.Name("this"),self:new d.Name("self"),scope:new d.Name("scope"),json:new d.Name("json"),jsonPos:new d.Name("jsonPos"),jsonLen:new d.Name("jsonLen"),jsonPart:new d.Name("jsonPart")};Hr.default=cn});var vi=V((vr)=>{Object.defineProperty(vr,"__esModule",{value:!0});vr.extendErrors=vr.resetErrorsCount=vr.reportExtraError=vr.reportError=vr.keyword$DataError=vr.keywordError=void 0;var Q=F(),Mt=B(),K=c();vr.keywordError={message:({keyword:i})=>Q.str`must pass "${i}" keyword validation`};vr.keyword$DataError={message:({keyword:i,schemaType:t})=>t?Q.str`"${i}" keyword must be ${t} ($data)`:Q.str`"${i}" keyword is invalid ($data)`};function Sn(i,t=vr.keywordError,o,r){let{it:$}=i,{gen:l,compositeRule:f,allErrors:s}=$,b=Kr(i,t,o);if(r!==null&&r!==void 0?r:f||s)Dr(l,b);else dr($,Q._`[${b}]`)}vr.reportError=Sn;function kn(i,t=vr.keywordError,o){let{it:r}=i,{gen:$,compositeRule:l,allErrors:f}=r,s=Kr(i,t,o);if(Dr($,s),!(l||f))dr(r,K.default.vErrors)}vr.reportExtraError=kn;function Cn(i,t){i.assign(K.default.errors,t),i.if(Q._`${K.default.vErrors} !== null`,()=>i.if(t,()=>i.assign(Q._`${K.default.vErrors}.length`,t),()=>i.assign(K.default.vErrors,null)))}vr.resetErrorsCount=Cn;function en({gen:i,keyword:t,schemaValue:o,data:r,errsCount:$,it:l}){if($===void 0)throw Error("ajv implementation error");let f=i.name("err");i.forRange("i",$,K.default.errors,(s)=>{if(i.const(f,Q._`${K.default.vErrors}[${s}]`),i.if(Q._`${f}.instancePath === undefined`,()=>i.assign(Q._`${f}.instancePath`,(0,Q.strConcat)(K.default.instancePath,l.errorPath))),i.assign(Q._`${f}.schemaPath`,Q.str`${l.errSchemaPath}/${t}`),l.opts.verbose)i.assign(Q._`${f}.schema`,o),i.assign(Q._`${f}.data`,r)})}vr.extendErrors=en;function Dr(i,t){let o=i.const("err",t);i.if(Q._`${K.default.vErrors} === null`,()=>i.assign(K.default.vErrors,Q._`[${o}]`),Q._`${K.default.vErrors}.push(${o})`),i.code(Q._`${K.default.errors}++`)}function dr(i,t){let{gen:o,validateName:r,schemaEnv:$}=i;if($.$async)o.throw(Q._`new ${i.ValidationError}(${t})`);else o.assign(Q._`${r}.errors`,t),o.return(!1)}var Vi={keyword:new Q.Name("keyword"),schemaPath:new Q.Name("schemaPath"),params:new Q.Name("params"),propertyName:new Q.Name("propertyName"),message:new Q.Name("message"),schema:new Q.Name("schema"),parentSchema:new Q.Name("parentSchema")};function Kr(i,t,o){let{createErrors:r}=i.it;if(r===!1)return Q._`{}`;return hn(i,t,o)}function hn(i,t,o={}){let{gen:r,it:$}=i,l=[gn($,o),xn(i,o)];return mn(i,t,l),r.object(...l)}function gn({errorPath:i},{instancePath:t}){let o=t?Q.str`${i}${(0,Mt.getErrorPath)(t,Mt.Type.Str)}`:i;return[K.default.instancePath,(0,Q.strConcat)(K.default.instancePath,o)]}function xn({keyword:i,it:{errSchemaPath:t}},{schemaPath:o,parentSchema:r}){let $=r?t:Q.str`${t}/${i}`;if(o)$=Q.str`${$}${(0,Mt.getErrorPath)(o,Mt.Type.Str)}`;return[Vi.schemaPath,$]}function mn(i,{params:t,message:o},r){let{keyword:$,data:l,schemaValue:f,it:s}=i,{opts:b,propertyName:n,topSchemaRef:u,schemaPath:I}=s;if(r.push([Vi.keyword,$],[Vi.params,typeof t=="function"?t(i):t||Q._`{}`]),b.messages)r.push([Vi.message,typeof o=="function"?o(i):o]);if(b.verbose)r.push([Vi.schema,f],[Vi.parentSchema,Q._`${u}${I}`],[K.default.data,l]);if(n)r.push([Vi.propertyName,n])}});var Pr=V((Er)=>{Object.defineProperty(Er,"__esModule",{value:!0});Er.boolOrEmptySchema=Er.topBoolOrEmptySchema=void 0;var ou=vi(),ru=F(),$u=c(),lu={message:"boolean schema is false"};function fu(i){let{gen:t,schema:o,validateName:r}=i;if(o===!1)Nr(i,!1);else if(typeof o=="object"&&o.$async===!0)t.return($u.default.data);else t.assign(ru._`${r}.errors`,null),t.return(!0)}Er.topBoolOrEmptySchema=fu;function su(i,t){let{gen:o,schema:r}=i;if(r===!1)o.var(t,!1),Nr(i);else o.var(t,!0)}Er.boolOrEmptySchema=su;function Nr(i,t){let{gen:o,data:r}=i,$={gen:o,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:i};(0,ou.reportError)($,lu,void 0,t)}});var $o=V((cr)=>{Object.defineProperty(cr,"__esModule",{value:!0});cr.getRules=cr.isJSONType=void 0;var nu=["string","number","integer","boolean","null","object","array"],uu=new Set(nu);function Iu(i){return typeof i=="string"&&uu.has(i)}cr.isJSONType=Iu;function yu(){let i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}cr.getRules=yu});var lo=V((Cr)=>{Object.defineProperty(Cr,"__esModule",{value:!0});Cr.shouldUseRule=Cr.shouldUseGroup=Cr.schemaHasRulesForType=void 0;function Vu({schema:i,self:t},o){let r=t.RULES.types[o];return r&&r!==!0&&Sr(i,r)}Cr.schemaHasRulesForType=Vu;function Sr(i,t){return t.rules.some((o)=>kr(i,o))}Cr.shouldUseGroup=Sr;function kr(i,t){var o;return i[t.keyword]!==void 0||((o=t.definition.implements)===null||o===void 0?void 0:o.some((r)=>i[r]!==void 0))}Cr.shouldUseRule=kr});var Ui=V((mr)=>{Object.defineProperty(mr,"__esModule",{value:!0});mr.reportTypeError=mr.checkDataTypes=mr.checkDataType=mr.coerceAndCheckDataType=mr.getJSONTypes=mr.getSchemaTypes=mr.DataType=void 0;var Tu=$o(),Wu=lo(),Ou=vi(),Z=F(),hr=B(),Bi;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(Bi||(mr.DataType=Bi={}));function wu(i){let t=gr(i.type);if(t.includes("null")){if(i.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&i.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(i.nullable===!0)t.push("null")}return t}mr.getSchemaTypes=wu;function gr(i){let t=Array.isArray(i)?i:i?[i]:[];if(t.every(Tu.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}mr.getJSONTypes=gr;function ju(i,t){let{gen:o,data:r,opts:$}=i,l=Fu(t,$.coerceTypes),f=t.length>0&&!(l.length===0&&t.length===1&&(0,Wu.schemaHasRulesForType)(i,t[0]));if(f){let s=so(t,r,$.strictNumbers,Bi.Wrong);o.if(s,()=>{if(l.length)Zu(i,t,l);else bo(i)})}return f}mr.coerceAndCheckDataType=ju;var xr=new Set(["string","number","integer","boolean","null"]);function Fu(i,t){return t?i.filter((o)=>xr.has(o)||t==="array"&&o==="array"):[]}function Zu(i,t,o){let{gen:r,data:$,opts:l}=i,f=r.let("dataType",Z._`typeof ${$}`),s=r.let("coerced",Z._`undefined`);if(l.coerceTypes==="array")r.if(Z._`${f} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>r.assign($,Z._`${$}[0]`).assign(f,Z._`typeof ${$}`).if(so(t,$,l.strictNumbers),()=>r.assign(s,$)));r.if(Z._`${s} !== undefined`);for(let n of o)if(xr.has(n)||n==="array"&&l.coerceTypes==="array")b(n);r.else(),bo(i),r.endIf(),r.if(Z._`${s} !== undefined`,()=>{r.assign($,s),Bu(i,s)});function b(n){switch(n){case"string":r.elseIf(Z._`${f} == "number" || ${f} == "boolean"`).assign(s,Z._`"" + ${$}`).elseIf(Z._`${$} === null`).assign(s,Z._`""`);return;case"number":r.elseIf(Z._`${f} == "boolean" || ${$} === null
5
- || (${f} == "string" && ${$} && ${$} == +${$})`).assign(s,Z._`+${$}`);return;case"integer":r.elseIf(Z._`${f} === "boolean" || ${$} === null
6
- || (${f} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(s,Z._`+${$}`);return;case"boolean":r.elseIf(Z._`${$} === "false" || ${$} === 0 || ${$} === null`).assign(s,!1).elseIf(Z._`${$} === "true" || ${$} === 1`).assign(s,!0);return;case"null":r.elseIf(Z._`${$} === "" || ${$} === 0 || ${$} === false`),r.assign(s,null);return;case"array":r.elseIf(Z._`${f} === "string" || ${f} === "number"
7
- || ${f} === "boolean" || ${$} === null`).assign(s,Z._`[${$}]`)}}}function Bu({gen:i,parentData:t,parentDataProperty:o},r){i.if(Z._`${t} !== undefined`,()=>i.assign(Z._`${t}[${o}]`,r))}function fo(i,t,o,r=Bi.Correct){let $=r===Bi.Correct?Z.operators.EQ:Z.operators.NEQ,l;switch(i){case"null":return Z._`${t} ${$} null`;case"array":l=Z._`Array.isArray(${t})`;break;case"object":l=Z._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":l=f(Z._`!(${t} % 1) && !isNaN(${t})`);break;case"number":l=f();break;default:return Z._`typeof ${t} ${$} ${i}`}return r===Bi.Correct?l:(0,Z.not)(l);function f(s=Z.nil){return(0,Z.and)(Z._`typeof ${t} == "number"`,s,o?Z._`isFinite(${t})`:Z.nil)}}mr.checkDataType=fo;function so(i,t,o,r){if(i.length===1)return fo(i[0],t,o,r);let $,l=(0,hr.toHash)(i);if(l.array&&l.object){let f=Z._`typeof ${t} != "object"`;$=l.null?f:Z._`!${t} || ${f}`,delete l.null,delete l.array,delete l.object}else $=Z.nil;if(l.number)delete l.integer;for(let f in l)$=(0,Z.and)($,fo(f,t,o,r));return $}mr.checkDataTypes=so;var Ju={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:t})=>typeof i=="string"?Z._`{type: ${i}}`:Z._`{type: ${t}}`};function bo(i){let t=Xu(i);(0,Ou.reportError)(t,Ju)}mr.reportTypeError=bo;function Xu(i){let{gen:t,data:o,schema:r}=i,$=(0,hr.schemaRefOrVal)(i,r,"type");return{gen:t,keyword:"type",data:o,schema:r.type,schemaCode:$,schemaValue:$,parentSchema:r,params:{},it:i}}});var o$=V((i$)=>{Object.defineProperty(i$,"__esModule",{value:!0});i$.assignDefaults=void 0;var Ji=F(),Du=B();function du(i,t){let{properties:o,items:r}=i.schema;if(t==="object"&&o)for(let $ in o)ar(i,$,o[$].default);else if(t==="array"&&Array.isArray(r))r.forEach(($,l)=>ar(i,l,$.default))}i$.assignDefaults=du;function ar(i,t,o){let{gen:r,compositeRule:$,data:l,opts:f}=i;if(o===void 0)return;let s=Ji._`${l}${(0,Ji.getProperty)(t)}`;if($){(0,Du.checkStrictMode)(i,`default is ignored for: ${s}`);return}let b=Ji._`${s} === undefined`;if(f.useDefaults==="empty")b=Ji._`${b} || ${s} === null || ${s} === ""`;r.if(b,Ji._`${s} = ${(0,Ji.stringify)(o)}`)}});var R=V((l$)=>{Object.defineProperty(l$,"__esModule",{value:!0});l$.validateUnion=l$.validateArray=l$.usePattern=l$.callValidateCode=l$.schemaProperties=l$.allSchemaProperties=l$.noPropertyInData=l$.propertyInData=l$.isOwnProperty=l$.hasPropFunc=l$.reportMissingProp=l$.checkMissingProp=l$.checkReportMissingProp=void 0;var G=F(),no=B(),bi=c(),Ku=B();function vu(i,t){let{gen:o,data:r,it:$}=i;o.if(Io(o,r,t,$.opts.ownProperties),()=>{i.setParams({missingProperty:G._`${t}`},!0),i.error()})}l$.checkReportMissingProp=vu;function Uu({gen:i,data:t,it:{opts:o}},r,$){return(0,G.or)(...r.map((l)=>(0,G.and)(Io(i,t,l,o.ownProperties),G._`${$} = ${l}`)))}l$.checkMissingProp=Uu;function Nu(i,t){i.setParams({missingProperty:t},!0),i.error()}l$.reportMissingProp=Nu;function r$(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:G._`Object.prototype.hasOwnProperty`})}l$.hasPropFunc=r$;function uo(i,t,o){return G._`${r$(i)}.call(${t}, ${o})`}l$.isOwnProperty=uo;function Eu(i,t,o,r){let $=G._`${t}${(0,G.getProperty)(o)} !== undefined`;return r?G._`${$} && ${uo(i,t,o)}`:$}l$.propertyInData=Eu;function Io(i,t,o,r){let $=G._`${t}${(0,G.getProperty)(o)} === undefined`;return r?(0,G.or)($,(0,G.not)(uo(i,t,o))):$}l$.noPropertyInData=Io;function $$(i){return i?Object.keys(i).filter((t)=>t!=="__proto__"):[]}l$.allSchemaProperties=$$;function pu(i,t){return $$(t).filter((o)=>!(0,no.alwaysValidSchema)(i,t[o]))}l$.schemaProperties=pu;function Pu({schemaCode:i,data:t,it:{gen:o,topSchemaRef:r,schemaPath:$,errorPath:l},it:f},s,b,n){let u=n?G._`${i}, ${t}, ${r}${$}`:t,I=[[bi.default.instancePath,(0,G.strConcat)(bi.default.instancePath,l)],[bi.default.parentData,f.parentData],[bi.default.parentDataProperty,f.parentDataProperty],[bi.default.rootData,bi.default.rootData]];if(f.opts.dynamicRef)I.push([bi.default.dynamicAnchors,bi.default.dynamicAnchors]);let q=G._`${u}, ${o.object(...I)}`;return b!==G.nil?G._`${s}.call(${b}, ${q})`:G._`${s}(${q})`}l$.callValidateCode=Pu;var cu=G._`new RegExp`;function Ru({gen:i,it:{opts:t}},o){let r=t.unicodeRegExp?"u":"",{regExp:$}=t.code,l=$(o,r);return i.scopeValue("pattern",{key:l.toString(),ref:l,code:G._`${$.code==="new RegExp"?cu:(0,Ku.useFunc)(i,$)}(${o}, ${r})`})}l$.usePattern=Ru;function Su(i){let{gen:t,data:o,keyword:r,it:$}=i,l=t.name("valid");if($.allErrors){let s=t.let("valid",!0);return f(()=>t.assign(s,!1)),s}return t.var(l,!0),f(()=>t.break()),l;function f(s){let b=t.const("len",G._`${o}.length`);t.forRange("i",0,b,(n)=>{i.subschema({keyword:r,dataProp:n,dataPropType:no.Type.Num},l),t.if((0,G.not)(l),s)})}}l$.validateArray=Su;function ku(i){let{gen:t,schema:o,keyword:r,it:$}=i;if(!Array.isArray(o))throw Error("ajv implementation error");if(o.some((b)=>(0,no.alwaysValidSchema)($,b))&&!$.opts.unevaluated)return;let f=t.let("valid",!1),s=t.name("_valid");t.block(()=>o.forEach((b,n)=>{let u=i.subschema({keyword:r,schemaProp:n,compositeRule:!0},s);if(t.assign(f,G._`${f} || ${s}`),!i.mergeValidEvaluated(u,s))t.if((0,G.not)(f))})),i.result(f,()=>i.reset(),()=>i.error(!0))}l$.validateUnion=ku});var I$=V((n$)=>{Object.defineProperty(n$,"__esModule",{value:!0});n$.validateKeywordUsage=n$.validSchemaType=n$.funcKeywordCode=n$.macroKeywordCode=void 0;var v=F(),Li=c(),$I=R(),lI=vi();function fI(i,t){let{gen:o,keyword:r,schema:$,parentSchema:l,it:f}=i,s=t.macro.call(f.self,$,l,f),b=b$(o,r,s);if(f.opts.validateSchema!==!1)f.self.validateSchema(s,!0);let n=o.name("valid");i.subschema({schema:s,schemaPath:v.nil,errSchemaPath:`${f.errSchemaPath}/${r}`,topSchemaRef:b,compositeRule:!0},n),i.pass(n,()=>i.error(!0))}n$.macroKeywordCode=fI;function sI(i,t){var o;let{gen:r,keyword:$,schema:l,parentSchema:f,$data:s,it:b}=i;nI(b,t);let n=!s&&t.compile?t.compile.call(b.self,l,f,b):t.validate,u=b$(r,$,n),I=r.let("valid");i.block$data(I,q),i.ok((o=t.valid)!==null&&o!==void 0?o:I);function q(){if(t.errors===!1){if(M(),t.modifying)s$(i);T(()=>i.error())}else{let W=t.async?L():y();if(t.modifying)s$(i);T(()=>bI(i,W))}}function L(){let W=r.let("ruleErrs",null);return r.try(()=>M(v._`await `),(Y)=>r.assign(I,!1).if(v._`${Y} instanceof ${b.ValidationError}`,()=>r.assign(W,v._`${Y}.errors`),()=>r.throw(Y))),W}function y(){let W=v._`${u}.errors`;return r.assign(W,null),M(v.nil),W}function M(W=t.async?v._`await `:v.nil){let Y=b.opts.passContext?Li.default.this:Li.default.self,J=!(("compile"in t)&&!s||t.schema===!1);r.assign(I,v._`${W}${(0,$I.callValidateCode)(i,u,Y,J)}`,t.modifying)}function T(W){var Y;r.if((0,v.not)((Y=t.valid)!==null&&Y!==void 0?Y:I),W)}}n$.funcKeywordCode=sI;function s$(i){let{gen:t,data:o,it:r}=i;t.if(r.parentData,()=>t.assign(o,v._`${r.parentData}[${r.parentDataProperty}]`))}function bI(i,t){let{gen:o}=i;o.if(v._`Array.isArray(${t})`,()=>{o.assign(Li.default.vErrors,v._`${Li.default.vErrors} === null ? ${t} : ${Li.default.vErrors}.concat(${t})`).assign(Li.default.errors,v._`${Li.default.vErrors}.length`),(0,lI.extendErrors)(i)},()=>i.error())}function nI({schemaEnv:i},t){if(t.async&&!i.$async)throw Error("async keyword in sync schema")}function b$(i,t,o){if(o===void 0)throw Error(`keyword "${t}" failed to compile`);return i.scopeValue("keyword",typeof o=="function"?{ref:o}:{ref:o,code:(0,v.stringify)(o)})}function uI(i,t,o=!1){return!t.length||t.some((r)=>r==="array"?Array.isArray(i):r==="object"?i&&typeof i=="object"&&!Array.isArray(i):typeof i==r||o&&typeof i>"u")}n$.validSchemaType=uI;function II({schema:i,opts:t,self:o,errSchemaPath:r},$,l){if(Array.isArray($.keyword)?!$.keyword.includes(l):$.keyword!==l)throw Error("ajv implementation error");let f=$.dependencies;if(f===null||f===void 0?void 0:f.some((s)=>!Object.prototype.hasOwnProperty.call(i,s)))throw Error(`parent schema must have dependencies of ${l}: ${f.join(",")}`);if($.validateSchema){if(!$.validateSchema(i[l])){let b=`keyword "${l}" value is invalid at path "${r}": `+o.errorsText($.validateSchema.errors);if(t.validateSchema==="log")o.logger.error(b);else throw Error(b)}}}n$.validateKeywordUsage=II});var L$=V((M$)=>{Object.defineProperty(M$,"__esModule",{value:!0});M$.extendSubschemaMode=M$.extendSubschemaData=M$.getSubschema=void 0;var a=F(),y$=B();function LI(i,{keyword:t,schemaProp:o,schema:r,schemaPath:$,errSchemaPath:l,topSchemaRef:f}){if(t!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(t!==void 0){let s=i.schema[t];return o===void 0?{schema:s,schemaPath:a._`${i.schemaPath}${(0,a.getProperty)(t)}`,errSchemaPath:`${i.errSchemaPath}/${t}`}:{schema:s[o],schemaPath:a._`${i.schemaPath}${(0,a.getProperty)(t)}${(0,a.getProperty)(o)}`,errSchemaPath:`${i.errSchemaPath}/${t}/${(0,y$.escapeFragment)(o)}`}}if(r!==void 0){if($===void 0||l===void 0||f===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:$,topSchemaRef:f,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')}M$.getSubschema=LI;function qI(i,t,{dataProp:o,dataPropType:r,data:$,dataTypes:l,propertyName:f}){if($!==void 0&&o!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=t;if(o!==void 0){let{errorPath:n,dataPathArr:u,opts:I}=t,q=s.let("data",a._`${t.data}${(0,a.getProperty)(o)}`,!0);b(q),i.errorPath=a.str`${n}${(0,y$.getErrorPath)(o,r,I.jsPropertySyntax)}`,i.parentDataProperty=a._`${o}`,i.dataPathArr=[...u,i.parentDataProperty]}if($!==void 0){let n=$ instanceof a.Name?$:s.let("data",$,!0);if(b(n),f!==void 0)i.propertyName=f}if(l)i.dataTypes=l;function b(n){i.data=n,i.dataLevel=t.dataLevel+1,i.dataTypes=[],t.definedProperties=new Set,i.parentData=t.data,i.dataNames=[...t.dataNames,n]}}M$.extendSubschemaData=qI;function TI(i,{jtdDiscriminator:t,jtdMetadata:o,compositeRule:r,createErrors:$,allErrors:l}){if(r!==void 0)i.compositeRule=r;if($!==void 0)i.createErrors=$;if(l!==void 0)i.allErrors=l;i.jtdDiscriminator=t,i.jtdMetadata=o}M$.extendSubschemaMode=TI});var yo=V((sL,q$)=>{q$.exports=function i(t,o){if(t===o)return!0;if(t&&o&&typeof t=="object"&&typeof o=="object"){if(t.constructor!==o.constructor)return!1;var r,$,l;if(Array.isArray(t)){if(r=t.length,r!=o.length)return!1;for($=r;$--!==0;)if(!i(t[$],o[$]))return!1;return!0}if(t.constructor===RegExp)return t.source===o.source&&t.flags===o.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===o.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===o.toString();if(l=Object.keys(t),r=l.length,r!==Object.keys(o).length)return!1;for($=r;$--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[$]))return!1;for($=r;$--!==0;){var f=l[$];if(!i(t[f],o[f]))return!1}return!0}return t!==t&&o!==o}});var W$=V((bL,T$)=>{var ni=T$.exports=function(i,t,o){if(typeof t=="function")o=t,t={};o=t.cb||o;var r=typeof o=="function"?o:o.pre||function(){},$=o.post||function(){};Vt(t,r,$,i,"",i)};ni.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};ni.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};ni.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};ni.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Vt(i,t,o,r,$,l,f,s,b,n){if(r&&typeof r=="object"&&!Array.isArray(r)){t(r,$,l,f,s,b,n);for(var u in r){var I=r[u];if(Array.isArray(I)){if(u in ni.arrayKeywords)for(var q=0;q<I.length;q++)Vt(i,t,o,I[q],$+"/"+u+"/"+q,l,$,u,r,q)}else if(u in ni.propsKeywords){if(I&&typeof I=="object")for(var L in I)Vt(i,t,o,I[L],$+"/"+u+"/"+wI(L),l,$,u,r,L)}else if(u in ni.keywords||i.allKeys&&!(u in ni.skipKeywords))Vt(i,t,o,I,$+"/"+u,l,$,u,r)}o(r,$,l,f,s,b,n)}}function wI(i){return i.replace(/~/g,"~0").replace(/\//g,"~1")}});var Ni=V((F$)=>{Object.defineProperty(F$,"__esModule",{value:!0});F$.getSchemaRefs=F$.resolveUrl=F$.normalizeId=F$._getFullPath=F$.getFullPath=F$.inlineRef=void 0;var jI=B(),FI=yo(),ZI=W$(),BI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function JI(i,t=!0){if(typeof i=="boolean")return!0;if(t===!0)return!Mo(i);if(!t)return!1;return O$(i)<=t}F$.inlineRef=JI;var XI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mo(i){for(let t in i){if(XI.has(t))return!0;let o=i[t];if(Array.isArray(o)&&o.some(Mo))return!0;if(typeof o=="object"&&Mo(o))return!0}return!1}function O$(i){let t=0;for(let o in i){if(o==="$ref")return 1/0;if(t++,BI.has(o))continue;if(typeof i[o]=="object")(0,jI.eachItem)(i[o],(r)=>t+=O$(r));if(t===1/0)return 1/0}return t}function w$(i,t="",o){if(o!==!1)t=Xi(t);let r=i.parse(t);return j$(i,r)}F$.getFullPath=w$;function j$(i,t){return i.serialize(t).split("#")[0]+"#"}F$._getFullPath=j$;var YI=/#\/?$/;function Xi(i){return i?i.replace(YI,""):""}F$.normalizeId=Xi;function QI(i,t,o){return o=Xi(o),i.resolve(t,o)}F$.resolveUrl=QI;var AI=/^[a-z_][-a-z0-9._]*$/i;function zI(i,t){if(typeof i=="boolean")return{};let{schemaId:o,uriResolver:r}=this.opts,$=Xi(i[o]||t),l={"":$},f=w$(r,$,!1),s={},b=new Set;return ZI(i,{allKeys:!0},(I,q,L,y)=>{if(y===void 0)return;let M=f+q,T=l[y];if(typeof I[o]=="string")T=W.call(this,I[o]);Y.call(this,I.$anchor),Y.call(this,I.$dynamicAnchor),l[q]=T;function W(J){let z=this.opts.uriResolver.resolve;if(J=Xi(T?z(T,J):J),b.has(J))throw u(J);b.add(J);let j=this.refs[J];if(typeof j=="string")j=this.refs[j];if(typeof j=="object")n(I,j.schema,J);else if(J!==Xi(M))if(J[0]==="#")n(I,s[J],J),s[J]=I;else this.refs[J]=M;return J}function Y(J){if(typeof J=="string"){if(!AI.test(J))throw Error(`invalid anchor "${J}"`);W.call(this,`#${J}`)}}}),s;function n(I,q,L){if(q!==void 0&&!FI(I,q))throw u(L)}function u(I){return Error(`reference "${I}" resolves to more than one schema`)}}F$.getSchemaRefs=zI});var Pi=V((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});N$.getData=N$.KeywordCxt=N$.validateFunctionCode=void 0;var Q$=Pr(),B$=Ui(),Lo=lo(),Lt=Ui(),vI=o$(),pi=I$(),Vo=L$(),O=F(),w=c(),UI=Ni(),oi=B(),Ei=vi();function NI(i){if(G$(i)){if(H$(i),z$(i)){PI(i);return}}A$(i,()=>(0,Q$.topBoolOrEmptySchema)(i))}N$.validateFunctionCode=NI;function A$({gen:i,validateName:t,schema:o,schemaEnv:r,opts:$},l){if($.code.es5)i.func(t,O._`${w.default.data}, ${w.default.valCxt}`,r.$async,()=>{i.code(O._`"use strict"; ${J$(o,$)}`),pI(i,$),i.code(l)});else i.func(t,O._`${w.default.data}, ${EI($)}`,r.$async,()=>i.code(J$(o,$)).code(l))}function EI(i){return O._`{${w.default.instancePath}="", ${w.default.parentData}, ${w.default.parentDataProperty}, ${w.default.rootData}=${w.default.data}${i.dynamicRef?O._`, ${w.default.dynamicAnchors}={}`:O.nil}}={}`}function pI(i,t){i.if(w.default.valCxt,()=>{if(i.var(w.default.instancePath,O._`${w.default.valCxt}.${w.default.instancePath}`),i.var(w.default.parentData,O._`${w.default.valCxt}.${w.default.parentData}`),i.var(w.default.parentDataProperty,O._`${w.default.valCxt}.${w.default.parentDataProperty}`),i.var(w.default.rootData,O._`${w.default.valCxt}.${w.default.rootData}`),t.dynamicRef)i.var(w.default.dynamicAnchors,O._`${w.default.valCxt}.${w.default.dynamicAnchors}`)},()=>{if(i.var(w.default.instancePath,O._`""`),i.var(w.default.parentData,O._`undefined`),i.var(w.default.parentDataProperty,O._`undefined`),i.var(w.default.rootData,w.default.data),t.dynamicRef)i.var(w.default.dynamicAnchors,O._`{}`)})}function PI(i){let{schema:t,opts:o,gen:r}=i;A$(i,()=>{if(o.$comment&&t.$comment)d$(i);if(CI(i),r.let(w.default.vErrors,null),r.let(w.default.errors,0),o.unevaluated)cI(i);D$(i),gI(i)});return}function cI(i){let{gen:t,validateName:o}=i;i.evaluated=t.const("evaluated",O._`${o}.evaluated`),t.if(O._`${i.evaluated}.dynamicProps`,()=>t.assign(O._`${i.evaluated}.props`,O._`undefined`)),t.if(O._`${i.evaluated}.dynamicItems`,()=>t.assign(O._`${i.evaluated}.items`,O._`undefined`))}function J$(i,t){let o=typeof i=="object"&&i[t.schemaId];return o&&(t.code.source||t.code.process)?O._`/*# sourceURL=${o} */`:O.nil}function RI(i,t){if(G$(i)){if(H$(i),z$(i)){SI(i,t);return}}(0,Q$.boolOrEmptySchema)(i,t)}function z$({schema:i,self:t}){if(typeof i=="boolean")return!i;for(let o in i)if(t.RULES.all[o])return!0;return!1}function G$(i){return typeof i.schema!="boolean"}function SI(i,t){let{schema:o,gen:r,opts:$}=i;if($.$comment&&o.$comment)d$(i);eI(i),hI(i);let l=r.const("_errs",w.default.errors);D$(i,l),r.var(t,O._`${l} === ${w.default.errors}`)}function H$(i){(0,oi.checkUnknownRules)(i),kI(i)}function D$(i,t){if(i.opts.jtd)return X$(i,[],!1,t);let o=(0,B$.getSchemaTypes)(i.schema),r=(0,B$.coerceAndCheckDataType)(i,o);X$(i,o,!r,t)}function kI(i){let{schema:t,errSchemaPath:o,opts:r,self:$}=i;if(t.$ref&&r.ignoreKeywordsWithRef&&(0,oi.schemaHasRulesButRef)(t,$.RULES))$.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}function CI(i){let{schema:t,opts:o}=i;if(t.default!==void 0&&o.useDefaults&&o.strictSchema)(0,oi.checkStrictMode)(i,"default is ignored in the schema root")}function eI(i){let t=i.schema[i.opts.schemaId];if(t)i.baseId=(0,UI.resolveUrl)(i.opts.uriResolver,i.baseId,t)}function hI(i){if(i.schema.$async&&!i.schemaEnv.$async)throw Error("async schema in sync schema")}function d$({gen:i,schemaEnv:t,schema:o,errSchemaPath:r,opts:$}){let l=o.$comment;if($.$comment===!0)i.code(O._`${w.default.self}.logger.log(${l})`);else if(typeof $.$comment=="function"){let f=O.str`${r}/$comment`,s=i.scopeValue("root",{ref:t.root});i.code(O._`${w.default.self}.opts.$comment(${l}, ${f}, ${s}.schema)`)}}function gI(i){let{gen:t,schemaEnv:o,validateName:r,ValidationError:$,opts:l}=i;if(o.$async)t.if(O._`${w.default.errors} === 0`,()=>t.return(w.default.data),()=>t.throw(O._`new ${$}(${w.default.vErrors})`));else{if(t.assign(O._`${r}.errors`,w.default.vErrors),l.unevaluated)xI(i);t.return(O._`${w.default.errors} === 0`)}}function xI({gen:i,evaluated:t,props:o,items:r}){if(o instanceof O.Name)i.assign(O._`${t}.props`,o);if(r instanceof O.Name)i.assign(O._`${t}.items`,r)}function X$(i,t,o,r){let{gen:$,schema:l,data:f,allErrors:s,opts:b,self:n}=i,{RULES:u}=n;if(l.$ref&&(b.ignoreKeywordsWithRef||!(0,oi.schemaHasRulesButRef)(l,u))){$.block(()=>v$(i,"$ref",u.all.$ref.definition));return}if(!b.jtd)mI(i,t);$.block(()=>{for(let q of u.rules)I(q);I(u.post)});function I(q){if(!(0,Lo.shouldUseGroup)(l,q))return;if(q.type){if($.if((0,Lt.checkDataType)(q.type,f,b.strictNumbers)),Y$(i,q),t.length===1&&t[0]===q.type&&o)$.else(),(0,Lt.reportTypeError)(i);$.endIf()}else Y$(i,q);if(!s)$.if(O._`${w.default.errors} === ${r||0}`)}}function Y$(i,t){let{gen:o,schema:r,opts:{useDefaults:$}}=i;if($)(0,vI.assignDefaults)(i,t.type);o.block(()=>{for(let l of t.rules)if((0,Lo.shouldUseRule)(r,l))v$(i,l.keyword,l.definition,t.type)})}function mI(i,t){if(i.schemaEnv.meta||!i.opts.strictTypes)return;if(_I(i,t),!i.opts.allowUnionTypes)aI(i,t);i0(i,i.dataTypes)}function _I(i,t){if(!t.length)return;if(!i.dataTypes.length){i.dataTypes=t;return}t.forEach((o)=>{if(!K$(i.dataTypes,o))qo(i,`type "${o}" not allowed by context "${i.dataTypes.join(",")}"`)}),o0(i,t)}function aI(i,t){if(t.length>1&&!(t.length===2&&t.includes("null")))qo(i,"use allowUnionTypes to allow union type keyword")}function i0(i,t){let o=i.self.RULES.all;for(let r in o){let $=o[r];if(typeof $=="object"&&(0,Lo.shouldUseRule)(i.schema,$)){let{type:l}=$.definition;if(l.length&&!l.some((f)=>t0(t,f)))qo(i,`missing type "${l.join(",")}" for keyword "${r}"`)}}}function t0(i,t){return i.includes(t)||t==="number"&&i.includes("integer")}function K$(i,t){return i.includes(t)||t==="integer"&&i.includes("number")}function o0(i,t){let o=[];for(let r of i.dataTypes)if(K$(t,r))o.push(r);else if(t.includes("integer")&&r==="number")o.push("integer");i.dataTypes=o}function qo(i,t){let o=i.schemaEnv.baseId+i.errSchemaPath;t+=` at "${o}" (strictTypes)`,(0,oi.checkStrictMode)(i,t,i.opts.strictTypes)}class To{constructor(i,t,o){if((0,pi.validateKeywordUsage)(i,t,o),this.gen=i.gen,this.allErrors=i.allErrors,this.keyword=o,this.data=i.data,this.schema=i.schema[o],this.$data=t.$data&&i.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,oi.schemaRefOrVal)(i,this.schema,o,this.$data),this.schemaType=t.schemaType,this.parentSchema=i.schema,this.params={},this.it=i,this.def=t,this.$data)this.schemaCode=i.gen.const("vSchema",U$(this.$data,i));else if(this.schemaCode=this.schemaValue,!(0,pi.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(t.schemaType)}`);if("code"in t?t.trackErrors:t.errors!==!1)this.errsCount=i.gen.const("_errs",w.default.errors)}result(i,t,o){this.failResult((0,O.not)(i),t,o)}failResult(i,t,o){if(this.gen.if(i),o)o();else this.error();if(t){if(this.gen.else(),t(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(i,t){this.failResult((0,O.not)(i),void 0,t)}fail(i){if(i===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(i),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(i){if(!this.$data)return this.fail(i);let{schemaCode:t}=this;this.fail(O._`${t} !== undefined && (${(0,O.or)(this.invalid$data(),i)})`)}error(i,t,o){if(t){this.setParams(t),this._error(i,o),this.setParams({});return}this._error(i,o)}_error(i,t){(i?Ei.reportExtraError:Ei.reportError)(this,this.def.error,t)}$dataError(){(0,Ei.reportError)(this,this.def.$dataError||Ei.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Ei.resetErrorsCount)(this.gen,this.errsCount)}ok(i){if(!this.allErrors)this.gen.if(i)}setParams(i,t){if(t)Object.assign(this.params,i);else this.params=i}block$data(i,t,o=O.nil){this.gen.block(()=>{this.check$data(i,o),t()})}check$data(i=O.nil,t=O.nil){if(!this.$data)return;let{gen:o,schemaCode:r,schemaType:$,def:l}=this;if(o.if((0,O.or)(O._`${r} === undefined`,t)),i!==O.nil)o.assign(i,!0);if($.length||l.validateSchema){if(o.elseIf(this.invalid$data()),this.$dataError(),i!==O.nil)o.assign(i,!1)}o.else()}invalid$data(){let{gen:i,schemaCode:t,schemaType:o,def:r,it:$}=this;return(0,O.or)(l(),f());function l(){if(o.length){if(!(t instanceof O.Name))throw Error("ajv implementation error");let s=Array.isArray(o)?o:[o];return O._`${(0,Lt.checkDataTypes)(s,t,$.opts.strictNumbers,Lt.DataType.Wrong)}`}return O.nil}function f(){if(r.validateSchema){let s=i.scopeValue("validate$data",{ref:r.validateSchema});return O._`!${s}(${t})`}return O.nil}}subschema(i,t){let o=(0,Vo.getSubschema)(this.it,i);(0,Vo.extendSubschemaData)(o,this.it,i),(0,Vo.extendSubschemaMode)(o,i);let r={...this.it,...o,items:void 0,props:void 0};return RI(r,t),r}mergeEvaluated(i,t){let{it:o,gen:r}=this;if(!o.opts.unevaluated)return;if(o.props!==!0&&i.props!==void 0)o.props=oi.mergeEvaluated.props(r,i.props,o.props,t);if(o.items!==!0&&i.items!==void 0)o.items=oi.mergeEvaluated.items(r,i.items,o.items,t)}mergeValidEvaluated(i,t){let{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(t,()=>this.mergeEvaluated(i,O.Name)),!0}}N$.KeywordCxt=To;function v$(i,t,o,r){let $=new To(i,o,t);if("code"in o)o.code($,r);else if($.$data&&o.validate)(0,pi.funcKeywordCode)($,o);else if("macro"in o)(0,pi.macroKeywordCode)($,o);else if(o.compile||o.validate)(0,pi.funcKeywordCode)($,o)}var r0=/^\/(?:[^~]|~0|~1)*$/,$0=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function U$(i,{dataLevel:t,dataNames:o,dataPathArr:r}){let $,l;if(i==="")return w.default.rootData;if(i[0]==="/"){if(!r0.test(i))throw Error(`Invalid JSON-pointer: ${i}`);$=i,l=w.default.rootData}else{let n=$0.exec(i);if(!n)throw Error(`Invalid JSON-pointer: ${i}`);let u=+n[1];if($=n[2],$==="#"){if(u>=t)throw Error(b("property/index",u));return r[t-u]}if(u>t)throw Error(b("data",u));if(l=o[t-u],!$)return l}let f=l,s=$.split("/");for(let n of s)if(n)l=O._`${l}${(0,O.getProperty)((0,oi.unescapeJsonPointer)(n))}`,f=O._`${f} && ${l}`;return f;function b(n,u){return`Cannot access ${n} ${u} levels up, current level is ${t}`}}N$.getData=U$});var qt=V((P$)=>{Object.defineProperty(P$,"__esModule",{value:!0});class p$ extends Error{constructor(i){super("validation failed");this.errors=i,this.ajv=this.validation=!0}}P$.default=p$});var ci=V((R$)=>{Object.defineProperty(R$,"__esModule",{value:!0});var Wo=Ni();class c$ extends Error{constructor(i,t,o,r){super(r||`can't resolve reference ${o} from id ${t}`);this.missingRef=(0,Wo.resolveUrl)(i,t,o),this.missingSchema=(0,Wo.normalizeId)((0,Wo.getFullPath)(i,this.missingRef))}}R$.default=c$});var Si=V((C$)=>{Object.defineProperty(C$,"__esModule",{value:!0});C$.resolveSchema=C$.getCompilingSchema=C$.resolveRef=C$.compileSchema=C$.SchemaEnv=void 0;var h=F(),n0=qt(),qi=c(),g=Ni(),S$=B(),u0=Pi();class Ri{constructor(i){var t;this.refs={},this.dynamicAnchors={};let o;if(typeof i.schema=="object")o=i.schema;this.schema=i.schema,this.schemaId=i.schemaId,this.root=i.root||this,this.baseId=(t=i.baseId)!==null&&t!==void 0?t:(0,g.normalizeId)(o===null||o===void 0?void 0:o[i.schemaId||"$id"]),this.schemaPath=i.schemaPath,this.localRefs=i.localRefs,this.meta=i.meta,this.$async=o===null||o===void 0?void 0:o.$async,this.refs={}}}C$.SchemaEnv=Ri;function wo(i){let t=k$.call(this,i);if(t)return t;let o=(0,g.getFullPath)(this.opts.uriResolver,i.root.baseId),{es5:r,lines:$}=this.opts.code,{ownProperties:l}=this.opts,f=new h.CodeGen(this.scope,{es5:r,lines:$,ownProperties:l}),s;if(i.$async)s=f.scopeValue("Error",{ref:n0.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let b=f.scopeName("validate");i.validateName=b;let n={gen:f,allErrors:this.opts.allErrors,data:qi.default.data,parentData:qi.default.parentData,parentDataProperty:qi.default.parentDataProperty,dataNames:[qi.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:i.schema,code:(0,h.stringify)(i.schema)}:{ref:i.schema}),validateName:b,ValidationError:s,schema:i.schema,schemaEnv:i,rootId:o,baseId:i.baseId||o,schemaPath:h.nil,errSchemaPath:i.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},u;try{this._compilations.add(i),(0,u0.validateFunctionCode)(n),f.optimize(this.opts.code.optimize);let I=f.toString();if(u=`${f.scopeRefs(qi.default.scope)}return ${I}`,this.opts.code.process)u=this.opts.code.process(u,i);let L=Function(`${qi.default.self}`,`${qi.default.scope}`,u)(this,this.scope.get());if(this.scope.value(b,{ref:L}),L.errors=null,L.schema=i.schema,L.schemaEnv=i,i.$async)L.$async=!0;if(this.opts.code.source===!0)L.source={validateName:b,validateCode:I,scopeValues:f._values};if(this.opts.unevaluated){let{props:y,items:M}=n;if(L.evaluated={props:y instanceof h.Name?void 0:y,items:M instanceof h.Name?void 0:M,dynamicProps:y instanceof h.Name,dynamicItems:M instanceof h.Name},L.source)L.source.evaluated=(0,h.stringify)(L.evaluated)}return i.validate=L,i}catch(I){if(delete i.validate,delete i.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw I}finally{this._compilations.delete(i)}}C$.compileSchema=wo;function I0(i,t,o){var r;o=(0,g.resolveUrl)(this.opts.uriResolver,t,o);let $=i.refs[o];if($)return $;let l=V0.call(this,i,o);if(l===void 0){let f=(r=i.localRefs)===null||r===void 0?void 0:r[o],{schemaId:s}=this.opts;if(f)l=new Ri({schema:f,schemaId:s,root:i,baseId:t})}if(l===void 0)return;return i.refs[o]=y0.call(this,l)}C$.resolveRef=I0;function y0(i){if((0,g.inlineRef)(i.schema,this.opts.inlineRefs))return i.schema;return i.validate?i:wo.call(this,i)}function k$(i){for(let t of this._compilations)if(M0(t,i))return t}C$.getCompilingSchema=k$;function M0(i,t){return i.schema===t.schema&&i.root===t.root&&i.baseId===t.baseId}function V0(i,t){let o;while(typeof(o=this.refs[t])=="string")t=o;return o||this.schemas[t]||Tt.call(this,i,t)}function Tt(i,t){let o=this.opts.uriResolver.parse(t),r=(0,g._getFullPath)(this.opts.uriResolver,o),$=(0,g.getFullPath)(this.opts.uriResolver,i.baseId,void 0);if(Object.keys(i.schema).length>0&&r===$)return Oo.call(this,o,i);let l=(0,g.normalizeId)(r),f=this.refs[l]||this.schemas[l];if(typeof f=="string"){let s=Tt.call(this,i,f);if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;return Oo.call(this,o,s)}if(typeof(f===null||f===void 0?void 0:f.schema)!=="object")return;if(!f.validate)wo.call(this,f);if(l===(0,g.normalizeId)(t)){let{schema:s}=f,{schemaId:b}=this.opts,n=s[b];if(n)$=(0,g.resolveUrl)(this.opts.uriResolver,$,n);return new Ri({schema:s,schemaId:b,root:i,baseId:$})}return Oo.call(this,o,f)}C$.resolveSchema=Tt;var L0=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function Oo(i,{baseId:t,schema:o,root:r}){var $;if((($=i.fragment)===null||$===void 0?void 0:$[0])!=="/")return;for(let s of i.fragment.slice(1).split("/")){if(typeof o==="boolean")return;let b=o[(0,S$.unescapeFragment)(s)];if(b===void 0)return;o=b;let n=typeof o==="object"&&o[this.opts.schemaId];if(!L0.has(s)&&n)t=(0,g.resolveUrl)(this.opts.uriResolver,t,n)}let l;if(typeof o!="boolean"&&o.$ref&&!(0,S$.schemaHasRulesButRef)(o,this.RULES)){let s=(0,g.resolveUrl)(this.opts.uriResolver,t,o.$ref);l=Tt.call(this,r,s)}let{schemaId:f}=this.opts;if(l=l||new Ri({schema:o,schemaId:f,root:r,baseId:t}),l.schema!==l.root.schema)return l;return}});var h$=V((VL,w0)=>{w0.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var Zo=V((LL,il)=>{var j0=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),x$=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),jo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),m$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),F0=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function Fo(i){let t="",o=0,r=0;for(r=0;r<i.length;r++){if(o=i[r].charCodeAt(0),o===48)continue;if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";t+=i[r];break}for(r+=1;r<i.length;r++){if(o=i[r].charCodeAt(0),!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";t+=i[r]}return t}var Z0=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g$(i){return i.length=0,!0}function B0(i,t,o){if(i.length){let r=Fo(i);if(r!=="")t.push(r);else return o.error=!0,!1;i.length=0}return!0}function J0(i){let t=0,o={error:!1,address:"",zone:""},r=[],$=[],l=!1,f=!1,s=B0;for(let b=0;b<i.length;b++){let n=i[b];if(n==="["||n==="]")continue;if(n===":"){if(l===!0)f=!0;if(!s($,r,o))break;if(++t>7){o.error=!0;break}if(b>0&&i[b-1]===":")l=!0;r.push(":");continue}else if(n==="%"){if(!s($,r,o))break;s=g$}else{$.push(n);continue}}if($.length)if(s===g$)o.zone=$.join("");else if(f)r.push($.join(""));else r.push(Fo($));return o.address=r.join(""),o}function _$(i){if(X0(i,":")<2)return{host:i,isIPV6:!1};let t=J0(i);if(!t.error){let{address:o,address:r}=t;if(t.zone)o+="%"+t.zone,r+="%25"+t.zone;return{host:o,isIPV6:!0,escapedHost:r}}else return{host:i,isIPV6:!1}}function X0(i,t){let o=0;for(let r=0;r<i.length;r++)if(i[r]===t)o++;return o}function Y0(i){let t=i,o=[],r=-1,$=0;while($=t.length){if($===1)if(t===".")break;else if(t==="/"){o.push("/");break}else{o.push(t);break}else if($===2){if(t[0]==="."){if(t[1]===".")break;else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."||t[1]==="/"){o.push("/");break}}}else if($===3){if(t==="/.."){if(o.length!==0)o.pop();o.push("/");break}}if(t[0]==="."){if(t[1]==="."){if(t[2]==="/"){t=t.slice(3);continue}}else if(t[1]==="/"){t=t.slice(2);continue}}else if(t[0]==="/"){if(t[1]==="."){if(t[2]==="/"){t=t.slice(2);continue}else if(t[2]==="."){if(t[3]==="/"){if(t=t.slice(3),o.length!==0)o.pop();continue}}}}if((r=t.indexOf("/",1))===-1){o.push(t);break}else o.push(t.slice(0,r)),t=t.slice(r)}return o.join("")}var Q0={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},A0=/[@/?#:]/g,z0=/[@/?#]/g;function a$(i,t){let o=t?z0:A0;return o.lastIndex=0,i.replace(o,(r)=>Q0[r])}function G0(i,t=!1){if(i.indexOf("%")===-1)return i;let o="";for(let r=0;r<i.length;r++){if(i[r]==="%"&&r+2<i.length){let $=i.slice(r+1,r+3);if(jo($)){let l=$.toUpperCase(),f=String.fromCharCode(parseInt(l,16));if(t&&m$(f))o+=f;else o+="%"+l;r+=2;continue}}o+=i[r]}return o}function H0(i){let t="";for(let o=0;o<i.length;o++){if(i[o]==="%"&&o+2<i.length){let r=i.slice(o+1,o+3);if(jo(r)){let $=r.toUpperCase(),l=String.fromCharCode(parseInt($,16));if(l!=="."&&m$(l))t+=l;else t+="%"+$;o+=2;continue}}if(F0(i[o]))t+=i[o];else t+=escape(i[o])}return t}function D0(i){let t="";for(let o=0;o<i.length;o++){if(i[o]==="%"&&o+2<i.length){let r=i.slice(o+1,o+3);if(jo(r)){t+="%"+r.toUpperCase(),o+=2;continue}}t+=escape(i[o])}return t}function d0(i){let t=[];if(i.userinfo!==void 0)t.push(i.userinfo),t.push("@");if(i.host!==void 0){let o=unescape(i.host);if(!x$(o)){let r=_$(o);if(r.isIPV6===!0)o=`[${r.escapedHost}]`;else o=a$(o,!1)}t.push(o)}if(typeof i.port==="number"||typeof i.port==="string")t.push(":"),t.push(String(i.port));return t.length?t.join(""):void 0}il.exports={nonSimpleDomain:Z0,recomposeAuthority:d0,reescapeHostDelimiters:a$,normalizePercentEncoding:G0,normalizePathEncoding:H0,escapePreservingEscapes:D0,removeDotSegments:Y0,isIPv4:x$,isUUID:j0,normalizeIPv6:_$,stringArrayToHexStripped:Fo}});var ll=V((qL,$l)=>{var{isUUID:K0}=Zo(),v0=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,U0=["http","https","ws","wss","urn","urn:uuid"];function N0(i){return U0.indexOf(i)!==-1}function Bo(i){if(i.secure===!0)return!0;else if(i.secure===!1)return!1;else if(i.scheme)return i.scheme.length===3&&(i.scheme[0]==="w"||i.scheme[0]==="W")&&(i.scheme[1]==="s"||i.scheme[1]==="S")&&(i.scheme[2]==="s"||i.scheme[2]==="S");else return!1}function tl(i){if(!i.host)i.error=i.error||"HTTP URIs must have a host.";return i}function ol(i){let t=String(i.scheme).toLowerCase()==="https";if(i.port===(t?443:80)||i.port==="")i.port=void 0;if(!i.path)i.path="/";return i}function E0(i){return i.secure=Bo(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function p0(i){if(i.port===(Bo(i)?443:80)||i.port==="")i.port=void 0;if(typeof i.secure==="boolean")i.scheme=i.secure?"wss":"ws",i.secure=void 0;if(i.resourceName){let[t,o]=i.resourceName.split("?");i.path=t&&t!=="/"?t:void 0,i.query=o,i.resourceName=void 0}return i.fragment=void 0,i}function P0(i,t){if(!i.path)return i.error="URN can not be parsed",i;let o=i.path.match(v0);if(o){let r=t.scheme||i.scheme||"urn";i.nid=o[1].toLowerCase(),i.nss=o[2];let $=`${r}:${t.nid||i.nid}`,l=Jo($);if(i.path=void 0,l)i=l.parse(i,t)}else i.error=i.error||"URN can not be parsed.";return i}function c0(i,t){if(i.nid===void 0)throw Error("URN without nid cannot be serialized");let o=t.scheme||i.scheme||"urn",r=i.nid.toLowerCase(),$=`${o}:${t.nid||r}`,l=Jo($);if(l)i=l.serialize(i,t);let f=i,s=i.nss;return f.path=`${r||t.nid}:${s}`,t.skipEscape=!0,f}function R0(i,t){let o=i;if(o.uuid=o.nss,o.nss=void 0,!t.tolerant&&(!o.uuid||!K0(o.uuid)))o.error=o.error||"UUID is not valid.";return o}function S0(i){let t=i;return t.nss=(i.uuid||"").toLowerCase(),t}var rl={scheme:"http",domainHost:!0,parse:tl,serialize:ol},k0={scheme:"https",domainHost:rl.domainHost,parse:tl,serialize:ol},Wt={scheme:"ws",domainHost:!0,parse:E0,serialize:p0},C0={scheme:"wss",domainHost:Wt.domainHost,parse:Wt.parse,serialize:Wt.serialize},e0={scheme:"urn",parse:P0,serialize:c0,skipNormalize:!0},h0={scheme:"urn:uuid",parse:R0,serialize:S0,skipNormalize:!0},Ot={http:rl,https:k0,ws:Wt,wss:C0,urn:e0,"urn:uuid":h0};Object.setPrototypeOf(Ot,null);function Jo(i){return i&&(Ot[i]||Ot[i.toLowerCase()])||void 0}$l.exports={wsIsSecure:Bo,SCHEMES:Ot,isValidSchemeName:N0,getSchemeHandler:Jo}});var ul=V((TL,Ft)=>{var{normalizeIPv6:g0,removeDotSegments:ki,recomposeAuthority:x0,normalizePercentEncoding:m0,normalizePathEncoding:_0,escapePreservingEscapes:a0,reescapeHostDelimiters:i1,isIPv4:t1,nonSimpleDomain:o1}=Zo(),{SCHEMES:r1,getSchemeHandler:sl}=ll();function $1(i,t){if(typeof i==="string")i=I1(i,t);else if(typeof i==="object")i=jt(Ti(i,t),t);return i}function l1(i,t,o){let r=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:$,malformedAuthorityOrPort:l}=wt(i,r),{parsed:f,malformedAuthorityOrPort:s}=wt(t,r);if(l||s)throw Error($.error||f.error||"URI is malformed.");let b=bl($,f,r,!0);return r.skipEscape=!0,Ti(b,r)}function bl(i,t,o,r){let $={};if(!r)i=jt(Ti(i,o),o),t=jt(Ti(t,o),o);if(o=o||{},!o.tolerant&&t.scheme)$.scheme=t.scheme,$.userinfo=t.userinfo,$.host=t.host,$.port=t.port,$.path=ki(t.path||""),$.query=t.query;else{if(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)$.userinfo=t.userinfo,$.host=t.host,$.port=t.port,$.path=ki(t.path||""),$.query=t.query;else{if(!t.path)if($.path=i.path,t.query!==void 0)$.query=t.query;else $.query=i.query;else{if(t.path[0]==="/")$.path=ki(t.path);else{if((i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)&&!i.path)$.path="/"+t.path;else if(!i.path)$.path=t.path;else $.path=i.path.slice(0,i.path.lastIndexOf("/")+1)+t.path;$.path=ki($.path)}$.query=t.query}$.userinfo=i.userinfo,$.host=i.host,$.port=i.port}$.scheme=i.scheme}return $.fragment=t.fragment,$}function f1(i,t,o){let r=fl(i,o),$=fl(t,o);return r!==void 0&&$!==void 0&&r.toLowerCase()===$.toLowerCase()}function Ti(i,t){let o={host:i.host,scheme:i.scheme,userinfo:i.userinfo,port:i.port,path:i.path,query:i.query,nid:i.nid,nss:i.nss,uuid:i.uuid,fragment:i.fragment,reference:i.reference,resourceName:i.resourceName,secure:i.secure,error:""},r=Object.assign({},t),$=[],l=sl(r.scheme||o.scheme);if(l&&l.serialize)l.serialize(o,r);if(o.path!==void 0)if(!r.skipEscape){if(o.path=a0(o.path),o.scheme!==void 0)o.path=o.path.split("%3A").join(":")}else o.path=m0(o.path);if(r.reference!=="suffix"&&o.scheme)$.push(o.scheme,":");let f=x0(o);if(f!==void 0){if(r.reference!=="suffix")$.push("//");if($.push(f),o.path&&o.path[0]!=="/")$.push("/")}if(o.path!==void 0){let s=o.path;if(!r.absolutePath&&(!l||!l.absolutePath))s=ki(s);if(f===void 0&&s[0]==="/"&&s[1]==="/")s="/%2F"+s.slice(2);$.push(s)}if(o.query!==void 0)$.push("?",o.query);if(o.fragment!==void 0)$.push("#",o.fragment);return $.join("")}var s1=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,b1=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,n1=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function u1(i,t){if(t[2]!==void 0&&i.path&&i.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof i.port==="number"&&(i.port<0||i.port>65535))return"URI port is malformed.";return}function wt(i,t){let o=Object.assign({},t),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=!1,l=!1;if(o.reference==="suffix")if(o.scheme)i=o.scheme+":"+i;else i="//"+i;let f=i.match(b1);if(f!==null&&f[1].indexOf("\\")!==-1)r.error="URI authority must not contain a literal backslash.",$=!0;let s=i.match(n1);if(s!==null){let n=s[1],u=n.replace(/[\t\n\r]/g,"");if(u.length>=2){if(u.slice(0,2)!=="//")r.error=r.error||"URI authority must not contain a literal backslash.",$=!0;else if(n.length!==u.length)r.error=r.error||"URI authority introducer must not contain whitespace.",$=!0}}let b=i.match(s1);if(b){if(r.scheme=b[1],r.userinfo=b[3],r.host=b[4],r.port=parseInt(b[5],10),r.path=b[6]||"",r.query=b[7],r.fragment=b[8],isNaN(r.port))r.port=b[5];let n=u1(r,b);if(n!==void 0)r.error=r.error||n,$=!0;if(r.host)if(t1(r.host)===!1){let q=g0(r.host);r.host=q.host.toLowerCase(),l=q.isIPV6}else l=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(o.reference&&o.reference!=="suffix"&&o.reference!==r.reference)r.error=r.error||"URI is not a "+o.reference+" reference.";let u=sl(o.scheme||r.scheme);if(!o.unicodeSupport&&(!u||!u.unicodeSupport)){if(r.host&&(o.domainHost||u&&u.domainHost)&&l===!1&&o1(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(I){r.error=r.error||"Host's domain name can not be converted to ASCII: "+I}}if(!u||u&&!u.skipNormalize){if(i.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=i1(unescape(r.host),l)}if(r.path)r.path=_0(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(u&&u.parse)u.parse(r,o)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:$}}function jt(i,t){return wt(i,t).parsed}function I1(i,t){return nl(i,t).normalized}function nl(i,t){let{parsed:o,malformedAuthorityOrPort:r}=wt(i,t);return{normalized:r?i:Ti(o,t),malformedAuthorityOrPort:r}}function fl(i,t){if(typeof i==="string"){let{normalized:o,malformedAuthorityOrPort:r}=nl(i,t);return r?void 0:o}if(typeof i==="object")return Ti(i,t)}var Xo={SCHEMES:r1,normalize:$1,resolve:l1,resolveComponent:bl,equal:f1,serialize:Ti,parse:jt};Ft.exports=Xo;Ft.exports.default=Xo;Ft.exports.fastUri=Xo});var Ml=V((yl)=>{Object.defineProperty(yl,"__esModule",{value:!0});var Il=ul();Il.code='require("ajv/dist/runtime/uri").default';yl.default=Il});var jl=V((ri)=>{Object.defineProperty(ri,"__esModule",{value:!0});ri.CodeGen=ri.Name=ri.nil=ri.stringify=ri.str=ri._=ri.KeywordCxt=void 0;var M1=Pi();Object.defineProperty(ri,"KeywordCxt",{enumerable:!0,get:function(){return M1.KeywordCxt}});var Yi=F();Object.defineProperty(ri,"_",{enumerable:!0,get:function(){return Yi._}});Object.defineProperty(ri,"str",{enumerable:!0,get:function(){return Yi.str}});Object.defineProperty(ri,"stringify",{enumerable:!0,get:function(){return Yi.stringify}});Object.defineProperty(ri,"nil",{enumerable:!0,get:function(){return Yi.nil}});Object.defineProperty(ri,"Name",{enumerable:!0,get:function(){return Yi.Name}});Object.defineProperty(ri,"CodeGen",{enumerable:!0,get:function(){return Yi.CodeGen}});var V1=qt(),Wl=ci(),L1=$o(),Ci=Si(),q1=F(),ei=Ni(),Zt=Ui(),Qo=B(),Vl=h$(),T1=Ml(),Ol=(i,t)=>new RegExp(i,t);Ol.code="new RegExp";var W1=["removeAdditional","useDefaults","coerceTypes"],O1=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),w1={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},j1={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},Ll=200;function F1(i){var t,o,r,$,l,f,s,b,n,u,I,q,L,y,M,T,W,Y,J,z,j,m,ii,Et,pt;let Hi=i.strict,Pt=(t=i.code)===null||t===void 0?void 0:t.optimize,go=Pt===!0||Pt===void 0?1:Pt||0,xo=(r=(o=i.code)===null||o===void 0?void 0:o.regExp)!==null&&r!==void 0?r:Ol,Jb=($=i.uriResolver)!==null&&$!==void 0?$:T1.default;return{strictSchema:(f=(l=i.strictSchema)!==null&&l!==void 0?l:Hi)!==null&&f!==void 0?f:!0,strictNumbers:(b=(s=i.strictNumbers)!==null&&s!==void 0?s:Hi)!==null&&b!==void 0?b:!0,strictTypes:(u=(n=i.strictTypes)!==null&&n!==void 0?n:Hi)!==null&&u!==void 0?u:"log",strictTuples:(q=(I=i.strictTuples)!==null&&I!==void 0?I:Hi)!==null&&q!==void 0?q:"log",strictRequired:(y=(L=i.strictRequired)!==null&&L!==void 0?L:Hi)!==null&&y!==void 0?y:!1,code:i.code?{...i.code,optimize:go,regExp:xo}:{optimize:go,regExp:xo},loopRequired:(M=i.loopRequired)!==null&&M!==void 0?M:Ll,loopEnum:(T=i.loopEnum)!==null&&T!==void 0?T:Ll,meta:(W=i.meta)!==null&&W!==void 0?W:!0,messages:(Y=i.messages)!==null&&Y!==void 0?Y:!0,inlineRefs:(J=i.inlineRefs)!==null&&J!==void 0?J:!0,schemaId:(z=i.schemaId)!==null&&z!==void 0?z:"$id",addUsedSchema:(j=i.addUsedSchema)!==null&&j!==void 0?j:!0,validateSchema:(m=i.validateSchema)!==null&&m!==void 0?m:!0,validateFormats:(ii=i.validateFormats)!==null&&ii!==void 0?ii:!0,unicodeRegExp:(Et=i.unicodeRegExp)!==null&&Et!==void 0?Et:!0,int32range:(pt=i.int32range)!==null&&pt!==void 0?pt:!0,uriResolver:Jb}}class Bt{constructor(i={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,i=this.opts={...i,...F1(i)};let{es5:t,lines:o}=this.opts.code;this.scope=new q1.ValueScope({scope:{},prefixes:O1,es5:t,lines:o}),this.logger=Q1(i.logger);let r=i.validateFormats;if(i.validateFormats=!1,this.RULES=(0,L1.getRules)(),ql.call(this,w1,i,"NOT SUPPORTED"),ql.call(this,j1,i,"DEPRECATED","warn"),this._metaOpts=X1.call(this),i.formats)B1.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),i.keywords)J1.call(this,i.keywords);if(typeof i.meta=="object")this.addMetaSchema(i.meta);Z1.call(this),i.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:i,meta:t,schemaId:o}=this.opts,r=Vl;if(o==="id")r={...Vl},r.id=r.$id,delete r.$id;if(t&&i)this.addMetaSchema(r,r[o],!1)}defaultMeta(){let{meta:i,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof i=="object"?i[t]||i:void 0}validate(i,t){let o;if(typeof i=="string"){if(o=this.getSchema(i),!o)throw Error(`no schema with key or ref "${i}"`)}else o=this.compile(i);let r=o(t);if(!("$async"in o))this.errors=o.errors;return r}compile(i,t){let o=this._addSchema(i,t);return o.validate||this._compileSchemaEnv(o)}compileAsync(i,t){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return r.call(this,i,t);async function r(n,u){await $.call(this,n.$schema);let I=this._addSchema(n,u);return I.validate||l.call(this,I)}async function $(n){if(n&&!this.getSchema(n))await r.call(this,{$ref:n},!0)}async function l(n){try{return this._compileSchemaEnv(n)}catch(u){if(!(u instanceof Wl.default))throw u;return f.call(this,u),await s.call(this,u.missingSchema),l.call(this,n)}}function f({missingSchema:n,missingRef:u}){if(this.refs[n])throw Error(`AnySchema ${n} is loaded but ${u} cannot be resolved`)}async function s(n){let u=await b.call(this,n);if(!this.refs[n])await $.call(this,u.$schema);if(!this.refs[n])this.addSchema(u,n,t)}async function b(n){let u=this._loading[n];if(u)return u;try{return await(this._loading[n]=o(n))}finally{delete this._loading[n]}}}addSchema(i,t,o,r=this.opts.validateSchema){if(Array.isArray(i)){for(let l of i)this.addSchema(l,void 0,o,r);return this}let $;if(typeof i==="object"){let{schemaId:l}=this.opts;if($=i[l],$!==void 0&&typeof $!="string")throw Error(`schema ${l} must be string`)}return t=(0,ei.normalizeId)(t||$),this._checkUnique(t),this.schemas[t]=this._addSchema(i,o,t,r,!0),this}addMetaSchema(i,t,o=this.opts.validateSchema){return this.addSchema(i,t,!0,o),this}validateSchema(i,t){if(typeof i=="boolean")return!0;let o;if(o=i.$schema,o!==void 0&&typeof o!="string")throw Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(o,i);if(!r&&t){let $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw Error($)}return r}getSchema(i){let t;while(typeof(t=Tl.call(this,i))=="string")i=t;if(t===void 0){let{schemaId:o}=this.opts,r=new Ci.SchemaEnv({schema:{},schemaId:o});if(t=Ci.resolveSchema.call(this,r,i),!t)return;this.refs[i]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(i){if(i instanceof RegExp)return this._removeAllSchemas(this.schemas,i),this._removeAllSchemas(this.refs,i),this;switch(typeof i){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=Tl.call(this,i);if(typeof t=="object")this._cache.delete(t.schema);return delete this.schemas[i],delete this.refs[i],this}case"object":{let t=i;this._cache.delete(t);let o=i[this.opts.schemaId];if(o)o=(0,ei.normalizeId)(o),delete this.schemas[o],delete this.refs[o];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(i){for(let t of i)this.addKeyword(t);return this}addKeyword(i,t){let o;if(typeof i=="string"){if(o=i,typeof t=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=o}else if(typeof i=="object"&&t===void 0){if(t=i,o=t.keyword,Array.isArray(o)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(z1.call(this,o,t),!t)return(0,Qo.eachItem)(o,($)=>Yo.call(this,$)),this;H1.call(this,t);let r={...t,type:(0,Zt.getJSONTypes)(t.type),schemaType:(0,Zt.getJSONTypes)(t.schemaType)};return(0,Qo.eachItem)(o,r.type.length===0?($)=>Yo.call(this,$,r):($)=>r.type.forEach((l)=>Yo.call(this,$,r,l))),this}getKeyword(i){let t=this.RULES.all[i];return typeof t=="object"?t.definition:!!t}removeKeyword(i){let{RULES:t}=this;delete t.keywords[i],delete t.all[i];for(let o of t.rules){let r=o.rules.findIndex(($)=>$.keyword===i);if(r>=0)o.rules.splice(r,1)}return this}addFormat(i,t){if(typeof t=="string")t=new RegExp(t);return this.formats[i]=t,this}errorsText(i=this.errors,{separator:t=", ",dataVar:o="data"}={}){if(!i||i.length===0)return"No errors";return i.map((r)=>`${o}${r.instancePath} ${r.message}`).reduce((r,$)=>r+t+$)}$dataMetaSchema(i,t){let o=this.RULES.all;i=JSON.parse(JSON.stringify(i));for(let r of t){let $=r.split("/").slice(1),l=i;for(let f of $)l=l[f];for(let f in o){let s=o[f];if(typeof s!="object")continue;let{$data:b}=s.definition,n=l[f];if(b&&n)l[f]=wl(n)}}return i}_removeAllSchemas(i,t){for(let o in i){let r=i[o];if(!t||t.test(o)){if(typeof r=="string")delete i[o];else if(r&&!r.meta)this._cache.delete(r.schema),delete i[o]}}}_addSchema(i,t,o,r=this.opts.validateSchema,$=this.opts.addUsedSchema){let l,{schemaId:f}=this.opts;if(typeof i=="object")l=i[f];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof i!="boolean")throw Error("schema must be object or boolean");let s=this._cache.get(i);if(s!==void 0)return s;o=(0,ei.normalizeId)(l||o);let b=ei.getSchemaRefs.call(this,i,o);if(s=new Ci.SchemaEnv({schema:i,schemaId:f,meta:t,baseId:o,localRefs:b}),this._cache.set(s.schema,s),$&&!o.startsWith("#")){if(o)this._checkUnique(o);this.refs[o]=s}if(r)this.validateSchema(i,!0);return s}_checkUnique(i){if(this.schemas[i]||this.refs[i])throw Error(`schema with key or id "${i}" already exists`)}_compileSchemaEnv(i){if(i.meta)this._compileMetaSchema(i);else Ci.compileSchema.call(this,i);if(!i.validate)throw Error("ajv implementation error");return i.validate}_compileMetaSchema(i){let t=this.opts;this.opts=this._metaOpts;try{Ci.compileSchema.call(this,i)}finally{this.opts=t}}}Bt.ValidationError=V1.default;Bt.MissingRefError=Wl.default;ri.default=Bt;function ql(i,t,o,r="error"){for(let $ in i){let l=$;if(l in t)this.logger[r](`${o}: option ${$}. ${i[l]}`)}}function Tl(i){return i=(0,ei.normalizeId)(i),this.schemas[i]||this.refs[i]}function Z1(){let i=this.opts.schemas;if(!i)return;if(Array.isArray(i))this.addSchema(i);else for(let t in i)this.addSchema(i[t],t)}function B1(){for(let i in this.opts.formats){let t=this.opts.formats[i];if(t)this.addFormat(i,t)}}function J1(i){if(Array.isArray(i)){this.addVocabulary(i);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let t in i){let o=i[t];if(!o.keyword)o.keyword=t;this.addKeyword(o)}}function X1(){let i={...this.opts};for(let t of W1)delete i[t];return i}var Y1={log(){},warn(){},error(){}};function Q1(i){if(i===!1)return Y1;if(i===void 0)return console;if(i.log&&i.warn&&i.error)return i;throw Error("logger must implement log, warn and error methods")}var A1=/^[a-z_$][a-z0-9_$:-]*$/i;function z1(i,t){let{RULES:o}=this;if((0,Qo.eachItem)(i,(r)=>{if(o.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!A1.test(r))throw Error(`Keyword ${r} has invalid name`)}),!t)return;if(t.$data&&!(("code"in t)||("validate"in t)))throw Error('$data keyword must have "code" or "validate" function')}function Yo(i,t,o){var r;let $=t===null||t===void 0?void 0:t.post;if(o&&$)throw Error('keyword with "post" flag cannot have "type"');let{RULES:l}=this,f=$?l.post:l.rules.find(({type:b})=>b===o);if(!f)f={type:o,rules:[]},l.rules.push(f);if(l.keywords[i]=!0,!t)return;let s={keyword:i,definition:{...t,type:(0,Zt.getJSONTypes)(t.type),schemaType:(0,Zt.getJSONTypes)(t.schemaType)}};if(t.before)G1.call(this,f,s,t.before);else f.rules.push(s);l.all[i]=s,(r=t.implements)===null||r===void 0||r.forEach((b)=>this.addKeyword(b))}function G1(i,t,o){let r=i.rules.findIndex(($)=>$.keyword===o);if(r>=0)i.rules.splice(r,0,t);else i.rules.push(t),this.logger.warn(`rule ${o} is not defined`)}function H1(i){let{metaSchema:t}=i;if(t===void 0)return;if(i.$data&&this.opts.$data)t=wl(t);i.validateSchema=this.compile(t,!0)}var D1={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function wl(i){return{anyOf:[i,D1]}}});var Zl=V((Fl)=>{Object.defineProperty(Fl,"__esModule",{value:!0});var v1={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Fl.default=v1});var Yt=V((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});Yl.callRef=Yl.getValidate=void 0;var N1=ci(),Bl=R(),E=F(),Qi=c(),Jl=Si(),Jt=B(),E1={keyword:"$ref",schemaType:"string",code(i){let{gen:t,schema:o,it:r}=i,{baseId:$,schemaEnv:l,validateName:f,opts:s,self:b}=r,{root:n}=l;if((o==="#"||o==="#/")&&$===n.baseId)return I();let u=Jl.resolveRef.call(b,n,$,o);if(u===void 0)throw new N1.default(r.opts.uriResolver,$,o);if(u instanceof Jl.SchemaEnv)return q(u);return L(u);function I(){if(l===n)return Xt(i,f,l,l.$async);let y=t.scopeValue("root",{ref:n});return Xt(i,E._`${y}.validate`,n,n.$async)}function q(y){let M=Xl(i,y);Xt(i,M,y,y.$async)}function L(y){let M=t.scopeValue("schema",s.code.source===!0?{ref:y,code:(0,E.stringify)(y)}:{ref:y}),T=t.name("valid"),W=i.subschema({schema:y,dataTypes:[],schemaPath:E.nil,topSchemaRef:M,errSchemaPath:o},T);i.mergeEvaluated(W),i.ok(T)}}};function Xl(i,t){let{gen:o}=i;return t.validate?o.scopeValue("validate",{ref:t.validate}):E._`${o.scopeValue("wrapper",{ref:t})}.validate`}Yl.getValidate=Xl;function Xt(i,t,o,r){let{gen:$,it:l}=i,{allErrors:f,schemaEnv:s,opts:b}=l,n=b.passContext?Qi.default.this:E.nil;if(r)u();else I();function u(){if(!s.$async)throw Error("async schema referenced by sync schema");let y=$.let("valid");$.try(()=>{if($.code(E._`await ${(0,Bl.callValidateCode)(i,t,n)}`),L(t),!f)$.assign(y,!0)},(M)=>{if($.if(E._`!(${M} instanceof ${l.ValidationError})`,()=>$.throw(M)),q(M),!f)$.assign(y,!1)}),i.ok(y)}function I(){i.result((0,Bl.callValidateCode)(i,t,n),()=>L(t),()=>q(t))}function q(y){let M=E._`${y}.errors`;$.assign(Qi.default.vErrors,E._`${Qi.default.vErrors} === null ? ${M} : ${Qi.default.vErrors}.concat(${M})`),$.assign(Qi.default.errors,E._`${Qi.default.vErrors}.length`)}function L(y){var M;if(!l.opts.unevaluated)return;let T=(M=o===null||o===void 0?void 0:o.validate)===null||M===void 0?void 0:M.evaluated;if(l.props!==!0)if(T&&!T.dynamicProps){if(T.props!==void 0)l.props=Jt.mergeEvaluated.props($,T.props,l.props)}else{let W=$.var("props",E._`${y}.evaluated.props`);l.props=Jt.mergeEvaluated.props($,W,l.props,E.Name)}if(l.items!==!0)if(T&&!T.dynamicItems){if(T.items!==void 0)l.items=Jt.mergeEvaluated.items($,T.items,l.items)}else{let W=$.var("items",E._`${y}.evaluated.items`);l.items=Jt.mergeEvaluated.items($,W,l.items,E.Name)}}}Yl.callRef=Xt;Yl.default=E1});var zl=V((Al)=>{Object.defineProperty(Al,"__esModule",{value:!0});var c1=Zl(),R1=Yt(),S1=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",c1.default,R1.default];Al.default=S1});var Hl=V((Gl)=>{Object.defineProperty(Gl,"__esModule",{value:!0});var Qt=F(),ui=Qt.operators,At={maximum:{okStr:"<=",ok:ui.LTE,fail:ui.GT},minimum:{okStr:">=",ok:ui.GTE,fail:ui.LT},exclusiveMaximum:{okStr:"<",ok:ui.LT,fail:ui.GTE},exclusiveMinimum:{okStr:">",ok:ui.GT,fail:ui.LTE}},C1={message:({keyword:i,schemaCode:t})=>Qt.str`must be ${At[i].okStr} ${t}`,params:({keyword:i,schemaCode:t})=>Qt._`{comparison: ${At[i].okStr}, limit: ${t}}`},e1={keyword:Object.keys(At),type:"number",schemaType:"number",$data:!0,error:C1,code(i){let{keyword:t,data:o,schemaCode:r}=i;i.fail$data(Qt._`${o} ${At[t].fail} ${r} || isNaN(${o})`)}};Gl.default=e1});var dl=V((Dl)=>{Object.defineProperty(Dl,"__esModule",{value:!0});var hi=F(),g1={message:({schemaCode:i})=>hi.str`must be multiple of ${i}`,params:({schemaCode:i})=>hi._`{multipleOf: ${i}}`},x1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:g1,code(i){let{gen:t,data:o,schemaCode:r,it:$}=i,l=$.opts.multipleOfPrecision,f=t.let("res"),s=l?hi._`Math.abs(Math.round(${f}) - ${f}) > 1e-${l}`:hi._`${f} !== parseInt(${f})`;i.fail$data(hi._`(${r} === 0 || (${f} = ${o}/${r}, ${s}))`)}};Dl.default=x1});var Ul=V((vl)=>{Object.defineProperty(vl,"__esModule",{value:!0});function Kl(i){let t=i.length,o=0,r=0,$;while(r<t)if(o++,$=i.charCodeAt(r++),$>=55296&&$<=56319&&r<t){if($=i.charCodeAt(r),($&64512)===56320)r++}return o}vl.default=Kl;Kl.code='require("ajv/dist/runtime/ucs2length").default'});var El=V((Nl)=>{Object.defineProperty(Nl,"__esModule",{value:!0});var Wi=F(),a1=B(),iy=Ul(),ty={message({keyword:i,schemaCode:t}){let o=i==="maxLength"?"more":"fewer";return Wi.str`must NOT have ${o} than ${t} characters`},params:({schemaCode:i})=>Wi._`{limit: ${i}}`},oy={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:ty,code(i){let{keyword:t,data:o,schemaCode:r,it:$}=i,l=t==="maxLength"?Wi.operators.GT:Wi.operators.LT,f=$.opts.unicode===!1?Wi._`${o}.length`:Wi._`${(0,a1.useFunc)(i.gen,iy.default)}(${o})`;i.fail$data(Wi._`${f} ${l} ${r}`)}};Nl.default=oy});var Pl=V((pl)=>{Object.defineProperty(pl,"__esModule",{value:!0});var $y=R(),ly=B(),Ai=F(),fy={message:({schemaCode:i})=>Ai.str`must match pattern "${i}"`,params:({schemaCode:i})=>Ai._`{pattern: ${i}}`},sy={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:fy,code(i){let{gen:t,data:o,$data:r,schema:$,schemaCode:l,it:f}=i,s=f.opts.unicodeRegExp?"u":"";if(r){let{regExp:b}=f.opts.code,n=b.code==="new RegExp"?Ai._`new RegExp`:(0,ly.useFunc)(t,b),u=t.let("valid");t.try(()=>t.assign(u,Ai._`${n}(${l}, ${s}).test(${o})`),()=>t.assign(u,!1)),i.fail$data(Ai._`!${u}`)}else{let b=(0,$y.usePattern)(i,$);i.fail$data(Ai._`!${b}.test(${o})`)}}};pl.default=sy});var Rl=V((cl)=>{Object.defineProperty(cl,"__esModule",{value:!0});var gi=F(),ny={message({keyword:i,schemaCode:t}){let o=i==="maxProperties"?"more":"fewer";return gi.str`must NOT have ${o} than ${t} properties`},params:({schemaCode:i})=>gi._`{limit: ${i}}`},uy={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:ny,code(i){let{keyword:t,data:o,schemaCode:r}=i,$=t==="maxProperties"?gi.operators.GT:gi.operators.LT;i.fail$data(gi._`Object.keys(${o}).length ${$} ${r}`)}};cl.default=uy});var kl=V((Sl)=>{Object.defineProperty(Sl,"__esModule",{value:!0});var xi=R(),mi=F(),yy=B(),My={message:({params:{missingProperty:i}})=>mi.str`must have required property '${i}'`,params:({params:{missingProperty:i}})=>mi._`{missingProperty: ${i}}`},Vy={keyword:"required",type:"object",schemaType:"array",$data:!0,error:My,code(i){let{gen:t,schema:o,schemaCode:r,data:$,$data:l,it:f}=i,{opts:s}=f;if(!l&&o.length===0)return;let b=o.length>=s.loopRequired;if(f.allErrors)n();else u();if(s.strictRequired){let L=i.parentSchema.properties,{definedProperties:y}=i.it;for(let M of o)if((L===null||L===void 0?void 0:L[M])===void 0&&!y.has(M)){let T=f.schemaEnv.baseId+f.errSchemaPath,W=`required property "${M}" is not defined at "${T}" (strictRequired)`;(0,yy.checkStrictMode)(f,W,f.opts.strictRequired)}}function n(){if(b||l)i.block$data(mi.nil,I);else for(let L of o)(0,xi.checkReportMissingProp)(i,L)}function u(){let L=t.let("missing");if(b||l){let y=t.let("valid",!0);i.block$data(y,()=>q(L,y)),i.ok(y)}else t.if((0,xi.checkMissingProp)(i,o,L)),(0,xi.reportMissingProp)(i,L),t.else()}function I(){t.forOf("prop",r,(L)=>{i.setParams({missingProperty:L}),t.if((0,xi.noPropertyInData)(t,$,L,s.ownProperties),()=>i.error())})}function q(L,y){i.setParams({missingProperty:L}),t.forOf(L,r,()=>{t.assign(y,(0,xi.propertyInData)(t,$,L,s.ownProperties)),t.if((0,mi.not)(y),()=>{i.error(),t.break()})},mi.nil)}}};Sl.default=Vy});var el=V((Cl)=>{Object.defineProperty(Cl,"__esModule",{value:!0});var _i=F(),qy={message({keyword:i,schemaCode:t}){let o=i==="maxItems"?"more":"fewer";return _i.str`must NOT have ${o} than ${t} items`},params:({schemaCode:i})=>_i._`{limit: ${i}}`},Ty={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:qy,code(i){let{keyword:t,data:o,schemaCode:r}=i,$=t==="maxItems"?_i.operators.GT:_i.operators.LT;i.fail$data(_i._`${o}.length ${$} ${r}`)}};Cl.default=Ty});var zt=V((gl)=>{Object.defineProperty(gl,"__esModule",{value:!0});var hl=yo();hl.code='require("ajv/dist/runtime/equal").default';gl.default=hl});var ml=V((xl)=>{Object.defineProperty(xl,"__esModule",{value:!0});var Ao=Ui(),D=F(),wy=B(),jy=zt(),Fy={message:({params:{i,j:t}})=>D.str`must NOT have duplicate items (items ## ${t} and ${i} are identical)`,params:({params:{i,j:t}})=>D._`{i: ${i}, j: ${t}}`},Zy={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:Fy,code(i){let{gen:t,data:o,$data:r,schema:$,parentSchema:l,schemaCode:f,it:s}=i;if(!r&&!$)return;let b=t.let("valid"),n=l.items?(0,Ao.getSchemaTypes)(l.items):[];i.block$data(b,u,D._`${f} === false`),i.ok(b);function u(){let y=t.let("i",D._`${o}.length`),M=t.let("j");i.setParams({i:y,j:M}),t.assign(b,!0),t.if(D._`${y} > 1`,()=>(I()?q:L)(y,M))}function I(){return n.length>0&&!n.some((y)=>y==="object"||y==="array")}function q(y,M){let T=t.name("item"),W=(0,Ao.checkDataTypes)(n,T,s.opts.strictNumbers,Ao.DataType.Wrong),Y=t.const("indices",D._`{}`);t.for(D._`;${y}--;`,()=>{if(t.let(T,D._`${o}[${y}]`),t.if(W,D._`continue`),n.length>1)t.if(D._`typeof ${T} == "string"`,D._`${T} += "_"`);t.if(D._`typeof ${Y}[${T}] == "number"`,()=>{t.assign(M,D._`${Y}[${T}]`),i.error(),t.assign(b,!1).break()}).code(D._`${Y}[${T}] = ${y}`)})}function L(y,M){let T=(0,wy.useFunc)(t,jy.default),W=t.name("outer");t.label(W).for(D._`;${y}--;`,()=>t.for(D._`${M} = ${y}; ${M}--;`,()=>t.if(D._`${T}(${o}[${y}], ${o}[${M}])`,()=>{i.error(),t.assign(b,!1).break(W)})))}}};xl.default=Zy});var al=V((_l)=>{Object.defineProperty(_l,"__esModule",{value:!0});var zo=F(),Jy=B(),Xy=zt(),Yy={message:"must be equal to constant",params:({schemaCode:i})=>zo._`{allowedValue: ${i}}`},Qy={keyword:"const",$data:!0,error:Yy,code(i){let{gen:t,data:o,$data:r,schemaCode:$,schema:l}=i;if(r||l&&typeof l=="object")i.fail$data(zo._`!${(0,Jy.useFunc)(t,Xy.default)}(${o}, ${$})`);else i.fail(zo._`${l} !== ${o}`)}};_l.default=Qy});var of=V((tf)=>{Object.defineProperty(tf,"__esModule",{value:!0});var ai=F(),zy=B(),Gy=zt(),Hy={message:"must be equal to one of the allowed values",params:({schemaCode:i})=>ai._`{allowedValues: ${i}}`},Dy={keyword:"enum",schemaType:"array",$data:!0,error:Hy,code(i){let{gen:t,data:o,$data:r,schema:$,schemaCode:l,it:f}=i;if(!r&&$.length===0)throw Error("enum must have non-empty array");let s=$.length>=f.opts.loopEnum,b,n=()=>b!==null&&b!==void 0?b:b=(0,zy.useFunc)(t,Gy.default),u;if(s||r)u=t.let("valid"),i.block$data(u,I);else{if(!Array.isArray($))throw Error("ajv implementation error");let L=t.const("vSchema",l);u=(0,ai.or)(...$.map((y,M)=>q(L,M)))}i.pass(u);function I(){t.assign(u,!1),t.forOf("v",l,(L)=>t.if(ai._`${n()}(${o}, ${L})`,()=>t.assign(u,!0).break()))}function q(L,y){let M=$[y];return typeof M==="object"&&M!==null?ai._`${n()}(${o}, ${L}[${y}])`:ai._`${o} === ${M}`}}};tf.default=Dy});var $f=V((rf)=>{Object.defineProperty(rf,"__esModule",{value:!0});var Ky=Hl(),vy=dl(),Uy=El(),Ny=Pl(),Ey=Rl(),py=kl(),Py=el(),cy=ml(),Ry=al(),Sy=of(),ky=[Ky.default,vy.default,Uy.default,Ny.default,Ey.default,py.default,Py.default,cy.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},Ry.default,Sy.default];rf.default=ky});var Ho=V((ff)=>{Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var Oi=F(),Go=B(),ey={message:({params:{len:i}})=>Oi.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>Oi._`{limit: ${i}}`},hy={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:ey,code(i){let{parentSchema:t,it:o}=i,{items:r}=t;if(!Array.isArray(r)){(0,Go.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}lf(i,r)}};function lf(i,t){let{gen:o,schema:r,data:$,keyword:l,it:f}=i;f.items=!0;let s=o.const("len",Oi._`${$}.length`);if(r===!1)i.setParams({len:t.length}),i.pass(Oi._`${s} <= ${t.length}`);else if(typeof r=="object"&&!(0,Go.alwaysValidSchema)(f,r)){let n=o.var("valid",Oi._`${s} <= ${t.length}`);o.if((0,Oi.not)(n),()=>b(n)),i.ok(n)}function b(n){o.forRange("i",t.length,s,(u)=>{if(i.subschema({keyword:l,dataProp:u,dataPropType:Go.Type.Num},n),!f.allErrors)o.if((0,Oi.not)(n),()=>o.break())})}}ff.validateAdditionalItems=lf;ff.default=hy});var Do=V((uf)=>{Object.defineProperty(uf,"__esModule",{value:!0});uf.validateTuple=void 0;var bf=F(),Gt=B(),xy=R(),my={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:t,it:o}=i;if(Array.isArray(t))return nf(i,"additionalItems",t);if(o.items=!0,(0,Gt.alwaysValidSchema)(o,t))return;i.ok((0,xy.validateArray)(i))}};function nf(i,t,o=i.schema){let{gen:r,parentSchema:$,data:l,keyword:f,it:s}=i;if(u($),s.opts.unevaluated&&o.length&&s.items!==!0)s.items=Gt.mergeEvaluated.items(r,o.length,s.items);let b=r.name("valid"),n=r.const("len",bf._`${l}.length`);o.forEach((I,q)=>{if((0,Gt.alwaysValidSchema)(s,I))return;r.if(bf._`${n} > ${q}`,()=>i.subschema({keyword:f,schemaProp:q,dataProp:q},b)),i.ok(b)});function u(I){let{opts:q,errSchemaPath:L}=s,y=o.length,M=y===I.minItems&&(y===I.maxItems||I[t]===!1);if(q.strictTuples&&!M){let T=`"${f}" is ${y}-tuple, but minItems or maxItems/${t} are not specified or different at path "${L}"`;(0,Gt.checkStrictMode)(s,T,q.strictTuples)}}}uf.validateTuple=nf;uf.default=my});var Mf=V((yf)=>{Object.defineProperty(yf,"__esModule",{value:!0});var ay=Do(),iM={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(i)=>(0,ay.validateTuple)(i,"items")};yf.default=iM});var qf=V((Lf)=>{Object.defineProperty(Lf,"__esModule",{value:!0});var Vf=F(),oM=B(),rM=R(),$M=Ho(),lM={message:({params:{len:i}})=>Vf.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>Vf._`{limit: ${i}}`},fM={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:lM,code(i){let{schema:t,parentSchema:o,it:r}=i,{prefixItems:$}=o;if(r.items=!0,(0,oM.alwaysValidSchema)(r,t))return;if($)(0,$M.validateAdditionalItems)(i,$);else i.ok((0,rM.validateArray)(i))}};Lf.default=fM});var Wf=V((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});var S=F(),Ht=B(),bM={message:({params:{min:i,max:t}})=>t===void 0?S.str`must contain at least ${i} valid item(s)`:S.str`must contain at least ${i} and no more than ${t} valid item(s)`,params:({params:{min:i,max:t}})=>t===void 0?S._`{minContains: ${i}}`:S._`{minContains: ${i}, maxContains: ${t}}`},nM={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:bM,code(i){let{gen:t,schema:o,parentSchema:r,data:$,it:l}=i,f,s,{minContains:b,maxContains:n}=r;if(l.opts.next)f=b===void 0?1:b,s=n;else f=1;let u=t.const("len",S._`${$}.length`);if(i.setParams({min:f,max:s}),s===void 0&&f===0){(0,Ht.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&f>s){(0,Ht.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,Ht.alwaysValidSchema)(l,o)){let M=S._`${u} >= ${f}`;if(s!==void 0)M=S._`${M} && ${u} <= ${s}`;i.pass(M);return}l.items=!0;let I=t.name("valid");if(s===void 0&&f===1)L(I,()=>t.if(I,()=>t.break()));else if(f===0){if(t.let(I,!0),s!==void 0)t.if(S._`${$}.length > 0`,q)}else t.let(I,!1),q();i.result(I,()=>i.reset());function q(){let M=t.name("_valid"),T=t.let("count",0);L(M,()=>t.if(M,()=>y(T)))}function L(M,T){t.forRange("i",0,u,(W)=>{i.subschema({keyword:"contains",dataProp:W,dataPropType:Ht.Type.Num,compositeRule:!0},M),T()})}function y(M){if(t.code(S._`${M}++`),s===void 0)t.if(S._`${M} >= ${f}`,()=>t.assign(I,!0).break());else if(t.if(S._`${M} > ${s}`,()=>t.assign(I,!1).break()),f===1)t.assign(I,!0);else t.if(S._`${M} >= ${f}`,()=>t.assign(I,!0))}}};Tf.default=nM});var Dt=V((jf)=>{Object.defineProperty(jf,"__esModule",{value:!0});jf.validateSchemaDeps=jf.validatePropertyDeps=jf.error=void 0;var Ko=F(),IM=B(),it=R();jf.error={message:({params:{property:i,depsCount:t,deps:o}})=>{let r=t===1?"property":"properties";return Ko.str`must have ${r} ${o} when property ${i} is present`},params:({params:{property:i,depsCount:t,deps:o,missingProperty:r}})=>Ko._`{property: ${i},
3
+ var zn=Object.create;var{getPrototypeOf:Qn,defineProperty:xo,getOwnPropertyNames:Gn}=Object;var Hn=Object.prototype.hasOwnProperty;function Dn(t){return this[t]}var vn,Kn,Un=(t,i,o)=>{var r=t!=null&&typeof t==="object";if(r){var $=i?vn??=new WeakMap:Kn??=new WeakMap,l=$.get(t);if(l)return l}o=t!=null?zn(Qn(t)):{};let f=i||!t||!t.__esModule?xo(o,"default",{value:t,enumerable:!0}):o;for(let s of Gn(t))if(!Hn.call(f,s))xo(f,s,{get:Dn.bind(t,s),enumerable:!0});if(r)$.set(t,f);return f};var M=(t,i)=>()=>(i||t((i={exports:{}}).exports,i),i.exports);var Qt=M((rr)=>{Object.defineProperty(rr,"__esModule",{value:!0});rr.regexpCode=rr.getEsmExportName=rr.getProperty=rr.safeStringify=rr.stringify=rr.strConcat=rr.addCodeArg=rr.str=rr._=rr.nil=rr._Code=rr.Name=rr.IDENTIFIER=rr._CodeOrName=void 0;class oi{}rr._CodeOrName=oi;rr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Tt extends oi{constructor(t){super();if(!rr.IDENTIFIER.test(t))throw Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}rr.Name=Tt;class k extends oi{constructor(t){super();this._items=typeof t==="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((i,o)=>`${i}${o}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((i,o)=>{if(o instanceof Tt)i[o.str]=(i[o.str]||0)+1;return i},{})}}rr._Code=k;rr.nil=new k("");function ir(t,...i){let o=[t[0]],r=0;while(r<i.length)Ci(o,i[r]),o.push(t[++r]);return new k(o)}rr._=ir;var ki=new k("+");function or(t,...i){let o=[zt(t[0])],r=0;while(r<i.length)o.push(ki),Ci(o,i[r]),o.push(ki,zt(t[++r]));return En(o),new k(o)}rr.str=or;function Ci(t,i){if(i instanceof k)t.push(...i._items);else if(i instanceof Tt)t.push(i);else t.push(kn(i))}rr.addCodeArg=Ci;function En(t){let i=1;while(i<t.length-1){if(t[i]===ki){let o=Rn(t[i-1],t[i+1]);if(o!==void 0){t.splice(i-1,3,o);continue}t[i++]="+"}i++}}function Rn(t,i){if(i==='""')return t;if(t==='""')return i;if(typeof t=="string"){if(i instanceof Tt||t[t.length-1]!=='"')return;if(typeof i!="string")return`${t.slice(0,-1)}${i}"`;if(i[0]==='"')return t.slice(0,-1)+i.slice(1);return}if(typeof i=="string"&&i[0]==='"'&&!(t instanceof Tt))return`"${t}${i.slice(1)}`;return}function Sn(t,i){return i.emptyStr()?t:t.emptyStr()?i:or`${t}${i}`}rr.strConcat=Sn;function kn(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:zt(Array.isArray(t)?t.join(","):t)}function Cn(t){return new k(zt(t))}rr.stringify=Cn;function zt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}rr.safeStringify=zt;function hn(t){return typeof t=="string"&&rr.IDENTIFIER.test(t)?new k(`.${t}`):ir`[${t}]`}rr.getProperty=hn;function gn(t){if(typeof t=="string"&&rr.IDENTIFIER.test(t))return new k(`${t}`);throw Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}rr.getEsmExportName=gn;function mn(t){return new k(t.toString())}rr.regexpCode=mn});var xi=M((sr)=>{Object.defineProperty(sr,"__esModule",{value:!0});sr.ValueScope=sr.ValueScopeName=sr.Scope=sr.varKinds=sr.UsedValueState=void 0;var v=Qt();class lr extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`);this.value=t.value}}var $i;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})($i||(sr.UsedValueState=$i={}));sr.varKinds={const:new v.Name("const"),let:new v.Name("let"),var:new v.Name("var")};class gi{constructor({prefixes:t,parent:i}={}){this._names={},this._prefixes=t,this._parent=i}toName(t){return t instanceof v.Name?t:this.name(t)}name(t){return new v.Name(this._newName(t))}_newName(t){let i=this._names[t]||this._nameGroup(t);return`${t}${i.index++}`}_nameGroup(t){var i,o;if(((o=(i=this._parent)===null||i===void 0?void 0:i._prefixes)===null||o===void 0?void 0:o.has(t))||this._prefixes&&!this._prefixes.has(t))throw Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}}sr.Scope=gi;class mi extends v.Name{constructor(t,i){super(i);this.prefix=t}setValue(t,{property:i,itemIndex:o}){this.value=t,this.scopePath=v._`.${new v.Name(i)}[${o}]`}}sr.ValueScopeName=mi;var bb=v._`\n`;class fr extends gi{constructor(t){super(t);this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?bb:v.nil}}get(){return this._scope}name(t){return new mi(t,this._newName(t))}value(t,i){var o;if(i.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(t),{prefix:$}=r,l=(o=i.key)!==null&&o!==void 0?o:i.ref,f=this._values[$];if(f){let b=f.get(l);if(b)return b}else f=this._values[$]=new Map;f.set(l,r);let s=this._scope[$]||(this._scope[$]=[]),n=s.length;return s[n]=i.ref,r.setValue(i,{property:$,itemIndex:n}),r}getValue(t,i){let o=this._values[t];if(!o)return;return o.get(i)}scopeRefs(t,i=this._values){return this._reduceValues(i,(o)=>{if(o.scopePath===void 0)throw Error(`CodeGen: name "${o}" has no value`);return v._`${t}${o.scopePath}`})}scopeCode(t=this._values,i,o){return this._reduceValues(t,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},i,o)}_reduceValues(t,i,o={},r){let $=v.nil;for(let l in t){let f=t[l];if(!f)continue;let s=o[l]=o[l]||new Map;f.forEach((n)=>{if(s.has(n))return;s.set(n,$i.Started);let b=i(n);if(b){let u=this.opts.es5?sr.varKinds.var:sr.varKinds.const;$=v._`${$}${u} ${n} = ${b};${this.opts._n}`}else if(b=r===null||r===void 0?void 0:r(n))$=v._`${$}${b}${this.opts._n}`;else throw new lr(n);s.set(n,$i.Completed)})}return $}}sr.ValueScope=fr});var O=M((K)=>{Object.defineProperty(K,"__esModule",{value:!0});K.or=K.and=K.not=K.CodeGen=K.operators=K.varKinds=K.ValueScopeName=K.ValueScope=K.Scope=K.Name=K.regexpCode=K.stringify=K.getProperty=K.nil=K.strConcat=K.str=K._=void 0;var F=Qt(),C=xi(),lt=Qt();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return lt._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return lt.str}});Object.defineProperty(K,"strConcat",{enumerable:!0,get:function(){return lt.strConcat}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return lt.nil}});Object.defineProperty(K,"getProperty",{enumerable:!0,get:function(){return lt.getProperty}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return lt.stringify}});Object.defineProperty(K,"regexpCode",{enumerable:!0,get:function(){return lt.regexpCode}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return lt.Name}});var ui=xi();Object.defineProperty(K,"Scope",{enumerable:!0,get:function(){return ui.Scope}});Object.defineProperty(K,"ValueScope",{enumerable:!0,get:function(){return ui.ValueScope}});Object.defineProperty(K,"ValueScopeName",{enumerable:!0,get:function(){return ui.ValueScopeName}});Object.defineProperty(K,"varKinds",{enumerable:!0,get:function(){return ui.varKinds}});K.operators={GT:new F._Code(">"),GTE:new F._Code(">="),LT:new F._Code("<"),LTE:new F._Code("<="),EQ:new F._Code("==="),NEQ:new F._Code("!=="),NOT:new F._Code("!"),OR:new F._Code("||"),AND:new F._Code("&&"),ADD:new F._Code("+")};class ft{optimizeNodes(){return this}optimizeNames(t,i){return this}}class br extends ft{constructor(t,i,o){super();this.varKind=t,this.name=i,this.rhs=o}render({es5:t,_n:i}){let o=t?C.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${o} ${this.name}${r};`+i}optimizeNames(t,i){if(!t[this.name.str])return;if(this.rhs)this.rhs=Wt(this.rhs,t,i);return this}get names(){return this.rhs instanceof F._CodeOrName?this.rhs.names:{}}}class to extends ft{constructor(t,i,o){super();this.lhs=t,this.rhs=i,this.sideEffects=o}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,i){if(this.lhs instanceof F.Name&&!t[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Wt(this.rhs,t,i),this}get names(){let t=this.lhs instanceof F.Name?{}:{...this.lhs.names};return bi(t,this.rhs)}}class ur extends to{constructor(t,i,o,r){super(t,o,r);this.op=i}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}}class Ir extends ft{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}}class yr extends ft{constructor(t){super();this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}}class er extends ft{constructor(t){super();this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}}class Mr extends ft{constructor(t){super();this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,i){return this.code=Wt(this.code,t,i),this}get names(){return this.code instanceof F._CodeOrName?this.code.names:{}}}class Ii extends ft{constructor(t=[]){super();this.nodes=t}render(t){return this.nodes.reduce((i,o)=>i+o.render(t),"")}optimizeNodes(){let{nodes:t}=this,i=t.length;while(i--){let o=t[i].optimizeNodes();if(Array.isArray(o))t.splice(i,1,...o);else if(o)t[i]=o;else t.splice(i,1)}return t.length>0?this:void 0}optimizeNames(t,i){let{nodes:o}=this,r=o.length;while(r--){let $=o[r];if($.optimizeNames(t,i))continue;eb(t,$.names),o.splice(r,1)}return o.length>0?this:void 0}get names(){return this.nodes.reduce((t,i)=>et(t,i.names),{})}}class st extends Ii{render(t){return"{"+t._n+super.render(t)+"}"+t._n}}class dr extends Ii{}class Gt extends st{}Gt.kind="else";class ot extends st{constructor(t,i){super(i);this.condition=t}render(t){let i=`if(${this.condition})`+super.render(t);if(this.else)i+="else "+this.else.render(t);return i}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let i=this.else;if(i){let o=i.optimizeNodes();i=this.else=Array.isArray(o)?new Gt(o):o}if(i){if(t===!1)return i instanceof ot?i:i.nodes;if(this.nodes.length)return this;return new ot(qr(t),i instanceof ot?[i]:i.nodes)}if(t===!1||!this.nodes.length)return;return this}optimizeNames(t,i){var o;if(this.else=(o=this.else)===null||o===void 0?void 0:o.optimizeNames(t,i),!(super.optimizeNames(t,i)||this.else))return;return this.condition=Wt(this.condition,t,i),this}get names(){let t=super.names;if(bi(t,this.condition),this.else)et(t,this.else.names);return t}}ot.kind="if";class Ot extends st{}Ot.kind="for";class Vr extends Ot{constructor(t){super();this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iteration=Wt(this.iteration,t,i),this}get names(){return et(super.names,this.iteration.names)}}class cr extends Ot{constructor(t,i,o,r){super();this.varKind=t,this.name=i,this.from=o,this.to=r}render(t){let i=t.es5?C.varKinds.var:this.varKind,{name:o,from:r,to:$}=this;return`for(${i} ${o}=${r}; ${o}<${$}; ${o}++)`+super.render(t)}get names(){let t=bi(super.names,this.from);return bi(t,this.to)}}class ai extends Ot{constructor(t,i,o,r){super();this.loop=t,this.varKind=i,this.name=o,this.iterable=r}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,i){if(!super.optimizeNames(t,i))return;return this.iterable=Wt(this.iterable,t,i),this}get names(){return et(super.names,this.iterable.names)}}class li extends st{constructor(t,i,o){super();this.name=t,this.args=i,this.async=o}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}}li.kind="func";class fi extends Ii{render(t){return"return "+super.render(t)}}fi.kind="return";class pr extends st{render(t){let i="try"+super.render(t);if(this.catch)i+=this.catch.render(t);if(this.finally)i+=this.finally.render(t);return i}optimizeNodes(){var t,i;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(i=this.finally)===null||i===void 0||i.optimizeNodes(),this}optimizeNames(t,i){var o,r;return super.optimizeNames(t,i),(o=this.catch)===null||o===void 0||o.optimizeNames(t,i),(r=this.finally)===null||r===void 0||r.optimizeNames(t,i),this}get names(){let t=super.names;if(this.catch)et(t,this.catch.names);if(this.finally)et(t,this.finally.names);return t}}class si extends st{constructor(t){super();this.error=t}render(t){return`catch(${this.error})`+super.render(t)}}si.kind="catch";class ni extends st{render(t){return"finally"+super.render(t)}}ni.kind="finally";class Lr{constructor(t,i={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...i,_n:i.lines?`
4
+ `:""},this._extScope=t,this._scope=new C.Scope({parent:t}),this._nodes=[new dr]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,i){let o=this._extScope.value(t,i);return(this._values[o.prefix]||(this._values[o.prefix]=new Set)).add(o),o}getScopeValue(t,i){return this._extScope.getValue(t,i)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,i,o,r){let $=this._scope.toName(i);if(o!==void 0&&r)this._constants[$.str]=o;return this._leafNode(new br(t,$,o)),$}const(t,i,o){return this._def(C.varKinds.const,t,i,o)}let(t,i,o){return this._def(C.varKinds.let,t,i,o)}var(t,i,o){return this._def(C.varKinds.var,t,i,o)}assign(t,i,o){return this._leafNode(new to(t,i,o))}add(t,i){return this._leafNode(new ur(t,K.operators.ADD,i))}code(t){if(typeof t=="function")t();else if(t!==F.nil)this._leafNode(new Mr(t));return this}object(...t){let i=["{"];for(let[o,r]of t){if(i.length>1)i.push(",");if(i.push(o),o!==r||this.opts.es5)i.push(":"),(0,F.addCodeArg)(i,r)}return i.push("}"),new F._Code(i)}if(t,i,o){if(this._blockNode(new ot(t)),i&&o)this.code(i).else().code(o).endIf();else if(i)this.code(i).endIf();else if(o)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new ot(t))}else(){return this._elseNode(new Gt)}endIf(){return this._endBlockNode(ot,Gt)}_for(t,i){if(this._blockNode(t),i)this.code(i).endFor();return this}for(t,i){return this._for(new Vr(t),i)}forRange(t,i,o,r,$=this.opts.es5?C.varKinds.var:C.varKinds.let){let l=this._scope.toName(t);return this._for(new cr($,l,i,o),()=>r(l))}forOf(t,i,o,r=C.varKinds.const){let $=this._scope.toName(t);if(this.opts.es5){let l=i instanceof F.Name?i:this.var("_arr",i);return this.forRange("_i",0,F._`${l}.length`,(f)=>{this.var($,F._`${l}[${f}]`),o($)})}return this._for(new ai("of",r,$,i),()=>o($))}forIn(t,i,o,r=this.opts.es5?C.varKinds.var:C.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,F._`Object.keys(${i})`,o);let $=this._scope.toName(t);return this._for(new ai("in",r,$,i),()=>o($))}endFor(){return this._endBlockNode(Ot)}label(t){return this._leafNode(new Ir(t))}break(t){return this._leafNode(new yr(t))}return(t){let i=new fi;if(this._blockNode(i),this.code(t),i.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(fi)}try(t,i,o){if(!i&&!o)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new pr;if(this._blockNode(r),this.code(t),i){let $=this.name("e");this._currNode=r.catch=new si($),i($)}if(o)this._currNode=r.finally=new ni,this.code(o);return this._endBlockNode(si,ni)}throw(t){return this._leafNode(new er(t))}block(t,i){if(this._blockStarts.push(this._nodes.length),t)this.code(t).endBlock(i);return this}endBlock(t){let i=this._blockStarts.pop();if(i===void 0)throw Error("CodeGen: not in self-balancing block");let o=this._nodes.length-i;if(o<0||t!==void 0&&o!==t)throw Error(`CodeGen: wrong number of nodes: ${o} vs ${t} expected`);return this._nodes.length=i,this}func(t,i=F.nil,o,r){if(this._blockNode(new li(t,i,o)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(li)}optimize(t=1){while(t-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,i){let o=this._currNode;if(o instanceof t||i&&o instanceof i)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${i?`${t.kind}/${i.kind}`:t.kind}"`)}_elseNode(t){let i=this._currNode;if(!(i instanceof ot))throw Error('CodeGen: "else" without "if"');return this._currNode=i.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let i=this._nodes;i[i.length-1]=t}}K.CodeGen=Lr;function et(t,i){for(let o in i)t[o]=(t[o]||0)+(i[o]||0);return t}function bi(t,i){return i instanceof F._CodeOrName?et(t,i.names):t}function Wt(t,i,o){if(t instanceof F.Name)return r(t);if(!$(t))return t;return new F._Code(t._items.reduce((l,f)=>{if(f instanceof F.Name)f=r(f);if(f instanceof F._Code)l.push(...f._items);else l.push(f);return l},[]));function r(l){let f=o[l.str];if(f===void 0||i[l.str]!==1)return l;return delete i[l.str],f}function $(l){return l instanceof F._Code&&l._items.some((f)=>f instanceof F.Name&&i[f.str]===1&&o[f.str]!==void 0)}}function eb(t,i){for(let o in i)t[o]=(t[o]||0)-(i[o]||0)}function qr(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:F._`!${_i(t)}`}K.not=qr;var Mb=Tr(K.operators.AND);function db(...t){return t.reduce(Mb)}K.and=db;var Vb=Tr(K.operators.OR);function cb(...t){return t.reduce(Vb)}K.or=cb;function Tr(t){return(i,o)=>i===F.nil?o:o===F.nil?i:F._`${_i(i)} ${t} ${_i(o)}`}function _i(t){return t instanceof F.Name?t:F._`(${t})`}});var j=M((Xr)=>{Object.defineProperty(Xr,"__esModule",{value:!0});Xr.checkStrictMode=Xr.getErrorPath=Xr.Type=Xr.useFunc=Xr.setEvaluated=Xr.evaluatedPropsToName=Xr.mergeEvaluated=Xr.eachItem=Xr.unescapeJsonPointer=Xr.escapeJsonPointer=Xr.escapeFragment=Xr.unescapeFragment=Xr.schemaRefOrVal=Xr.schemaHasRulesButRef=Xr.schemaHasRules=Xr.checkUnknownRules=Xr.alwaysValidSchema=Xr.toHash=void 0;var J=O(),Tb=Qt();function Ob(t){let i={};for(let o of t)i[o]=!0;return i}Xr.toHash=Ob;function Wb(t,i){if(typeof i=="boolean")return i;if(Object.keys(i).length===0)return!0;return wr(t,i),!Fr(i,t.self.RULES.all)}Xr.alwaysValidSchema=Wb;function wr(t,i=t.schema){let{opts:o,self:r}=t;if(!o.strictSchema)return;if(typeof i==="boolean")return;let $=r.RULES.keywords;for(let l in i)if(!$[l])Jr(t,`unknown keyword: "${l}"`)}Xr.checkUnknownRules=wr;function Fr(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(i[o])return!0;return!1}Xr.schemaHasRules=Fr;function jb(t,i){if(typeof t=="boolean")return!t;for(let o in t)if(o!=="$ref"&&i.all[o])return!0;return!1}Xr.schemaHasRulesButRef=jb;function wb({topSchemaRef:t,schemaPath:i},o,r,$){if(!$){if(typeof o=="number"||typeof o=="boolean")return o;if(typeof o=="string")return J._`${o}`}return J._`${t}${i}${(0,J.getProperty)(r)}`}Xr.schemaRefOrVal=wb;function Fb(t){return Zr(decodeURIComponent(t))}Xr.unescapeFragment=Fb;function Zb(t){return encodeURIComponent(oo(t))}Xr.escapeFragment=Zb;function oo(t){if(typeof t=="number")return`${t}`;return t.replace(/~/g,"~0").replace(/\//g,"~1")}Xr.escapeJsonPointer=oo;function Zr(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}Xr.unescapeJsonPointer=Zr;function Bb(t,i){if(Array.isArray(t))for(let o of t)i(o);else i(t)}Xr.eachItem=Bb;function Wr({mergeNames:t,mergeToName:i,mergeValues:o,resultToName:r}){return($,l,f,s)=>{let n=f===void 0?l:f instanceof J.Name?(l instanceof J.Name?t($,l,f):i($,l,f),f):l instanceof J.Name?(i($,f,l),l):o(l,f);return s===J.Name&&!(n instanceof J.Name)?r($,n):n}}Xr.mergeEvaluated={props:Wr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>{t.if(J._`${i} === true`,()=>t.assign(o,!0),()=>t.assign(o,J._`${o} || {}`).code(J._`Object.assign(${o}, ${i})`))}),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>{if(i===!0)t.assign(o,!0);else t.assign(o,J._`${o} || {}`),ro(t,o,i)}),mergeValues:(t,i)=>t===!0?!0:{...t,...i},resultToName:Br}),items:Wr({mergeNames:(t,i,o)=>t.if(J._`${o} !== true && ${i} !== undefined`,()=>t.assign(o,J._`${i} === true ? true : ${o} > ${i} ? ${o} : ${i}`)),mergeToName:(t,i,o)=>t.if(J._`${o} !== true`,()=>t.assign(o,i===!0?!0:J._`${o} > ${i} ? ${o} : ${i}`)),mergeValues:(t,i)=>t===!0?!0:Math.max(t,i),resultToName:(t,i)=>t.var("items",i)})};function Br(t,i){if(i===!0)return t.var("props",!0);let o=t.var("props",J._`{}`);if(i!==void 0)ro(t,o,i);return o}Xr.evaluatedPropsToName=Br;function ro(t,i,o){Object.keys(o).forEach((r)=>t.assign(J._`${i}${(0,J.getProperty)(r)}`,!0))}Xr.setEvaluated=ro;var jr={};function Jb(t,i){return t.scopeValue("func",{ref:i,code:jr[i.code]||(jr[i.code]=new Tb._Code(i.code))})}Xr.useFunc=Jb;var io;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(io||(Xr.Type=io={}));function Xb(t,i,o){if(t instanceof J.Name){let r=i===io.Num;return o?r?J._`"[" + ${t} + "]"`:J._`"['" + ${t} + "']"`:r?J._`"/" + ${t}`:J._`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return o?(0,J.getProperty)(t).toString():"/"+oo(t)}Xr.getErrorPath=Xb;function Jr(t,i,o=t.opts.strictSchema){if(!o)return;if(i=`strict mode: ${i}`,o===!0)throw Error(i);t.self.logger.warn(i)}Xr.checkStrictMode=Jr});var P=M((Ar)=>{Object.defineProperty(Ar,"__esModule",{value:!0});var Q=O(),hb={data:new Q.Name("data"),valCxt:new Q.Name("valCxt"),instancePath:new Q.Name("instancePath"),parentData:new Q.Name("parentData"),parentDataProperty:new Q.Name("parentDataProperty"),rootData:new Q.Name("rootData"),dynamicAnchors:new Q.Name("dynamicAnchors"),vErrors:new Q.Name("vErrors"),errors:new Q.Name("errors"),this:new Q.Name("this"),self:new Q.Name("self"),scope:new Q.Name("scope"),json:new Q.Name("json"),jsonPos:new Q.Name("jsonPos"),jsonLen:new Q.Name("jsonLen"),jsonPart:new Q.Name("jsonPart")};Ar.default=hb});var Ht=M((Hr)=>{Object.defineProperty(Hr,"__esModule",{value:!0});Hr.extendErrors=Hr.resetErrorsCount=Hr.reportExtraError=Hr.reportError=Hr.keyword$DataError=Hr.keywordError=void 0;var B=O(),ei=j(),G=P();Hr.keywordError={message:({keyword:t})=>B.str`must pass "${t}" keyword validation`};Hr.keyword$DataError={message:({keyword:t,schemaType:i})=>i?B.str`"${t}" keyword must be ${i} ($data)`:B.str`"${t}" keyword is invalid ($data)`};function mb(t,i=Hr.keywordError,o,r){let{it:$}=t,{gen:l,compositeRule:f,allErrors:s}=$,n=Gr(t,i,o);if(r!==null&&r!==void 0?r:f||s)zr(l,n);else Qr($,B._`[${n}]`)}Hr.reportError=mb;function xb(t,i=Hr.keywordError,o){let{it:r}=t,{gen:$,compositeRule:l,allErrors:f}=r,s=Gr(t,i,o);if(zr($,s),!(l||f))Qr(r,G.default.vErrors)}Hr.reportExtraError=xb;function ab(t,i){t.assign(G.default.errors,i),t.if(B._`${G.default.vErrors} !== null`,()=>t.if(i,()=>t.assign(B._`${G.default.vErrors}.length`,i),()=>t.assign(G.default.vErrors,null)))}Hr.resetErrorsCount=ab;function _b({gen:t,keyword:i,schemaValue:o,data:r,errsCount:$,it:l}){if($===void 0)throw Error("ajv implementation error");let f=t.name("err");t.forRange("i",$,G.default.errors,(s)=>{if(t.const(f,B._`${G.default.vErrors}[${s}]`),t.if(B._`${f}.instancePath === undefined`,()=>t.assign(B._`${f}.instancePath`,(0,B.strConcat)(G.default.instancePath,l.errorPath))),t.assign(B._`${f}.schemaPath`,B.str`${l.errSchemaPath}/${i}`),l.opts.verbose)t.assign(B._`${f}.schema`,o),t.assign(B._`${f}.data`,r)})}Hr.extendErrors=_b;function zr(t,i){let o=t.const("err",i);t.if(B._`${G.default.vErrors} === null`,()=>t.assign(G.default.vErrors,B._`[${o}]`),B._`${G.default.vErrors}.push(${o})`),t.code(B._`${G.default.errors}++`)}function Qr(t,i){let{gen:o,validateName:r,schemaEnv:$}=t;if($.$async)o.throw(B._`new ${t.ValidationError}(${i})`);else o.assign(B._`${r}.errors`,i),o.return(!1)}var Mt={keyword:new B.Name("keyword"),schemaPath:new B.Name("schemaPath"),params:new B.Name("params"),propertyName:new B.Name("propertyName"),message:new B.Name("message"),schema:new B.Name("schema"),parentSchema:new B.Name("parentSchema")};function Gr(t,i,o){let{createErrors:r}=t.it;if(r===!1)return B._`{}`;return tu(t,i,o)}function tu(t,i,o={}){let{gen:r,it:$}=t,l=[iu($,o),ou(t,o)];return ru(t,i,l),r.object(...l)}function iu({errorPath:t},{instancePath:i}){let o=i?B.str`${t}${(0,ei.getErrorPath)(i,ei.Type.Str)}`:t;return[G.default.instancePath,(0,B.strConcat)(G.default.instancePath,o)]}function ou({keyword:t,it:{errSchemaPath:i}},{schemaPath:o,parentSchema:r}){let $=r?i:B.str`${i}/${t}`;if(o)$=B.str`${$}${(0,ei.getErrorPath)(o,ei.Type.Str)}`;return[Mt.schemaPath,$]}function ru(t,{params:i,message:o},r){let{keyword:$,data:l,schemaValue:f,it:s}=t,{opts:n,propertyName:b,topSchemaRef:u,schemaPath:I}=s;if(r.push([Mt.keyword,$],[Mt.params,typeof i=="function"?i(t):i||B._`{}`]),n.messages)r.push([Mt.message,typeof o=="function"?o(t):o]);if(n.verbose)r.push([Mt.schema,f],[Mt.parentSchema,B._`${u}${I}`],[G.default.data,l]);if(b)r.push([Mt.propertyName,b])}});var Nr=M((Kr)=>{Object.defineProperty(Kr,"__esModule",{value:!0});Kr.boolOrEmptySchema=Kr.topBoolOrEmptySchema=void 0;var nu=Ht(),bu=O(),uu=P(),Iu={message:"boolean schema is false"};function yu(t){let{gen:i,schema:o,validateName:r}=t;if(o===!1)vr(t,!1);else if(typeof o=="object"&&o.$async===!0)i.return(uu.default.data);else i.assign(bu._`${r}.errors`,null),i.return(!0)}Kr.topBoolOrEmptySchema=yu;function eu(t,i){let{gen:o,schema:r}=t;if(r===!1)o.var(i,!1),vr(t);else o.var(i,!0)}Kr.boolOrEmptySchema=eu;function vr(t,i){let{gen:o,data:r}=t,$={gen:o,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,nu.reportError)($,Iu,void 0,i)}});var lo=M((Pr)=>{Object.defineProperty(Pr,"__esModule",{value:!0});Pr.getRules=Pr.isJSONType=void 0;var du=["string","number","integer","boolean","null","object","array"],Vu=new Set(du);function cu(t){return typeof t=="string"&&Vu.has(t)}Pr.isJSONType=cu;function pu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Pr.getRules=pu});var fo=M((kr)=>{Object.defineProperty(kr,"__esModule",{value:!0});kr.shouldUseRule=kr.shouldUseGroup=kr.schemaHasRulesForType=void 0;function qu({schema:t,self:i},o){let r=i.RULES.types[o];return r&&r!==!0&&Rr(t,r)}kr.schemaHasRulesForType=qu;function Rr(t,i){return i.rules.some((o)=>Sr(t,o))}kr.shouldUseGroup=Rr;function Sr(t,i){var o;return t[i.keyword]!==void 0||((o=i.definition.implements)===null||o===void 0?void 0:o.some((r)=>t[r]!==void 0))}kr.shouldUseRule=Sr});var Dt=M((xr)=>{Object.defineProperty(xr,"__esModule",{value:!0});xr.reportTypeError=xr.checkDataTypes=xr.checkDataType=xr.coerceAndCheckDataType=xr.getJSONTypes=xr.getSchemaTypes=xr.DataType=void 0;var Wu=lo(),ju=fo(),wu=Ht(),W=O(),hr=j(),jt;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(jt||(xr.DataType=jt={}));function Fu(t){let i=gr(t.type);if(i.includes("null")){if(t.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!i.length&&t.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(t.nullable===!0)i.push("null")}return i}xr.getSchemaTypes=Fu;function gr(t){let i=Array.isArray(t)?t:t?[t]:[];if(i.every(Wu.isJSONType))return i;throw Error("type must be JSONType or JSONType[]: "+i.join(","))}xr.getJSONTypes=gr;function Zu(t,i){let{gen:o,data:r,opts:$}=t,l=Bu(i,$.coerceTypes),f=i.length>0&&!(l.length===0&&i.length===1&&(0,ju.schemaHasRulesForType)(t,i[0]));if(f){let s=no(i,r,$.strictNumbers,jt.Wrong);o.if(s,()=>{if(l.length)Ju(t,i,l);else bo(t)})}return f}xr.coerceAndCheckDataType=Zu;var mr=new Set(["string","number","integer","boolean","null"]);function Bu(t,i){return i?t.filter((o)=>mr.has(o)||i==="array"&&o==="array"):[]}function Ju(t,i,o){let{gen:r,data:$,opts:l}=t,f=r.let("dataType",W._`typeof ${$}`),s=r.let("coerced",W._`undefined`);if(l.coerceTypes==="array")r.if(W._`${f} == 'object' && Array.isArray(${$}) && ${$}.length == 1`,()=>r.assign($,W._`${$}[0]`).assign(f,W._`typeof ${$}`).if(no(i,$,l.strictNumbers),()=>r.assign(s,$)));r.if(W._`${s} !== undefined`);for(let b of o)if(mr.has(b)||b==="array"&&l.coerceTypes==="array")n(b);r.else(),bo(t),r.endIf(),r.if(W._`${s} !== undefined`,()=>{r.assign($,s),Xu(t,s)});function n(b){switch(b){case"string":r.elseIf(W._`${f} == "number" || ${f} == "boolean"`).assign(s,W._`"" + ${$}`).elseIf(W._`${$} === null`).assign(s,W._`""`);return;case"number":r.elseIf(W._`${f} == "boolean" || ${$} === null
5
+ || (${f} == "string" && ${$} && ${$} == +${$})`).assign(s,W._`+${$}`);return;case"integer":r.elseIf(W._`${f} === "boolean" || ${$} === null
6
+ || (${f} === "string" && ${$} && ${$} == +${$} && !(${$} % 1))`).assign(s,W._`+${$}`);return;case"boolean":r.elseIf(W._`${$} === "false" || ${$} === 0 || ${$} === null`).assign(s,!1).elseIf(W._`${$} === "true" || ${$} === 1`).assign(s,!0);return;case"null":r.elseIf(W._`${$} === "" || ${$} === 0 || ${$} === false`),r.assign(s,null);return;case"array":r.elseIf(W._`${f} === "string" || ${f} === "number"
7
+ || ${f} === "boolean" || ${$} === null`).assign(s,W._`[${$}]`)}}}function Xu({gen:t,parentData:i,parentDataProperty:o},r){t.if(W._`${i} !== undefined`,()=>t.assign(W._`${i}[${o}]`,r))}function so(t,i,o,r=jt.Correct){let $=r===jt.Correct?W.operators.EQ:W.operators.NEQ,l;switch(t){case"null":return W._`${i} ${$} null`;case"array":l=W._`Array.isArray(${i})`;break;case"object":l=W._`${i} && typeof ${i} == "object" && !Array.isArray(${i})`;break;case"integer":l=f(W._`!(${i} % 1) && !isNaN(${i})`);break;case"number":l=f();break;default:return W._`typeof ${i} ${$} ${t}`}return r===jt.Correct?l:(0,W.not)(l);function f(s=W.nil){return(0,W.and)(W._`typeof ${i} == "number"`,s,o?W._`isFinite(${i})`:W.nil)}}xr.checkDataType=so;function no(t,i,o,r){if(t.length===1)return so(t[0],i,o,r);let $,l=(0,hr.toHash)(t);if(l.array&&l.object){let f=W._`typeof ${i} != "object"`;$=l.null?f:W._`!${i} || ${f}`,delete l.null,delete l.array,delete l.object}else $=W.nil;if(l.number)delete l.integer;for(let f in l)$=(0,W.and)($,so(f,i,o,r));return $}xr.checkDataTypes=no;var Yu={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:i})=>typeof t=="string"?W._`{type: ${t}}`:W._`{type: ${i}}`};function bo(t){let i=Au(t);(0,wu.reportError)(i,Yu)}xr.reportTypeError=bo;function Au(t){let{gen:i,data:o,schema:r}=t,$=(0,hr.schemaRefOrVal)(t,r,"type");return{gen:i,keyword:"type",data:o,schema:r.type,schemaCode:$,schemaValue:$,parentSchema:r,params:{},it:t}}});var o$=M((t$)=>{Object.defineProperty(t$,"__esModule",{value:!0});t$.assignDefaults=void 0;var wt=O(),Ku=j();function Uu(t,i){let{properties:o,items:r}=t.schema;if(i==="object"&&o)for(let $ in o)_r(t,$,o[$].default);else if(i==="array"&&Array.isArray(r))r.forEach(($,l)=>_r(t,l,$.default))}t$.assignDefaults=Uu;function _r(t,i,o){let{gen:r,compositeRule:$,data:l,opts:f}=t;if(o===void 0)return;let s=wt._`${l}${(0,wt.getProperty)(i)}`;if($){(0,Ku.checkStrictMode)(t,`default is ignored for: ${s}`);return}let n=wt._`${s} === undefined`;if(f.useDefaults==="empty")n=wt._`${n} || ${s} === null || ${s} === ""`;r.if(n,wt._`${s} = ${(0,wt.stringify)(o)}`)}});var E=M((l$)=>{Object.defineProperty(l$,"__esModule",{value:!0});l$.validateUnion=l$.validateArray=l$.usePattern=l$.callValidateCode=l$.schemaProperties=l$.allSchemaProperties=l$.noPropertyInData=l$.propertyInData=l$.isOwnProperty=l$.hasPropFunc=l$.reportMissingProp=l$.checkMissingProp=l$.checkReportMissingProp=void 0;var Y=O(),uo=j(),nt=P(),Nu=j();function Pu(t,i){let{gen:o,data:r,it:$}=t;o.if(yo(o,r,i,$.opts.ownProperties),()=>{t.setParams({missingProperty:Y._`${i}`},!0),t.error()})}l$.checkReportMissingProp=Pu;function Eu({gen:t,data:i,it:{opts:o}},r,$){return(0,Y.or)(...r.map((l)=>(0,Y.and)(yo(t,i,l,o.ownProperties),Y._`${$} = ${l}`)))}l$.checkMissingProp=Eu;function Ru(t,i){t.setParams({missingProperty:i},!0),t.error()}l$.reportMissingProp=Ru;function r$(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Y._`Object.prototype.hasOwnProperty`})}l$.hasPropFunc=r$;function Io(t,i,o){return Y._`${r$(t)}.call(${i}, ${o})`}l$.isOwnProperty=Io;function Su(t,i,o,r){let $=Y._`${i}${(0,Y.getProperty)(o)} !== undefined`;return r?Y._`${$} && ${Io(t,i,o)}`:$}l$.propertyInData=Su;function yo(t,i,o,r){let $=Y._`${i}${(0,Y.getProperty)(o)} === undefined`;return r?(0,Y.or)($,(0,Y.not)(Io(t,i,o))):$}l$.noPropertyInData=yo;function $$(t){return t?Object.keys(t).filter((i)=>i!=="__proto__"):[]}l$.allSchemaProperties=$$;function ku(t,i){return $$(i).filter((o)=>!(0,uo.alwaysValidSchema)(t,i[o]))}l$.schemaProperties=ku;function Cu({schemaCode:t,data:i,it:{gen:o,topSchemaRef:r,schemaPath:$,errorPath:l},it:f},s,n,b){let u=b?Y._`${t}, ${i}, ${r}${$}`:i,I=[[nt.default.instancePath,(0,Y.strConcat)(nt.default.instancePath,l)],[nt.default.parentData,f.parentData],[nt.default.parentDataProperty,f.parentDataProperty],[nt.default.rootData,nt.default.rootData]];if(f.opts.dynamicRef)I.push([nt.default.dynamicAnchors,nt.default.dynamicAnchors]);let V=Y._`${u}, ${o.object(...I)}`;return n!==Y.nil?Y._`${s}.call(${n}, ${V})`:Y._`${s}(${V})`}l$.callValidateCode=Cu;var hu=Y._`new RegExp`;function gu({gen:t,it:{opts:i}},o){let r=i.unicodeRegExp?"u":"",{regExp:$}=i.code,l=$(o,r);return t.scopeValue("pattern",{key:l.toString(),ref:l,code:Y._`${$.code==="new RegExp"?hu:(0,Nu.useFunc)(t,$)}(${o}, ${r})`})}l$.usePattern=gu;function mu(t){let{gen:i,data:o,keyword:r,it:$}=t,l=i.name("valid");if($.allErrors){let s=i.let("valid",!0);return f(()=>i.assign(s,!1)),s}return i.var(l,!0),f(()=>i.break()),l;function f(s){let n=i.const("len",Y._`${o}.length`);i.forRange("i",0,n,(b)=>{t.subschema({keyword:r,dataProp:b,dataPropType:uo.Type.Num},l),i.if((0,Y.not)(l),s)})}}l$.validateArray=mu;function xu(t){let{gen:i,schema:o,keyword:r,it:$}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if(o.some((n)=>(0,uo.alwaysValidSchema)($,n))&&!$.opts.unevaluated)return;let f=i.let("valid",!1),s=i.name("_valid");i.block(()=>o.forEach((n,b)=>{let u=t.subschema({keyword:r,schemaProp:b,compositeRule:!0},s);if(i.assign(f,Y._`${f} || ${s}`),!t.mergeValidEvaluated(u,s))i.if((0,Y.not)(f))})),t.result(f,()=>t.reset(),()=>t.error(!0))}l$.validateUnion=xu});var I$=M((b$)=>{Object.defineProperty(b$,"__esModule",{value:!0});b$.validateKeywordUsage=b$.validSchemaType=b$.funcKeywordCode=b$.macroKeywordCode=void 0;var H=O(),dt=P(),uI=E(),II=Ht();function yI(t,i){let{gen:o,keyword:r,schema:$,parentSchema:l,it:f}=t,s=i.macro.call(f.self,$,l,f),n=n$(o,r,s);if(f.opts.validateSchema!==!1)f.self.validateSchema(s,!0);let b=o.name("valid");t.subschema({schema:s,schemaPath:H.nil,errSchemaPath:`${f.errSchemaPath}/${r}`,topSchemaRef:n,compositeRule:!0},b),t.pass(b,()=>t.error(!0))}b$.macroKeywordCode=yI;function eI(t,i){var o;let{gen:r,keyword:$,schema:l,parentSchema:f,$data:s,it:n}=t;dI(n,i);let b=!s&&i.compile?i.compile.call(n.self,l,f,n):i.validate,u=n$(r,$,b),I=r.let("valid");t.block$data(I,V),t.ok((o=i.valid)!==null&&o!==void 0?o:I);function V(){if(i.errors===!1){if(e(),i.modifying)s$(t);c(()=>t.error())}else{let p=i.async?d():y();if(i.modifying)s$(t);c(()=>MI(t,p))}}function d(){let p=r.let("ruleErrs",null);return r.try(()=>e(H._`await `),(Z)=>r.assign(I,!1).if(H._`${Z} instanceof ${n.ValidationError}`,()=>r.assign(p,H._`${Z}.errors`),()=>r.throw(Z))),p}function y(){let p=H._`${u}.errors`;return r.assign(p,null),e(H.nil),p}function e(p=i.async?H._`await `:H.nil){let Z=n.opts.passContext?dt.default.this:dt.default.self,w=!(("compile"in i)&&!s||i.schema===!1);r.assign(I,H._`${p}${(0,uI.callValidateCode)(t,u,Z,w)}`,i.modifying)}function c(p){var Z;r.if((0,H.not)((Z=i.valid)!==null&&Z!==void 0?Z:I),p)}}b$.funcKeywordCode=eI;function s$(t){let{gen:i,data:o,it:r}=t;i.if(r.parentData,()=>i.assign(o,H._`${r.parentData}[${r.parentDataProperty}]`))}function MI(t,i){let{gen:o}=t;o.if(H._`Array.isArray(${i})`,()=>{o.assign(dt.default.vErrors,H._`${dt.default.vErrors} === null ? ${i} : ${dt.default.vErrors}.concat(${i})`).assign(dt.default.errors,H._`${dt.default.vErrors}.length`),(0,II.extendErrors)(t)},()=>t.error())}function dI({schemaEnv:t},i){if(i.async&&!t.$async)throw Error("async keyword in sync schema")}function n$(t,i,o){if(o===void 0)throw Error(`keyword "${i}" failed to compile`);return t.scopeValue("keyword",typeof o=="function"?{ref:o}:{ref:o,code:(0,H.stringify)(o)})}function VI(t,i,o=!1){return!i.length||i.some((r)=>r==="array"?Array.isArray(t):r==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==r||o&&typeof t>"u")}b$.validSchemaType=VI;function cI({schema:t,opts:i,self:o,errSchemaPath:r},$,l){if(Array.isArray($.keyword)?!$.keyword.includes(l):$.keyword!==l)throw Error("ajv implementation error");let f=$.dependencies;if(f===null||f===void 0?void 0:f.some((s)=>!Object.prototype.hasOwnProperty.call(t,s)))throw Error(`parent schema must have dependencies of ${l}: ${f.join(",")}`);if($.validateSchema){if(!$.validateSchema(t[l])){let n=`keyword "${l}" value is invalid at path "${r}": `+o.errorsText($.validateSchema.errors);if(i.validateSchema==="log")o.logger.error(n);else throw Error(n)}}}b$.validateKeywordUsage=cI});var d$=M((e$)=>{Object.defineProperty(e$,"__esModule",{value:!0});e$.extendSubschemaMode=e$.extendSubschemaData=e$.getSubschema=void 0;var _=O(),y$=j();function TI(t,{keyword:i,schemaProp:o,schema:r,schemaPath:$,errSchemaPath:l,topSchemaRef:f}){if(i!==void 0&&r!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(i!==void 0){let s=t.schema[i];return o===void 0?{schema:s,schemaPath:_._`${t.schemaPath}${(0,_.getProperty)(i)}`,errSchemaPath:`${t.errSchemaPath}/${i}`}:{schema:s[o],schemaPath:_._`${t.schemaPath}${(0,_.getProperty)(i)}${(0,_.getProperty)(o)}`,errSchemaPath:`${t.errSchemaPath}/${i}/${(0,y$.escapeFragment)(o)}`}}if(r!==void 0){if($===void 0||l===void 0||f===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:r,schemaPath:$,topSchemaRef:f,errSchemaPath:l}}throw Error('either "keyword" or "schema" must be passed')}e$.getSubschema=TI;function OI(t,i,{dataProp:o,dataPropType:r,data:$,dataTypes:l,propertyName:f}){if($!==void 0&&o!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:s}=i;if(o!==void 0){let{errorPath:b,dataPathArr:u,opts:I}=i,V=s.let("data",_._`${i.data}${(0,_.getProperty)(o)}`,!0);n(V),t.errorPath=_.str`${b}${(0,y$.getErrorPath)(o,r,I.jsPropertySyntax)}`,t.parentDataProperty=_._`${o}`,t.dataPathArr=[...u,t.parentDataProperty]}if($!==void 0){let b=$ instanceof _.Name?$:s.let("data",$,!0);if(n(b),f!==void 0)t.propertyName=f}if(l)t.dataTypes=l;function n(b){t.data=b,t.dataLevel=i.dataLevel+1,t.dataTypes=[],i.definedProperties=new Set,t.parentData=i.data,t.dataNames=[...i.dataNames,b]}}e$.extendSubschemaData=OI;function WI(t,{jtdDiscriminator:i,jtdMetadata:o,compositeRule:r,createErrors:$,allErrors:l}){if(r!==void 0)t.compositeRule=r;if($!==void 0)t.createErrors=$;if(l!==void 0)t.allErrors=l;t.jtdDiscriminator=i,t.jtdMetadata=o}e$.extendSubschemaMode=WI});var eo=M((yV,V$)=>{V$.exports=function t(i,o){if(i===o)return!0;if(i&&o&&typeof i=="object"&&typeof o=="object"){if(i.constructor!==o.constructor)return!1;var r,$,l;if(Array.isArray(i)){if(r=i.length,r!=o.length)return!1;for($=r;$--!==0;)if(!t(i[$],o[$]))return!1;return!0}if(i.constructor===RegExp)return i.source===o.source&&i.flags===o.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===o.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===o.toString();if(l=Object.keys(i),r=l.length,r!==Object.keys(o).length)return!1;for($=r;$--!==0;)if(!Object.prototype.hasOwnProperty.call(o,l[$]))return!1;for($=r;$--!==0;){var f=l[$];if(!t(i[f],o[f]))return!1}return!0}return i!==i&&o!==o}});var p$=M((eV,c$)=>{var bt=c$.exports=function(t,i,o){if(typeof i=="function")o=i,i={};o=i.cb||o;var r=typeof o=="function"?o:o.pre||function(){},$=o.post||function(){};Mi(i,r,$,t,"",t)};bt.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};bt.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};bt.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};bt.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function Mi(t,i,o,r,$,l,f,s,n,b){if(r&&typeof r=="object"&&!Array.isArray(r)){i(r,$,l,f,s,n,b);for(var u in r){var I=r[u];if(Array.isArray(I)){if(u in bt.arrayKeywords)for(var V=0;V<I.length;V++)Mi(t,i,o,I[V],$+"/"+u+"/"+V,l,$,u,r,V)}else if(u in bt.propsKeywords){if(I&&typeof I=="object")for(var d in I)Mi(t,i,o,I[d],$+"/"+u+"/"+FI(d),l,$,u,r,d)}else if(u in bt.keywords||t.allKeys&&!(u in bt.skipKeywords))Mi(t,i,o,I,$+"/"+u,l,$,u,r)}o(r,$,l,f,s,n,b)}}function FI(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var vt=M((O$)=>{Object.defineProperty(O$,"__esModule",{value:!0});O$.getSchemaRefs=O$.resolveUrl=O$.normalizeId=O$._getFullPath=O$.getFullPath=O$.inlineRef=void 0;var ZI=j(),BI=eo(),JI=p$(),XI=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function YI(t,i=!0){if(typeof t=="boolean")return!0;if(i===!0)return!Mo(t);if(!i)return!1;return L$(t)<=i}O$.inlineRef=YI;var AI=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function Mo(t){for(let i in t){if(AI.has(i))return!0;let o=t[i];if(Array.isArray(o)&&o.some(Mo))return!0;if(typeof o=="object"&&Mo(o))return!0}return!1}function L$(t){let i=0;for(let o in t){if(o==="$ref")return 1/0;if(i++,XI.has(o))continue;if(typeof t[o]=="object")(0,ZI.eachItem)(t[o],(r)=>i+=L$(r));if(i===1/0)return 1/0}return i}function q$(t,i="",o){if(o!==!1)i=Ft(i);let r=t.parse(i);return T$(t,r)}O$.getFullPath=q$;function T$(t,i){return t.serialize(i).split("#")[0]+"#"}O$._getFullPath=T$;var zI=/#\/?$/;function Ft(t){return t?t.replace(zI,""):""}O$.normalizeId=Ft;function QI(t,i,o){return o=Ft(o),t.resolve(i,o)}O$.resolveUrl=QI;var GI=/^[a-z_][-a-z0-9._]*$/i;function HI(t,i){if(typeof t=="boolean")return{};let{schemaId:o,uriResolver:r}=this.opts,$=Ft(t[o]||i),l={"":$},f=q$(r,$,!1),s={},n=new Set;return JI(t,{allKeys:!0},(I,V,d,y)=>{if(y===void 0)return;let e=f+V,c=l[y];if(typeof I[o]=="string")c=p.call(this,I[o]);Z.call(this,I.$anchor),Z.call(this,I.$dynamicAnchor),l[V]=c;function p(w){let X=this.opts.uriResolver.resolve;if(w=Ft(c?X(c,w):w),n.has(w))throw u(w);n.add(w);let T=this.refs[w];if(typeof T=="string")T=this.refs[T];if(typeof T=="object")b(I,T.schema,w);else if(w!==Ft(e))if(w[0]==="#")b(I,s[w],w),s[w]=I;else this.refs[w]=e;return w}function Z(w){if(typeof w=="string"){if(!GI.test(w))throw Error(`invalid anchor "${w}"`);p.call(this,`#${w}`)}}}),s;function b(I,V,d){if(V!==void 0&&!BI(I,V))throw u(d)}function u(I){return Error(`reference "${I}" resolves to more than one schema`)}}O$.getSchemaRefs=HI});var Nt=M((v$)=>{Object.defineProperty(v$,"__esModule",{value:!0});v$.getData=v$.KeywordCxt=v$.validateFunctionCode=void 0;var B$=Nr(),j$=Dt(),co=fo(),di=Dt(),PI=o$(),Ut=I$(),Vo=d$(),L=O(),q=P(),EI=vt(),rt=j(),Kt=Ht();function RI(t){if(Y$(t)){if(A$(t),X$(t)){CI(t);return}}J$(t,()=>(0,B$.topBoolOrEmptySchema)(t))}v$.validateFunctionCode=RI;function J$({gen:t,validateName:i,schema:o,schemaEnv:r,opts:$},l){if($.code.es5)t.func(i,L._`${q.default.data}, ${q.default.valCxt}`,r.$async,()=>{t.code(L._`"use strict"; ${w$(o,$)}`),kI(t,$),t.code(l)});else t.func(i,L._`${q.default.data}, ${SI($)}`,r.$async,()=>t.code(w$(o,$)).code(l))}function SI(t){return L._`{${q.default.instancePath}="", ${q.default.parentData}, ${q.default.parentDataProperty}, ${q.default.rootData}=${q.default.data}${t.dynamicRef?L._`, ${q.default.dynamicAnchors}={}`:L.nil}}={}`}function kI(t,i){t.if(q.default.valCxt,()=>{if(t.var(q.default.instancePath,L._`${q.default.valCxt}.${q.default.instancePath}`),t.var(q.default.parentData,L._`${q.default.valCxt}.${q.default.parentData}`),t.var(q.default.parentDataProperty,L._`${q.default.valCxt}.${q.default.parentDataProperty}`),t.var(q.default.rootData,L._`${q.default.valCxt}.${q.default.rootData}`),i.dynamicRef)t.var(q.default.dynamicAnchors,L._`${q.default.valCxt}.${q.default.dynamicAnchors}`)},()=>{if(t.var(q.default.instancePath,L._`""`),t.var(q.default.parentData,L._`undefined`),t.var(q.default.parentDataProperty,L._`undefined`),t.var(q.default.rootData,q.default.data),i.dynamicRef)t.var(q.default.dynamicAnchors,L._`{}`)})}function CI(t){let{schema:i,opts:o,gen:r}=t;J$(t,()=>{if(o.$comment&&i.$comment)Q$(t);if(aI(t),r.let(q.default.vErrors,null),r.let(q.default.errors,0),o.unevaluated)hI(t);z$(t),iy(t)});return}function hI(t){let{gen:i,validateName:o}=t;t.evaluated=i.const("evaluated",L._`${o}.evaluated`),i.if(L._`${t.evaluated}.dynamicProps`,()=>i.assign(L._`${t.evaluated}.props`,L._`undefined`)),i.if(L._`${t.evaluated}.dynamicItems`,()=>i.assign(L._`${t.evaluated}.items`,L._`undefined`))}function w$(t,i){let o=typeof t=="object"&&t[i.schemaId];return o&&(i.code.source||i.code.process)?L._`/*# sourceURL=${o} */`:L.nil}function gI(t,i){if(Y$(t)){if(A$(t),X$(t)){mI(t,i);return}}(0,B$.boolOrEmptySchema)(t,i)}function X$({schema:t,self:i}){if(typeof t=="boolean")return!t;for(let o in t)if(i.RULES.all[o])return!0;return!1}function Y$(t){return typeof t.schema!="boolean"}function mI(t,i){let{schema:o,gen:r,opts:$}=t;if($.$comment&&o.$comment)Q$(t);_I(t),ty(t);let l=r.const("_errs",q.default.errors);z$(t,l),r.var(i,L._`${l} === ${q.default.errors}`)}function A$(t){(0,rt.checkUnknownRules)(t),xI(t)}function z$(t,i){if(t.opts.jtd)return F$(t,[],!1,i);let o=(0,j$.getSchemaTypes)(t.schema),r=(0,j$.coerceAndCheckDataType)(t,o);F$(t,o,!r,i)}function xI(t){let{schema:i,errSchemaPath:o,opts:r,self:$}=t;if(i.$ref&&r.ignoreKeywordsWithRef&&(0,rt.schemaHasRulesButRef)(i,$.RULES))$.logger.warn(`$ref: keywords ignored in schema at path "${o}"`)}function aI(t){let{schema:i,opts:o}=t;if(i.default!==void 0&&o.useDefaults&&o.strictSchema)(0,rt.checkStrictMode)(t,"default is ignored in the schema root")}function _I(t){let i=t.schema[t.opts.schemaId];if(i)t.baseId=(0,EI.resolveUrl)(t.opts.uriResolver,t.baseId,i)}function ty(t){if(t.schema.$async&&!t.schemaEnv.$async)throw Error("async schema in sync schema")}function Q$({gen:t,schemaEnv:i,schema:o,errSchemaPath:r,opts:$}){let l=o.$comment;if($.$comment===!0)t.code(L._`${q.default.self}.logger.log(${l})`);else if(typeof $.$comment=="function"){let f=L.str`${r}/$comment`,s=t.scopeValue("root",{ref:i.root});t.code(L._`${q.default.self}.opts.$comment(${l}, ${f}, ${s}.schema)`)}}function iy(t){let{gen:i,schemaEnv:o,validateName:r,ValidationError:$,opts:l}=t;if(o.$async)i.if(L._`${q.default.errors} === 0`,()=>i.return(q.default.data),()=>i.throw(L._`new ${$}(${q.default.vErrors})`));else{if(i.assign(L._`${r}.errors`,q.default.vErrors),l.unevaluated)oy(t);i.return(L._`${q.default.errors} === 0`)}}function oy({gen:t,evaluated:i,props:o,items:r}){if(o instanceof L.Name)t.assign(L._`${i}.props`,o);if(r instanceof L.Name)t.assign(L._`${i}.items`,r)}function F$(t,i,o,r){let{gen:$,schema:l,data:f,allErrors:s,opts:n,self:b}=t,{RULES:u}=b;if(l.$ref&&(n.ignoreKeywordsWithRef||!(0,rt.schemaHasRulesButRef)(l,u))){$.block(()=>H$(t,"$ref",u.all.$ref.definition));return}if(!n.jtd)ry(t,i);$.block(()=>{for(let V of u.rules)I(V);I(u.post)});function I(V){if(!(0,co.shouldUseGroup)(l,V))return;if(V.type){if($.if((0,di.checkDataType)(V.type,f,n.strictNumbers)),Z$(t,V),i.length===1&&i[0]===V.type&&o)$.else(),(0,di.reportTypeError)(t);$.endIf()}else Z$(t,V);if(!s)$.if(L._`${q.default.errors} === ${r||0}`)}}function Z$(t,i){let{gen:o,schema:r,opts:{useDefaults:$}}=t;if($)(0,PI.assignDefaults)(t,i.type);o.block(()=>{for(let l of i.rules)if((0,co.shouldUseRule)(r,l))H$(t,l.keyword,l.definition,i.type)})}function ry(t,i){if(t.schemaEnv.meta||!t.opts.strictTypes)return;if($y(t,i),!t.opts.allowUnionTypes)ly(t,i);fy(t,t.dataTypes)}function $y(t,i){if(!i.length)return;if(!t.dataTypes.length){t.dataTypes=i;return}i.forEach((o)=>{if(!G$(t.dataTypes,o))po(t,`type "${o}" not allowed by context "${t.dataTypes.join(",")}"`)}),ny(t,i)}function ly(t,i){if(i.length>1&&!(i.length===2&&i.includes("null")))po(t,"use allowUnionTypes to allow union type keyword")}function fy(t,i){let o=t.self.RULES.all;for(let r in o){let $=o[r];if(typeof $=="object"&&(0,co.shouldUseRule)(t.schema,$)){let{type:l}=$.definition;if(l.length&&!l.some((f)=>sy(i,f)))po(t,`missing type "${l.join(",")}" for keyword "${r}"`)}}}function sy(t,i){return t.includes(i)||i==="number"&&t.includes("integer")}function G$(t,i){return t.includes(i)||i==="integer"&&t.includes("number")}function ny(t,i){let o=[];for(let r of t.dataTypes)if(G$(i,r))o.push(r);else if(i.includes("integer")&&r==="number")o.push("integer");t.dataTypes=o}function po(t,i){let o=t.schemaEnv.baseId+t.errSchemaPath;i+=` at "${o}" (strictTypes)`,(0,rt.checkStrictMode)(t,i,t.opts.strictTypes)}class Lo{constructor(t,i,o){if((0,Ut.validateKeywordUsage)(t,i,o),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=o,this.data=t.data,this.schema=t.schema[o],this.$data=i.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,rt.schemaRefOrVal)(t,this.schema,o,this.$data),this.schemaType=i.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=i,this.$data)this.schemaCode=t.gen.const("vSchema",D$(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,Ut.validSchemaType)(this.schema,i.schemaType,i.allowUndefined))throw Error(`${o} value must be ${JSON.stringify(i.schemaType)}`);if("code"in i?i.trackErrors:i.errors!==!1)this.errsCount=t.gen.const("_errs",q.default.errors)}result(t,i,o){this.failResult((0,L.not)(t),i,o)}failResult(t,i,o){if(this.gen.if(t),o)o();else this.error();if(i){if(this.gen.else(),i(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(t,i){this.failResult((0,L.not)(t),void 0,i)}fail(t){if(t===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(t),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);let{schemaCode:i}=this;this.fail(L._`${i} !== undefined && (${(0,L.or)(this.invalid$data(),t)})`)}error(t,i,o){if(i){this.setParams(i),this._error(t,o),this.setParams({});return}this._error(t,o)}_error(t,i){(t?Kt.reportExtraError:Kt.reportError)(this,this.def.error,i)}$dataError(){(0,Kt.reportError)(this,this.def.$dataError||Kt.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,Kt.resetErrorsCount)(this.gen,this.errsCount)}ok(t){if(!this.allErrors)this.gen.if(t)}setParams(t,i){if(i)Object.assign(this.params,t);else this.params=t}block$data(t,i,o=L.nil){this.gen.block(()=>{this.check$data(t,o),i()})}check$data(t=L.nil,i=L.nil){if(!this.$data)return;let{gen:o,schemaCode:r,schemaType:$,def:l}=this;if(o.if((0,L.or)(L._`${r} === undefined`,i)),t!==L.nil)o.assign(t,!0);if($.length||l.validateSchema){if(o.elseIf(this.invalid$data()),this.$dataError(),t!==L.nil)o.assign(t,!1)}o.else()}invalid$data(){let{gen:t,schemaCode:i,schemaType:o,def:r,it:$}=this;return(0,L.or)(l(),f());function l(){if(o.length){if(!(i instanceof L.Name))throw Error("ajv implementation error");let s=Array.isArray(o)?o:[o];return L._`${(0,di.checkDataTypes)(s,i,$.opts.strictNumbers,di.DataType.Wrong)}`}return L.nil}function f(){if(r.validateSchema){let s=t.scopeValue("validate$data",{ref:r.validateSchema});return L._`!${s}(${i})`}return L.nil}}subschema(t,i){let o=(0,Vo.getSubschema)(this.it,t);(0,Vo.extendSubschemaData)(o,this.it,t),(0,Vo.extendSubschemaMode)(o,t);let r={...this.it,...o,items:void 0,props:void 0};return gI(r,i),r}mergeEvaluated(t,i){let{it:o,gen:r}=this;if(!o.opts.unevaluated)return;if(o.props!==!0&&t.props!==void 0)o.props=rt.mergeEvaluated.props(r,t.props,o.props,i);if(o.items!==!0&&t.items!==void 0)o.items=rt.mergeEvaluated.items(r,t.items,o.items,i)}mergeValidEvaluated(t,i){let{it:o,gen:r}=this;if(o.opts.unevaluated&&(o.props!==!0||o.items!==!0))return r.if(i,()=>this.mergeEvaluated(t,L.Name)),!0}}v$.KeywordCxt=Lo;function H$(t,i,o,r){let $=new Lo(t,o,i);if("code"in o)o.code($,r);else if($.$data&&o.validate)(0,Ut.funcKeywordCode)($,o);else if("macro"in o)(0,Ut.macroKeywordCode)($,o);else if(o.compile||o.validate)(0,Ut.funcKeywordCode)($,o)}var by=/^\/(?:[^~]|~0|~1)*$/,uy=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function D$(t,{dataLevel:i,dataNames:o,dataPathArr:r}){let $,l;if(t==="")return q.default.rootData;if(t[0]==="/"){if(!by.test(t))throw Error(`Invalid JSON-pointer: ${t}`);$=t,l=q.default.rootData}else{let b=uy.exec(t);if(!b)throw Error(`Invalid JSON-pointer: ${t}`);let u=+b[1];if($=b[2],$==="#"){if(u>=i)throw Error(n("property/index",u));return r[i-u]}if(u>i)throw Error(n("data",u));if(l=o[i-u],!$)return l}let f=l,s=$.split("/");for(let b of s)if(b)l=L._`${l}${(0,L.getProperty)((0,rt.unescapeJsonPointer)(b))}`,f=L._`${f} && ${l}`;return f;function n(b,u){return`Cannot access ${b} ${u} levels up, current level is ${i}`}}v$.getData=D$});var Vi=M((N$)=>{Object.defineProperty(N$,"__esModule",{value:!0});class U$ extends Error{constructor(t){super("validation failed");this.errors=t,this.ajv=this.validation=!0}}N$.default=U$});var Pt=M((E$)=>{Object.defineProperty(E$,"__esModule",{value:!0});var qo=vt();class P$ extends Error{constructor(t,i,o,r){super(r||`can't resolve reference ${o} from id ${i}`);this.missingRef=(0,qo.resolveUrl)(t,i,o),this.missingSchema=(0,qo.normalizeId)((0,qo.getFullPath)(t,this.missingRef))}}E$.default=P$});var Rt=M((k$)=>{Object.defineProperty(k$,"__esModule",{value:!0});k$.resolveSchema=k$.getCompilingSchema=k$.resolveRef=k$.compileSchema=k$.SchemaEnv=void 0;var h=O(),dy=Vi(),Vt=P(),g=vt(),R$=j(),Vy=Nt();class Et{constructor(t){var i;this.refs={},this.dynamicAnchors={};let o;if(typeof t.schema=="object")o=t.schema;this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=(i=t.baseId)!==null&&i!==void 0?i:(0,g.normalizeId)(o===null||o===void 0?void 0:o[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=o===null||o===void 0?void 0:o.$async,this.refs={}}}k$.SchemaEnv=Et;function Oo(t){let i=S$.call(this,t);if(i)return i;let o=(0,g.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:r,lines:$}=this.opts.code,{ownProperties:l}=this.opts,f=new h.CodeGen(this.scope,{es5:r,lines:$,ownProperties:l}),s;if(t.$async)s=f.scopeValue("Error",{ref:dy.default,code:h._`require("ajv/dist/runtime/validation_error").default`});let n=f.scopeName("validate");t.validateName=n;let b={gen:f,allErrors:this.opts.allErrors,data:Vt.default.data,parentData:Vt.default.parentData,parentDataProperty:Vt.default.parentDataProperty,dataNames:[Vt.default.data],dataPathArr:[h.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",this.opts.code.source===!0?{ref:t.schema,code:(0,h.stringify)(t.schema)}:{ref:t.schema}),validateName:n,ValidationError:s,schema:t.schema,schemaEnv:t,rootId:o,baseId:t.baseId||o,schemaPath:h.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:h._`""`,opts:this.opts,self:this},u;try{this._compilations.add(t),(0,Vy.validateFunctionCode)(b),f.optimize(this.opts.code.optimize);let I=f.toString();if(u=`${f.scopeRefs(Vt.default.scope)}return ${I}`,this.opts.code.process)u=this.opts.code.process(u,t);let d=Function(`${Vt.default.self}`,`${Vt.default.scope}`,u)(this,this.scope.get());if(this.scope.value(n,{ref:d}),d.errors=null,d.schema=t.schema,d.schemaEnv=t,t.$async)d.$async=!0;if(this.opts.code.source===!0)d.source={validateName:n,validateCode:I,scopeValues:f._values};if(this.opts.unevaluated){let{props:y,items:e}=b;if(d.evaluated={props:y instanceof h.Name?void 0:y,items:e instanceof h.Name?void 0:e,dynamicProps:y instanceof h.Name,dynamicItems:e instanceof h.Name},d.source)d.source.evaluated=(0,h.stringify)(d.evaluated)}return t.validate=d,t}catch(I){if(delete t.validate,delete t.validateName,u)this.logger.error("Error compiling schema, function code:",u);throw I}finally{this._compilations.delete(t)}}k$.compileSchema=Oo;function cy(t,i,o){var r;o=(0,g.resolveUrl)(this.opts.uriResolver,i,o);let $=t.refs[o];if($)return $;let l=qy.call(this,t,o);if(l===void 0){let f=(r=t.localRefs)===null||r===void 0?void 0:r[o],{schemaId:s}=this.opts;if(f)l=new Et({schema:f,schemaId:s,root:t,baseId:i})}if(l===void 0)return;return t.refs[o]=py.call(this,l)}k$.resolveRef=cy;function py(t){if((0,g.inlineRef)(t.schema,this.opts.inlineRefs))return t.schema;return t.validate?t:Oo.call(this,t)}function S$(t){for(let i of this._compilations)if(Ly(i,t))return i}k$.getCompilingSchema=S$;function Ly(t,i){return t.schema===i.schema&&t.root===i.root&&t.baseId===i.baseId}function qy(t,i){let o;while(typeof(o=this.refs[i])=="string")i=o;return o||this.schemas[i]||ci.call(this,t,i)}function ci(t,i){let o=this.opts.uriResolver.parse(i),r=(0,g._getFullPath)(this.opts.uriResolver,o),$=(0,g.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&r===$)return To.call(this,o,t);let l=(0,g.normalizeId)(r),f=this.refs[l]||this.schemas[l];if(typeof f=="string"){let s=ci.call(this,t,f);if(typeof(s===null||s===void 0?void 0:s.schema)!=="object")return;return To.call(this,o,s)}if(typeof(f===null||f===void 0?void 0:f.schema)!=="object")return;if(!f.validate)Oo.call(this,f);if(l===(0,g.normalizeId)(i)){let{schema:s}=f,{schemaId:n}=this.opts,b=s[n];if(b)$=(0,g.resolveUrl)(this.opts.uriResolver,$,b);return new Et({schema:s,schemaId:n,root:t,baseId:$})}return To.call(this,o,f)}k$.resolveSchema=ci;var Ty=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function To(t,{baseId:i,schema:o,root:r}){var $;if((($=t.fragment)===null||$===void 0?void 0:$[0])!=="/")return;for(let s of t.fragment.slice(1).split("/")){if(typeof o==="boolean")return;let n=o[(0,R$.unescapeFragment)(s)];if(n===void 0)return;o=n;let b=typeof o==="object"&&o[this.opts.schemaId];if(!Ty.has(s)&&b)i=(0,g.resolveUrl)(this.opts.uriResolver,i,b)}let l;if(typeof o!="boolean"&&o.$ref&&!(0,R$.schemaHasRulesButRef)(o,this.RULES)){let s=(0,g.resolveUrl)(this.opts.uriResolver,i,o.$ref);l=ci.call(this,r,s)}let{schemaId:f}=this.opts;if(l=l||new Et({schema:o,schemaId:f,root:r,baseId:i}),l.schema!==l.root.schema)return l;return}});var h$=M((LV,Fy)=>{Fy.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var wo=M((qV,tl)=>{var Zy=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),m$=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),Wo=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),x$=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),By=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function jo(t){let i="",o=0,r=0;for(r=0;r<t.length;r++){if(o=t[r].charCodeAt(0),o===48)continue;if(!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r];break}for(r+=1;r<t.length;r++){if(o=t[r].charCodeAt(0),!(o>=48&&o<=57||o>=65&&o<=70||o>=97&&o<=102))return"";i+=t[r]}return i}var Jy=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g$(t){return t.length=0,!0}function Xy(t,i,o){if(t.length){let r=jo(t);if(r!=="")i.push(r);else return o.error=!0,!1;t.length=0}return!0}function Yy(t){let i=0,o={error:!1,address:"",zone:""},r=[],$=[],l=!1,f=!1,s=Xy;for(let n=0;n<t.length;n++){let b=t[n];if(b==="["||b==="]")continue;if(b===":"){if(l===!0)f=!0;if(!s($,r,o))break;if(++i>7){o.error=!0;break}if(n>0&&t[n-1]===":")l=!0;r.push(":");continue}else if(b==="%"){if(!s($,r,o))break;s=g$}else{$.push(b);continue}}if($.length)if(s===g$)o.zone=$.join("");else if(f)r.push($.join(""));else r.push(jo($));return o.address=r.join(""),o}function a$(t){if(Ay(t,":")<2)return{host:t,isIPV6:!1};let i=Yy(t);if(!i.error){let{address:o,address:r}=i;if(i.zone)o+="%"+i.zone,r+="%25"+i.zone;return{host:o,isIPV6:!0,escapedHost:r}}else return{host:t,isIPV6:!1}}function Ay(t,i){let o=0;for(let r=0;r<t.length;r++)if(t[r]===i)o++;return o}function zy(t){let i=t,o=[],r=-1,$=0;while($=i.length){if($===1)if(i===".")break;else if(i==="/"){o.push("/");break}else{o.push(i);break}else if($===2){if(i[0]==="."){if(i[1]===".")break;else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."||i[1]==="/"){o.push("/");break}}}else if($===3){if(i==="/.."){if(o.length!==0)o.pop();o.push("/");break}}if(i[0]==="."){if(i[1]==="."){if(i[2]==="/"){i=i.slice(3);continue}}else if(i[1]==="/"){i=i.slice(2);continue}}else if(i[0]==="/"){if(i[1]==="."){if(i[2]==="/"){i=i.slice(2);continue}else if(i[2]==="."){if(i[3]==="/"){if(i=i.slice(3),o.length!==0)o.pop();continue}}}}if((r=i.indexOf("/",1))===-1){o.push(i);break}else o.push(i.slice(0,r)),i=i.slice(r)}return o.join("")}var Qy={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},Gy=/[@/?#:]/g,Hy=/[@/?#]/g;function _$(t,i){let o=i?Hy:Gy;return o.lastIndex=0,t.replace(o,(r)=>Qy[r])}function Dy(t,i=!1){if(t.indexOf("%")===-1)return t;let o="";for(let r=0;r<t.length;r++){if(t[r]==="%"&&r+2<t.length){let $=t.slice(r+1,r+3);if(Wo($)){let l=$.toUpperCase(),f=String.fromCharCode(parseInt(l,16));if(i&&x$(f))o+=f;else o+="%"+l;r+=2;continue}}o+=t[r]}return o}function vy(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Wo(r)){let $=r.toUpperCase(),l=String.fromCharCode(parseInt($,16));if(l!=="."&&x$(l))i+=l;else i+="%"+$;o+=2;continue}}if(By(t[o]))i+=t[o];else i+=escape(t[o])}return i}function Ky(t){let i="";for(let o=0;o<t.length;o++){if(t[o]==="%"&&o+2<t.length){let r=t.slice(o+1,o+3);if(Wo(r)){i+="%"+r.toUpperCase(),o+=2;continue}}i+=escape(t[o])}return i}function Uy(t){let i=[];if(t.userinfo!==void 0)i.push(t.userinfo),i.push("@");if(t.host!==void 0){let o=unescape(t.host);if(!m$(o)){let r=a$(o);if(r.isIPV6===!0)o=`[${r.escapedHost}]`;else o=_$(o,!1)}i.push(o)}if(typeof t.port==="number"||typeof t.port==="string")i.push(":"),i.push(String(t.port));return i.length?i.join(""):void 0}tl.exports={nonSimpleDomain:Jy,recomposeAuthority:Uy,reescapeHostDelimiters:_$,normalizePercentEncoding:Dy,normalizePathEncoding:vy,escapePreservingEscapes:Ky,removeDotSegments:zy,isIPv4:m$,isUUID:Zy,normalizeIPv6:a$,stringArrayToHexStripped:jo}});var ll=M((TV,$l)=>{var{isUUID:Ny}=wo(),Py=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,Ey=["http","https","ws","wss","urn","urn:uuid"];function Ry(t){return Ey.indexOf(t)!==-1}function Fo(t){if(t.secure===!0)return!0;else if(t.secure===!1)return!1;else if(t.scheme)return t.scheme.length===3&&(t.scheme[0]==="w"||t.scheme[0]==="W")&&(t.scheme[1]==="s"||t.scheme[1]==="S")&&(t.scheme[2]==="s"||t.scheme[2]==="S");else return!1}function il(t){if(!t.host)t.error=t.error||"HTTP URIs must have a host.";return t}function ol(t){let i=String(t.scheme).toLowerCase()==="https";if(t.port===(i?443:80)||t.port==="")t.port=void 0;if(!t.path)t.path="/";return t}function Sy(t){return t.secure=Fo(t),t.resourceName=(t.path||"/")+(t.query?"?"+t.query:""),t.path=void 0,t.query=void 0,t}function ky(t){if(t.port===(Fo(t)?443:80)||t.port==="")t.port=void 0;if(typeof t.secure==="boolean")t.scheme=t.secure?"wss":"ws",t.secure=void 0;if(t.resourceName){let[i,o]=t.resourceName.split("?");t.path=i&&i!=="/"?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}function Cy(t,i){if(!t.path)return t.error="URN can not be parsed",t;let o=t.path.match(Py);if(o){let r=i.scheme||t.scheme||"urn";t.nid=o[1].toLowerCase(),t.nss=o[2];let $=`${r}:${i.nid||t.nid}`,l=Zo($);if(t.path=void 0,l)t=l.parse(t,i)}else t.error=t.error||"URN can not be parsed.";return t}function hy(t,i){if(t.nid===void 0)throw Error("URN without nid cannot be serialized");let o=i.scheme||t.scheme||"urn",r=t.nid.toLowerCase(),$=`${o}:${i.nid||r}`,l=Zo($);if(l)t=l.serialize(t,i);let f=t,s=t.nss;return f.path=`${r||i.nid}:${s}`,i.skipEscape=!0,f}function gy(t,i){let o=t;if(o.uuid=o.nss,o.nss=void 0,!i.tolerant&&(!o.uuid||!Ny(o.uuid)))o.error=o.error||"UUID is not valid.";return o}function my(t){let i=t;return i.nss=(t.uuid||"").toLowerCase(),i}var rl={scheme:"http",domainHost:!0,parse:il,serialize:ol},xy={scheme:"https",domainHost:rl.domainHost,parse:il,serialize:ol},pi={scheme:"ws",domainHost:!0,parse:Sy,serialize:ky},ay={scheme:"wss",domainHost:pi.domainHost,parse:pi.parse,serialize:pi.serialize},_y={scheme:"urn",parse:Cy,serialize:hy,skipNormalize:!0},t0={scheme:"urn:uuid",parse:gy,serialize:my,skipNormalize:!0},Li={http:rl,https:xy,ws:pi,wss:ay,urn:_y,"urn:uuid":t0};Object.setPrototypeOf(Li,null);function Zo(t){return t&&(Li[t]||Li[t.toLowerCase()])||void 0}$l.exports={wsIsSecure:Fo,SCHEMES:Li,isValidSchemeName:Ry,getSchemeHandler:Zo}});var ul=M((OV,Oi)=>{var{normalizeIPv6:i0,removeDotSegments:St,recomposeAuthority:o0,normalizePercentEncoding:r0,normalizePathEncoding:$0,escapePreservingEscapes:l0,reescapeHostDelimiters:f0,isIPv4:s0,nonSimpleDomain:n0}=wo(),{SCHEMES:b0,getSchemeHandler:sl}=ll();function u0(t,i){if(typeof t==="string")t=c0(t,i);else if(typeof t==="object")t=Ti(ct(t,i),i);return t}function I0(t,i,o){let r=o?Object.assign({scheme:"null"},o):{scheme:"null"},{parsed:$,malformedAuthorityOrPort:l}=qi(t,r),{parsed:f,malformedAuthorityOrPort:s}=qi(i,r);if(l||s)throw Error($.error||f.error||"URI is malformed.");let n=nl($,f,r,!0);return r.skipEscape=!0,ct(n,r)}function nl(t,i,o,r){let $={};if(!r)t=Ti(ct(t,o),o),i=Ti(ct(i,o),o);if(o=o||{},!o.tolerant&&i.scheme)$.scheme=i.scheme,$.userinfo=i.userinfo,$.host=i.host,$.port=i.port,$.path=St(i.path||""),$.query=i.query;else{if(i.userinfo!==void 0||i.host!==void 0||i.port!==void 0)$.userinfo=i.userinfo,$.host=i.host,$.port=i.port,$.path=St(i.path||""),$.query=i.query;else{if(!i.path)if($.path=t.path,i.query!==void 0)$.query=i.query;else $.query=t.query;else{if(i.path[0]==="/")$.path=St(i.path);else{if((t.userinfo!==void 0||t.host!==void 0||t.port!==void 0)&&!t.path)$.path="/"+i.path;else if(!t.path)$.path=i.path;else $.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+i.path;$.path=St($.path)}$.query=i.query}$.userinfo=t.userinfo,$.host=t.host,$.port=t.port}$.scheme=t.scheme}return $.fragment=i.fragment,$}function y0(t,i,o){let r=fl(t,o),$=fl(i,o);return r!==void 0&&$!==void 0&&r.toLowerCase()===$.toLowerCase()}function ct(t,i){let o={host:t.host,scheme:t.scheme,userinfo:t.userinfo,port:t.port,path:t.path,query:t.query,nid:t.nid,nss:t.nss,uuid:t.uuid,fragment:t.fragment,reference:t.reference,resourceName:t.resourceName,secure:t.secure,error:""},r=Object.assign({},i),$=[],l=sl(r.scheme||o.scheme);if(l&&l.serialize)l.serialize(o,r);if(o.path!==void 0)if(!r.skipEscape){if(o.path=l0(o.path),o.scheme!==void 0)o.path=o.path.split("%3A").join(":")}else o.path=r0(o.path);if(r.reference!=="suffix"&&o.scheme)$.push(o.scheme,":");let f=o0(o);if(f!==void 0){if(r.reference!=="suffix")$.push("//");if($.push(f),o.path&&o.path[0]!=="/")$.push("/")}if(o.path!==void 0){let s=o.path;if(!r.absolutePath&&(!l||!l.absolutePath))s=St(s);if(f===void 0&&s[0]==="/"&&s[1]==="/")s="/%2F"+s.slice(2);$.push(s)}if(o.query!==void 0)$.push("?",o.query);if(o.fragment!==void 0)$.push("#",o.fragment);return $.join("")}var e0=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,M0=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,d0=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function V0(t,i){if(i[2]!==void 0&&t.path&&t.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof t.port==="number"&&(t.port<0||t.port>65535))return"URI port is malformed.";return}function qi(t,i){let o=Object.assign({},i),r={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},$=!1,l=!1;if(o.reference==="suffix")if(o.scheme)t=o.scheme+":"+t;else t="//"+t;let f=t.match(M0);if(f!==null&&f[1].indexOf("\\")!==-1)r.error="URI authority must not contain a literal backslash.",$=!0;let s=t.match(d0);if(s!==null){let b=s[1],u=b.replace(/[\t\n\r]/g,"");if(u.length>=2){if(u.slice(0,2)!=="//")r.error=r.error||"URI authority must not contain a literal backslash.",$=!0;else if(b.length!==u.length)r.error=r.error||"URI authority introducer must not contain whitespace.",$=!0}}let n=t.match(e0);if(n){if(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port))r.port=n[5];let b=V0(r,n);if(b!==void 0)r.error=r.error||b,$=!0;if(r.host)if(s0(r.host)===!1){let V=i0(r.host);r.host=V.host.toLowerCase(),l=V.isIPV6}else l=!0;if(r.scheme===void 0&&r.userinfo===void 0&&r.host===void 0&&r.port===void 0&&r.query===void 0&&!r.path)r.reference="same-document";else if(r.scheme===void 0)r.reference="relative";else if(r.fragment===void 0)r.reference="absolute";else r.reference="uri";if(o.reference&&o.reference!=="suffix"&&o.reference!==r.reference)r.error=r.error||"URI is not a "+o.reference+" reference.";let u=sl(o.scheme||r.scheme);if(!o.unicodeSupport&&(!u||!u.unicodeSupport)){if(r.host&&(o.domainHost||u&&u.domainHost)&&l===!1&&n0(r.host))try{r.host=new URL("http://"+r.host).hostname}catch(I){r.error=r.error||"Host's domain name can not be converted to ASCII: "+I}}if(!u||u&&!u.skipNormalize){if(t.indexOf("%")!==-1){if(r.scheme!==void 0)r.scheme=unescape(r.scheme);if(r.host!==void 0)r.host=f0(unescape(r.host),l)}if(r.path)r.path=$0(r.path);if(r.fragment)try{r.fragment=encodeURI(decodeURIComponent(r.fragment))}catch{r.error=r.error||"URI malformed"}}if(u&&u.parse)u.parse(r,o)}else r.error=r.error||"URI can not be parsed.";return{parsed:r,malformedAuthorityOrPort:$}}function Ti(t,i){return qi(t,i).parsed}function c0(t,i){return bl(t,i).normalized}function bl(t,i){let{parsed:o,malformedAuthorityOrPort:r}=qi(t,i);return{normalized:r?t:ct(o,i),malformedAuthorityOrPort:r}}function fl(t,i){if(typeof t==="string"){let{normalized:o,malformedAuthorityOrPort:r}=bl(t,i);return r?void 0:o}if(typeof t==="object")return ct(t,i)}var Bo={SCHEMES:b0,normalize:u0,resolve:I0,resolveComponent:nl,equal:y0,serialize:ct,parse:Ti};Oi.exports=Bo;Oi.exports.default=Bo;Oi.exports.fastUri=Bo});var el=M((yl)=>{Object.defineProperty(yl,"__esModule",{value:!0});var Il=ul();Il.code='require("ajv/dist/runtime/uri").default';yl.default=Il});var Tl=M(($t)=>{Object.defineProperty($t,"__esModule",{value:!0});$t.CodeGen=$t.Name=$t.nil=$t.stringify=$t.str=$t._=$t.KeywordCxt=void 0;var L0=Nt();Object.defineProperty($t,"KeywordCxt",{enumerable:!0,get:function(){return L0.KeywordCxt}});var Zt=O();Object.defineProperty($t,"_",{enumerable:!0,get:function(){return Zt._}});Object.defineProperty($t,"str",{enumerable:!0,get:function(){return Zt.str}});Object.defineProperty($t,"stringify",{enumerable:!0,get:function(){return Zt.stringify}});Object.defineProperty($t,"nil",{enumerable:!0,get:function(){return Zt.nil}});Object.defineProperty($t,"Name",{enumerable:!0,get:function(){return Zt.Name}});Object.defineProperty($t,"CodeGen",{enumerable:!0,get:function(){return Zt.CodeGen}});var q0=Vi(),pl=Pt(),T0=lo(),kt=Rt(),O0=O(),Ct=vt(),Wi=Dt(),Xo=j(),Ml=h$(),W0=el(),Ll=(t,i)=>new RegExp(t,i);Ll.code="new RegExp";var j0=["removeAdditional","useDefaults","coerceTypes"],w0=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),F0={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},Z0={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},dl=200;function B0(t){var i,o,r,$,l,f,s,n,b,u,I,V,d,y,e,c,p,Z,w,X,T,x,it,Ui,Ni;let At=t.strict,Pi=(i=t.code)===null||i===void 0?void 0:i.optimize,go=Pi===!0||Pi===void 0?1:Pi||0,mo=(r=(o=t.code)===null||o===void 0?void 0:o.regExp)!==null&&r!==void 0?r:Ll,An=($=t.uriResolver)!==null&&$!==void 0?$:W0.default;return{strictSchema:(f=(l=t.strictSchema)!==null&&l!==void 0?l:At)!==null&&f!==void 0?f:!0,strictNumbers:(n=(s=t.strictNumbers)!==null&&s!==void 0?s:At)!==null&&n!==void 0?n:!0,strictTypes:(u=(b=t.strictTypes)!==null&&b!==void 0?b:At)!==null&&u!==void 0?u:"log",strictTuples:(V=(I=t.strictTuples)!==null&&I!==void 0?I:At)!==null&&V!==void 0?V:"log",strictRequired:(y=(d=t.strictRequired)!==null&&d!==void 0?d:At)!==null&&y!==void 0?y:!1,code:t.code?{...t.code,optimize:go,regExp:mo}:{optimize:go,regExp:mo},loopRequired:(e=t.loopRequired)!==null&&e!==void 0?e:dl,loopEnum:(c=t.loopEnum)!==null&&c!==void 0?c:dl,meta:(p=t.meta)!==null&&p!==void 0?p:!0,messages:(Z=t.messages)!==null&&Z!==void 0?Z:!0,inlineRefs:(w=t.inlineRefs)!==null&&w!==void 0?w:!0,schemaId:(X=t.schemaId)!==null&&X!==void 0?X:"$id",addUsedSchema:(T=t.addUsedSchema)!==null&&T!==void 0?T:!0,validateSchema:(x=t.validateSchema)!==null&&x!==void 0?x:!0,validateFormats:(it=t.validateFormats)!==null&&it!==void 0?it:!0,unicodeRegExp:(Ui=t.unicodeRegExp)!==null&&Ui!==void 0?Ui:!0,int32range:(Ni=t.int32range)!==null&&Ni!==void 0?Ni:!0,uriResolver:An}}class ji{constructor(t={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...B0(t)};let{es5:i,lines:o}=this.opts.code;this.scope=new O0.ValueScope({scope:{},prefixes:w0,es5:i,lines:o}),this.logger=Q0(t.logger);let r=t.validateFormats;if(t.validateFormats=!1,this.RULES=(0,T0.getRules)(),Vl.call(this,F0,t,"NOT SUPPORTED"),Vl.call(this,Z0,t,"DEPRECATED","warn"),this._metaOpts=A0.call(this),t.formats)X0.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords)Y0.call(this,t.keywords);if(typeof t.meta=="object")this.addMetaSchema(t.meta);J0.call(this),t.validateFormats=r}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:t,meta:i,schemaId:o}=this.opts,r=Ml;if(o==="id")r={...Ml},r.id=r.$id,delete r.$id;if(i&&t)this.addMetaSchema(r,r[o],!1)}defaultMeta(){let{meta:t,schemaId:i}=this.opts;return this.opts.defaultMeta=typeof t=="object"?t[i]||t:void 0}validate(t,i){let o;if(typeof t=="string"){if(o=this.getSchema(t),!o)throw Error(`no schema with key or ref "${t}"`)}else o=this.compile(t);let r=o(i);if(!("$async"in o))this.errors=o.errors;return r}compile(t,i){let o=this._addSchema(t,i);return o.validate||this._compileSchemaEnv(o)}compileAsync(t,i){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:o}=this.opts;return r.call(this,t,i);async function r(b,u){await $.call(this,b.$schema);let I=this._addSchema(b,u);return I.validate||l.call(this,I)}async function $(b){if(b&&!this.getSchema(b))await r.call(this,{$ref:b},!0)}async function l(b){try{return this._compileSchemaEnv(b)}catch(u){if(!(u instanceof pl.default))throw u;return f.call(this,u),await s.call(this,u.missingSchema),l.call(this,b)}}function f({missingSchema:b,missingRef:u}){if(this.refs[b])throw Error(`AnySchema ${b} is loaded but ${u} cannot be resolved`)}async function s(b){let u=await n.call(this,b);if(!this.refs[b])await $.call(this,u.$schema);if(!this.refs[b])this.addSchema(u,b,i)}async function n(b){let u=this._loading[b];if(u)return u;try{return await(this._loading[b]=o(b))}finally{delete this._loading[b]}}}addSchema(t,i,o,r=this.opts.validateSchema){if(Array.isArray(t)){for(let l of t)this.addSchema(l,void 0,o,r);return this}let $;if(typeof t==="object"){let{schemaId:l}=this.opts;if($=t[l],$!==void 0&&typeof $!="string")throw Error(`schema ${l} must be string`)}return i=(0,Ct.normalizeId)(i||$),this._checkUnique(i),this.schemas[i]=this._addSchema(t,o,i,r,!0),this}addMetaSchema(t,i,o=this.opts.validateSchema){return this.addSchema(t,i,!0,o),this}validateSchema(t,i){if(typeof t=="boolean")return!0;let o;if(o=t.$schema,o!==void 0&&typeof o!="string")throw Error("$schema must be a string");if(o=o||this.opts.defaultMeta||this.defaultMeta(),!o)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let r=this.validate(o,t);if(!r&&i){let $="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error($);else throw Error($)}return r}getSchema(t){let i;while(typeof(i=cl.call(this,t))=="string")t=i;if(i===void 0){let{schemaId:o}=this.opts,r=new kt.SchemaEnv({schema:{},schemaId:o});if(i=kt.resolveSchema.call(this,r,t),!i)return;this.refs[t]=i}return i.validate||this._compileSchemaEnv(i)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let i=cl.call(this,t);if(typeof i=="object")this._cache.delete(i.schema);return delete this.schemas[t],delete this.refs[t],this}case"object":{let i=t;this._cache.delete(i);let o=t[this.opts.schemaId];if(o)o=(0,Ct.normalizeId)(o),delete this.schemas[o],delete this.refs[o];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(let i of t)this.addKeyword(i);return this}addKeyword(t,i){let o;if(typeof t=="string"){if(o=t,typeof i=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),i.keyword=o}else if(typeof t=="object"&&i===void 0){if(i=t,o=i.keyword,Array.isArray(o)&&!o.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(H0.call(this,o,i),!i)return(0,Xo.eachItem)(o,($)=>Jo.call(this,$)),this;v0.call(this,i);let r={...i,type:(0,Wi.getJSONTypes)(i.type),schemaType:(0,Wi.getJSONTypes)(i.schemaType)};return(0,Xo.eachItem)(o,r.type.length===0?($)=>Jo.call(this,$,r):($)=>r.type.forEach((l)=>Jo.call(this,$,r,l))),this}getKeyword(t){let i=this.RULES.all[t];return typeof i=="object"?i.definition:!!i}removeKeyword(t){let{RULES:i}=this;delete i.keywords[t],delete i.all[t];for(let o of i.rules){let r=o.rules.findIndex(($)=>$.keyword===t);if(r>=0)o.rules.splice(r,1)}return this}addFormat(t,i){if(typeof i=="string")i=new RegExp(i);return this.formats[t]=i,this}errorsText(t=this.errors,{separator:i=", ",dataVar:o="data"}={}){if(!t||t.length===0)return"No errors";return t.map((r)=>`${o}${r.instancePath} ${r.message}`).reduce((r,$)=>r+i+$)}$dataMetaSchema(t,i){let o=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(let r of i){let $=r.split("/").slice(1),l=t;for(let f of $)l=l[f];for(let f in o){let s=o[f];if(typeof s!="object")continue;let{$data:n}=s.definition,b=l[f];if(n&&b)l[f]=ql(b)}}return t}_removeAllSchemas(t,i){for(let o in t){let r=t[o];if(!i||i.test(o)){if(typeof r=="string")delete t[o];else if(r&&!r.meta)this._cache.delete(r.schema),delete t[o]}}}_addSchema(t,i,o,r=this.opts.validateSchema,$=this.opts.addUsedSchema){let l,{schemaId:f}=this.opts;if(typeof t=="object")l=t[f];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof t!="boolean")throw Error("schema must be object or boolean");let s=this._cache.get(t);if(s!==void 0)return s;o=(0,Ct.normalizeId)(l||o);let n=Ct.getSchemaRefs.call(this,t,o);if(s=new kt.SchemaEnv({schema:t,schemaId:f,meta:i,baseId:o,localRefs:n}),this._cache.set(s.schema,s),$&&!o.startsWith("#")){if(o)this._checkUnique(o);this.refs[o]=s}if(r)this.validateSchema(t,!0);return s}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta)this._compileMetaSchema(t);else kt.compileSchema.call(this,t);if(!t.validate)throw Error("ajv implementation error");return t.validate}_compileMetaSchema(t){let i=this.opts;this.opts=this._metaOpts;try{kt.compileSchema.call(this,t)}finally{this.opts=i}}}ji.ValidationError=q0.default;ji.MissingRefError=pl.default;$t.default=ji;function Vl(t,i,o,r="error"){for(let $ in t){let l=$;if(l in i)this.logger[r](`${o}: option ${$}. ${t[l]}`)}}function cl(t){return t=(0,Ct.normalizeId)(t),this.schemas[t]||this.refs[t]}function J0(){let t=this.opts.schemas;if(!t)return;if(Array.isArray(t))this.addSchema(t);else for(let i in t)this.addSchema(t[i],i)}function X0(){for(let t in this.opts.formats){let i=this.opts.formats[t];if(i)this.addFormat(t,i)}}function Y0(t){if(Array.isArray(t)){this.addVocabulary(t);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let i in t){let o=t[i];if(!o.keyword)o.keyword=i;this.addKeyword(o)}}function A0(){let t={...this.opts};for(let i of j0)delete t[i];return t}var z0={log(){},warn(){},error(){}};function Q0(t){if(t===!1)return z0;if(t===void 0)return console;if(t.log&&t.warn&&t.error)return t;throw Error("logger must implement log, warn and error methods")}var G0=/^[a-z_$][a-z0-9_$:-]*$/i;function H0(t,i){let{RULES:o}=this;if((0,Xo.eachItem)(t,(r)=>{if(o.keywords[r])throw Error(`Keyword ${r} is already defined`);if(!G0.test(r))throw Error(`Keyword ${r} has invalid name`)}),!i)return;if(i.$data&&!(("code"in i)||("validate"in i)))throw Error('$data keyword must have "code" or "validate" function')}function Jo(t,i,o){var r;let $=i===null||i===void 0?void 0:i.post;if(o&&$)throw Error('keyword with "post" flag cannot have "type"');let{RULES:l}=this,f=$?l.post:l.rules.find(({type:n})=>n===o);if(!f)f={type:o,rules:[]},l.rules.push(f);if(l.keywords[t]=!0,!i)return;let s={keyword:t,definition:{...i,type:(0,Wi.getJSONTypes)(i.type),schemaType:(0,Wi.getJSONTypes)(i.schemaType)}};if(i.before)D0.call(this,f,s,i.before);else f.rules.push(s);l.all[t]=s,(r=i.implements)===null||r===void 0||r.forEach((n)=>this.addKeyword(n))}function D0(t,i,o){let r=t.rules.findIndex(($)=>$.keyword===o);if(r>=0)t.rules.splice(r,0,i);else t.rules.push(i),this.logger.warn(`rule ${o} is not defined`)}function v0(t){let{metaSchema:i}=t;if(i===void 0)return;if(t.$data&&this.opts.$data)i=ql(i);t.validateSchema=this.compile(i,!0)}var K0={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ql(t){return{anyOf:[t,K0]}}});var Wl=M((Ol)=>{Object.defineProperty(Ol,"__esModule",{value:!0});var P0={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};Ol.default=P0});var Zi=M((Zl)=>{Object.defineProperty(Zl,"__esModule",{value:!0});Zl.callRef=Zl.getValidate=void 0;var R0=Pt(),jl=E(),U=O(),Bt=P(),wl=Rt(),wi=j(),S0={keyword:"$ref",schemaType:"string",code(t){let{gen:i,schema:o,it:r}=t,{baseId:$,schemaEnv:l,validateName:f,opts:s,self:n}=r,{root:b}=l;if((o==="#"||o==="#/")&&$===b.baseId)return I();let u=wl.resolveRef.call(n,b,$,o);if(u===void 0)throw new R0.default(r.opts.uriResolver,$,o);if(u instanceof wl.SchemaEnv)return V(u);return d(u);function I(){if(l===b)return Fi(t,f,l,l.$async);let y=i.scopeValue("root",{ref:b});return Fi(t,U._`${y}.validate`,b,b.$async)}function V(y){let e=Fl(t,y);Fi(t,e,y,y.$async)}function d(y){let e=i.scopeValue("schema",s.code.source===!0?{ref:y,code:(0,U.stringify)(y)}:{ref:y}),c=i.name("valid"),p=t.subschema({schema:y,dataTypes:[],schemaPath:U.nil,topSchemaRef:e,errSchemaPath:o},c);t.mergeEvaluated(p),t.ok(c)}}};function Fl(t,i){let{gen:o}=t;return i.validate?o.scopeValue("validate",{ref:i.validate}):U._`${o.scopeValue("wrapper",{ref:i})}.validate`}Zl.getValidate=Fl;function Fi(t,i,o,r){let{gen:$,it:l}=t,{allErrors:f,schemaEnv:s,opts:n}=l,b=n.passContext?Bt.default.this:U.nil;if(r)u();else I();function u(){if(!s.$async)throw Error("async schema referenced by sync schema");let y=$.let("valid");$.try(()=>{if($.code(U._`await ${(0,jl.callValidateCode)(t,i,b)}`),d(i),!f)$.assign(y,!0)},(e)=>{if($.if(U._`!(${e} instanceof ${l.ValidationError})`,()=>$.throw(e)),V(e),!f)$.assign(y,!1)}),t.ok(y)}function I(){t.result((0,jl.callValidateCode)(t,i,b),()=>d(i),()=>V(i))}function V(y){let e=U._`${y}.errors`;$.assign(Bt.default.vErrors,U._`${Bt.default.vErrors} === null ? ${e} : ${Bt.default.vErrors}.concat(${e})`),$.assign(Bt.default.errors,U._`${Bt.default.vErrors}.length`)}function d(y){var e;if(!l.opts.unevaluated)return;let c=(e=o===null||o===void 0?void 0:o.validate)===null||e===void 0?void 0:e.evaluated;if(l.props!==!0)if(c&&!c.dynamicProps){if(c.props!==void 0)l.props=wi.mergeEvaluated.props($,c.props,l.props)}else{let p=$.var("props",U._`${y}.evaluated.props`);l.props=wi.mergeEvaluated.props($,p,l.props,U.Name)}if(l.items!==!0)if(c&&!c.dynamicItems){if(c.items!==void 0)l.items=wi.mergeEvaluated.items($,c.items,l.items)}else{let p=$.var("items",U._`${y}.evaluated.items`);l.items=wi.mergeEvaluated.items($,p,l.items,U.Name)}}}Zl.callRef=Fi;Zl.default=S0});var Xl=M((Jl)=>{Object.defineProperty(Jl,"__esModule",{value:!0});var h0=Wl(),g0=Zi(),m0=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",h0.default,g0.default];Jl.default=m0});var Al=M((Yl)=>{Object.defineProperty(Yl,"__esModule",{value:!0});var Bi=O(),ut=Bi.operators,Ji={maximum:{okStr:"<=",ok:ut.LTE,fail:ut.GT},minimum:{okStr:">=",ok:ut.GTE,fail:ut.LT},exclusiveMaximum:{okStr:"<",ok:ut.LT,fail:ut.GTE},exclusiveMinimum:{okStr:">",ok:ut.GT,fail:ut.LTE}},a0={message:({keyword:t,schemaCode:i})=>Bi.str`must be ${Ji[t].okStr} ${i}`,params:({keyword:t,schemaCode:i})=>Bi._`{comparison: ${Ji[t].okStr}, limit: ${i}}`},_0={keyword:Object.keys(Ji),type:"number",schemaType:"number",$data:!0,error:a0,code(t){let{keyword:i,data:o,schemaCode:r}=t;t.fail$data(Bi._`${o} ${Ji[i].fail} ${r} || isNaN(${o})`)}};Yl.default=_0});var Ql=M((zl)=>{Object.defineProperty(zl,"__esModule",{value:!0});var ht=O(),i1={message:({schemaCode:t})=>ht.str`must be multiple of ${t}`,params:({schemaCode:t})=>ht._`{multipleOf: ${t}}`},o1={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:i1,code(t){let{gen:i,data:o,schemaCode:r,it:$}=t,l=$.opts.multipleOfPrecision,f=i.let("res"),s=l?ht._`Math.abs(Math.round(${f}) - ${f}) > 1e-${l}`:ht._`${f} !== parseInt(${f})`;t.fail$data(ht._`(${r} === 0 || (${f} = ${o}/${r}, ${s}))`)}};zl.default=o1});var Dl=M((Hl)=>{Object.defineProperty(Hl,"__esModule",{value:!0});function Gl(t){let i=t.length,o=0,r=0,$;while(r<i)if(o++,$=t.charCodeAt(r++),$>=55296&&$<=56319&&r<i){if($=t.charCodeAt(r),($&64512)===56320)r++}return o}Hl.default=Gl;Gl.code='require("ajv/dist/runtime/ucs2length").default'});var Kl=M((vl)=>{Object.defineProperty(vl,"__esModule",{value:!0});var pt=O(),l1=j(),f1=Dl(),s1={message({keyword:t,schemaCode:i}){let o=t==="maxLength"?"more":"fewer";return pt.str`must NOT have ${o} than ${i} characters`},params:({schemaCode:t})=>pt._`{limit: ${t}}`},n1={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:s1,code(t){let{keyword:i,data:o,schemaCode:r,it:$}=t,l=i==="maxLength"?pt.operators.GT:pt.operators.LT,f=$.opts.unicode===!1?pt._`${o}.length`:pt._`${(0,l1.useFunc)(t.gen,f1.default)}(${o})`;t.fail$data(pt._`${f} ${l} ${r}`)}};vl.default=n1});var Nl=M((Ul)=>{Object.defineProperty(Ul,"__esModule",{value:!0});var u1=E(),I1=j(),Jt=O(),y1={message:({schemaCode:t})=>Jt.str`must match pattern "${t}"`,params:({schemaCode:t})=>Jt._`{pattern: ${t}}`},e1={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:y1,code(t){let{gen:i,data:o,$data:r,schema:$,schemaCode:l,it:f}=t,s=f.opts.unicodeRegExp?"u":"";if(r){let{regExp:n}=f.opts.code,b=n.code==="new RegExp"?Jt._`new RegExp`:(0,I1.useFunc)(i,n),u=i.let("valid");i.try(()=>i.assign(u,Jt._`${b}(${l}, ${s}).test(${o})`),()=>i.assign(u,!1)),t.fail$data(Jt._`!${u}`)}else{let n=(0,u1.usePattern)(t,$);t.fail$data(Jt._`!${n}.test(${o})`)}}};Ul.default=e1});var El=M((Pl)=>{Object.defineProperty(Pl,"__esModule",{value:!0});var gt=O(),d1={message({keyword:t,schemaCode:i}){let o=t==="maxProperties"?"more":"fewer";return gt.str`must NOT have ${o} than ${i} properties`},params:({schemaCode:t})=>gt._`{limit: ${t}}`},V1={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:d1,code(t){let{keyword:i,data:o,schemaCode:r}=t,$=i==="maxProperties"?gt.operators.GT:gt.operators.LT;t.fail$data(gt._`Object.keys(${o}).length ${$} ${r}`)}};Pl.default=V1});var Sl=M((Rl)=>{Object.defineProperty(Rl,"__esModule",{value:!0});var mt=E(),xt=O(),p1=j(),L1={message:({params:{missingProperty:t}})=>xt.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>xt._`{missingProperty: ${t}}`},q1={keyword:"required",type:"object",schemaType:"array",$data:!0,error:L1,code(t){let{gen:i,schema:o,schemaCode:r,data:$,$data:l,it:f}=t,{opts:s}=f;if(!l&&o.length===0)return;let n=o.length>=s.loopRequired;if(f.allErrors)b();else u();if(s.strictRequired){let d=t.parentSchema.properties,{definedProperties:y}=t.it;for(let e of o)if((d===null||d===void 0?void 0:d[e])===void 0&&!y.has(e)){let c=f.schemaEnv.baseId+f.errSchemaPath,p=`required property "${e}" is not defined at "${c}" (strictRequired)`;(0,p1.checkStrictMode)(f,p,f.opts.strictRequired)}}function b(){if(n||l)t.block$data(xt.nil,I);else for(let d of o)(0,mt.checkReportMissingProp)(t,d)}function u(){let d=i.let("missing");if(n||l){let y=i.let("valid",!0);t.block$data(y,()=>V(d,y)),t.ok(y)}else i.if((0,mt.checkMissingProp)(t,o,d)),(0,mt.reportMissingProp)(t,d),i.else()}function I(){i.forOf("prop",r,(d)=>{t.setParams({missingProperty:d}),i.if((0,mt.noPropertyInData)(i,$,d,s.ownProperties),()=>t.error())})}function V(d,y){t.setParams({missingProperty:d}),i.forOf(d,r,()=>{i.assign(y,(0,mt.propertyInData)(i,$,d,s.ownProperties)),i.if((0,xt.not)(y),()=>{t.error(),i.break()})},xt.nil)}}};Rl.default=q1});var Cl=M((kl)=>{Object.defineProperty(kl,"__esModule",{value:!0});var at=O(),O1={message({keyword:t,schemaCode:i}){let o=t==="maxItems"?"more":"fewer";return at.str`must NOT have ${o} than ${i} items`},params:({schemaCode:t})=>at._`{limit: ${t}}`},W1={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:O1,code(t){let{keyword:i,data:o,schemaCode:r}=t,$=i==="maxItems"?at.operators.GT:at.operators.LT;t.fail$data(at._`${o}.length ${$} ${r}`)}};kl.default=W1});var Xi=M((gl)=>{Object.defineProperty(gl,"__esModule",{value:!0});var hl=eo();hl.code='require("ajv/dist/runtime/equal").default';gl.default=hl});var xl=M((ml)=>{Object.defineProperty(ml,"__esModule",{value:!0});var Yo=Dt(),z=O(),F1=j(),Z1=Xi(),B1={message:({params:{i:t,j:i}})=>z.str`must NOT have duplicate items (items ## ${i} and ${t} are identical)`,params:({params:{i:t,j:i}})=>z._`{i: ${t}, j: ${i}}`},J1={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:B1,code(t){let{gen:i,data:o,$data:r,schema:$,parentSchema:l,schemaCode:f,it:s}=t;if(!r&&!$)return;let n=i.let("valid"),b=l.items?(0,Yo.getSchemaTypes)(l.items):[];t.block$data(n,u,z._`${f} === false`),t.ok(n);function u(){let y=i.let("i",z._`${o}.length`),e=i.let("j");t.setParams({i:y,j:e}),i.assign(n,!0),i.if(z._`${y} > 1`,()=>(I()?V:d)(y,e))}function I(){return b.length>0&&!b.some((y)=>y==="object"||y==="array")}function V(y,e){let c=i.name("item"),p=(0,Yo.checkDataTypes)(b,c,s.opts.strictNumbers,Yo.DataType.Wrong),Z=i.const("indices",z._`{}`);i.for(z._`;${y}--;`,()=>{if(i.let(c,z._`${o}[${y}]`),i.if(p,z._`continue`),b.length>1)i.if(z._`typeof ${c} == "string"`,z._`${c} += "_"`);i.if(z._`typeof ${Z}[${c}] == "number"`,()=>{i.assign(e,z._`${Z}[${c}]`),t.error(),i.assign(n,!1).break()}).code(z._`${Z}[${c}] = ${y}`)})}function d(y,e){let c=(0,F1.useFunc)(i,Z1.default),p=i.name("outer");i.label(p).for(z._`;${y}--;`,()=>i.for(z._`${e} = ${y}; ${e}--;`,()=>i.if(z._`${c}(${o}[${y}], ${o}[${e}])`,()=>{t.error(),i.assign(n,!1).break(p)})))}}};ml.default=J1});var _l=M((al)=>{Object.defineProperty(al,"__esModule",{value:!0});var Ao=O(),Y1=j(),A1=Xi(),z1={message:"must be equal to constant",params:({schemaCode:t})=>Ao._`{allowedValue: ${t}}`},Q1={keyword:"const",$data:!0,error:z1,code(t){let{gen:i,data:o,$data:r,schemaCode:$,schema:l}=t;if(r||l&&typeof l=="object")t.fail$data(Ao._`!${(0,Y1.useFunc)(i,A1.default)}(${o}, ${$})`);else t.fail(Ao._`${l} !== ${o}`)}};al.default=Q1});var of=M((tf)=>{Object.defineProperty(tf,"__esModule",{value:!0});var _t=O(),H1=j(),D1=Xi(),v1={message:"must be equal to one of the allowed values",params:({schemaCode:t})=>_t._`{allowedValues: ${t}}`},K1={keyword:"enum",schemaType:"array",$data:!0,error:v1,code(t){let{gen:i,data:o,$data:r,schema:$,schemaCode:l,it:f}=t;if(!r&&$.length===0)throw Error("enum must have non-empty array");let s=$.length>=f.opts.loopEnum,n,b=()=>n!==null&&n!==void 0?n:n=(0,H1.useFunc)(i,D1.default),u;if(s||r)u=i.let("valid"),t.block$data(u,I);else{if(!Array.isArray($))throw Error("ajv implementation error");let d=i.const("vSchema",l);u=(0,_t.or)(...$.map((y,e)=>V(d,e)))}t.pass(u);function I(){i.assign(u,!1),i.forOf("v",l,(d)=>i.if(_t._`${b()}(${o}, ${d})`,()=>i.assign(u,!0).break()))}function V(d,y){let e=$[y];return typeof e==="object"&&e!==null?_t._`${b()}(${o}, ${d}[${y}])`:_t._`${o} === ${e}`}}};tf.default=K1});var $f=M((rf)=>{Object.defineProperty(rf,"__esModule",{value:!0});var N1=Al(),P1=Ql(),E1=Kl(),R1=Nl(),S1=El(),k1=Sl(),C1=Cl(),h1=xl(),g1=_l(),m1=of(),x1=[N1.default,P1.default,E1.default,R1.default,S1.default,k1.default,C1.default,h1.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},g1.default,m1.default];rf.default=x1});var Qo=M((ff)=>{Object.defineProperty(ff,"__esModule",{value:!0});ff.validateAdditionalItems=void 0;var Lt=O(),zo=j(),_1={message:({params:{len:t}})=>Lt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Lt._`{limit: ${t}}`},te={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:_1,code(t){let{parentSchema:i,it:o}=t,{items:r}=i;if(!Array.isArray(r)){(0,zo.checkStrictMode)(o,'"additionalItems" is ignored when "items" is not an array of schemas');return}lf(t,r)}};function lf(t,i){let{gen:o,schema:r,data:$,keyword:l,it:f}=t;f.items=!0;let s=o.const("len",Lt._`${$}.length`);if(r===!1)t.setParams({len:i.length}),t.pass(Lt._`${s} <= ${i.length}`);else if(typeof r=="object"&&!(0,zo.alwaysValidSchema)(f,r)){let b=o.var("valid",Lt._`${s} <= ${i.length}`);o.if((0,Lt.not)(b),()=>n(b)),t.ok(b)}function n(b){o.forRange("i",i.length,s,(u)=>{if(t.subschema({keyword:l,dataProp:u,dataPropType:zo.Type.Num},b),!f.allErrors)o.if((0,Lt.not)(b),()=>o.break())})}}ff.validateAdditionalItems=lf;ff.default=te});var Go=M((uf)=>{Object.defineProperty(uf,"__esModule",{value:!0});uf.validateTuple=void 0;var nf=O(),Yi=j(),oe=E(),re={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){let{schema:i,it:o}=t;if(Array.isArray(i))return bf(t,"additionalItems",i);if(o.items=!0,(0,Yi.alwaysValidSchema)(o,i))return;t.ok((0,oe.validateArray)(t))}};function bf(t,i,o=t.schema){let{gen:r,parentSchema:$,data:l,keyword:f,it:s}=t;if(u($),s.opts.unevaluated&&o.length&&s.items!==!0)s.items=Yi.mergeEvaluated.items(r,o.length,s.items);let n=r.name("valid"),b=r.const("len",nf._`${l}.length`);o.forEach((I,V)=>{if((0,Yi.alwaysValidSchema)(s,I))return;r.if(nf._`${b} > ${V}`,()=>t.subschema({keyword:f,schemaProp:V,dataProp:V},n)),t.ok(n)});function u(I){let{opts:V,errSchemaPath:d}=s,y=o.length,e=y===I.minItems&&(y===I.maxItems||I[i]===!1);if(V.strictTuples&&!e){let c=`"${f}" is ${y}-tuple, but minItems or maxItems/${i} are not specified or different at path "${d}"`;(0,Yi.checkStrictMode)(s,c,V.strictTuples)}}}uf.validateTuple=bf;uf.default=re});var ef=M((yf)=>{Object.defineProperty(yf,"__esModule",{value:!0});var le=Go(),fe={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(t)=>(0,le.validateTuple)(t,"items")};yf.default=fe});var Vf=M((df)=>{Object.defineProperty(df,"__esModule",{value:!0});var Mf=O(),ne=j(),be=E(),ue=Qo(),Ie={message:({params:{len:t}})=>Mf.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Mf._`{limit: ${t}}`},ye={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:Ie,code(t){let{schema:i,parentSchema:o,it:r}=t,{prefixItems:$}=o;if(r.items=!0,(0,ne.alwaysValidSchema)(r,i))return;if($)(0,ue.validateAdditionalItems)(t,$);else t.ok((0,be.validateArray)(t))}};df.default=ye});var pf=M((cf)=>{Object.defineProperty(cf,"__esModule",{value:!0});var R=O(),Ai=j(),Me={message:({params:{min:t,max:i}})=>i===void 0?R.str`must contain at least ${t} valid item(s)`:R.str`must contain at least ${t} and no more than ${i} valid item(s)`,params:({params:{min:t,max:i}})=>i===void 0?R._`{minContains: ${t}}`:R._`{minContains: ${t}, maxContains: ${i}}`},de={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:Me,code(t){let{gen:i,schema:o,parentSchema:r,data:$,it:l}=t,f,s,{minContains:n,maxContains:b}=r;if(l.opts.next)f=n===void 0?1:n,s=b;else f=1;let u=i.const("len",R._`${$}.length`);if(t.setParams({min:f,max:s}),s===void 0&&f===0){(0,Ai.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(s!==void 0&&f>s){(0,Ai.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),t.fail();return}if((0,Ai.alwaysValidSchema)(l,o)){let e=R._`${u} >= ${f}`;if(s!==void 0)e=R._`${e} && ${u} <= ${s}`;t.pass(e);return}l.items=!0;let I=i.name("valid");if(s===void 0&&f===1)d(I,()=>i.if(I,()=>i.break()));else if(f===0){if(i.let(I,!0),s!==void 0)i.if(R._`${$}.length > 0`,V)}else i.let(I,!1),V();t.result(I,()=>t.reset());function V(){let e=i.name("_valid"),c=i.let("count",0);d(e,()=>i.if(e,()=>y(c)))}function d(e,c){i.forRange("i",0,u,(p)=>{t.subschema({keyword:"contains",dataProp:p,dataPropType:Ai.Type.Num,compositeRule:!0},e),c()})}function y(e){if(i.code(R._`${e}++`),s===void 0)i.if(R._`${e} >= ${f}`,()=>i.assign(I,!0).break());else if(i.if(R._`${e} > ${s}`,()=>i.assign(I,!1).break()),f===1)i.assign(I,!0);else i.if(R._`${e} >= ${f}`,()=>i.assign(I,!0))}}};cf.default=de});var zi=M((Tf)=>{Object.defineProperty(Tf,"__esModule",{value:!0});Tf.validateSchemaDeps=Tf.validatePropertyDeps=Tf.error=void 0;var Ho=O(),ce=j(),ti=E();Tf.error={message:({params:{property:t,depsCount:i,deps:o}})=>{let r=i===1?"property":"properties";return Ho.str`must have ${r} ${o} when property ${t} is present`},params:({params:{property:t,depsCount:i,deps:o,missingProperty:r}})=>Ho._`{property: ${t},
8
8
  missingProperty: ${r},
9
- depsCount: ${t},
10
- deps: ${o}}`};var yM={keyword:"dependencies",type:"object",schemaType:"object",error:jf.error,code(i){let[t,o]=MM(i);Of(i,t),wf(i,o)}};function MM({schema:i}){let t={},o={};for(let r in i){if(r==="__proto__")continue;let $=Array.isArray(i[r])?t:o;$[r]=i[r]}return[t,o]}function Of(i,t=i.schema){let{gen:o,data:r,it:$}=i;if(Object.keys(t).length===0)return;let l=o.let("missing");for(let f in t){let s=t[f];if(s.length===0)continue;let b=(0,it.propertyInData)(o,r,f,$.opts.ownProperties);if(i.setParams({property:f,depsCount:s.length,deps:s.join(", ")}),$.allErrors)o.if(b,()=>{for(let n of s)(0,it.checkReportMissingProp)(i,n)});else o.if(Ko._`${b} && (${(0,it.checkMissingProp)(i,s,l)})`),(0,it.reportMissingProp)(i,l),o.else()}}jf.validatePropertyDeps=Of;function wf(i,t=i.schema){let{gen:o,data:r,keyword:$,it:l}=i,f=o.name("valid");for(let s in t){if((0,IM.alwaysValidSchema)(l,t[s]))continue;o.if((0,it.propertyInData)(o,r,s,l.opts.ownProperties),()=>{let b=i.subschema({keyword:$,schemaProp:s},f);i.mergeValidEvaluated(b,f)},()=>o.var(f,!0)),i.ok(f)}}jf.validateSchemaDeps=wf;jf.default=yM});var Xf=V((Jf)=>{Object.defineProperty(Jf,"__esModule",{value:!0});var Bf=F(),qM=B(),TM={message:"property name must be valid",params:({params:i})=>Bf._`{propertyName: ${i.propertyName}}`},WM={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:TM,code(i){let{gen:t,schema:o,data:r,it:$}=i;if((0,qM.alwaysValidSchema)($,o))return;let l=t.name("valid");t.forIn("key",r,(f)=>{i.setParams({propertyName:f}),i.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},l),t.if((0,Bf.not)(l),()=>{if(i.error(!0),!$.allErrors)t.break()})}),i.ok(l)}};Jf.default=WM});var vo=V((Yf)=>{Object.defineProperty(Yf,"__esModule",{value:!0});var dt=R(),x=F(),wM=c(),Kt=B(),jM={message:"must NOT have additional properties",params:({params:i})=>x._`{additionalProperty: ${i.additionalProperty}}`},FM={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:jM,code(i){let{gen:t,schema:o,parentSchema:r,data:$,errsCount:l,it:f}=i;if(!l)throw Error("ajv implementation error");let{allErrors:s,opts:b}=f;if(f.props=!0,b.removeAdditional!=="all"&&(0,Kt.alwaysValidSchema)(f,o))return;let n=(0,dt.allSchemaProperties)(r.properties),u=(0,dt.allSchemaProperties)(r.patternProperties);I(),i.ok(x._`${l} === ${wM.default.errors}`);function I(){t.forIn("key",$,(T)=>{if(!n.length&&!u.length)y(T);else t.if(q(T),()=>y(T))})}function q(T){let W;if(n.length>8){let Y=(0,Kt.schemaRefOrVal)(f,r.properties,"properties");W=(0,dt.isOwnProperty)(t,Y,T)}else if(n.length)W=(0,x.or)(...n.map((Y)=>x._`${T} === ${Y}`));else W=x.nil;if(u.length)W=(0,x.or)(W,...u.map((Y)=>x._`${(0,dt.usePattern)(i,Y)}.test(${T})`));return(0,x.not)(W)}function L(T){t.code(x._`delete ${$}[${T}]`)}function y(T){if(b.removeAdditional==="all"||b.removeAdditional&&o===!1){L(T);return}if(o===!1){if(i.setParams({additionalProperty:T}),i.error(),!s)t.break();return}if(typeof o=="object"&&!(0,Kt.alwaysValidSchema)(f,o)){let W=t.name("valid");if(b.removeAdditional==="failing")M(T,W,!1),t.if((0,x.not)(W),()=>{i.reset(),L(T)});else if(M(T,W),!s)t.if((0,x.not)(W),()=>t.break())}}function M(T,W,Y){let J={keyword:"additionalProperties",dataProp:T,dataPropType:Kt.Type.Str};if(Y===!1)Object.assign(J,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(J,W)}}};Yf.default=FM});var Gf=V((zf)=>{Object.defineProperty(zf,"__esModule",{value:!0});var BM=Pi(),Qf=R(),Uo=B(),Af=vo(),JM={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:t,schema:o,parentSchema:r,data:$,it:l}=i;if(l.opts.removeAdditional==="all"&&r.additionalProperties===void 0)Af.default.code(new BM.KeywordCxt(l,Af.default,"additionalProperties"));let f=(0,Qf.allSchemaProperties)(o);for(let I of f)l.definedProperties.add(I);if(l.opts.unevaluated&&f.length&&l.props!==!0)l.props=Uo.mergeEvaluated.props(t,(0,Uo.toHash)(f),l.props);let s=f.filter((I)=>!(0,Uo.alwaysValidSchema)(l,o[I]));if(s.length===0)return;let b=t.name("valid");for(let I of s){if(n(I))u(I);else{if(t.if((0,Qf.propertyInData)(t,$,I,l.opts.ownProperties)),u(I),!l.allErrors)t.else().var(b,!0);t.endIf()}i.it.definedProperties.add(I),i.ok(b)}function n(I){return l.opts.useDefaults&&!l.compositeRule&&o[I].default!==void 0}function u(I){i.subschema({keyword:"properties",schemaProp:I,dataProp:I},b)}}};zf.default=JM});var vf=V((Kf)=>{Object.defineProperty(Kf,"__esModule",{value:!0});var Hf=R(),vt=F(),Df=B(),df=B(),YM={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:t,schema:o,data:r,parentSchema:$,it:l}=i,{opts:f}=l,s=(0,Hf.allSchemaProperties)(o),b=s.filter((M)=>(0,Df.alwaysValidSchema)(l,o[M]));if(s.length===0||b.length===s.length&&(!l.opts.unevaluated||l.props===!0))return;let n=f.strictSchema&&!f.allowMatchingProperties&&$.properties,u=t.name("valid");if(l.props!==!0&&!(l.props instanceof vt.Name))l.props=(0,df.evaluatedPropsToName)(t,l.props);let{props:I}=l;q();function q(){for(let M of s){if(n)L(M);if(l.allErrors)y(M);else t.var(u,!0),y(M),t.if(u)}}function L(M){for(let T in n)if(new RegExp(M).test(T))(0,Df.checkStrictMode)(l,`property ${T} matches pattern ${M} (use allowMatchingProperties)`)}function y(M){t.forIn("key",r,(T)=>{t.if(vt._`${(0,Hf.usePattern)(i,M)}.test(${T})`,()=>{let W=b.includes(M);if(!W)i.subschema({keyword:"patternProperties",schemaProp:M,dataProp:T,dataPropType:df.Type.Str},u);if(l.opts.unevaluated&&I!==!0)t.assign(vt._`${I}[${T}]`,!0);else if(!W&&!l.allErrors)t.if((0,vt.not)(u),()=>t.break())})})}}};Kf.default=YM});var Nf=V((Uf)=>{Object.defineProperty(Uf,"__esModule",{value:!0});var AM=B(),zM={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(i){let{gen:t,schema:o,it:r}=i;if((0,AM.alwaysValidSchema)(r,o)){i.fail();return}let $=t.name("valid");i.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},$),i.failResult($,()=>i.reset(),()=>i.error())},error:{message:"must NOT be valid"}};Uf.default=zM});var pf=V((Ef)=>{Object.defineProperty(Ef,"__esModule",{value:!0});var HM=R(),DM={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:HM.validateUnion,error:{message:"must match a schema in anyOf"}};Ef.default=DM});var cf=V((Pf)=>{Object.defineProperty(Pf,"__esModule",{value:!0});var Ut=F(),KM=B(),vM={message:"must match exactly one schema in oneOf",params:({params:i})=>Ut._`{passingSchemas: ${i.passing}}`},UM={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:vM,code(i){let{gen:t,schema:o,parentSchema:r,it:$}=i;if(!Array.isArray(o))throw Error("ajv implementation error");if($.opts.discriminator&&r.discriminator)return;let l=o,f=t.let("valid",!1),s=t.let("passing",null),b=t.name("_valid");i.setParams({passing:s}),t.block(n),i.result(f,()=>i.reset(),()=>i.error(!0));function n(){l.forEach((u,I)=>{let q;if((0,KM.alwaysValidSchema)($,u))t.var(b,!0);else q=i.subschema({keyword:"oneOf",schemaProp:I,compositeRule:!0},b);if(I>0)t.if(Ut._`${b} && ${f}`).assign(f,!1).assign(s,Ut._`[${s}, ${I}]`).else();t.if(b,()=>{if(t.assign(f,!0),t.assign(s,I),q)i.mergeEvaluated(q,Ut.Name)})})}}};Pf.default=UM});var Sf=V((Rf)=>{Object.defineProperty(Rf,"__esModule",{value:!0});var EM=B(),pM={keyword:"allOf",schemaType:"array",code(i){let{gen:t,schema:o,it:r}=i;if(!Array.isArray(o))throw Error("ajv implementation error");let $=t.name("valid");o.forEach((l,f)=>{if((0,EM.alwaysValidSchema)(r,l))return;let s=i.subschema({keyword:"allOf",schemaProp:f},$);i.ok($),i.mergeEvaluated(s)})}};Rf.default=pM});var hf=V((ef)=>{Object.defineProperty(ef,"__esModule",{value:!0});var Nt=F(),Cf=B(),cM={message:({params:i})=>Nt.str`must match "${i.ifClause}" schema`,params:({params:i})=>Nt._`{failingKeyword: ${i.ifClause}}`},RM={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:cM,code(i){let{gen:t,parentSchema:o,it:r}=i;if(o.then===void 0&&o.else===void 0)(0,Cf.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let $=kf(r,"then"),l=kf(r,"else");if(!$&&!l)return;let f=t.let("valid",!0),s=t.name("_valid");if(b(),i.reset(),$&&l){let u=t.let("ifClause");i.setParams({ifClause:u}),t.if(s,n("then",u),n("else",u))}else if($)t.if(s,n("then"));else t.if((0,Nt.not)(s),n("else"));i.pass(f,()=>i.error(!0));function b(){let u=i.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);i.mergeEvaluated(u)}function n(u,I){return()=>{let q=i.subschema({keyword:u},s);if(t.assign(f,s),i.mergeValidEvaluated(q,f),I)t.assign(I,Nt._`${u}`);else i.setParams({ifClause:u})}}}};function kf(i,t){let o=i.schema[t];return o!==void 0&&!(0,Cf.alwaysValidSchema)(i,o)}ef.default=RM});var xf=V((gf)=>{Object.defineProperty(gf,"__esModule",{value:!0});var kM=B(),CM={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:i,parentSchema:t,it:o}){if(t.if===void 0)(0,kM.checkStrictMode)(o,`"${i}" without "if" is ignored`)}};gf.default=CM});var _f=V((mf)=>{Object.defineProperty(mf,"__esModule",{value:!0});var hM=Ho(),gM=Mf(),xM=Do(),mM=qf(),_M=Wf(),aM=Dt(),i6=Xf(),t6=vo(),o6=Gf(),r6=vf(),$6=Nf(),l6=pf(),f6=cf(),s6=Sf(),b6=hf(),n6=xf();function u6(i=!1){let t=[$6.default,l6.default,f6.default,s6.default,b6.default,n6.default,i6.default,t6.default,aM.default,o6.default,r6.default];if(i)t.push(gM.default,mM.default);else t.push(hM.default,xM.default);return t.push(_M.default),t}mf.default=u6});var Eo=V((ts)=>{Object.defineProperty(ts,"__esModule",{value:!0});ts.dynamicAnchor=void 0;var No=F(),y6=c(),af=Si(),M6=Yt(),V6={keyword:"$dynamicAnchor",schemaType:"string",code:(i)=>is(i,i.schema)};function is(i,t){let{gen:o,it:r}=i;r.schemaEnv.root.dynamicAnchors[t]=!0;let $=No._`${y6.default.dynamicAnchors}${(0,No.getProperty)(t)}`,l=r.errSchemaPath==="#"?r.validateName:L6(i);o.if(No._`!${$}`,()=>o.assign($,l))}ts.dynamicAnchor=is;function L6(i){let{schemaEnv:t,schema:o,self:r}=i.it,{root:$,baseId:l,localRefs:f,meta:s}=t.root,{schemaId:b}=r.opts,n=new af.SchemaEnv({schema:o,schemaId:b,root:$,baseId:l,localRefs:f,meta:s});return af.compileSchema.call(r,n),(0,M6.getValidate)(i,n)}ts.default=V6});var po=V((fs)=>{Object.defineProperty(fs,"__esModule",{value:!0});fs.dynamicRef=void 0;var rs=F(),T6=c(),$s=Yt(),W6={keyword:"$dynamicRef",schemaType:"string",code:(i)=>ls(i,i.schema)};function ls(i,t){let{gen:o,keyword:r,it:$}=i;if(t[0]!=="#")throw Error(`"${r}" only supports hash fragment reference`);let l=t.slice(1);if($.allErrors)f();else{let b=o.let("valid",!1);f(b),i.ok(b)}function f(b){if($.schemaEnv.root.dynamicAnchors[l]){let n=o.let("_v",rs._`${T6.default.dynamicAnchors}${(0,rs.getProperty)(l)}`);o.if(n,s(n,b),s($.validateName,b))}else s($.validateName,b)()}function s(b,n){return n?()=>o.block(()=>{(0,$s.callRef)(i,b),o.let(n,!0)}):()=>(0,$s.callRef)(i,b)}}fs.dynamicRef=ls;fs.default=W6});var ns=V((bs)=>{Object.defineProperty(bs,"__esModule",{value:!0});var w6=Eo(),j6=B(),F6={keyword:"$recursiveAnchor",schemaType:"boolean",code(i){if(i.schema)(0,w6.dynamicAnchor)(i,"");else(0,j6.checkStrictMode)(i.it,"$recursiveAnchor: false is ignored")}};bs.default=F6});var Is=V((us)=>{Object.defineProperty(us,"__esModule",{value:!0});var B6=po(),J6={keyword:"$recursiveRef",schemaType:"string",code:(i)=>(0,B6.dynamicRef)(i,i.schema)};us.default=J6});var Ms=V((ys)=>{Object.defineProperty(ys,"__esModule",{value:!0});var Y6=Eo(),Q6=po(),A6=ns(),z6=Is(),G6=[Y6.default,Q6.default,A6.default,z6.default];ys.default=G6});var qs=V((Ls)=>{Object.defineProperty(Ls,"__esModule",{value:!0});var Vs=Dt(),D6={keyword:"dependentRequired",type:"object",schemaType:"object",error:Vs.error,code:(i)=>(0,Vs.validatePropertyDeps)(i)};Ls.default=D6});var Ws=V((Ts)=>{Object.defineProperty(Ts,"__esModule",{value:!0});var K6=Dt(),v6={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(i)=>(0,K6.validateSchemaDeps)(i)};Ts.default=v6});var ws=V((Os)=>{Object.defineProperty(Os,"__esModule",{value:!0});var N6=B(),E6={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:i,parentSchema:t,it:o}){if(t.contains===void 0)(0,N6.checkStrictMode)(o,`"${i}" without "contains" is ignored`)}};Os.default=E6});var Fs=V((js)=>{Object.defineProperty(js,"__esModule",{value:!0});var P6=qs(),c6=Ws(),R6=ws(),S6=[P6.default,c6.default,R6.default];js.default=S6});var Js=V((Bs)=>{Object.defineProperty(Bs,"__esModule",{value:!0});var Ii=F(),Zs=B(),C6=c(),e6={message:"must NOT have unevaluated properties",params:({params:i})=>Ii._`{unevaluatedProperty: ${i.unevaluatedProperty}}`},h6={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:e6,code(i){let{gen:t,schema:o,data:r,errsCount:$,it:l}=i;if(!$)throw Error("ajv implementation error");let{allErrors:f,props:s}=l;if(s instanceof Ii.Name)t.if(Ii._`${s} !== true`,()=>t.forIn("key",r,(I)=>t.if(n(s,I),()=>b(I))));else if(s!==!0)t.forIn("key",r,(I)=>s===void 0?b(I):t.if(u(s,I),()=>b(I)));l.props=!0,i.ok(Ii._`${$} === ${C6.default.errors}`);function b(I){if(o===!1){if(i.setParams({unevaluatedProperty:I}),i.error(),!f)t.break();return}if(!(0,Zs.alwaysValidSchema)(l,o)){let q=t.name("valid");if(i.subschema({keyword:"unevaluatedProperties",dataProp:I,dataPropType:Zs.Type.Str},q),!f)t.if((0,Ii.not)(q),()=>t.break())}}function n(I,q){return Ii._`!${I} || !${I}[${q}]`}function u(I,q){let L=[];for(let y in I)if(I[y]===!0)L.push(Ii._`${q} !== ${y}`);return(0,Ii.and)(...L)}}};Bs.default=h6});var Qs=V((Ys)=>{Object.defineProperty(Ys,"__esModule",{value:!0});var wi=F(),Xs=B(),x6={message:({params:{len:i}})=>wi.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>wi._`{limit: ${i}}`},m6={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:x6,code(i){let{gen:t,schema:o,data:r,it:$}=i,l=$.items||0;if(l===!0)return;let f=t.const("len",wi._`${r}.length`);if(o===!1)i.setParams({len:l}),i.fail(wi._`${f} > ${l}`);else if(typeof o=="object"&&!(0,Xs.alwaysValidSchema)($,o)){let b=t.var("valid",wi._`${f} <= ${l}`);t.if((0,wi.not)(b),()=>s(b,l)),i.ok(b)}$.items=!0;function s(b,n){t.forRange("i",n,f,(u)=>{if(i.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:Xs.Type.Num},b),!$.allErrors)t.if((0,wi.not)(b),()=>t.break())})}}};Ys.default=m6});var zs=V((As)=>{Object.defineProperty(As,"__esModule",{value:!0});var a6=Js(),i8=Qs(),t8=[a6.default,i8.default];As.default=t8});var Hs=V((Gs)=>{Object.defineProperty(Gs,"__esModule",{value:!0});var H=F(),r8={message:({schemaCode:i})=>H.str`must match format "${i}"`,params:({schemaCode:i})=>H._`{format: ${i}}`},$8={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:r8,code(i,t){let{gen:o,data:r,$data:$,schema:l,schemaCode:f,it:s}=i,{opts:b,errSchemaPath:n,schemaEnv:u,self:I}=s;if(!b.validateFormats)return;if($)q();else L();function q(){let y=o.scopeValue("formats",{ref:I.formats,code:b.code.formats}),M=o.const("fDef",H._`${y}[${f}]`),T=o.let("fType"),W=o.let("format");o.if(H._`typeof ${M} == "object" && !(${M} instanceof RegExp)`,()=>o.assign(T,H._`${M}.type || "string"`).assign(W,H._`${M}.validate`),()=>o.assign(T,H._`"string"`).assign(W,M)),i.fail$data((0,H.or)(Y(),J()));function Y(){if(b.strictSchema===!1)return H.nil;return H._`${f} && !${W}`}function J(){let z=u.$async?H._`(${M}.async ? await ${W}(${r}) : ${W}(${r}))`:H._`${W}(${r})`,j=H._`(typeof ${W} == "function" ? ${z} : ${W}.test(${r}))`;return H._`${W} && ${W} !== true && ${T} === ${t} && !${j}`}}function L(){let y=I.formats[l];if(!y){Y();return}if(y===!0)return;let[M,T,W]=J(y);if(M===t)i.pass(z());function Y(){if(b.strictSchema===!1){I.logger.warn(j());return}throw Error(j());function j(){return`unknown format "${l}" ignored in schema at path "${n}"`}}function J(j){let m=j instanceof RegExp?(0,H.regexpCode)(j):b.code.formats?H._`${b.code.formats}${(0,H.getProperty)(l)}`:void 0,ii=o.scopeValue("formats",{key:l,ref:j,code:m});if(typeof j=="object"&&!(j instanceof RegExp))return[j.type||"string",j.validate,H._`${ii}.validate`];return["string",j,ii]}function z(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return H._`await ${W}(${r})`}return typeof T=="function"?H._`${W}(${r})`:H._`${W}.test(${r})`}}}};Gs.default=$8});var ds=V((Ds)=>{Object.defineProperty(Ds,"__esModule",{value:!0});var f8=Hs(),s8=[f8.default];Ds.default=s8});var Us=V((Ks)=>{Object.defineProperty(Ks,"__esModule",{value:!0});Ks.contentVocabulary=Ks.metadataVocabulary=void 0;Ks.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Ks.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var ps=V((Es)=>{Object.defineProperty(Es,"__esModule",{value:!0});var u8=zl(),I8=$f(),y8=_f(),M8=Ms(),V8=Fs(),L8=zs(),q8=ds(),Ns=Us(),T8=[M8.default,u8.default,I8.default,(0,y8.default)(!0),q8.default,Ns.metadataVocabulary,Ns.contentVocabulary,V8.default,L8.default];Es.default=T8});var Ss=V((cs)=>{Object.defineProperty(cs,"__esModule",{value:!0});cs.DiscrError=void 0;var Ps;(function(i){i.Tag="tag",i.Mapping="mapping"})(Ps||(cs.DiscrError=Ps={}))});var es=V((Cs)=>{Object.defineProperty(Cs,"__esModule",{value:!0});var zi=F(),Po=Ss(),ks=Si(),O8=ci(),w8=B(),j8={message:({params:{discrError:i,tagName:t}})=>i===Po.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:i,tag:t,tagName:o}})=>zi._`{error: ${i}, tag: ${o}, tagValue: ${t}}`},F8={keyword:"discriminator",type:"object",schemaType:"object",error:j8,code(i){let{gen:t,data:o,schema:r,parentSchema:$,it:l}=i,{oneOf:f}=$;if(!l.opts.discriminator)throw Error("discriminator: requires discriminator option");let s=r.propertyName;if(typeof s!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!f)throw Error("discriminator: requires oneOf keyword");let b=t.let("valid",!1),n=t.const("tag",zi._`${o}${(0,zi.getProperty)(s)}`);t.if(zi._`typeof ${n} == "string"`,()=>u(),()=>i.error(!1,{discrError:Po.DiscrError.Tag,tag:n,tagName:s})),i.ok(b);function u(){let L=q();t.if(!1);for(let y in L)t.elseIf(zi._`${n} === ${y}`),t.assign(b,I(L[y]));t.else(),i.error(!1,{discrError:Po.DiscrError.Mapping,tag:n,tagName:s}),t.endIf()}function I(L){let y=t.name("valid"),M=i.subschema({keyword:"oneOf",schemaProp:L},y);return i.mergeEvaluated(M,zi.Name),y}function q(){var L;let y={},M=W($),T=!0;for(let z=0;z<f.length;z++){let j=f[z];if((j===null||j===void 0?void 0:j.$ref)&&!(0,w8.schemaHasRulesButRef)(j,l.self.RULES)){let ii=j.$ref;if(j=ks.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,ii),j instanceof ks.SchemaEnv)j=j.schema;if(j===void 0)throw new O8.default(l.opts.uriResolver,l.baseId,ii)}let m=(L=j===null||j===void 0?void 0:j.properties)===null||L===void 0?void 0:L[s];if(typeof m!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);T=T&&(M||W(j)),Y(m,z)}if(!T)throw Error(`discriminator: "${s}" must be required`);return y;function W({required:z}){return Array.isArray(z)&&z.includes(s)}function Y(z,j){if(z.const)J(z.const,j);else if(z.enum)for(let m of z.enum)J(m,j);else throw Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function J(z,j){if(typeof z!="string"||z in y)throw Error(`discriminator: "${s}" values must be unique strings`);y[z]=j}}}};Cs.default=F8});var hs=V((Z5,B8)=>{B8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var gs=V((B5,J8)=>{J8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var xs=V((J5,X8)=>{X8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var ms=V((X5,Y8)=>{Y8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var _s=V((Y5,Q8)=>{Q8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var as=V((Q5,A8)=>{A8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var ib=V((A5,z8)=>{z8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var tb=V((z5,G8)=>{G8.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var rb=V((ob)=>{Object.defineProperty(ob,"__esModule",{value:!0});var H8=hs(),D8=gs(),d8=xs(),K8=ms(),v8=_s(),U8=as(),N8=ib(),E8=tb(),p8=["/properties"];function P8(i){return[H8,D8,d8,K8,v8,t(this,U8),N8,t(this,E8)].forEach((o)=>this.addMetaSchema(o,void 0,!1)),this;function t(o,r){return i?o.$dataMetaSchema(r,p8):r}}ob.default=P8});var $b=V((p,Ro)=>{Object.defineProperty(p,"__esModule",{value:!0});p.MissingRefError=p.ValidationError=p.CodeGen=p.Name=p.nil=p.stringify=p.str=p._=p.KeywordCxt=p.Ajv2020=void 0;var R8=jl(),S8=ps(),k8=es(),C8=rb(),co="https://json-schema.org/draft/2020-12/schema";class tt extends R8.default{constructor(i={}){super({...i,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),S8.default.forEach((i)=>this.addVocabulary(i)),this.opts.discriminator)this.addKeyword(k8.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:i,meta:t}=this.opts;if(!t)return;C8.default.call(this,i),this.refs["http://json-schema.org/schema"]=co}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(co)?co:void 0)}}p.Ajv2020=tt;Ro.exports=p=tt;Ro.exports.Ajv2020=tt;Object.defineProperty(p,"__esModule",{value:!0});p.default=tt;var e8=Pi();Object.defineProperty(p,"KeywordCxt",{enumerable:!0,get:function(){return e8.KeywordCxt}});var Gi=F();Object.defineProperty(p,"_",{enumerable:!0,get:function(){return Gi._}});Object.defineProperty(p,"str",{enumerable:!0,get:function(){return Gi.str}});Object.defineProperty(p,"stringify",{enumerable:!0,get:function(){return Gi.stringify}});Object.defineProperty(p,"nil",{enumerable:!0,get:function(){return Gi.nil}});Object.defineProperty(p,"Name",{enumerable:!0,get:function(){return Gi.Name}});Object.defineProperty(p,"CodeGen",{enumerable:!0,get:function(){return Gi.CodeGen}});var h8=qt();Object.defineProperty(p,"ValidationError",{enumerable:!0,get:function(){return h8.default}});var g8=ci();Object.defineProperty(p,"MissingRefError",{enumerable:!0,get:function(){return g8.default}})});import{randomUUID as YV}from"crypto";var _o=Buffer.from(`\r
9
+ depsCount: ${i},
10
+ deps: ${o}}`};var pe={keyword:"dependencies",type:"object",schemaType:"object",error:Tf.error,code(t){let[i,o]=Le(t);Lf(t,i),qf(t,o)}};function Le({schema:t}){let i={},o={};for(let r in t){if(r==="__proto__")continue;let $=Array.isArray(t[r])?i:o;$[r]=t[r]}return[i,o]}function Lf(t,i=t.schema){let{gen:o,data:r,it:$}=t;if(Object.keys(i).length===0)return;let l=o.let("missing");for(let f in i){let s=i[f];if(s.length===0)continue;let n=(0,ti.propertyInData)(o,r,f,$.opts.ownProperties);if(t.setParams({property:f,depsCount:s.length,deps:s.join(", ")}),$.allErrors)o.if(n,()=>{for(let b of s)(0,ti.checkReportMissingProp)(t,b)});else o.if(Ho._`${n} && (${(0,ti.checkMissingProp)(t,s,l)})`),(0,ti.reportMissingProp)(t,l),o.else()}}Tf.validatePropertyDeps=Lf;function qf(t,i=t.schema){let{gen:o,data:r,keyword:$,it:l}=t,f=o.name("valid");for(let s in i){if((0,ce.alwaysValidSchema)(l,i[s]))continue;o.if((0,ti.propertyInData)(o,r,s,l.opts.ownProperties),()=>{let n=t.subschema({keyword:$,schemaProp:s},f);t.mergeValidEvaluated(n,f)},()=>o.var(f,!0)),t.ok(f)}}Tf.validateSchemaDeps=qf;Tf.default=pe});var Ff=M((wf)=>{Object.defineProperty(wf,"__esModule",{value:!0});var jf=O(),Oe=j(),We={message:"property name must be valid",params:({params:t})=>jf._`{propertyName: ${t.propertyName}}`},je={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:We,code(t){let{gen:i,schema:o,data:r,it:$}=t;if((0,Oe.alwaysValidSchema)($,o))return;let l=i.name("valid");i.forIn("key",r,(f)=>{t.setParams({propertyName:f}),t.subschema({keyword:"propertyNames",data:f,dataTypes:["string"],propertyName:f,compositeRule:!0},l),i.if((0,jf.not)(l),()=>{if(t.error(!0),!$.allErrors)i.break()})}),t.ok(l)}};wf.default=je});var Do=M((Zf)=>{Object.defineProperty(Zf,"__esModule",{value:!0});var Qi=E(),m=O(),Fe=P(),Gi=j(),Ze={message:"must NOT have additional properties",params:({params:t})=>m._`{additionalProperty: ${t.additionalProperty}}`},Be={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:Ze,code(t){let{gen:i,schema:o,parentSchema:r,data:$,errsCount:l,it:f}=t;if(!l)throw Error("ajv implementation error");let{allErrors:s,opts:n}=f;if(f.props=!0,n.removeAdditional!=="all"&&(0,Gi.alwaysValidSchema)(f,o))return;let b=(0,Qi.allSchemaProperties)(r.properties),u=(0,Qi.allSchemaProperties)(r.patternProperties);I(),t.ok(m._`${l} === ${Fe.default.errors}`);function I(){i.forIn("key",$,(c)=>{if(!b.length&&!u.length)y(c);else i.if(V(c),()=>y(c))})}function V(c){let p;if(b.length>8){let Z=(0,Gi.schemaRefOrVal)(f,r.properties,"properties");p=(0,Qi.isOwnProperty)(i,Z,c)}else if(b.length)p=(0,m.or)(...b.map((Z)=>m._`${c} === ${Z}`));else p=m.nil;if(u.length)p=(0,m.or)(p,...u.map((Z)=>m._`${(0,Qi.usePattern)(t,Z)}.test(${c})`));return(0,m.not)(p)}function d(c){i.code(m._`delete ${$}[${c}]`)}function y(c){if(n.removeAdditional==="all"||n.removeAdditional&&o===!1){d(c);return}if(o===!1){if(t.setParams({additionalProperty:c}),t.error(),!s)i.break();return}if(typeof o=="object"&&!(0,Gi.alwaysValidSchema)(f,o)){let p=i.name("valid");if(n.removeAdditional==="failing")e(c,p,!1),i.if((0,m.not)(p),()=>{t.reset(),d(c)});else if(e(c,p),!s)i.if((0,m.not)(p),()=>i.break())}}function e(c,p,Z){let w={keyword:"additionalProperties",dataProp:c,dataPropType:Gi.Type.Str};if(Z===!1)Object.assign(w,{compositeRule:!0,createErrors:!1,allErrors:!1});t.subschema(w,p)}}};Zf.default=Be});var Yf=M((Xf)=>{Object.defineProperty(Xf,"__esModule",{value:!0});var Xe=Nt(),Bf=E(),vo=j(),Jf=Do(),Ye={keyword:"properties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,parentSchema:r,data:$,it:l}=t;if(l.opts.removeAdditional==="all"&&r.additionalProperties===void 0)Jf.default.code(new Xe.KeywordCxt(l,Jf.default,"additionalProperties"));let f=(0,Bf.allSchemaProperties)(o);for(let I of f)l.definedProperties.add(I);if(l.opts.unevaluated&&f.length&&l.props!==!0)l.props=vo.mergeEvaluated.props(i,(0,vo.toHash)(f),l.props);let s=f.filter((I)=>!(0,vo.alwaysValidSchema)(l,o[I]));if(s.length===0)return;let n=i.name("valid");for(let I of s){if(b(I))u(I);else{if(i.if((0,Bf.propertyInData)(i,$,I,l.opts.ownProperties)),u(I),!l.allErrors)i.else().var(n,!0);i.endIf()}t.it.definedProperties.add(I),t.ok(n)}function b(I){return l.opts.useDefaults&&!l.compositeRule&&o[I].default!==void 0}function u(I){t.subschema({keyword:"properties",schemaProp:I,dataProp:I},n)}}};Xf.default=Ye});var Hf=M((Gf)=>{Object.defineProperty(Gf,"__esModule",{value:!0});var Af=E(),Hi=O(),zf=j(),Qf=j(),ze={keyword:"patternProperties",type:"object",schemaType:"object",code(t){let{gen:i,schema:o,data:r,parentSchema:$,it:l}=t,{opts:f}=l,s=(0,Af.allSchemaProperties)(o),n=s.filter((e)=>(0,zf.alwaysValidSchema)(l,o[e]));if(s.length===0||n.length===s.length&&(!l.opts.unevaluated||l.props===!0))return;let b=f.strictSchema&&!f.allowMatchingProperties&&$.properties,u=i.name("valid");if(l.props!==!0&&!(l.props instanceof Hi.Name))l.props=(0,Qf.evaluatedPropsToName)(i,l.props);let{props:I}=l;V();function V(){for(let e of s){if(b)d(e);if(l.allErrors)y(e);else i.var(u,!0),y(e),i.if(u)}}function d(e){for(let c in b)if(new RegExp(e).test(c))(0,zf.checkStrictMode)(l,`property ${c} matches pattern ${e} (use allowMatchingProperties)`)}function y(e){i.forIn("key",r,(c)=>{i.if(Hi._`${(0,Af.usePattern)(t,e)}.test(${c})`,()=>{let p=n.includes(e);if(!p)t.subschema({keyword:"patternProperties",schemaProp:e,dataProp:c,dataPropType:Qf.Type.Str},u);if(l.opts.unevaluated&&I!==!0)i.assign(Hi._`${I}[${c}]`,!0);else if(!p&&!l.allErrors)i.if((0,Hi.not)(u),()=>i.break())})})}}};Gf.default=ze});var vf=M((Df)=>{Object.defineProperty(Df,"__esModule",{value:!0});var Ge=j(),He={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){let{gen:i,schema:o,it:r}=t;if((0,Ge.alwaysValidSchema)(r,o)){t.fail();return}let $=i.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},$),t.failResult($,()=>t.reset(),()=>t.error())},error:{message:"must NOT be valid"}};Df.default=He});var Uf=M((Kf)=>{Object.defineProperty(Kf,"__esModule",{value:!0});var ve=E(),Ke={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ve.validateUnion,error:{message:"must match a schema in anyOf"}};Kf.default=Ke});var Pf=M((Nf)=>{Object.defineProperty(Nf,"__esModule",{value:!0});var Di=O(),Ne=j(),Pe={message:"must match exactly one schema in oneOf",params:({params:t})=>Di._`{passingSchemas: ${t.passing}}`},Ee={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:Pe,code(t){let{gen:i,schema:o,parentSchema:r,it:$}=t;if(!Array.isArray(o))throw Error("ajv implementation error");if($.opts.discriminator&&r.discriminator)return;let l=o,f=i.let("valid",!1),s=i.let("passing",null),n=i.name("_valid");t.setParams({passing:s}),i.block(b),t.result(f,()=>t.reset(),()=>t.error(!0));function b(){l.forEach((u,I)=>{let V;if((0,Ne.alwaysValidSchema)($,u))i.var(n,!0);else V=t.subschema({keyword:"oneOf",schemaProp:I,compositeRule:!0},n);if(I>0)i.if(Di._`${n} && ${f}`).assign(f,!1).assign(s,Di._`[${s}, ${I}]`).else();i.if(n,()=>{if(i.assign(f,!0),i.assign(s,I),V)t.mergeEvaluated(V,Di.Name)})})}}};Nf.default=Ee});var Rf=M((Ef)=>{Object.defineProperty(Ef,"__esModule",{value:!0});var Se=j(),ke={keyword:"allOf",schemaType:"array",code(t){let{gen:i,schema:o,it:r}=t;if(!Array.isArray(o))throw Error("ajv implementation error");let $=i.name("valid");o.forEach((l,f)=>{if((0,Se.alwaysValidSchema)(r,l))return;let s=t.subschema({keyword:"allOf",schemaProp:f},$);t.ok($),t.mergeEvaluated(s)})}};Ef.default=ke});var hf=M((Cf)=>{Object.defineProperty(Cf,"__esModule",{value:!0});var vi=O(),kf=j(),he={message:({params:t})=>vi.str`must match "${t.ifClause}" schema`,params:({params:t})=>vi._`{failingKeyword: ${t.ifClause}}`},ge={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:he,code(t){let{gen:i,parentSchema:o,it:r}=t;if(o.then===void 0&&o.else===void 0)(0,kf.checkStrictMode)(r,'"if" without "then" and "else" is ignored');let $=Sf(r,"then"),l=Sf(r,"else");if(!$&&!l)return;let f=i.let("valid",!0),s=i.name("_valid");if(n(),t.reset(),$&&l){let u=i.let("ifClause");t.setParams({ifClause:u}),i.if(s,b("then",u),b("else",u))}else if($)i.if(s,b("then"));else i.if((0,vi.not)(s),b("else"));t.pass(f,()=>t.error(!0));function n(){let u=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},s);t.mergeEvaluated(u)}function b(u,I){return()=>{let V=t.subschema({keyword:u},s);if(i.assign(f,s),t.mergeValidEvaluated(V,f),I)i.assign(I,vi._`${u}`);else t.setParams({ifClause:u})}}}};function Sf(t,i){let o=t.schema[i];return o!==void 0&&!(0,kf.alwaysValidSchema)(t,o)}Cf.default=ge});var mf=M((gf)=>{Object.defineProperty(gf,"__esModule",{value:!0});var xe=j(),ae={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:i,it:o}){if(i.if===void 0)(0,xe.checkStrictMode)(o,`"${t}" without "if" is ignored`)}};gf.default=ae});var af=M((xf)=>{Object.defineProperty(xf,"__esModule",{value:!0});var tM=Qo(),iM=ef(),oM=Go(),rM=Vf(),$M=pf(),lM=zi(),fM=Ff(),sM=Do(),nM=Yf(),bM=Hf(),uM=vf(),IM=Uf(),yM=Pf(),eM=Rf(),MM=hf(),dM=mf();function VM(t=!1){let i=[uM.default,IM.default,yM.default,eM.default,MM.default,dM.default,fM.default,sM.default,lM.default,nM.default,bM.default];if(t)i.push(iM.default,rM.default);else i.push(tM.default,oM.default);return i.push($M.default),i}xf.default=VM});var Uo=M((is)=>{Object.defineProperty(is,"__esModule",{value:!0});is.dynamicAnchor=void 0;var Ko=O(),pM=P(),_f=Rt(),LM=Zi(),qM={keyword:"$dynamicAnchor",schemaType:"string",code:(t)=>ts(t,t.schema)};function ts(t,i){let{gen:o,it:r}=t;r.schemaEnv.root.dynamicAnchors[i]=!0;let $=Ko._`${pM.default.dynamicAnchors}${(0,Ko.getProperty)(i)}`,l=r.errSchemaPath==="#"?r.validateName:TM(t);o.if(Ko._`!${$}`,()=>o.assign($,l))}is.dynamicAnchor=ts;function TM(t){let{schemaEnv:i,schema:o,self:r}=t.it,{root:$,baseId:l,localRefs:f,meta:s}=i.root,{schemaId:n}=r.opts,b=new _f.SchemaEnv({schema:o,schemaId:n,root:$,baseId:l,localRefs:f,meta:s});return _f.compileSchema.call(r,b),(0,LM.getValidate)(t,b)}is.default=qM});var No=M((fs)=>{Object.defineProperty(fs,"__esModule",{value:!0});fs.dynamicRef=void 0;var rs=O(),WM=P(),$s=Zi(),jM={keyword:"$dynamicRef",schemaType:"string",code:(t)=>ls(t,t.schema)};function ls(t,i){let{gen:o,keyword:r,it:$}=t;if(i[0]!=="#")throw Error(`"${r}" only supports hash fragment reference`);let l=i.slice(1);if($.allErrors)f();else{let n=o.let("valid",!1);f(n),t.ok(n)}function f(n){if($.schemaEnv.root.dynamicAnchors[l]){let b=o.let("_v",rs._`${WM.default.dynamicAnchors}${(0,rs.getProperty)(l)}`);o.if(b,s(b,n),s($.validateName,n))}else s($.validateName,n)()}function s(n,b){return b?()=>o.block(()=>{(0,$s.callRef)(t,n),o.let(b,!0)}):()=>(0,$s.callRef)(t,n)}}fs.dynamicRef=ls;fs.default=jM});var bs=M((ns)=>{Object.defineProperty(ns,"__esModule",{value:!0});var FM=Uo(),ZM=j(),BM={keyword:"$recursiveAnchor",schemaType:"boolean",code(t){if(t.schema)(0,FM.dynamicAnchor)(t,"");else(0,ZM.checkStrictMode)(t.it,"$recursiveAnchor: false is ignored")}};ns.default=BM});var Is=M((us)=>{Object.defineProperty(us,"__esModule",{value:!0});var XM=No(),YM={keyword:"$recursiveRef",schemaType:"string",code:(t)=>(0,XM.dynamicRef)(t,t.schema)};us.default=YM});var es=M((ys)=>{Object.defineProperty(ys,"__esModule",{value:!0});var zM=Uo(),QM=No(),GM=bs(),HM=Is(),DM=[zM.default,QM.default,GM.default,HM.default];ys.default=DM});var Vs=M((ds)=>{Object.defineProperty(ds,"__esModule",{value:!0});var Ms=zi(),KM={keyword:"dependentRequired",type:"object",schemaType:"object",error:Ms.error,code:(t)=>(0,Ms.validatePropertyDeps)(t)};ds.default=KM});var ps=M((cs)=>{Object.defineProperty(cs,"__esModule",{value:!0});var NM=zi(),PM={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(t)=>(0,NM.validateSchemaDeps)(t)};cs.default=PM});var qs=M((Ls)=>{Object.defineProperty(Ls,"__esModule",{value:!0});var RM=j(),SM={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:t,parentSchema:i,it:o}){if(i.contains===void 0)(0,RM.checkStrictMode)(o,`"${t}" without "contains" is ignored`)}};Ls.default=SM});var Os=M((Ts)=>{Object.defineProperty(Ts,"__esModule",{value:!0});var CM=Vs(),hM=ps(),gM=qs(),mM=[CM.default,hM.default,gM.default];Ts.default=mM});var ws=M((js)=>{Object.defineProperty(js,"__esModule",{value:!0});var It=O(),Ws=j(),aM=P(),_M={message:"must NOT have unevaluated properties",params:({params:t})=>It._`{unevaluatedProperty: ${t.unevaluatedProperty}}`},td={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:_M,code(t){let{gen:i,schema:o,data:r,errsCount:$,it:l}=t;if(!$)throw Error("ajv implementation error");let{allErrors:f,props:s}=l;if(s instanceof It.Name)i.if(It._`${s} !== true`,()=>i.forIn("key",r,(I)=>i.if(b(s,I),()=>n(I))));else if(s!==!0)i.forIn("key",r,(I)=>s===void 0?n(I):i.if(u(s,I),()=>n(I)));l.props=!0,t.ok(It._`${$} === ${aM.default.errors}`);function n(I){if(o===!1){if(t.setParams({unevaluatedProperty:I}),t.error(),!f)i.break();return}if(!(0,Ws.alwaysValidSchema)(l,o)){let V=i.name("valid");if(t.subschema({keyword:"unevaluatedProperties",dataProp:I,dataPropType:Ws.Type.Str},V),!f)i.if((0,It.not)(V),()=>i.break())}}function b(I,V){return It._`!${I} || !${I}[${V}]`}function u(I,V){let d=[];for(let y in I)if(I[y]===!0)d.push(It._`${V} !== ${y}`);return(0,It.and)(...d)}}};js.default=td});var Bs=M((Zs)=>{Object.defineProperty(Zs,"__esModule",{value:!0});var qt=O(),Fs=j(),od={message:({params:{len:t}})=>qt.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>qt._`{limit: ${t}}`},rd={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:od,code(t){let{gen:i,schema:o,data:r,it:$}=t,l=$.items||0;if(l===!0)return;let f=i.const("len",qt._`${r}.length`);if(o===!1)t.setParams({len:l}),t.fail(qt._`${f} > ${l}`);else if(typeof o=="object"&&!(0,Fs.alwaysValidSchema)($,o)){let n=i.var("valid",qt._`${f} <= ${l}`);i.if((0,qt.not)(n),()=>s(n,l)),t.ok(n)}$.items=!0;function s(n,b){i.forRange("i",b,f,(u)=>{if(t.subschema({keyword:"unevaluatedItems",dataProp:u,dataPropType:Fs.Type.Num},n),!$.allErrors)i.if((0,qt.not)(n),()=>i.break())})}}};Zs.default=rd});var Xs=M((Js)=>{Object.defineProperty(Js,"__esModule",{value:!0});var ld=ws(),fd=Bs(),sd=[ld.default,fd.default];Js.default=sd});var As=M((Ys)=>{Object.defineProperty(Ys,"__esModule",{value:!0});var A=O(),bd={message:({schemaCode:t})=>A.str`must match format "${t}"`,params:({schemaCode:t})=>A._`{format: ${t}}`},ud={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:bd,code(t,i){let{gen:o,data:r,$data:$,schema:l,schemaCode:f,it:s}=t,{opts:n,errSchemaPath:b,schemaEnv:u,self:I}=s;if(!n.validateFormats)return;if($)V();else d();function V(){let y=o.scopeValue("formats",{ref:I.formats,code:n.code.formats}),e=o.const("fDef",A._`${y}[${f}]`),c=o.let("fType"),p=o.let("format");o.if(A._`typeof ${e} == "object" && !(${e} instanceof RegExp)`,()=>o.assign(c,A._`${e}.type || "string"`).assign(p,A._`${e}.validate`),()=>o.assign(c,A._`"string"`).assign(p,e)),t.fail$data((0,A.or)(Z(),w()));function Z(){if(n.strictSchema===!1)return A.nil;return A._`${f} && !${p}`}function w(){let X=u.$async?A._`(${e}.async ? await ${p}(${r}) : ${p}(${r}))`:A._`${p}(${r})`,T=A._`(typeof ${p} == "function" ? ${X} : ${p}.test(${r}))`;return A._`${p} && ${p} !== true && ${c} === ${i} && !${T}`}}function d(){let y=I.formats[l];if(!y){Z();return}if(y===!0)return;let[e,c,p]=w(y);if(e===i)t.pass(X());function Z(){if(n.strictSchema===!1){I.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${l}" ignored in schema at path "${b}"`}}function w(T){let x=T instanceof RegExp?(0,A.regexpCode)(T):n.code.formats?A._`${n.code.formats}${(0,A.getProperty)(l)}`:void 0,it=o.scopeValue("formats",{key:l,ref:T,code:x});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,A._`${it}.validate`];return["string",T,it]}function X(){if(typeof y=="object"&&!(y instanceof RegExp)&&y.async){if(!u.$async)throw Error("async format in sync schema");return A._`await ${p}(${r})`}return typeof c=="function"?A._`${p}(${r})`:A._`${p}.test(${r})`}}}};Ys.default=ud});var Qs=M((zs)=>{Object.defineProperty(zs,"__esModule",{value:!0});var yd=As(),ed=[yd.default];zs.default=ed});var Ds=M((Gs)=>{Object.defineProperty(Gs,"__esModule",{value:!0});Gs.contentVocabulary=Gs.metadataVocabulary=void 0;Gs.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"];Gs.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]});var Us=M((Ks)=>{Object.defineProperty(Ks,"__esModule",{value:!0});var Vd=Xl(),cd=$f(),pd=af(),Ld=es(),qd=Os(),Td=Xs(),Od=Qs(),vs=Ds(),Wd=[Ld.default,Vd.default,cd.default,(0,pd.default)(!0),Od.default,vs.metadataVocabulary,vs.contentVocabulary,qd.default,Td.default];Ks.default=Wd});var Rs=M((Ps)=>{Object.defineProperty(Ps,"__esModule",{value:!0});Ps.DiscrError=void 0;var Ns;(function(t){t.Tag="tag",t.Mapping="mapping"})(Ns||(Ps.DiscrError=Ns={}))});var Cs=M((ks)=>{Object.defineProperty(ks,"__esModule",{value:!0});var Xt=O(),Po=Rs(),Ss=Rt(),wd=Pt(),Fd=j(),Zd={message:({params:{discrError:t,tagName:i}})=>t===Po.DiscrError.Tag?`tag "${i}" must be string`:`value of tag "${i}" must be in oneOf`,params:({params:{discrError:t,tag:i,tagName:o}})=>Xt._`{error: ${t}, tag: ${o}, tagValue: ${i}}`},Bd={keyword:"discriminator",type:"object",schemaType:"object",error:Zd,code(t){let{gen:i,data:o,schema:r,parentSchema:$,it:l}=t,{oneOf:f}=$;if(!l.opts.discriminator)throw Error("discriminator: requires discriminator option");let s=r.propertyName;if(typeof s!="string")throw Error("discriminator: requires propertyName");if(r.mapping)throw Error("discriminator: mapping is not supported");if(!f)throw Error("discriminator: requires oneOf keyword");let n=i.let("valid",!1),b=i.const("tag",Xt._`${o}${(0,Xt.getProperty)(s)}`);i.if(Xt._`typeof ${b} == "string"`,()=>u(),()=>t.error(!1,{discrError:Po.DiscrError.Tag,tag:b,tagName:s})),t.ok(n);function u(){let d=V();i.if(!1);for(let y in d)i.elseIf(Xt._`${b} === ${y}`),i.assign(n,I(d[y]));i.else(),t.error(!1,{discrError:Po.DiscrError.Mapping,tag:b,tagName:s}),i.endIf()}function I(d){let y=i.name("valid"),e=t.subschema({keyword:"oneOf",schemaProp:d},y);return t.mergeEvaluated(e,Xt.Name),y}function V(){var d;let y={},e=p($),c=!0;for(let X=0;X<f.length;X++){let T=f[X];if((T===null||T===void 0?void 0:T.$ref)&&!(0,Fd.schemaHasRulesButRef)(T,l.self.RULES)){let it=T.$ref;if(T=Ss.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,it),T instanceof Ss.SchemaEnv)T=T.schema;if(T===void 0)throw new wd.default(l.opts.uriResolver,l.baseId,it)}let x=(d=T===null||T===void 0?void 0:T.properties)===null||d===void 0?void 0:d[s];if(typeof x!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${s}"`);c=c&&(e||p(T)),Z(x,X)}if(!c)throw Error(`discriminator: "${s}" must be required`);return y;function p({required:X}){return Array.isArray(X)&&X.includes(s)}function Z(X,T){if(X.const)w(X.const,T);else if(X.enum)for(let x of X.enum)w(x,T);else throw Error(`discriminator: "properties/${s}" must have "const" or "enum"`)}function w(X,T){if(typeof X!="string"||X in y)throw Error(`discriminator: "${s}" values must be unique strings`);y[X]=T}}}};ks.default=Bd});var hs=M((B8,Xd)=>{Xd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}});var gs=M((J8,Yd)=>{Yd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}});var ms=M((X8,Ad)=>{Ad.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}});var xs=M((Y8,zd)=>{zd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}});var as=M((A8,Qd)=>{Qd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}});var _s=M((z8,Gd)=>{Gd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}});var tn=M((Q8,Hd)=>{Hd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}});var on=M((G8,Dd)=>{Dd.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}});var $n=M((rn)=>{Object.defineProperty(rn,"__esModule",{value:!0});var vd=hs(),Kd=gs(),Ud=ms(),Nd=xs(),Pd=as(),Ed=_s(),Rd=tn(),Sd=on(),kd=["/properties"];function Cd(t){return[vd,Kd,Ud,Nd,Pd,i(this,Ed),Rd,i(this,Sd)].forEach((o)=>this.addMetaSchema(o,void 0,!1)),this;function i(o,r){return t?o.$dataMetaSchema(r,kd):r}}rn.default=Cd});var ln=M((N,Ro)=>{Object.defineProperty(N,"__esModule",{value:!0});N.MissingRefError=N.ValidationError=N.CodeGen=N.Name=N.nil=N.stringify=N.str=N._=N.KeywordCxt=N.Ajv2020=void 0;var gd=Tl(),md=Us(),xd=Cs(),ad=$n(),Eo="https://json-schema.org/draft/2020-12/schema";class ii extends gd.default{constructor(t={}){super({...t,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),md.default.forEach((t)=>this.addVocabulary(t)),this.opts.discriminator)this.addKeyword(xd.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:t,meta:i}=this.opts;if(!i)return;ad.default.call(this,t),this.refs["http://json-schema.org/schema"]=Eo}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(Eo)?Eo:void 0)}}N.Ajv2020=ii;Ro.exports=N=ii;Ro.exports.Ajv2020=ii;Object.defineProperty(N,"__esModule",{value:!0});N.default=ii;var _d=Nt();Object.defineProperty(N,"KeywordCxt",{enumerable:!0,get:function(){return _d.KeywordCxt}});var Yt=O();Object.defineProperty(N,"_",{enumerable:!0,get:function(){return Yt._}});Object.defineProperty(N,"str",{enumerable:!0,get:function(){return Yt.str}});Object.defineProperty(N,"stringify",{enumerable:!0,get:function(){return Yt.stringify}});Object.defineProperty(N,"nil",{enumerable:!0,get:function(){return Yt.nil}});Object.defineProperty(N,"Name",{enumerable:!0,get:function(){return Yt.Name}});Object.defineProperty(N,"CodeGen",{enumerable:!0,get:function(){return Yt.CodeGen}});var t6=Vi();Object.defineProperty(N,"ValidationError",{enumerable:!0,get:function(){return t6.default}});var i6=Pt();Object.defineProperty(N,"MissingRefError",{enumerable:!0,get:function(){return i6.default}})});import{randomUUID as A6}from"crypto";var ao=Buffer.from(`\r
11
11
  \r
12
- `,"ascii");var db=new TextDecoder("utf-8",{fatal:!0});class _ extends Error{constructor(i){super(i);this.name="FrameProtocolError"}}function Kb(i){let t;try{t=JSON.stringify(i)}catch{throw new _("Outbound protocol message is not JSON serializable.")}if(t===void 0)throw new _("Outbound protocol message is not a JSON value.");let o=Buffer.from(t,"utf8"),r=Buffer.from(`Content-Length: ${o.byteLength}\r
12
+ `,"ascii");var Nn=new TextDecoder("utf-8",{fatal:!0});class a extends Error{constructor(t){super(t);this.name="FrameProtocolError"}}function Pn(t){let i;try{i=JSON.stringify(t)}catch{throw new a("Outbound protocol message is not JSON serializable.")}if(i===void 0)throw new a("Outbound protocol message is not a JSON value.");let o=Buffer.from(i,"utf8"),r=Buffer.from(`Content-Length: ${o.byteLength}\r
13
13
  \r
14
- `,"ascii");return Buffer.concat([r,o])}class ct{#o;#i=Buffer.alloc(0);constructor(i={}){this.#o=i.maxFrameBytes}push(i){if(i.byteLength>0)this.#i=Buffer.concat([this.#i,i]);let t=[];while(!0){let o=this.#i.indexOf(_o);if(o<0){if(this.#i.byteLength>128)throw new _("Protocol frame header exceeds 128 bytes.");break}if(o>128)throw new _("Protocol frame header exceeds 128 bytes.");let r=this.#i.subarray(0,o).toString("ascii"),$=/^Content-Length: ([0-9]+)$/.exec(r);if($===null)throw new _("Protocol frame has an invalid Content-Length header.");let l=Number($[1]);if(!Number.isSafeInteger(l))throw new _("Protocol Content-Length is not a safe integer.");if(this.#o!==void 0&&l>this.#o)throw new _(`Protocol frame declares ${l} bytes, exceeding the configured limit.`);let f=o+_o.byteLength,s=f+l;if(this.#i.byteLength<s)break;try{let b=db.decode(this.#i.subarray(f,s));t.push(JSON.parse(b))}catch{throw new _("Protocol frame body is not valid UTF-8 JSON.")}this.#i=this.#i.subarray(s)}return t}finish(){if(this.#i.byteLength!==0)throw new _("Protocol stream ended with an incomplete frame.")}}class Rt{#o;#i=Promise.resolve();constructor(i){this.#o=i}send(i){let t=Kb(i),o=this.#i.then(async()=>{await this.#o(t)});return this.#i=o.catch(()=>{}),o}async drain(){await this.#i}}function St(i,t,o){if(i===null||typeof i==="string"||typeof i==="boolean")return;if(typeof i==="number")return Number.isFinite(i)?void 0:{path:t,reason:"numbers must be finite"};if(typeof i!=="object")return{path:t,reason:`${typeof i} is not a JSON value`};if(o.has(i))return{path:t,reason:"circular references are not JSON values"};o.add(i);try{if(Array.isArray(i)){let $=new Set(["length"]);for(let l=0;l<i.length;l+=1){if($.add(String(l)),!Object.prototype.hasOwnProperty.call(i,l))return{path:`${t}[${l}]`,reason:"array holes are not JSON values"};let f=St(i[l],`${t}[${l}]`,o);if(f!==void 0)return f}for(let l of Reflect.ownKeys(i))if(typeof l!=="string"||!$.has(l))return{path:t,reason:"arrays must not contain custom properties"};return}let r=Object.getPrototypeOf(i);if(r!==Object.prototype&&r!==null)return{path:t,reason:"objects must be plain JSON objects"};for(let $ of Reflect.ownKeys(i)){if(typeof $!=="string")return{path:t,reason:"symbol keys are not JSON object keys"};let l=Object.getOwnPropertyDescriptor(i,$);if(l===void 0||l.enumerable!==!0||"get"in l||"set"in l)return{path:`${t}.${$}`,reason:"JSON fields must be enumerable data properties"};let f=St(l.value,`${t}.${$}`,o);if(f!==void 0)return f}return}finally{o.delete(i)}}function ir(i){return St(i,"$",new Set)}function ao(i){if(typeof i!=="object"||i===null)return i;if(Array.isArray(i))for(let t of i)ao(t);else for(let t of Object.values(i))ao(t);return Object.isFrozen(i)?i:Object.freeze(i)}var Ob=Db($b(),1);var lb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v1",title:"WOML Attempt Failure v1",description:"Canonical failure taxonomy shared by the script-host protocol and durable run events.","x-status":"frozen-for-rust-hello-slice",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"},{$ref:"#/$defs/hostCrashed"},{$ref:"#/$defs/interrupted"}]},hostReportedFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"}]},failureKind:{enum:["script_threw","script_timed_out","invalid_script_result","context_too_large","result_too_large","worker_crashed","host_crashed","interrupted"]},scriptThrew:{$ref:"#/$defs/simpleFailureScriptThrew"},scriptTimedOut:{$ref:"#/$defs/simpleFailureScriptTimedOut"},invalidScriptResult:{$ref:"#/$defs/simpleFailureInvalidScriptResult"},workerCrashed:{$ref:"#/$defs/simpleFailureWorkerCrashed"},hostCrashed:{$ref:"#/$defs/simpleFailureHostCrashed"},interrupted:{$ref:"#/$defs/simpleFailureInterrupted"},simpleFailureScriptThrew:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_threw"},code:{const:"WOML_SCRIPT_THROWN"},message:{$ref:"#/$defs/message"}}},simpleFailureScriptTimedOut:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_timed_out"},code:{const:"WOML_SCRIPT_TIMEOUT"},message:{$ref:"#/$defs/message"}}},simpleFailureInvalidScriptResult:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invalid_script_result"},code:{const:"WOML_SCRIPT_NON_JSON_RESULT"},message:{$ref:"#/$defs/message"}}},simpleFailureWorkerCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"worker_crashed"},code:{const:"WOML_SCRIPT_WORKER_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureHostCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"host_crashed"},code:{const:"WOML_SCRIPT_HOST_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureInterrupted:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"interrupted"},code:{const:"WOML_STEP_INTERRUPTED"},message:{$ref:"#/$defs/message"}}},contextTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"context_too_large"},code:{const:"WOML_SCRIPT_CONTEXT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},resultTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"result_too_large"},code:{const:"WOML_SCRIPT_RESULT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},sizeDetails:{type:"object",additionalProperties:!1,minProperties:1,properties:{actualBytes:{type:"integer",minimum:0},limitBytes:{type:"integer",minimum:0}}},message:{type:"string",minLength:1}}};var fb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v2",title:"WOML Attempt Failure v2",description:"Attempt failure taxonomy for parallel execution. Version 2 preserves every v1 failure and adds engine-requested invocation cancellation.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v1",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/attemptFailure"},{$ref:"#/$defs/invocationCancelled"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"},{$ref:"#/$defs/invocationCancelled"}]},invocationCancelled:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invocation_cancelled"},code:{const:"WOML_SCRIPT_CANCELLED"},message:{type:"string",minLength:1}}}}};var sb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v3",title:"WOML Attempt Failure v3",description:"Attempt failure taxonomy preserving an uncaught managed-capability failure without flattening it into script_threw.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v2",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/attemptFailure"},{$ref:"#/$defs/serviceFailed"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"},{$ref:"#/$defs/serviceFailed"}]},serviceFailed:{type:"object",additionalProperties:!1,required:["kind","code","message","capability","operation","callId","retryable","ambiguous","cause"],properties:{kind:{const:"service_failed"},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},capability:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},operation:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},callId:{type:"string",minLength:1,maxLength:256},retryable:{type:"boolean"},ambiguous:{type:"boolean"},cause:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}}}}};var bb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/capability-call/v1",title:"WOML Capability Call v1",description:"Generic, asynchronous, invocation-scoped call and result contract for Rust-managed services.","x-status":"services-capabilities-contract-frozen","x-correlation":"Every reply correlates by invocationId and callId; replies may arrive out of order.","x-idempotency":"operationKey is sha256(UTF8('woml.capability-operation\\0v1\\0' + stepIdempotencyKey + '\\0' + operationName)). automatic identity is limited to one effectful call per capability operation per step attempt; authors must supply a stable name when multiple effectful calls can occur.","x-defaultLimits":{inputBytes:1048576,resultBytes:4194304,frameBytes:8388608,timeoutMs:30000,inFlightPerInvocation:32,inFlightGlobal:256},oneOf:[{$ref:"#/$defs/request"},{$ref:"#/$defs/succeeded"},{$ref:"#/$defs/failed"},{$ref:"#/$defs/cancelled"}],$defs:{id:{type:"string",minLength:1,maxLength:256},name:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},digest:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"},base:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"}}},request:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","runId","nodeId","attemptNumber","capability","operation","inputContractVersion","resultContractVersion","identity","limits","input"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"request"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attemptNumber:{type:"integer",minimum:1,maximum:10},capability:{$ref:"#/$defs/name"},operation:{$ref:"#/$defs/name"},inputContractVersion:{type:"integer",minimum:1},resultContractVersion:{type:"integer",minimum:1},identity:{$ref:"#/$defs/identity"},limits:{$ref:"#/$defs/limits"},input:{}}},identity:{type:"object",additionalProperties:!1,required:["mode","stepIdempotencyKey","operationName","operationKey"],properties:{mode:{enum:["automatic","named"]},stepIdempotencyKey:{$ref:"#/$defs/digest"},operationName:{type:"string",minLength:1,maxLength:256},operationKey:{$ref:"#/$defs/digest"},providerIdempotencyKey:{type:"string",minLength:1,maxLength:256}}},limits:{type:"object",additionalProperties:!1,required:["inputBytes","resultBytes","timeoutMs"],properties:{inputBytes:{type:"integer",minimum:1,maximum:8388608},resultBytes:{type:"integer",minimum:1,maximum:8388608},timeoutMs:{type:"integer",minimum:1,maximum:86400000}}},resultBase:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0}}},succeeded:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","resultContractVersion","resultBytes","durationMs","result"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"succeeded"},resultContractVersion:{type:"integer",minimum:1},resultBytes:{type:"integer",minimum:0,maximum:8388608},durationMs:{type:"number",minimum:0},result:{}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"failed"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},cancelled:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"cancelled"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},failure:{type:"object",additionalProperties:!1,required:["kind","code","message","retryable","ambiguous"],properties:{kind:{enum:["invalid_input","invalid_result","unsupported_capability","unsupported_operation","unsupported_version","input_too_large","result_too_large","frame_too_large","timed_out","cancelled","handler_crashed","worker_crashed","host_crashed","transport_failed","service_rejected","interrupted","ambiguous"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},retryable:{type:"boolean"},ambiguous:{type:"boolean"},details:{$ref:"#/$defs/safeMetadata"}}},safeMetadata:{type:"object",maxProperties:32,propertyNames:{pattern:"^(?!(?:authorization|cookie|set-cookie|token|secret|password|body|query|url|headers|input|output|data|value)$)[A-Za-z][A-Za-z0-9_.-]{0,63}$"},additionalProperties:{type:["string","number","boolean","null"]}}}};var nb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/native-fetch-observation/v1",title:"WOML Native Fetch Observation v1",description:"Redacted observation messages around Bun's unchanged native Fetch implementation.","x-status":"services-capabilities-contract-frozen","x-redaction":"No URL query, credentials, headers, request body, or response body may cross this boundary.",oneOf:[{$ref:"#/$defs/started"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/failed"}],$defs:{id:{type:"string",minLength:1,maxLength:256},method:{type:"string",pattern:"^[A-Z]+$",maxLength:32},origin:{type:"string",pattern:"^https?://(?![^/?#]*@)[^/?#]+$",maxLength:2048},path:{type:"string",pattern:"^/[^?#]*$",maxLength:2048},started:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","method","origin","path","startedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"started"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},method:{$ref:"#/$defs/method"},origin:{$ref:"#/$defs/origin"},path:{$ref:"#/$defs/path"},requestBodyBytes:{type:["integer","null"],minimum:0},startedAt:{type:"string",format:"date-time"}}},completed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","status","durationMs","completedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},status:{type:"integer",minimum:100,maximum:599},responseBodyBytes:{type:["integer","null"],minimum:0},durationMs:{type:"number",minimum:0},completedAt:{type:"string",format:"date-time"}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","durationMs","failedAt","error"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"failed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0},failedAt:{type:"string",format:"date-time"},error:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{enum:["tracking_failed","fetch_rejected","timed_out","cancelled","worker_crashed","host_crashed"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$"},message:{type:"string",minLength:1,maxLength:2048}}}}}}};var ub={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v1",title:"WOML Script Host Protocol v1",description:"Versioned messages exchanged between the Rust core and the long-lived Bun script host.","x-status":"frozen-for-rust-hello-slice","x-transport":"Content-Length-framed UTF-8 JSON over child stdin/stdout","x-multiplexing":"Multiple execute messages may be in flight and completed responses may arrive out of order; invocationId is the sole correlation key.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"}}}}};var Ib={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v2",title:"WOML Script Host Protocol v2",description:"Asynchronous Content-Length-framed Rust/Bun protocol with per-invocation cancellation for parallel fail-fast.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v1","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var yb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v3",title:"WOML Script Host Protocol v3",description:"Asynchronous Content-Length-framed Rust/Bun protocol adding immutable attempt metadata and a stable effect key.","x-status":"retry-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v2","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3}}},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{$ref:"#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},attempt:{type:"object",additionalProperties:!1,required:["number","maxAttempts","idempotencyKey"],properties:{number:{type:"integer",minimum:1,maximum:10},maxAttempts:{type:"integer",minimum:1,maximum:10},idempotencyKey:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var Mb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v4",title:"WOML Script Host Protocol v4",description:"Full-duplex Content-Length-framed Rust/Bun protocol adding Script Bindings v1, managed capability calls, and tracked native Fetch.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v3","x-multiplexing":"Multiple execute messages and multiple nested calls per invocation may be in flight. Every response correlates by invocationId and callId/requestId and may arrive out of order.","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Vb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v5",title:"WOML Script Host Protocol v5",description:"Full-duplex Rust/Bun protocol adding content-addressed local-module registration and per-invocation module bindings.","x-status":"module-system-ms3-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v4","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:4194304}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{const:"WOML_MODULE_DIGEST_MISMATCH"},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Lb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v6",title:"WOML Script Host Protocol v6",description:"Full-duplex Rust/Bun protocol adding recoverable source maps, bounded immutable caching, and source-mapped module diagnostics.","x-status":"module-system-ms4-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v5","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var qb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v7",title:"WOML Script Host Protocol v7",description:"Full-duplex Rust/Bun protocol adding isolated lifecycle-script execution and the frozen Lifecycle Binding v1.","x-status":"lifecycle-engine-controls-lec3","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v6","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}},allOf:[{if:{properties:{mode:{const:"lifecycle"}},required:["mode"]},then:{required:["lifecycle"],properties:{handler:{const:"runtime.lifecycle-script"}}}},{if:{properties:{mode:{const:"step"}},required:["mode"]},then:{not:{required:["lifecycle"]},properties:{handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Tb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v8",title:"WOML Script Host Protocol v8",description:"Protocol v7 plus isolated reusable-step and reusable-lifecycle bindings.","x-status":"switch-custom-definitions-scp4","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v7","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
14
+ `,"ascii");return Buffer.concat([r,o])}class Ei{#o;#t=Buffer.alloc(0);constructor(t={}){this.#o=t.maxFrameBytes}push(t){if(t.byteLength>0)this.#t=Buffer.concat([this.#t,t]);let i=[];while(!0){let o=this.#t.indexOf(ao);if(o<0){if(this.#t.byteLength>128)throw new a("Protocol frame header exceeds 128 bytes.");break}if(o>128)throw new a("Protocol frame header exceeds 128 bytes.");let r=this.#t.subarray(0,o).toString("ascii"),$=/^Content-Length: ([0-9]+)$/.exec(r);if($===null)throw new a("Protocol frame has an invalid Content-Length header.");let l=Number($[1]);if(!Number.isSafeInteger(l))throw new a("Protocol Content-Length is not a safe integer.");if(this.#o!==void 0&&l>this.#o)throw new a(`Protocol frame declares ${l} bytes, exceeding the configured limit.`);let f=o+ao.byteLength,s=f+l;if(this.#t.byteLength<s)break;try{let n=Nn.decode(this.#t.subarray(f,s));i.push(JSON.parse(n))}catch{throw new a("Protocol frame body is not valid UTF-8 JSON.")}this.#t=this.#t.subarray(s)}return i}finish(){if(this.#t.byteLength!==0)throw new a("Protocol stream ended with an incomplete frame.")}}class Ri{#o;#t=Promise.resolve();constructor(t){this.#o=t}send(t){let i=Pn(t),o=this.#t.then(async()=>{await this.#o(i)});return this.#t=o.catch(()=>{}),o}async drain(){await this.#t}}function Si(t,i,o){if(t===null||typeof t==="string"||typeof t==="boolean")return;if(typeof t==="number")return Number.isFinite(t)?void 0:{path:i,reason:"numbers must be finite"};if(typeof t!=="object")return{path:i,reason:`${typeof t} is not a JSON value`};if(o.has(t))return{path:i,reason:"circular references are not JSON values"};o.add(t);try{if(Array.isArray(t)){let $=new Set(["length"]);for(let l=0;l<t.length;l+=1){if($.add(String(l)),!Object.prototype.hasOwnProperty.call(t,l))return{path:`${i}[${l}]`,reason:"array holes are not JSON values"};let f=Si(t[l],`${i}[${l}]`,o);if(f!==void 0)return f}for(let l of Reflect.ownKeys(t))if(typeof l!=="string"||!$.has(l))return{path:i,reason:"arrays must not contain custom properties"};return}let r=Object.getPrototypeOf(t);if(r!==Object.prototype&&r!==null)return{path:i,reason:"objects must be plain JSON objects"};for(let $ of Reflect.ownKeys(t)){if(typeof $!=="string")return{path:i,reason:"symbol keys are not JSON object keys"};let l=Object.getOwnPropertyDescriptor(t,$);if(l===void 0||l.enumerable!==!0||"get"in l||"set"in l)return{path:`${i}.${$}`,reason:"JSON fields must be enumerable data properties"};let f=Si(l.value,`${i}.${$}`,o);if(f!==void 0)return f}return}finally{o.delete(t)}}function tr(t){return Si(t,"$",new Set)}function _o(t){if(typeof t!=="object"||t===null)return t;if(Array.isArray(t))for(let i of t)_o(i);else for(let i of Object.values(t))_o(i);return Object.isFrozen(t)?t:Object.freeze(t)}var Tn=Un(ln(),1);var fn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v1",title:"WOML Attempt Failure v1",description:"Canonical failure taxonomy shared by the script-host protocol and durable run events.","x-status":"frozen-for-rust-hello-slice",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"},{$ref:"#/$defs/hostCrashed"},{$ref:"#/$defs/interrupted"}]},hostReportedFailure:{oneOf:[{$ref:"#/$defs/scriptThrew"},{$ref:"#/$defs/scriptTimedOut"},{$ref:"#/$defs/invalidScriptResult"},{$ref:"#/$defs/contextTooLarge"},{$ref:"#/$defs/resultTooLarge"},{$ref:"#/$defs/workerCrashed"}]},failureKind:{enum:["script_threw","script_timed_out","invalid_script_result","context_too_large","result_too_large","worker_crashed","host_crashed","interrupted"]},scriptThrew:{$ref:"#/$defs/simpleFailureScriptThrew"},scriptTimedOut:{$ref:"#/$defs/simpleFailureScriptTimedOut"},invalidScriptResult:{$ref:"#/$defs/simpleFailureInvalidScriptResult"},workerCrashed:{$ref:"#/$defs/simpleFailureWorkerCrashed"},hostCrashed:{$ref:"#/$defs/simpleFailureHostCrashed"},interrupted:{$ref:"#/$defs/simpleFailureInterrupted"},simpleFailureScriptThrew:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_threw"},code:{const:"WOML_SCRIPT_THROWN"},message:{$ref:"#/$defs/message"}}},simpleFailureScriptTimedOut:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"script_timed_out"},code:{const:"WOML_SCRIPT_TIMEOUT"},message:{$ref:"#/$defs/message"}}},simpleFailureInvalidScriptResult:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invalid_script_result"},code:{const:"WOML_SCRIPT_NON_JSON_RESULT"},message:{$ref:"#/$defs/message"}}},simpleFailureWorkerCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"worker_crashed"},code:{const:"WOML_SCRIPT_WORKER_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureHostCrashed:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"host_crashed"},code:{const:"WOML_SCRIPT_HOST_CRASHED"},message:{$ref:"#/$defs/message"}}},simpleFailureInterrupted:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"interrupted"},code:{const:"WOML_STEP_INTERRUPTED"},message:{$ref:"#/$defs/message"}}},contextTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"context_too_large"},code:{const:"WOML_SCRIPT_CONTEXT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},resultTooLarge:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"result_too_large"},code:{const:"WOML_SCRIPT_RESULT_TOO_LARGE"},message:{$ref:"#/$defs/message"},details:{$ref:"#/$defs/sizeDetails"}}},sizeDetails:{type:"object",additionalProperties:!1,minProperties:1,properties:{actualBytes:{type:"integer",minimum:0},limitBytes:{type:"integer",minimum:0}}},message:{type:"string",minLength:1}}};var sn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v2",title:"WOML Attempt Failure v2",description:"Attempt failure taxonomy for parallel execution. Version 2 preserves every v1 failure and adds engine-requested invocation cancellation.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v1",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/attemptFailure"},{$ref:"#/$defs/invocationCancelled"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"},{$ref:"#/$defs/invocationCancelled"}]},invocationCancelled:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{const:"invocation_cancelled"},code:{const:"WOML_SCRIPT_CANCELLED"},message:{type:"string",minLength:1}}}}};var nn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/attempt-failure/v3",title:"WOML Attempt Failure v3",description:"Attempt failure taxonomy preserving an uncaught managed-capability failure without flattening it into script_threw.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/attempt-failure/v2",$ref:"#/$defs/attemptFailure",$defs:{attemptFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/attemptFailure"},{$ref:"#/$defs/serviceFailed"}]},hostReportedFailure:{oneOf:[{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"},{$ref:"#/$defs/serviceFailed"}]},serviceFailed:{type:"object",additionalProperties:!1,required:["kind","code","message","capability","operation","callId","retryable","ambiguous","cause"],properties:{kind:{const:"service_failed"},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},capability:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},operation:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},callId:{type:"string",minLength:1,maxLength:256},retryable:{type:"boolean"},ambiguous:{type:"boolean"},cause:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}}}}};var bn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/capability-call/v1",title:"WOML Capability Call v1",description:"Generic, asynchronous, invocation-scoped call and result contract for Rust-managed services.","x-status":"services-capabilities-contract-frozen","x-correlation":"Every reply correlates by invocationId and callId; replies may arrive out of order.","x-idempotency":"operationKey is sha256(UTF8('woml.capability-operation\\0v1\\0' + stepIdempotencyKey + '\\0' + operationName)). automatic identity is limited to one effectful call per capability operation per step attempt; authors must supply a stable name when multiple effectful calls can occur.","x-defaultLimits":{inputBytes:1048576,resultBytes:4194304,frameBytes:8388608,timeoutMs:30000,inFlightPerInvocation:32,inFlightGlobal:256},oneOf:[{$ref:"#/$defs/request"},{$ref:"#/$defs/succeeded"},{$ref:"#/$defs/failed"},{$ref:"#/$defs/cancelled"}],$defs:{id:{type:"string",minLength:1,maxLength:256},name:{type:"string",pattern:"^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$",maxLength:128},digest:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"},base:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"}}},request:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","runId","nodeId","attemptNumber","capability","operation","inputContractVersion","resultContractVersion","identity","limits","input"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"request"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attemptNumber:{type:"integer",minimum:1,maximum:10},capability:{$ref:"#/$defs/name"},operation:{$ref:"#/$defs/name"},inputContractVersion:{type:"integer",minimum:1},resultContractVersion:{type:"integer",minimum:1},identity:{$ref:"#/$defs/identity"},limits:{$ref:"#/$defs/limits"},input:{}}},identity:{type:"object",additionalProperties:!1,required:["mode","stepIdempotencyKey","operationName","operationKey"],properties:{mode:{enum:["automatic","named"]},stepIdempotencyKey:{$ref:"#/$defs/digest"},operationName:{type:"string",minLength:1,maxLength:256},operationKey:{$ref:"#/$defs/digest"},providerIdempotencyKey:{type:"string",minLength:1,maxLength:256}}},limits:{type:"object",additionalProperties:!1,required:["inputBytes","resultBytes","timeoutMs"],properties:{inputBytes:{type:"integer",minimum:1,maximum:8388608},resultBytes:{type:"integer",minimum:1,maximum:8388608},timeoutMs:{type:"integer",minimum:1,maximum:86400000}}},resultBase:{type:"object",properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0}}},succeeded:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","resultContractVersion","resultBytes","durationMs","result"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"succeeded"},resultContractVersion:{type:"integer",minimum:1},resultBytes:{type:"integer",minimum:0,maximum:8388608},durationMs:{type:"number",minimum:0},result:{}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"failed"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},cancelled:{type:"object",additionalProperties:!1,required:["contract","contractVersion","messageType","invocationId","callId","outcome","durationMs","error"],properties:{contract:{const:"woml.capability-call"},contractVersion:{const:1},messageType:{const:"result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},outcome:{const:"cancelled"},durationMs:{type:"number",minimum:0},error:{$ref:"#/$defs/failure"}}},failure:{type:"object",additionalProperties:!1,required:["kind","code","message","retryable","ambiguous"],properties:{kind:{enum:["invalid_input","invalid_result","unsupported_capability","unsupported_operation","unsupported_version","input_too_large","result_too_large","frame_too_large","timed_out","cancelled","handler_crashed","worker_crashed","host_crashed","transport_failed","service_rejected","interrupted","ambiguous"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},message:{type:"string",minLength:1,maxLength:2048},retryable:{type:"boolean"},ambiguous:{type:"boolean"},details:{$ref:"#/$defs/safeMetadata"}}},safeMetadata:{type:"object",maxProperties:32,propertyNames:{pattern:"^(?!(?:authorization|cookie|set-cookie|token|secret|password|body|query|url|headers|input|output|data|value)$)[A-Za-z][A-Za-z0-9_.-]{0,63}$"},additionalProperties:{type:["string","number","boolean","null"]}}}};var un={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/native-fetch-observation/v1",title:"WOML Native Fetch Observation v1",description:"Redacted observation messages around Bun's unchanged native Fetch implementation.","x-status":"services-capabilities-contract-frozen","x-redaction":"No URL query, credentials, headers, request body, or response body may cross this boundary.",oneOf:[{$ref:"#/$defs/started"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/failed"}],$defs:{id:{type:"string",minLength:1,maxLength:256},method:{type:"string",pattern:"^[A-Z]+$",maxLength:32},origin:{type:"string",pattern:"^https?://(?![^/?#]*@)[^/?#]+$",maxLength:2048},path:{type:"string",pattern:"^/[^?#]*$",maxLength:2048},started:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","method","origin","path","startedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"started"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},method:{$ref:"#/$defs/method"},origin:{$ref:"#/$defs/origin"},path:{$ref:"#/$defs/path"},requestBodyBytes:{type:["integer","null"],minimum:0},startedAt:{type:"string",format:"date-time"}}},completed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","status","durationMs","completedAt"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},status:{type:"integer",minimum:100,maximum:599},responseBodyBytes:{type:["integer","null"],minimum:0},durationMs:{type:"number",minimum:0},completedAt:{type:"string",format:"date-time"}}},failed:{type:"object",additionalProperties:!1,required:["contract","contractVersion","observationType","invocationId","requestId","durationMs","failedAt","error"],properties:{contract:{const:"woml.native-fetch-observation"},contractVersion:{const:1},observationType:{const:"failed"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},durationMs:{type:"number",minimum:0},failedAt:{type:"string",format:"date-time"},error:{type:"object",additionalProperties:!1,required:["kind","code","message"],properties:{kind:{enum:["tracking_failed","fetch_rejected","timed_out","cancelled","worker_crashed","host_crashed"]},code:{type:"string",pattern:"^[A-Z][A-Z0-9_]*$"},message:{type:"string",minLength:1,maxLength:2048}}}}}}};var In={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v1",title:"WOML Script Host Protocol v1",description:"Versioned messages exchanged between the Rust core and the long-lived Bun script host.","x-status":"frozen-for-rust-hello-slice","x-transport":"Content-Length-framed UTF-8 JSON over child stdin/stdout","x-multiplexing":"Multiple execute messages may be in flight and completed responses may arrive out of order; invocationId is the sole correlation key.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:1},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v1#/$defs/hostReportedFailure"}}}}};var yn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v2",title:"WOML Script Host Protocol v2",description:"Asynchronous Content-Length-framed Rust/Bun protocol with per-invocation cancellation for parallel fail-fast.","x-status":"parallel-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v1","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{type:"integer",minimum:1},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:2},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var en={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v3",title:"WOML Script Host Protocol v3",description:"Asynchronous Content-Length-framed Rust/Bun protocol adding immutable attempt metadata and a stable effect key.","x-status":"retry-profile-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v2","x-multiplexing":"Multiple execute and cancel messages may be in flight; terminal completed responses may arrive out of order and correlate only by invocationId.",oneOf:[{$ref:"#/$defs/readyMessage"},{$ref:"#/$defs/executeMessage"},{$ref:"#/$defs/cancelMessage"},{$ref:"#/$defs/successMessage"},{$ref:"#/$defs/failureMessage"}],$defs:{nonEmptyId:{type:"string",minLength:1,maxLength:256},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3}}},readyMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/nonEmptyId"}}},executeMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/nonEmptyId"},runId:{$ref:"#/$defs/nonEmptyId"},nodeId:{$ref:"#/$defs/nonEmptyId"},attempt:{$ref:"#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1},source:{type:"string"},context:{$ref:"#/$defs/context"}}},attempt:{type:"object",additionalProperties:!1,required:["number","maxAttempts","idempotencyKey"],properties:{number:{type:"integer",minimum:1,maximum:10},maxAttempts:{type:"integer",minimum:1,maximum:10},idempotencyKey:{type:"string",pattern:"^sha256:[a-f0-9]{64}$"}}},cancelMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/nonEmptyId"},reason:{const:"parallel_fail_fast"}}},successMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},failureMessage:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:3},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/nonEmptyId"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0}}},successOutcome:{type:"object",additionalProperties:!1,required:["kind","value"],properties:{kind:{const:"success"},value:{}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v2#/$defs/hostReportedFailure"}}}}};var Mn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v4",title:"WOML Script Host Protocol v4",description:"Full-duplex Content-Length-framed Rust/Bun protocol adding Script Bindings v1, managed capability calls, and tracked native Fetch.","x-status":"services-capabilities-contract-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v3","x-multiplexing":"Multiple execute messages and multiple nested calls per invocation may be in flight. Every response correlates by invocationId and callId/requestId and may arrive out of order.","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:4},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var dn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v5",title:"WOML Script Host Protocol v5",description:"Full-duplex Rust/Bun protocol adding content-addressed local-module registration and per-invocation module bindings.","x-status":"module-system-ms3-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v4","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:4194304}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{const:"WOML_MODULE_DIGEST_MISMATCH"},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:5},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var Vn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v6",title:"WOML Script Host Protocol v6",description:"Full-duplex Rust/Bun protocol adding recoverable source maps, bounded immutable caching, and source-mapped module diagnostics.","x-status":"module-system-ms4-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v5","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},handler:{const:"runtime.script"},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}}},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:6},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var cn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v7",title:"WOML Script Host Protocol v7",description:"Full-duplex Rust/Bun protocol adding isolated lifecycle-script execution and the frozen Lifecycle Binding v1.","x-status":"lifecycle-engine-controls-lec3","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v6","x-framing":{format:"Content-Length: <UTF-8 byte length>\\r\\n\\r\\n<JSON bytes>",maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completedSuccess"},{$ref:"#/$defs/completedFailure"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},envelope:{type:"object",properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7}},required:["protocol","protocolVersion"]},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{enum:["WOML_MODULE_DIGEST_MISMATCH","WOML_MODULE_CACHE_LIMIT_EXCEEDED"]},message:{type:"string",minLength:1,maxLength:512}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["code","message"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{anyOf:[{required:["code"]},{required:["message"]}]}}}]},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},bindings:{type:"object",additionalProperties:!1,required:["bindingVersion","servicesVersion","secrets"],properties:{bindingVersion:{const:1},servicesVersion:{const:1},secrets:{type:"object",maxProperties:64,propertyNames:{pattern:"^[A-Z][A-Z0-9_]*$",maxLength:128},additionalProperties:{type:"string",maxLength:65536}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"#/$defs/bindings"},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}}},allOf:[{if:{properties:{mode:{const:"lifecycle"}},required:["mode"]},then:{required:["lifecycle"],properties:{handler:{const:"runtime.lifecycle-script"}}}},{if:{properties:{mode:{const:"step"}},required:["mode"]},then:{not:{required:["lifecycle"]},properties:{handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completedSuccess:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/successOutcome"},durationMs:{type:"number",minimum:0}}},completedFailure:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{$ref:"#/$defs/failureOutcome"},durationMs:{type:"number",minimum:0}}},failureOutcome:{type:"object",additionalProperties:!1,required:["kind","error"],properties:{kind:{const:"failure"},error:{$ref:"https://cronflow.dev/schemas/attempt-failure/v3#/$defs/hostReportedFailure"}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{oneOf:[{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/succeeded"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failed"},{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/cancelled"}]}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:7},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/failure"}},allOf:[{if:{properties:{accepted:{const:!1}},required:["accepted"]},then:{required:["error"]}},{if:{properties:{accepted:{const:!0}},required:["accepted"]},then:{not:{required:["error"]}}}]}}};var pn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://cronflow.dev/schemas/script-host-protocol/v8",title:"WOML Script Host Protocol v8",description:"Protocol v7 plus isolated reusable-step and reusable-lifecycle bindings.","x-status":"switch-custom-definitions-scp4","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v7","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
15
15
  \r
16
- <JSON bytes>`,maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},base:{type:"object",required:["protocol","protocolVersion","messageType"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{type:"string"}}},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var Wb={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/lifecycle-binding/v1",title:"WOML Lifecycle Runtime Binding v1","x-status":"lifecycle-engine-controls-lec0-frozen","x-forbiddenFields":["secrets","stack","eventId","invocationId","operationKey","idempotencyKey","context.run"],type:"object",additionalProperties:!1,required:["event","workflow"],properties:{event:{enum:["run_start","step_start","step_success","step_failure","step_complete","run_success","run_failure","run_cancel","run_complete"]},workflow:{$ref:"#/$defs/workflow"},step:{$ref:"#/$defs/step"},failure:{$ref:"#/$defs/failure"}},$defs:{workflow:{type:"object",additionalProperties:!1,required:["id"],properties:{id:{type:"string",minLength:1,maxLength:256},outcome:{enum:["succeeded","failed","cancelled"]}}},step:{type:"object",additionalProperties:!1,required:["id","attempts"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},outcome:{enum:["succeeded","failed","cancelled"]},attempts:{type:"integer",minimum:0,maximum:10}}},failure:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",pattern:"^WOML_[A-Z0-9_]+$",maxLength:128},message:{type:"string",minLength:1,maxLength:1024}}}}};var P=new Ob.default({allErrors:!0,strict:!1,logger:!1});P.addSchema(lb);P.addSchema(fb);P.addSchema(sb);P.addSchema(bb);P.addSchema(nb);P.addSchema(Wb);var yV=P.compile(ub),MV=P.compile(Ib),VV=P.compile(yb),LV=P.compile(Mb),qV=P.compile(Vb),TV=P.compile(Lb),So=P.compile(qb),wb=P.compile(Tb);function $i(i,t,o=[]){let r=new Set([...t,...o]);return t.every(($)=>Object.hasOwn(i,$))&&Object.keys(i).every(($)=>r.has($))}function WV(i){if(typeof i!=="object"||i===null||Array.isArray(i))return!1;let t=i,o=t.definition,r=t.props;return $i(t,["profile","invocationId","definition","props"])&&t.profile==="woml.reusable-script-binding/v3"&&typeof t.invocationId==="string"&&t.invocationId.length>=1&&t.invocationId.length<=256&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&$i(o,["kind","alias","digest","source"])&&(o.kind==="step"||o.kind==="notification-provider")&&typeof o.alias==="string"&&/^sha256:[0-9a-f]{64}$/.test(String(o.digest))&&typeof o.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&Object.keys(r).length<=64&&Buffer.byteLength(JSON.stringify(r),"utf8")<=1048576}function OV(i){if(typeof i!=="object"||i===null||Array.isArray(i))return!1;let t=i;return $i(t,["hook","outcome"],["result","error"])&&(t.hook==="on-success"||t.hook==="on-error"||t.hook==="on-complete")&&(t.outcome==="succeeded"||t.outcome==="failed"||t.outcome==="cancelled")&&(t.error===void 0||typeof t.error==="object"&&t.error!==null&&!Array.isArray(t.error)&&$i(t.error,["code","message"])&&typeof t.error.code==="string"&&typeof t.error.message==="string")}function wV(i){let{attempt:t,context:o,bindings:r,modules:$}=i;return $i(i,["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],["lifecycle","reusable","reusableLifecycle"])&&i.protocol==="woml.script-host"&&i.protocolVersion===8&&i.messageType==="execute"&&[i.invocationId,i.runId,i.nodeId].every((l)=>typeof l==="string"&&l.length>0&&l.length<=256)&&typeof t==="object"&&t!==null&&!Array.isArray(t)&&$i(t,["number","maxAttempts","idempotencyKey"])&&Number.isInteger(t.number)&&Number(t.number)>=1&&Number.isInteger(t.maxAttempts)&&Number(t.maxAttempts)>=1&&/^sha256:[0-9a-f]{64}$/.test(String(t.idempotencyKey))&&(i.mode==="step"&&i.handler==="runtime.script"||i.mode==="lifecycle"&&i.handler==="runtime.lifecycle-script")&&Number.isInteger(i.timeoutMs)&&Number(i.timeoutMs)>=1&&Number(i.timeoutMs)<=86400000&&typeof i.source==="string"&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&$i(o,["trigger","steps"])&&typeof o.trigger==="object"&&o.trigger!==null&&typeof o.steps==="object"&&o.steps!==null&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&$i(r,["bindingVersion","servicesVersion","secrets"])&&r.bindingVersion===1&&r.servicesVersion===1&&typeof r.secrets==="object"&&r.secrets!==null&&Array.isArray($)&&$.length<=64&&$.every((l)=>{if(typeof l!=="object"||l===null||Array.isArray(l))return!1;let f=l;return $i(f,["name","bundleDigest","exports"])&&typeof f.name==="string"&&/^[a-z][A-Za-z0-9]*$/.test(f.name)&&/^sha256:[0-9a-f]{64}$/.test(String(f.bundleDigest))&&Array.isArray(f.exports)&&f.exports.length>0&&f.exports.every((s)=>typeof s==="string")})}function jV(i){if(typeof i!=="object"||i===null||Array.isArray(i))return!1;let t=i;if(t.protocolVersion!==8)return!1;if(!wb(i))return!1;if(t.messageType==="execute"){if(!wV(t))return!1;if(t.reusable===void 0)return t.reusableLifecycle===void 0;if(!WV(t.reusable))return!1;if(t.reusableLifecycle===void 0)return t.mode==="step";return t.mode==="lifecycle"&&OV(t.reusableLifecycle)}let o={...t,protocolVersion:7};if(delete o.reusable,delete o.reusableLifecycle,!So(o))return!1;return t.reusable===void 0&&t.reusableLifecycle===void 0}class k extends Error{constructor(i){super(i);this.name="MessageProtocolError"}}function FV(i){if((i.protocolVersion===3||i.protocolVersion===4||i.protocolVersion===5||i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8)&&i.attempt.number>i.attempt.maxAttempts)throw new k(`Script-host protocol v${i.protocolVersion} attempt.number must not exceed attempt.maxAttempts.`)}function ZV(i){if(i===void 0||i===null||i.length===0)return"unknown schema violation";return i.slice(0,5).map((t)=>`${t.instancePath||"/"} ${t.message??t.keyword}`).join("; ")}function jb(i,t){let o=t===8?So:t===7?So:t===6?TV:t===5?qV:t===4?LV:t===3?VV:t===2?MV:yV;if(!(t===8?jV(i):o(i)))throw new k(`Message does not match script-host protocol v${t}: ${ZV(t===8?wb.errors:o.errors)}.`);if(typeof i!=="object"||i===null||!("protocolVersion"in i)||i.protocolVersion!==t||!("messageType"in i)||i.messageType!=="execute"&&i.messageType!=="register_module"&&i.messageType!=="cancel"&&i.messageType!=="capability_result"&&i.messageType!=="fetch_observation_ack")throw new k(`The Bun script host received an unsupported protocol-v${t} message direction.`);if(i.messageType==="execute")FV(i)}var Fb=3145728,BV=33554432,JV=64;function ko(i,t){let o={protocol:"woml.script-host",messageType:"module_registered",bundleDigest:i.bundleDigest,...t};return i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?{...o,protocolVersion:i.protocolVersion,sourceMapDigest:i.sourceMapDigest}:{...o,protocolVersion:5}}function Bb(i){return Math.max(0,performance.now()-i)}function yi(i,t,o){return{protocol:"woml.script-host",protocolVersion:i.protocolVersion,messageType:"completed",invocationId:i.invocationId,outcome:{kind:"failure",error:o},durationMs:Bb(t)}}function XV(i,t,o){return{protocol:"woml.script-host",protocolVersion:i.protocolVersion,messageType:"completed",invocationId:i.invocationId,outcome:{kind:"success",value:o},durationMs:Bb(t)}}function Zb(i){return Buffer.byteLength(JSON.stringify(i),"utf8")}class eo{#o;#i;#t;#M;#n=new Map;#$=new Map;#u=new Map;#l=new Map;#f=new Set;#r=new Map;#s=new Map;#b=new Set;#I=new Map;#y=0;#V=!1;constructor(i){this.#o=i.workerUrl,this.#i=i.limits??{},this.#t=i.send,this.#M=i.protocolVersion??3}accept(i){if(this.#V)throw new k("The script host is shutting down.");if(jb(i,this.#M),i.messageType==="register_module"){this.#L(i);return}if(i.messageType==="cancel"){this.#q(i);return}if(i.messageType==="capability_result"){this.#T(i);return}if(i.messageType==="fetch_observation_ack"){this.#W(i);return}if(this.#n.has(i.invocationId))throw new k(`Invocation ID "${i.invocationId}" is already active.`);let t=this.#O(i).finally(()=>{this.#n.delete(i.invocationId),this.#u.delete(i.invocationId)});this.#n.set(i.invocationId,t)}#L(i){let t=`sha256:${new Bun.CryptoHasher("sha256").update(i.bundle).digest("hex")}`,o=i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?`sha256:${new Bun.CryptoHasher("sha256").update(i.sourceMap).digest("hex")}`:void 0;if(t!==i.bundleDigest||(i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8)&&o!==i.sourceMapDigest){this.#t(ko(i,{accepted:!1,code:"WOML_MODULE_DIGEST_MISMATCH",message:"The registered module bundle does not match its SHA-256 identity."}));return}let $=this.#I.get(i.bundleDigest);if($!==void 0&&($.bundle!==i.bundle||(i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8)&&($.sourceMap!==i.sourceMap||$.sourceMapDigest!==i.sourceMapDigest)))throw new k("One module digest was registered with different immutable bytes.");let l=Buffer.byteLength(i.bundle,"utf8")+(i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?Buffer.byteLength(i.sourceMap,"utf8"):0),f=Buffer.byteLength(i.bundle,"utf8")>Fb||(i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8)&&Buffer.byteLength(i.sourceMap,"utf8")>Fb;if($===void 0&&(f||this.#I.size>=JV||this.#y+l>BV)){this.#t(ko(i,{accepted:!1,code:"WOML_MODULE_CACHE_LIMIT_EXCEEDED",message:"The immutable module cache limit was exceeded."}));return}if($===void 0)this.#I.set(i.bundleDigest,{bundle:i.bundle,...i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?{sourceMap:i.sourceMap,sourceMapDigest:i.sourceMapDigest}:{},bytes:l}),this.#y+=l;this.#t(ko(i,{accepted:!0}))}async drain(){while(this.#n.size>0)await Promise.all([...this.#n.values()])}abort(){this.#V=!0;for(let i of this.#$.values())i.terminate();this.#$.clear(),this.#u.clear(),this.#l.clear(),this.#f.clear(),this.#r.clear(),this.#s.clear(),this.#b.clear(),this.#I.clear(),this.#y=0}#q(i){this.#u.get(i.invocationId)?.(i.reason)}#T(i){if(i.invocationId!==i.result.invocationId||i.callId!==i.result.callId)throw new k("Capability result wrapper IDs do not match its result payload.");let t=this.#$.get(i.invocationId),o=this.#l.get(i.invocationId);if(t===void 0||o===void 0||!o.delete(i.callId)){let r=`${i.invocationId}\x00${i.callId}`;if(this.#f.delete(r))return;throw new k(`Capability result references unknown call ID "${i.callId}".`)}t.postMessage({messageType:"capability_result",callId:i.callId,result:i.result})}#W(i){let t=this.#$.get(i.invocationId),o=this.#r.get(i.invocationId),r=o?.get(i.requestId);if(t===void 0||o===void 0||r===void 0){let l=`${i.invocationId}\x00${i.requestId}`;if(this.#b.delete(l))return;throw new k(`Native Fetch acknowledgement references unknown request ID "${i.requestId}".`)}o.delete(i.requestId);let $=this.#s.get(i.invocationId);if(i.accepted&&r==="started")$.add(i.requestId);if(!i.accepted||r==="terminal")$.delete(i.requestId);t.postMessage({messageType:"fetch_observation_ack",requestId:i.requestId,ack:i})}async#O(i){let t=performance.now(),o=Zb(i.context);if(this.#i.maxContextBytes!==void 0&&o>this.#i.maxContextBytes){await this.#t(yi(i,t,{kind:"context_too_large",code:"WOML_SCRIPT_CONTEXT_TOO_LARGE",message:"Invocation context exceeds the configured byte limit.",details:{actualBytes:o,limitBytes:this.#i.maxContextBytes}}));return}let r=await this.#w(i);if(r.kind==="timeout"){await this.#t(yi(i,t,{kind:"script_timed_out",code:"WOML_SCRIPT_TIMEOUT",message:"Script exceeded its execution deadline."}));return}if(r.kind==="cancelled"){await this.#t(yi(i,t,{kind:"invocation_cancelled",code:"WOML_SCRIPT_CANCELLED",message:r.reason==="parallel_fail_fast"?"Invocation was cancelled by parallel fail-fast.":r.reason==="run_cancelled"?"Invocation was cancelled because its run was cancelled.":r.reason==="step_timed_out"?"Invocation was cancelled because its step timed out.":"Invocation was cancelled because the script host is shutting down."}));return}if(r.kind==="crashed"){await this.#t(yi(i,t,{kind:"worker_crashed",code:"WOML_SCRIPT_WORKER_CRASHED",message:r.message}));return}let $=r.response;if(!$.ok){await this.#t(yi(i,t,{...$.error.kind==="service"&&$.error.capability!==void 0&&$.error.operation!==void 0&&$.error.callId!==void 0&&$.error.cause!==void 0?{kind:"service_failed",code:$.error.cause.code,message:$.error.message,capability:$.error.capability,operation:$.error.operation,callId:$.error.callId,retryable:$.error.cause.retryable,ambiguous:$.error.cause.ambiguous,cause:$.error.cause}:{kind:$.error.kind==="non-json"?"invalid_script_result":"script_threw",code:$.error.kind==="non-json"?"WOML_SCRIPT_NON_JSON_RESULT":"WOML_SCRIPT_THROWN",message:$.error.moduleFrame===void 0?$.error.message:`${$.error.message} (${$.error.moduleFrame})`}}));return}let l=ir($.result);if(l!==void 0){await this.#t(yi(i,t,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:`${l.path}: ${l.reason}`}));return}if((i.protocolVersion===4||i.protocolVersion===5||i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8)&&Co($.result,Object.values(i.bindings.secrets))){await this.#t(yi(i,t,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:"Script results must not contain a resolved secret value."}));return}let f=Zb($.result);if(this.#i.maxResultBytes!==void 0&&f>this.#i.maxResultBytes){await this.#t(yi(i,t,{kind:"result_too_large",code:"WOML_SCRIPT_RESULT_TOO_LARGE",message:"Script result exceeds the configured byte limit.",details:{actualBytes:f,limitBytes:this.#i.maxResultBytes}}));return}await this.#t(XV(i,t,$.result))}#w(i){let t;try{t=new Worker(this.#o,{type:"module",ref:!0,smol:!0,env:{}})}catch{return Promise.resolve({kind:"crashed",message:"The isolated script Worker could not be started."})}return this.#$.set(i.invocationId,t),new Promise((o)=>{let r=!1,$=(f)=>{if(r)return;r=!0,clearTimeout(l),this.#$.delete(i.invocationId),this.#u.delete(i.invocationId);for(let s of this.#l.get(i.invocationId)??[])this.#f.add(`${i.invocationId}\x00${s}`);for(let s of this.#r.get(i.invocationId)?.keys()??[])this.#b.add(`${i.invocationId}\x00${s}`);while(this.#f.size>4096){let s=this.#f.values().next().value;if(s===void 0)break;this.#f.delete(s)}while(this.#b.size>4096){let s=this.#b.values().next().value;if(s===void 0)break;this.#b.delete(s)}this.#l.delete(i.invocationId),this.#r.delete(i.invocationId),this.#s.delete(i.invocationId),t.terminate(),o(f)},l=setTimeout(()=>$({kind:"timeout"}),i.timeoutMs);this.#u.set(i.invocationId,(f)=>{$({kind:"cancelled",reason:f})}),this.#l.set(i.invocationId,new Set),this.#r.set(i.invocationId,new Map),this.#s.set(i.invocationId,new Set),t.onmessage=(f)=>{let s=f.data;if(s.messageType==="completed"){if((this.#r.get(i.invocationId)?.size??0)>0||(this.#s.get(i.invocationId)?.size??0)>0){$({kind:"crashed",message:"The isolated script Worker completed with an unclosed native Fetch observation."});return}$({kind:"response",response:s.response});return}if(s.messageType==="fetch_observation"){let u=s.observation;if(i.protocolVersion!==4&&i.protocolVersion!==5&&i.protocolVersion!==6&&i.protocolVersion!==7&&i.protocolVersion!==8||u.invocationId!==i.invocationId){$({kind:"crashed",message:"The isolated script Worker emitted an invalid native Fetch observation."});return}let I=this.#r.get(i.invocationId),q=this.#s.get(i.invocationId),L=u.observationType==="started"?"started":"terminal";if(I.has(u.requestId)||(L==="started"?q.has(u.requestId):!q.has(u.requestId))){$({kind:"crashed",message:"The isolated script Worker violated the native Fetch observation lifecycle."});return}I.set(u.requestId,L),this.#t({protocol:"woml.script-host",protocolVersion:i.protocolVersion,messageType:"fetch_observation",invocationId:i.invocationId,requestId:u.requestId,observation:u}).catch(()=>{$({kind:"crashed",message:"The native Fetch observation could not be sent to Rust."})});return}let b=s.call;if(i.protocolVersion!==4&&i.protocolVersion!==5&&i.protocolVersion!==6&&i.protocolVersion!==7&&i.protocolVersion!==8||b.invocationId!==i.invocationId||b.runId!==i.runId||b.nodeId!==i.nodeId||b.attemptNumber!==i.attempt.number){$({kind:"crashed",message:"The isolated script Worker emitted an invalid capability call."});return}let n=this.#l.get(i.invocationId);if(n===void 0||n.has(b.callId)){$({kind:"crashed",message:"The isolated script Worker reused a capability call ID."});return}n.add(b.callId),this.#t({protocol:"woml.script-host",protocolVersion:i.protocolVersion,messageType:"capability_call",invocationId:i.invocationId,callId:b.callId,call:b}).catch(()=>{$({kind:"crashed",message:"The capability call could not be sent to Rust."})})},t.onerror=(f)=>{f.preventDefault(),$({kind:"crashed",message:f.message||"The isolated script Worker crashed."})},t.onmessageerror=()=>{$({kind:"crashed",message:"The isolated script Worker returned an unreadable message."})},t.addEventListener("close",()=>{$({kind:"crashed",message:"The isolated script Worker exited without a result."})});try{let f=i.protocolVersion===3||i.protocolVersion===4||i.protocolVersion===5||i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?i.attempt:void 0;t.postMessage({messageType:"execute",request:{invocationId:i.invocationId,runId:i.runId,nodeId:i.nodeId,timeoutMs:i.timeoutMs,source:i.source,context:i.context,...i.protocolVersion===7||i.protocolVersion===8?{mode:i.mode,...i.mode==="lifecycle"?{lifecycle:i.lifecycle}:{}}:{},...i.protocolVersion===8&&i.reusable!==void 0?{reusable:i.reusable,...i.reusableLifecycle===void 0?{}:{reusableLifecycle:i.reusableLifecycle}}:{},attempt:f,...i.protocolVersion===4||i.protocolVersion===5||i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?{bindings:i.bindings}:{},...i.protocolVersion===5||i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?{modules:i.modules.map((s)=>{let b=this.#I.get(s.bundleDigest);if(b===void 0)throw new k(`Module bundle ${s.bundleDigest} was not registered.`);return{...s,bundle:b.bundle,...i.protocolVersion===6||i.protocolVersion===7||i.protocolVersion===8?{sourceMap:b.sourceMap,sourceMapDigest:b.sourceMapDigest}:{}}})}:{}}})}catch{$({kind:"crashed",message:"The invocation could not be delivered to its script Worker."})}})}}function Co(i,t){let o=t.filter((r)=>r.length>0);if(o.length===0)return!1;if(typeof i==="string")return o.some((r)=>i.includes(r));if(Array.isArray(i))return i.some((r)=>Co(r,o));if(i!==null&&typeof i==="object")return Object.values(i).some((r)=>Co(r,o));return!1}function ho(i){let t=process.env[i];if(t===void 0||t==="")return;let o=Number(t);if(!Number.isSafeInteger(o)||o<1)throw Error(`${i} must be a positive safe integer when provided.`);return o}function QV(){return{maxContextBytes:ho("WOML_SCRIPT_HOST_MAX_CONTEXT_BYTES"),maxResultBytes:ho("WOML_SCRIPT_HOST_MAX_RESULT_BYTES"),maxFrameBytes:ho("WOML_SCRIPT_HOST_MAX_FRAME_BYTES")}}function AV(){let i=process.env.WOML_SCRIPT_HOST_PROTOCOL_VERSION??"3";if(i==="1"||i==="2"||i==="3"||i==="4"||i==="5"||i==="6"||i==="7"||i==="8")return Number(i);throw Error("WOML_SCRIPT_HOST_PROTOCOL_VERSION must be 1, 2, 3, 4, 5, 6, 7, or 8.")}async function zV(i){await new Promise((t,o)=>{process.stdout.write(i,(r)=>{if(r===null||r===void 0)t();else o(r)})})}async function GV(){let i=QV(),t=AV(),o=new ct({maxFrameBytes:i.maxFrameBytes}),r=new Rt(zV),$=import.meta.url.endsWith(".ts")?"./script-host-worker.ts":"./script-host-worker.js",l=new eo({workerUrl:new URL($,import.meta.url),limits:i,protocolVersion:t,send:(s)=>r.send(s)}),f={protocol:"woml.script-host",protocolVersion:t,messageType:"ready",hostInstanceId:`host_${YV()}`};try{await r.send(f);let s=Bun.stdin.stream().getReader();while(!0){let{done:b,value:n}=await s.read();if(b)break;for(let u of o.push(n))l.accept(u)}o.finish(),await l.drain(),await r.drain()}catch(s){l.abort();let b=s instanceof Error?`${s.name}: ${s.message}`:String(s);process.stderr.write(`WOML script host failed: ${b}
17
- `),process.exitCode=1}}if(import.meta.main)await GV();export{GV as runScriptHost};
16
+ <JSON bytes>`,maximumFrameBytes:8388608},oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},base:{type:"object",required:["protocol","protocolVersion","messageType"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{type:"string"}}},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:8},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var Ln={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/script-host-protocol/v9",title:"WOML For-Each Script Host Protocol v9",description:"Protocol v8 plus bounded iteration-local context for loop-body and matching lifecycle invocations.","x-status":"for-each-fe0-frozen","x-previousVersion":"https://cronflow.dev/schemas/script-host-protocol/v8","x-framing":{format:`Content-Length: <UTF-8 byte length>\r
17
+ \r
18
+ <JSON bytes>`,maximumFrameBytes:8388608},"x-multiplexing":"Execute messages remain asynchronous; completed responses correlate only by invocationId and may arrive out of order.","x-iterationRule":"context.item and context.iteration are both required for a loop-owned invocation and both forbidden for a root invocation.",oneOf:[{$ref:"#/$defs/ready"},{$ref:"#/$defs/registerModule"},{$ref:"#/$defs/moduleRegistered"},{$ref:"#/$defs/execute"},{$ref:"#/$defs/cancel"},{$ref:"#/$defs/completed"},{$ref:"#/$defs/capabilityCall"},{$ref:"#/$defs/capabilityResult"},{$ref:"#/$defs/fetchObservation"},{$ref:"#/$defs/fetchObservationAck"}],$defs:{id:{type:"string",minLength:1,maxLength:256},sha256:{type:"string",pattern:"^sha256:[0-9a-f]{64}$"},ready:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","hostInstanceId"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"ready"},hostInstanceId:{$ref:"#/$defs/id"}}},registerModule:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","bundle","sourceMapDigest","sourceMap"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"register_module"},bundleDigest:{$ref:"#/$defs/sha256"},bundle:{type:"string",maxLength:3145728},sourceMapDigest:{$ref:"#/$defs/sha256"},sourceMap:{type:"string",maxLength:3145728}}},moduleRegistered:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","bundleDigest","sourceMapDigest","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"module_registered"},bundleDigest:{$ref:"#/$defs/sha256"},sourceMapDigest:{$ref:"#/$defs/sha256"},accepted:{type:"boolean"},code:{type:"string"},message:{type:"string"}}},moduleBinding:{type:"object",additionalProperties:!1,required:["name","bundleDigest","exports"],properties:{name:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$",maxLength:128},bundleDigest:{$ref:"#/$defs/sha256"},exports:{type:"array",minItems:1,uniqueItems:!0,items:{type:"string",pattern:"^[A-Za-z_$][A-Za-z0-9_$]*$"}}}},reusableDefinition:{type:"object",additionalProperties:!1,required:["kind","alias","digest","source"],properties:{kind:{enum:["step","notification-provider"]},alias:{$ref:"#/$defs/id"},digest:{$ref:"#/$defs/sha256"},source:{type:"string",minLength:1,maxLength:4096}}},reusable:{type:"object",additionalProperties:!1,required:["profile","invocationId","definition","props"],properties:{profile:{const:"woml.reusable-script-binding/v3"},invocationId:{$ref:"#/$defs/id"},definition:{$ref:"#/$defs/reusableDefinition"},props:{type:"object",maxProperties:64}}},reusableLifecycle:{type:"object",additionalProperties:!1,required:["hook","outcome"],properties:{hook:{enum:["on-success","on-error","on-complete"]},outcome:{enum:["succeeded","failed","cancelled"]},result:!0,error:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",minLength:1},message:{type:"string",minLength:1}}}}},iteration:{type:"object",additionalProperties:!1,required:["index","total"],properties:{index:{type:"integer",minimum:0,maximum:9999},total:{type:"integer",minimum:1,maximum:1e4}}},context:{type:"object",additionalProperties:!1,required:["trigger","steps"],properties:{trigger:{type:"object"},steps:{type:"object",additionalProperties:!0},item:!0,iteration:{$ref:"#/$defs/iteration"}},oneOf:[{required:["item","iteration"]},{not:{anyOf:[{required:["item"]},{required:["iteration"]}]}}]},execute:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"execute"},invocationId:{$ref:"#/$defs/id"},runId:{$ref:"#/$defs/id"},nodeId:{$ref:"#/$defs/id"},attempt:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v3#/$defs/attempt"},mode:{enum:["step","lifecycle"]},handler:{enum:["runtime.script","runtime.lifecycle-script"]},timeoutMs:{type:"integer",minimum:1,maximum:86400000},source:{type:"string"},context:{$ref:"#/$defs/context"},bindings:{$ref:"https://cronflow.dev/schemas/script-host-protocol/v7#/$defs/bindings"},modules:{type:"array",maxItems:64,items:{$ref:"#/$defs/moduleBinding"}},lifecycle:{$ref:"https://woml.dev/schemas/lifecycle-binding/v1"},reusable:{$ref:"#/$defs/reusable"},reusableLifecycle:{$ref:"#/$defs/reusableLifecycle"}},allOf:[{if:{required:["reusableLifecycle"]},then:{required:["reusable"],properties:{mode:{const:"lifecycle"},handler:{const:"runtime.lifecycle-script"}}}},{if:{required:["reusable"],not:{required:["reusableLifecycle"]}},then:{properties:{mode:{const:"step"},handler:{const:"runtime.script"}}}}]},cancel:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","reason"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"cancel"},invocationId:{$ref:"#/$defs/id"},reason:{enum:["parallel_fail_fast","step_timed_out","run_cancelled","host_shutdown"]}}},completed:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","outcome","durationMs"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"completed"},invocationId:{$ref:"#/$defs/id"},outcome:{type:"object"},durationMs:{type:"number",minimum:0}}},capabilityCall:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","call"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_call"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},call:{$ref:"https://cronflow.dev/schemas/capability-call/v1#/$defs/request"}}},capabilityResult:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","callId","result"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"capability_result"},invocationId:{$ref:"#/$defs/id"},callId:{$ref:"#/$defs/id"},result:{type:"object"}}},fetchObservation:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","observation"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},observation:{$ref:"https://cronflow.dev/schemas/native-fetch-observation/v1"}}},fetchObservationAck:{type:"object",additionalProperties:!1,required:["protocol","protocolVersion","messageType","invocationId","requestId","accepted"],properties:{protocol:{const:"woml.script-host"},protocolVersion:{const:9},messageType:{const:"fetch_observation_ack"},invocationId:{$ref:"#/$defs/id"},requestId:{$ref:"#/$defs/id"},accepted:{type:"boolean"},error:{type:"object"}}}}};var qn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://woml.dev/schemas/lifecycle-binding/v1",title:"WOML Lifecycle Runtime Binding v1","x-status":"lifecycle-engine-controls-lec0-frozen","x-forbiddenFields":["secrets","stack","eventId","invocationId","operationKey","idempotencyKey","context.run"],type:"object",additionalProperties:!1,required:["event","workflow"],properties:{event:{enum:["run_start","step_start","step_success","step_failure","step_complete","run_success","run_failure","run_cancel","run_complete"]},workflow:{$ref:"#/$defs/workflow"},step:{$ref:"#/$defs/step"},failure:{$ref:"#/$defs/failure"}},$defs:{workflow:{type:"object",additionalProperties:!1,required:["id"],properties:{id:{type:"string",minLength:1,maxLength:256},outcome:{enum:["succeeded","failed","cancelled"]}}},step:{type:"object",additionalProperties:!1,required:["id","attempts"],properties:{id:{type:"string",pattern:"^[a-z][A-Za-z0-9]*$"},outcome:{enum:["succeeded","failed","cancelled"]},attempts:{type:"integer",minimum:0,maximum:10}}},failure:{type:"object",additionalProperties:!1,required:["code","message"],properties:{code:{type:"string",pattern:"^WOML_[A-Z0-9_]+$",maxLength:128},message:{type:"string",minLength:1,maxLength:1024}}}}};var D=new Tn.default({allErrors:!0,strict:!1,logger:!1});D.addSchema(fn);D.addSchema(sn);D.addSchema(nn);D.addSchema(bn);D.addSchema(un);D.addSchema(qn);var L6=D.compile(In),q6=D.compile(yn),T6=D.compile(en),O6=D.compile(Mn),W6=D.compile(dn),j6=D.compile(Vn),Ki=D.compile(cn),On=D.compile(pn),Wn=D.compile(Ln);function tt(t,i,o=[]){let r=new Set([...i,...o]);return i.every(($)=>Object.hasOwn(t,$))&&Object.keys(t).every(($)=>r.has($))}function jn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t,o=i.definition,r=i.props;return tt(i,["profile","invocationId","definition","props"])&&i.profile==="woml.reusable-script-binding/v3"&&typeof i.invocationId==="string"&&i.invocationId.length>=1&&i.invocationId.length<=256&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&tt(o,["kind","alias","digest","source"])&&(o.kind==="step"||o.kind==="notification-provider")&&typeof o.alias==="string"&&/^sha256:[0-9a-f]{64}$/.test(String(o.digest))&&typeof o.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&Object.keys(r).length<=64&&Buffer.byteLength(JSON.stringify(r),"utf8")<=1048576}function wn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;return tt(i,["hook","outcome"],["result","error"])&&(i.hook==="on-success"||i.hook==="on-error"||i.hook==="on-complete")&&(i.outcome==="succeeded"||i.outcome==="failed"||i.outcome==="cancelled")&&(i.error===void 0||typeof i.error==="object"&&i.error!==null&&!Array.isArray(i.error)&&tt(i.error,["code","message"])&&typeof i.error.code==="string"&&typeof i.error.message==="string")}function Fn(t,i){let{attempt:o,context:r,bindings:$,modules:l}=t;return tt(t,["protocol","protocolVersion","messageType","invocationId","runId","nodeId","attempt","mode","handler","timeoutMs","source","context","bindings","modules"],["lifecycle","reusable","reusableLifecycle"])&&t.protocol==="woml.script-host"&&t.protocolVersion===i&&t.messageType==="execute"&&[t.invocationId,t.runId,t.nodeId].every((f)=>typeof f==="string"&&f.length>0&&f.length<=256)&&typeof o==="object"&&o!==null&&!Array.isArray(o)&&tt(o,["number","maxAttempts","idempotencyKey"])&&Number.isInteger(o.number)&&Number(o.number)>=1&&Number.isInteger(o.maxAttempts)&&Number(o.maxAttempts)>=1&&/^sha256:[0-9a-f]{64}$/.test(String(o.idempotencyKey))&&(t.mode==="step"&&t.handler==="runtime.script"||t.mode==="lifecycle"&&t.handler==="runtime.lifecycle-script")&&Number.isInteger(t.timeoutMs)&&Number(t.timeoutMs)>=1&&Number(t.timeoutMs)<=86400000&&typeof t.source==="string"&&typeof r==="object"&&r!==null&&!Array.isArray(r)&&tt(r,["trigger","steps"],i===9?["item","iteration"]:[])&&typeof r.trigger==="object"&&r.trigger!==null&&typeof r.steps==="object"&&r.steps!==null&&typeof $==="object"&&$!==null&&!Array.isArray($)&&tt($,["bindingVersion","servicesVersion","secrets"])&&$.bindingVersion===1&&$.servicesVersion===1&&typeof $.secrets==="object"&&$.secrets!==null&&Array.isArray(l)&&l.length<=64&&l.every((f)=>{if(typeof f!=="object"||f===null||Array.isArray(f))return!1;let s=f;return tt(s,["name","bundleDigest","exports"])&&typeof s.name==="string"&&/^[a-z][A-Za-z0-9]*$/.test(s.name)&&/^sha256:[0-9a-f]{64}$/.test(String(s.bundleDigest))&&Array.isArray(s.exports)&&s.exports.length>0&&s.exports.every((n)=>typeof n==="string")})}function w6(t){let i=t.context,o=Object.hasOwn(i,"item"),r=Object.hasOwn(i,"iteration");if(o!==r)return!1;if(!r)return!0;let $=i.iteration;if(typeof $!=="object"||$===null||Array.isArray($))return!1;let l=$;return tt(l,["index","total"])&&Number.isInteger(l.index)&&Number.isInteger(l.total)&&Number(l.total)>=1&&Number(l.total)<=1e4&&Number(l.index)>=0&&Number(l.index)<Number(l.total)}function Zn(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==8)return!1;if(!On(t))return!1;if(i.messageType==="execute"){if(!Fn(i,8))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!jn(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&wn(i.reusableLifecycle)}let o={...i,protocolVersion:7};if(delete o.reusable,delete o.reusableLifecycle,!Ki(o))return!1;return i.reusable===void 0&&i.reusableLifecycle===void 0}function F6(t){if(typeof t!=="object"||t===null||Array.isArray(t))return!1;let i=t;if(i.protocolVersion!==9||!Wn(t))return!1;if(i.messageType==="execute"){if(!Fn(i,9)||!w6(i))return!1;if(i.reusable===void 0)return i.reusableLifecycle===void 0;if(!jn(i.reusable))return!1;if(i.reusableLifecycle===void 0)return i.mode==="step";return i.mode==="lifecycle"&&wn(i.reusableLifecycle)}let o={...i,protocolVersion:8};return Zn(o)}class S extends Error{constructor(t){super(t);this.name="MessageProtocolError"}}function Z6(t){if((t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&t.attempt.number>t.attempt.maxAttempts)throw new S(`Script-host protocol v${t.protocolVersion} attempt.number must not exceed attempt.maxAttempts.`)}function B6(t){if(t===void 0||t===null||t.length===0)return"unknown schema violation";return t.slice(0,5).map((i)=>`${i.instancePath||"/"} ${i.message??i.keyword}`).join("; ")}function Bn(t,i){let o=i===9?Ki:i===8?Ki:i===7?Ki:i===6?j6:i===5?W6:i===4?O6:i===3?T6:i===2?q6:L6,r=i===9?F6(t):Zn(t);if(!(i>=8?r:o(t)))throw new S(`Message does not match script-host protocol v${i}: ${B6(i>=8?i===9?Wn.errors:On.errors:o.errors)}.`);if(typeof t!=="object"||t===null||!("protocolVersion"in t)||t.protocolVersion!==i||!("messageType"in t)||t.messageType!=="execute"&&t.messageType!=="register_module"&&t.messageType!=="cancel"&&t.messageType!=="capability_result"&&t.messageType!=="fetch_observation_ack")throw new S(`The Bun script host received an unsupported protocol-v${i} message direction.`);if(t.messageType==="execute")Z6(t)}var Jn=3145728,J6=33554432,X6=64;function So(t,i){let o={protocol:"woml.script-host",messageType:"module_registered",bundleDigest:t.bundleDigest,...i};return t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{...o,protocolVersion:t.protocolVersion,sourceMapDigest:t.sourceMapDigest}:{...o,protocolVersion:5}}function Yn(t){return Math.max(0,performance.now()-t)}function yt(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"failure",error:o},durationMs:Yn(i)}}function Y6(t,i,o){return{protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"completed",invocationId:t.invocationId,outcome:{kind:"success",value:o},durationMs:Yn(i)}}function Xn(t){return Buffer.byteLength(JSON.stringify(t),"utf8")}class Co{#o;#t;#i;#e;#b=new Map;#$=new Map;#u=new Map;#l=new Map;#f=new Set;#r=new Map;#s=new Map;#n=new Set;#I=new Map;#y=0;#M=!1;constructor(t){this.#o=t.workerUrl,this.#t=t.limits??{},this.#i=t.send,this.#e=t.protocolVersion??3}accept(t){if(this.#M)throw new S("The script host is shutting down.");if(Bn(t,this.#e),t.messageType==="register_module"){this.#d(t);return}if(t.messageType==="cancel"){this.#V(t);return}if(t.messageType==="capability_result"){this.#c(t);return}if(t.messageType==="fetch_observation_ack"){this.#p(t);return}if(this.#b.has(t.invocationId))throw new S(`Invocation ID "${t.invocationId}" is already active.`);let i=this.#L(t).finally(()=>{this.#b.delete(t.invocationId),this.#u.delete(t.invocationId)});this.#b.set(t.invocationId,i)}#d(t){let i=`sha256:${new Bun.CryptoHasher("sha256").update(t.bundle).digest("hex")}`,o=t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?`sha256:${new Bun.CryptoHasher("sha256").update(t.sourceMap).digest("hex")}`:void 0;if(i!==t.bundleDigest||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&o!==t.sourceMapDigest){this.#i(So(t,{accepted:!1,code:"WOML_MODULE_DIGEST_MISMATCH",message:"The registered module bundle does not match its SHA-256 identity."}));return}let $=this.#I.get(t.bundleDigest);if($!==void 0&&($.bundle!==t.bundle||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&($.sourceMap!==t.sourceMap||$.sourceMapDigest!==t.sourceMapDigest)))throw new S("One module digest was registered with different immutable bytes.");let l=Buffer.byteLength(t.bundle,"utf8")+(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?Buffer.byteLength(t.sourceMap,"utf8"):0),f=Buffer.byteLength(t.bundle,"utf8")>Jn||(t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&Buffer.byteLength(t.sourceMap,"utf8")>Jn;if($===void 0&&(f||this.#I.size>=X6||this.#y+l>J6)){this.#i(So(t,{accepted:!1,code:"WOML_MODULE_CACHE_LIMIT_EXCEEDED",message:"The immutable module cache limit was exceeded."}));return}if($===void 0)this.#I.set(t.bundleDigest,{bundle:t.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:t.sourceMap,sourceMapDigest:t.sourceMapDigest}:{},bytes:l}),this.#y+=l;this.#i(So(t,{accepted:!0}))}async drain(){while(this.#b.size>0)await Promise.all([...this.#b.values()])}abort(){this.#M=!0;for(let t of this.#$.values())t.terminate();this.#$.clear(),this.#u.clear(),this.#l.clear(),this.#f.clear(),this.#r.clear(),this.#s.clear(),this.#n.clear(),this.#I.clear(),this.#y=0}#V(t){this.#u.get(t.invocationId)?.(t.reason)}#c(t){if(t.invocationId!==t.result.invocationId||t.callId!==t.result.callId)throw new S("Capability result wrapper IDs do not match its result payload.");let i=this.#$.get(t.invocationId),o=this.#l.get(t.invocationId);if(i===void 0||o===void 0||!o.delete(t.callId)){let r=`${t.invocationId}\x00${t.callId}`;if(this.#f.delete(r))return;throw new S(`Capability result references unknown call ID "${t.callId}".`)}i.postMessage({messageType:"capability_result",callId:t.callId,result:t.result})}#p(t){let i=this.#$.get(t.invocationId),o=this.#r.get(t.invocationId),r=o?.get(t.requestId);if(i===void 0||o===void 0||r===void 0){let l=`${t.invocationId}\x00${t.requestId}`;if(this.#n.delete(l))return;throw new S(`Native Fetch acknowledgement references unknown request ID "${t.requestId}".`)}o.delete(t.requestId);let $=this.#s.get(t.invocationId);if(t.accepted&&r==="started")$.add(t.requestId);if(!t.accepted||r==="terminal")$.delete(t.requestId);i.postMessage({messageType:"fetch_observation_ack",requestId:t.requestId,ack:t})}async#L(t){let i=performance.now(),o=Xn(t.context);if(this.#t.maxContextBytes!==void 0&&o>this.#t.maxContextBytes){await this.#i(yt(t,i,{kind:"context_too_large",code:"WOML_SCRIPT_CONTEXT_TOO_LARGE",message:"Invocation context exceeds the configured byte limit.",details:{actualBytes:o,limitBytes:this.#t.maxContextBytes}}));return}let r=await this.#q(t);if(r.kind==="timeout"){await this.#i(yt(t,i,{kind:"script_timed_out",code:"WOML_SCRIPT_TIMEOUT",message:"Script exceeded its execution deadline."}));return}if(r.kind==="cancelled"){await this.#i(yt(t,i,{kind:"invocation_cancelled",code:"WOML_SCRIPT_CANCELLED",message:r.reason==="parallel_fail_fast"?"Invocation was cancelled by parallel fail-fast.":r.reason==="run_cancelled"?"Invocation was cancelled because its run was cancelled.":r.reason==="step_timed_out"?"Invocation was cancelled because its step timed out.":"Invocation was cancelled because the script host is shutting down."}));return}if(r.kind==="crashed"){await this.#i(yt(t,i,{kind:"worker_crashed",code:"WOML_SCRIPT_WORKER_CRASHED",message:r.message}));return}let $=r.response;if(!$.ok){await this.#i(yt(t,i,{...$.error.kind==="service"&&$.error.capability!==void 0&&$.error.operation!==void 0&&$.error.callId!==void 0&&$.error.cause!==void 0?{kind:"service_failed",code:$.error.cause.code,message:$.error.message,capability:$.error.capability,operation:$.error.operation,callId:$.error.callId,retryable:$.error.cause.retryable,ambiguous:$.error.cause.ambiguous,cause:$.error.cause}:{kind:$.error.kind==="non-json"?"invalid_script_result":"script_threw",code:$.error.kind==="non-json"?"WOML_SCRIPT_NON_JSON_RESULT":"WOML_SCRIPT_THROWN",message:$.error.moduleFrame===void 0?$.error.message:`${$.error.message} (${$.error.moduleFrame})`}}));return}let l=tr($.result);if(l!==void 0){await this.#i(yt(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:`${l.path}: ${l.reason}`}));return}if((t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9)&&ko($.result,Object.values(t.bindings.secrets))){await this.#i(yt(t,i,{kind:"invalid_script_result",code:"WOML_SCRIPT_NON_JSON_RESULT",message:"Script results must not contain a resolved secret value."}));return}let f=Xn($.result);if(this.#t.maxResultBytes!==void 0&&f>this.#t.maxResultBytes){await this.#i(yt(t,i,{kind:"result_too_large",code:"WOML_SCRIPT_RESULT_TOO_LARGE",message:"Script result exceeds the configured byte limit.",details:{actualBytes:f,limitBytes:this.#t.maxResultBytes}}));return}await this.#i(Y6(t,i,$.result))}#q(t){let i;try{i=new Worker(this.#o,{type:"module",ref:!0,smol:!0,env:{}})}catch{return Promise.resolve({kind:"crashed",message:"The isolated script Worker could not be started."})}return this.#$.set(t.invocationId,i),new Promise((o)=>{let r=!1,$=(f)=>{if(r)return;r=!0,clearTimeout(l),this.#$.delete(t.invocationId),this.#u.delete(t.invocationId);for(let s of this.#l.get(t.invocationId)??[])this.#f.add(`${t.invocationId}\x00${s}`);for(let s of this.#r.get(t.invocationId)?.keys()??[])this.#n.add(`${t.invocationId}\x00${s}`);while(this.#f.size>4096){let s=this.#f.values().next().value;if(s===void 0)break;this.#f.delete(s)}while(this.#n.size>4096){let s=this.#n.values().next().value;if(s===void 0)break;this.#n.delete(s)}this.#l.delete(t.invocationId),this.#r.delete(t.invocationId),this.#s.delete(t.invocationId),i.terminate(),o(f)},l=setTimeout(()=>$({kind:"timeout"}),t.timeoutMs);this.#u.set(t.invocationId,(f)=>{$({kind:"cancelled",reason:f})}),this.#l.set(t.invocationId,new Set),this.#r.set(t.invocationId,new Map),this.#s.set(t.invocationId,new Set),i.onmessage=(f)=>{let s=f.data;if(s.messageType==="completed"){if((this.#r.get(t.invocationId)?.size??0)>0||(this.#s.get(t.invocationId)?.size??0)>0){$({kind:"crashed",message:"The isolated script Worker completed with an unclosed native Fetch observation."});return}$({kind:"response",response:s.response});return}if(s.messageType==="fetch_observation"){let u=s.observation;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||u.invocationId!==t.invocationId){$({kind:"crashed",message:"The isolated script Worker emitted an invalid native Fetch observation."});return}let I=this.#r.get(t.invocationId),V=this.#s.get(t.invocationId),d=u.observationType==="started"?"started":"terminal";if(I.has(u.requestId)||(d==="started"?V.has(u.requestId):!V.has(u.requestId))){$({kind:"crashed",message:"The isolated script Worker violated the native Fetch observation lifecycle."});return}I.set(u.requestId,d),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"fetch_observation",invocationId:t.invocationId,requestId:u.requestId,observation:u}).catch(()=>{$({kind:"crashed",message:"The native Fetch observation could not be sent to Rust."})});return}let n=s.call;if(t.protocolVersion!==4&&t.protocolVersion!==5&&t.protocolVersion!==6&&t.protocolVersion!==7&&t.protocolVersion!==8&&t.protocolVersion!==9||n.invocationId!==t.invocationId||n.runId!==t.runId||n.nodeId!==t.nodeId||n.attemptNumber!==t.attempt.number){$({kind:"crashed",message:"The isolated script Worker emitted an invalid capability call."});return}let b=this.#l.get(t.invocationId);if(b===void 0||b.has(n.callId)){$({kind:"crashed",message:"The isolated script Worker reused a capability call ID."});return}b.add(n.callId),this.#i({protocol:"woml.script-host",protocolVersion:t.protocolVersion,messageType:"capability_call",invocationId:t.invocationId,callId:n.callId,call:n}).catch(()=>{$({kind:"crashed",message:"The capability call could not be sent to Rust."})})},i.onerror=(f)=>{f.preventDefault(),$({kind:"crashed",message:f.message||"The isolated script Worker crashed."})},i.onmessageerror=()=>{$({kind:"crashed",message:"The isolated script Worker returned an unreadable message."})},i.addEventListener("close",()=>{$({kind:"crashed",message:"The isolated script Worker exited without a result."})});try{let f=t.protocolVersion===3||t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?t.attempt:void 0;i.postMessage({messageType:"execute",request:{invocationId:t.invocationId,runId:t.runId,nodeId:t.nodeId,timeoutMs:t.timeoutMs,source:t.source,context:t.context,...t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{mode:t.mode,...t.mode==="lifecycle"?{lifecycle:t.lifecycle}:{}}:{},...(t.protocolVersion===8||t.protocolVersion===9)&&t.reusable!==void 0?{reusable:t.reusable,...t.reusableLifecycle===void 0?{}:{reusableLifecycle:t.reusableLifecycle}}:{},attempt:f,...t.protocolVersion===4||t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{bindings:t.bindings}:{},...t.protocolVersion===5||t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{modules:t.modules.map((s)=>{let n=this.#I.get(s.bundleDigest);if(n===void 0)throw new S(`Module bundle ${s.bundleDigest} was not registered.`);return{...s,bundle:n.bundle,...t.protocolVersion===6||t.protocolVersion===7||t.protocolVersion===8||t.protocolVersion===9?{sourceMap:n.sourceMap,sourceMapDigest:n.sourceMapDigest}:{}}})}:{}}})}catch{$({kind:"crashed",message:"The invocation could not be delivered to its script Worker."})}})}}function ko(t,i){let o=i.filter((r)=>r.length>0);if(o.length===0)return!1;if(typeof t==="string")return o.some((r)=>t.includes(r));if(Array.isArray(t))return t.some((r)=>ko(r,o));if(t!==null&&typeof t==="object")return Object.values(t).some((r)=>ko(r,o));return!1}function ho(t){let i=process.env[t];if(i===void 0||i==="")return;let o=Number(i);if(!Number.isSafeInteger(o)||o<1)throw Error(`${t} must be a positive safe integer when provided.`);return o}function z6(){return{maxContextBytes:ho("WOML_SCRIPT_HOST_MAX_CONTEXT_BYTES"),maxResultBytes:ho("WOML_SCRIPT_HOST_MAX_RESULT_BYTES"),maxFrameBytes:ho("WOML_SCRIPT_HOST_MAX_FRAME_BYTES")}}function Q6(){let t=process.env.WOML_SCRIPT_HOST_PROTOCOL_VERSION??"3";if(t==="1"||t==="2"||t==="3"||t==="4"||t==="5"||t==="6"||t==="7"||t==="8"||t==="9")return Number(t);throw Error("WOML_SCRIPT_HOST_PROTOCOL_VERSION must be 1, 2, 3, 4, 5, 6, 7, 8, or 9.")}async function G6(t){await new Promise((i,o)=>{process.stdout.write(t,(r)=>{if(r===null||r===void 0)i();else o(r)})})}async function H6(){let t=z6(),i=Q6(),o=new Ei({maxFrameBytes:t.maxFrameBytes}),r=new Ri(G6),$=import.meta.url.endsWith(".ts")?"./script-host-worker.ts":"./script-host-worker.js",l=new Co({workerUrl:new URL($,import.meta.url),limits:t,protocolVersion:i,send:(s)=>r.send(s)}),f={protocol:"woml.script-host",protocolVersion:i,messageType:"ready",hostInstanceId:`host_${A6()}`};try{await r.send(f);let s=Bun.stdin.stream().getReader();while(!0){let{done:n,value:b}=await s.read();if(n)break;for(let u of o.push(b))l.accept(u)}o.finish(),await l.drain(),await r.drain()}catch(s){l.abort();let n=s instanceof Error?`${s.name}: ${s.message}`:String(s);process.stderr.write(`WOML script host failed: ${n}
19
+ `),process.exitCode=1}}if(import.meta.main)await H6();export{H6 as runScriptHost};
18
20
 
19
- //# debugId=F3EE7B5DAA546B9564756E2164756E21
21
+ //# debugId=5FD5C02652D77EEE64756E2164756E21