@tempots/beatui 0.41.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
- "use strict";const D=require("./notice-D3P0lewM.cjs"),J=require("./utils-DH-SYrQg.cjs"),E=require("@tempots/dom"),Ne=require("./translations-C21osktO.cjs"),Ls=require("./colors-Qc1mmmfr.cjs");function Us(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(n,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke={exports:{}},Bt={},$r;function Ks(){return $r||($r=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(A,z){return{validate:A,compare:z}}e.fullFormats={date:t(s,o),time:t(m(!0),y),"date-time":t($(!0),S),"iso-time":t(m(),d),"iso-date-time":t($(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:l,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:c,int32:{type:"number",validate:_},int64:{type:"number",validate:O},float:{type:"number",validate:C},double:{type:"number",validate:C},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,y),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,S),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(A){return A%4===0&&(A%100!==0||A%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(A){const z=n.exec(A);if(!z)return!1;const U=+z[1],B=+z[2],ee=+z[3];return B>=1&&B<=12&&ee>=1&&ee<=(B===2&&r(U)?29:a[B])}function o(A,z){if(A&&z)return A>z?1:A<z?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(A){return function(U){const B=u.exec(U);if(!B)return!1;const ee=+B[1],ae=+B[2],se=+B[3],te=B[4],he=B[5]==="-"?-1:1,M=+(B[6]||0),k=+(B[7]||0);if(M>23||k>59||A&&!te)return!1;if(ee<=23&&ae<=59&&se<60)return!0;const T=ae-k*he,I=ee-M*he-(T<0?1:0);return(I===23||I===-1)&&(T===59||T===-1)&&se<61}}function y(A,z){if(!(A&&z))return;const U=new Date("2020-01-01T"+A).valueOf(),B=new Date("2020-01-01T"+z).valueOf();if(U&&B)return U-B}function d(A,z){if(!(A&&z))return;const U=u.exec(A),B=u.exec(z);if(U&&B)return A=U[1]+U[2]+U[3],z=B[1]+B[2]+B[3],A>z?1:A<z?-1:0}const v=/t|\s/i;function $(A){const z=m(A);return function(B){const ee=B.split(v);return ee.length===2&&s(ee[0])&&z(ee[1])}}function S(A,z){if(!(A&&z))return;const U=new Date(A).valueOf(),B=new Date(z).valueOf();if(U&&B)return U-B}function w(A,z){if(!(A&&z))return;const[U,B]=A.split(v),[ee,ae]=z.split(v),se=o(U,ee);if(se!==void 0)return se||y(B,ae)}const g=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function l(A){return g.test(A)&&f.test(A)}const i=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(A){return i.lastIndex=0,i.test(A)}const p=-2147483648,b=2**31-1;function _(A){return Number.isInteger(A)&&A<=b&&A>=p}function O(A){return Number.isInteger(A)}function C(){return!0}const V=/[^\\]\\Z/;function F(A){if(V.test(A))return!1;try{return new RegExp(A),!0}catch{return!1}}}(Bt)),Bt}var Ht={},Je={exports:{}},xt={},be={},Oe={},Gt={},Xt={},Yt={},wr;function kt(){return wr||(wr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(i){if(super(),!e.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const 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((c,p)=>`${c}${p}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((c,p)=>(p instanceof r&&(c[p.str]=(c[p.str]||0)+1),c),{})}}e._Code=n,e.nil=new n("");function a(l,...i){const c=[l[0]];let p=0;for(;p<i.length;)u(c,i[p]),c.push(l[++p]);return new n(c)}e._=a;const s=new n("+");function o(l,...i){const c=[S(l[0])];let p=0;for(;p<i.length;)c.push(s),u(c,i[p]),c.push(s,S(l[++p]));return m(c),new n(c)}e.str=o;function u(l,i){i instanceof n?l.push(...i._items):i instanceof r?l.push(i):l.push(v(i))}e.addCodeArg=u;function m(l){let i=1;for(;i<l.length-1;){if(l[i]===s){const c=y(l[i-1],l[i+1]);if(c!==void 0){l.splice(i-1,3,c);continue}l[i++]="+"}i++}}function y(l,i){if(i==='""')return l;if(l==='""')return i;if(typeof l=="string")return i instanceof r||l[l.length-1]!=='"'?void 0:typeof i!="string"?`${l.slice(0,-1)}${i}"`:i[0]==='"'?l.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(l instanceof r))return`"${l}${i.slice(1)}`}function d(l,i){return i.emptyStr()?l:l.emptyStr()?i:o`${l}${i}`}e.strConcat=d;function v(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:S(Array.isArray(l)?l.join(","):l)}function $(l){return new n(S(l))}e.stringify=$;function S(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=S;function w(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new n(`.${l}`):a`[${l}]`}e.getProperty=w;function g(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new n(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=g;function f(l){return new n(l.toString())}e.regexpCode=f}(Yt)),Yt}var Zt={},Sr;function Pr(){return Sr||(Sr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=kt();class r extends Error{constructor(y){super(`CodeGen: "code" for ${y} not defined`),this.value=y.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:y,parent:d}={}){this._names={},this._prefixes=y,this._parent=d}toName(y){return y instanceof t.Name?y:this.name(y)}name(y){return new t.Name(this._newName(y))}_newName(y){const d=this._names[y]||this._nameGroup(y);return`${y}${d.index++}`}_nameGroup(y){var d,v;if(!((v=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||v===void 0)&&v.has(y)||this._prefixes&&!this._prefixes.has(y))throw new Error(`CodeGen: prefix "${y}" is not allowed in this scope`);return this._names[y]={prefix:y,index:0}}}e.Scope=a;class s extends t.Name{constructor(y,d){super(d),this.prefix=y}setValue(y,{property:d,itemIndex:v}){this.value=y,this.scopePath=(0,t._)`.${new t.Name(d)}[${v}]`}}e.ValueScopeName=s;const o=(0,t._)`\n`;class u extends a{constructor(y){super(y),this._values={},this._scope=y.scope,this.opts={...y,_n:y.lines?o:t.nil}}get(){return this._scope}name(y){return new s(y,this._newName(y))}value(y,d){var v;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(y),{prefix:S}=$,w=(v=d.key)!==null&&v!==void 0?v:d.ref;let g=this._values[S];if(g){const i=g.get(w);if(i)return i}else g=this._values[S]=new Map;g.set(w,$);const f=this._scope[S]||(this._scope[S]=[]),l=f.length;return f[l]=d.ref,$.setValue(d,{property:S,itemIndex:l}),$}getValue(y,d){const v=this._values[y];if(v)return v.get(d)}scopeRefs(y,d=this._values){return this._reduceValues(d,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,t._)`${y}${v.scopePath}`})}scopeCode(y=this._values,d,v){return this._reduceValues(y,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},d,v)}_reduceValues(y,d,v={},$){let S=t.nil;for(const w in y){const g=y[w];if(!g)continue;const f=v[w]=v[w]||new Map;g.forEach(l=>{if(f.has(l))return;f.set(l,n.Started);let i=d(l);if(i){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;S=(0,t._)`${S}${c} ${l} = ${i};${this.opts._n}`}else if(i=$?.(l))S=(0,t._)`${S}${i}${this.opts._n}`;else throw new r(l);f.set(l,n.Completed)})}return S}}e.ValueScope=u}(Zt)),Zt}var Er;function x(){return Er||(Er=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=kt(),r=Pr();var n=kt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var a=Pr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(h,P){return this}}class o extends s{constructor(h,P,R){super(),this.varKind=h,this.name=P,this.rhs=R}render({es5:h,_n:P}){const R=h?r.varKinds.var:this.varKind,K=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${K};`+P}optimizeNames(h,P){if(h[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,h,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends s{constructor(h,P,R){super(),this.lhs=h,this.rhs=P,this.sideEffects=R}render({_n:h}){return`${this.lhs} = ${this.rhs};`+h}optimizeNames(h,P){if(!(this.lhs instanceof t.Name&&!h[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,h,P),this}get names(){const h=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(h,this.rhs)}}class m extends u{constructor(h,P,R,K){super(h,R,K),this.op=P}render({_n:h}){return`${this.lhs} ${this.op}= ${this.rhs};`+h}}class y extends s{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`${this.label}:`+h}}class d extends s{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`break${this.label?` ${this.label}`:""};`+h}}class v extends s{constructor(h){super(),this.error=h}render({_n:h}){return`throw ${this.error};`+h}get names(){return this.error.names}}class $ extends s{constructor(h){super(),this.code=h}render({_n:h}){return`${this.code};`+h}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(h,P){return this.code=B(this.code,h,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class S extends s{constructor(h=[]){super(),this.nodes=h}render(h){return this.nodes.reduce((P,R)=>P+R.render(h),"")}optimizeNodes(){const{nodes:h}=this;let P=h.length;for(;P--;){const R=h[P].optimizeNodes();Array.isArray(R)?h.splice(P,1,...R):R?h[P]=R:h.splice(P,1)}return h.length>0?this:void 0}optimizeNames(h,P){const{nodes:R}=this;let K=R.length;for(;K--;){const W=R[K];W.optimizeNames(h,P)||(ee(h,W.names),R.splice(K,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((h,P)=>z(h,P.names),{})}}class w extends S{render(h){return"{"+h._n+super.render(h)+"}"+h._n}}class g extends S{}class f extends w{}f.kind="else";class l extends w{constructor(h,P){super(P),this.condition=h}render(h){let P=`if(${this.condition})`+super.render(h);return this.else&&(P+="else "+this.else.render(h)),P}optimizeNodes(){super.optimizeNodes();const h=this.condition;if(h===!0)return this.nodes;let P=this.else;if(P){const R=P.optimizeNodes();P=this.else=Array.isArray(R)?new f(R):R}if(P)return h===!1?P instanceof l?P:P.nodes:this.nodes.length?this:new l(ae(h),P instanceof l?[P]:P.nodes);if(!(h===!1||!this.nodes.length))return this}optimizeNames(h,P){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(h,P),!!(super.optimizeNames(h,P)||this.else))return this.condition=B(this.condition,h,P),this}get names(){const h=super.names;return U(h,this.condition),this.else&&z(h,this.else.names),h}}l.kind="if";class i extends w{}i.kind="for";class c extends i{constructor(h){super(),this.iteration=h}render(h){return`for(${this.iteration})`+super.render(h)}optimizeNames(h,P){if(super.optimizeNames(h,P))return this.iteration=B(this.iteration,h,P),this}get names(){return z(super.names,this.iteration.names)}}class p extends i{constructor(h,P,R,K){super(),this.varKind=h,this.name=P,this.from=R,this.to=K}render(h){const P=h.es5?r.varKinds.var:this.varKind,{name:R,from:K,to:W}=this;return`for(${P} ${R}=${K}; ${R}<${W}; ${R}++)`+super.render(h)}get names(){const h=U(super.names,this.from);return U(h,this.to)}}class b extends i{constructor(h,P,R,K){super(),this.loop=h,this.varKind=P,this.name=R,this.iterable=K}render(h){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(h)}optimizeNames(h,P){if(super.optimizeNames(h,P))return this.iterable=B(this.iterable,h,P),this}get names(){return z(super.names,this.iterable.names)}}class _ extends w{constructor(h,P,R){super(),this.name=h,this.args=P,this.async=R}render(h){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(h)}}_.kind="func";class O extends S{render(h){return"return "+super.render(h)}}O.kind="return";class C extends w{render(h){let P="try"+super.render(h);return this.catch&&(P+=this.catch.render(h)),this.finally&&(P+=this.finally.render(h)),P}optimizeNodes(){var h,P;return super.optimizeNodes(),(h=this.catch)===null||h===void 0||h.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(h,P){var R,K;return super.optimizeNames(h,P),(R=this.catch)===null||R===void 0||R.optimizeNames(h,P),(K=this.finally)===null||K===void 0||K.optimizeNames(h,P),this}get names(){const h=super.names;return this.catch&&z(h,this.catch.names),this.finally&&z(h,this.finally.names),h}}class V extends w{constructor(h){super(),this.error=h}render(h){return`catch(${this.error})`+super.render(h)}}V.kind="catch";class F extends w{render(h){return"finally"+super.render(h)}}F.kind="finally";class A{constructor(h,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
1
+ "use strict";const D=require("./notice-BC7NWoXS.cjs"),J=require("./utils-Bxv-9oEL.cjs"),E=require("@tempots/dom"),Ne=require("./translations-C21osktO.cjs"),Ls=require("./colors-Qc1mmmfr.cjs");function Us(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in e)){const s=Object.getOwnPropertyDescriptor(n,a);s&&Object.defineProperty(e,a,s.get?s:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke={exports:{}},Bt={},$r;function Ks(){return $r||($r=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(A,z){return{validate:A,compare:z}}e.fullFormats={date:t(s,o),time:t(m(!0),y),"date-time":t($(!0),S),"iso-time":t(m(),d),"iso-date-time":t($(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:l,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:F,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:c,int32:{type:"number",validate:_},int64:{type:"number",validate:O},float:{type:"number",validate:C},double:{type:"number",validate:C},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,y),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,S),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,d),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,w),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(A){return A%4===0&&(A%100!==0||A%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,a=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(A){const z=n.exec(A);if(!z)return!1;const U=+z[1],B=+z[2],ee=+z[3];return B>=1&&B<=12&&ee>=1&&ee<=(B===2&&r(U)?29:a[B])}function o(A,z){if(A&&z)return A>z?1:A<z?-1:0}const u=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function m(A){return function(U){const B=u.exec(U);if(!B)return!1;const ee=+B[1],ae=+B[2],se=+B[3],te=B[4],he=B[5]==="-"?-1:1,M=+(B[6]||0),k=+(B[7]||0);if(M>23||k>59||A&&!te)return!1;if(ee<=23&&ae<=59&&se<60)return!0;const T=ae-k*he,I=ee-M*he-(T<0?1:0);return(I===23||I===-1)&&(T===59||T===-1)&&se<61}}function y(A,z){if(!(A&&z))return;const U=new Date("2020-01-01T"+A).valueOf(),B=new Date("2020-01-01T"+z).valueOf();if(U&&B)return U-B}function d(A,z){if(!(A&&z))return;const U=u.exec(A),B=u.exec(z);if(U&&B)return A=U[1]+U[2]+U[3],z=B[1]+B[2]+B[3],A>z?1:A<z?-1:0}const v=/t|\s/i;function $(A){const z=m(A);return function(B){const ee=B.split(v);return ee.length===2&&s(ee[0])&&z(ee[1])}}function S(A,z){if(!(A&&z))return;const U=new Date(A).valueOf(),B=new Date(z).valueOf();if(U&&B)return U-B}function w(A,z){if(!(A&&z))return;const[U,B]=A.split(v),[ee,ae]=z.split(v),se=o(U,ee);if(se!==void 0)return se||y(B,ae)}const g=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function l(A){return g.test(A)&&f.test(A)}const i=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function c(A){return i.lastIndex=0,i.test(A)}const p=-2147483648,b=2**31-1;function _(A){return Number.isInteger(A)&&A<=b&&A>=p}function O(A){return Number.isInteger(A)}function C(){return!0}const V=/[^\\]\\Z/;function F(A){if(V.test(A))return!1;try{return new RegExp(A),!0}catch{return!1}}}(Bt)),Bt}var Ht={},Je={exports:{}},xt={},be={},Oe={},Gt={},Xt={},Yt={},wr;function kt(){return wr||(wr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(i){if(super(),!e.IDENTIFIER.test(i))throw new Error("CodeGen: name must be a valid identifier");this.str=i}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(i){super(),this._items=typeof i=="string"?[i]:i}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const 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((c,p)=>`${c}${p}`,"")}get names(){var i;return(i=this._names)!==null&&i!==void 0?i:this._names=this._items.reduce((c,p)=>(p instanceof r&&(c[p.str]=(c[p.str]||0)+1),c),{})}}e._Code=n,e.nil=new n("");function a(l,...i){const c=[l[0]];let p=0;for(;p<i.length;)u(c,i[p]),c.push(l[++p]);return new n(c)}e._=a;const s=new n("+");function o(l,...i){const c=[S(l[0])];let p=0;for(;p<i.length;)c.push(s),u(c,i[p]),c.push(s,S(l[++p]));return m(c),new n(c)}e.str=o;function u(l,i){i instanceof n?l.push(...i._items):i instanceof r?l.push(i):l.push(v(i))}e.addCodeArg=u;function m(l){let i=1;for(;i<l.length-1;){if(l[i]===s){const c=y(l[i-1],l[i+1]);if(c!==void 0){l.splice(i-1,3,c);continue}l[i++]="+"}i++}}function y(l,i){if(i==='""')return l;if(l==='""')return i;if(typeof l=="string")return i instanceof r||l[l.length-1]!=='"'?void 0:typeof i!="string"?`${l.slice(0,-1)}${i}"`:i[0]==='"'?l.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(l instanceof r))return`"${l}${i.slice(1)}`}function d(l,i){return i.emptyStr()?l:l.emptyStr()?i:o`${l}${i}`}e.strConcat=d;function v(l){return typeof l=="number"||typeof l=="boolean"||l===null?l:S(Array.isArray(l)?l.join(","):l)}function $(l){return new n(S(l))}e.stringify=$;function S(l){return JSON.stringify(l).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=S;function w(l){return typeof l=="string"&&e.IDENTIFIER.test(l)?new n(`.${l}`):a`[${l}]`}e.getProperty=w;function g(l){if(typeof l=="string"&&e.IDENTIFIER.test(l))return new n(`${l}`);throw new Error(`CodeGen: invalid export name: ${l}, use explicit $id name mapping`)}e.getEsmExportName=g;function f(l){return new n(l.toString())}e.regexpCode=f}(Yt)),Yt}var Zt={},Sr;function Pr(){return Sr||(Sr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=kt();class r extends Error{constructor(y){super(`CodeGen: "code" for ${y} not defined`),this.value=y.value}}var n;(function(m){m[m.Started=0]="Started",m[m.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};class a{constructor({prefixes:y,parent:d}={}){this._names={},this._prefixes=y,this._parent=d}toName(y){return y instanceof t.Name?y:this.name(y)}name(y){return new t.Name(this._newName(y))}_newName(y){const d=this._names[y]||this._nameGroup(y);return`${y}${d.index++}`}_nameGroup(y){var d,v;if(!((v=(d=this._parent)===null||d===void 0?void 0:d._prefixes)===null||v===void 0)&&v.has(y)||this._prefixes&&!this._prefixes.has(y))throw new Error(`CodeGen: prefix "${y}" is not allowed in this scope`);return this._names[y]={prefix:y,index:0}}}e.Scope=a;class s extends t.Name{constructor(y,d){super(d),this.prefix=y}setValue(y,{property:d,itemIndex:v}){this.value=y,this.scopePath=(0,t._)`.${new t.Name(d)}[${v}]`}}e.ValueScopeName=s;const o=(0,t._)`\n`;class u extends a{constructor(y){super(y),this._values={},this._scope=y.scope,this.opts={...y,_n:y.lines?o:t.nil}}get(){return this._scope}name(y){return new s(y,this._newName(y))}value(y,d){var v;if(d.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(y),{prefix:S}=$,w=(v=d.key)!==null&&v!==void 0?v:d.ref;let g=this._values[S];if(g){const i=g.get(w);if(i)return i}else g=this._values[S]=new Map;g.set(w,$);const f=this._scope[S]||(this._scope[S]=[]),l=f.length;return f[l]=d.ref,$.setValue(d,{property:S,itemIndex:l}),$}getValue(y,d){const v=this._values[y];if(v)return v.get(d)}scopeRefs(y,d=this._values){return this._reduceValues(d,v=>{if(v.scopePath===void 0)throw new Error(`CodeGen: name "${v}" has no value`);return(0,t._)`${y}${v.scopePath}`})}scopeCode(y=this._values,d,v){return this._reduceValues(y,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},d,v)}_reduceValues(y,d,v={},$){let S=t.nil;for(const w in y){const g=y[w];if(!g)continue;const f=v[w]=v[w]||new Map;g.forEach(l=>{if(f.has(l))return;f.set(l,n.Started);let i=d(l);if(i){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;S=(0,t._)`${S}${c} ${l} = ${i};${this.opts._n}`}else if(i=$?.(l))S=(0,t._)`${S}${i}${this.opts._n}`;else throw new r(l);f.set(l,n.Completed)})}return S}}e.ValueScope=u}(Zt)),Zt}var Er;function x(){return Er||(Er=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=kt(),r=Pr();var n=kt();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var a=Pr();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return a.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return a.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return a.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return a.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class s{optimizeNodes(){return this}optimizeNames(h,P){return this}}class o extends s{constructor(h,P,R){super(),this.varKind=h,this.name=P,this.rhs=R}render({es5:h,_n:P}){const R=h?r.varKinds.var:this.varKind,K=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${K};`+P}optimizeNames(h,P){if(h[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,h,P)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends s{constructor(h,P,R){super(),this.lhs=h,this.rhs=P,this.sideEffects=R}render({_n:h}){return`${this.lhs} = ${this.rhs};`+h}optimizeNames(h,P){if(!(this.lhs instanceof t.Name&&!h[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,h,P),this}get names(){const h=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(h,this.rhs)}}class m extends u{constructor(h,P,R,K){super(h,R,K),this.op=P}render({_n:h}){return`${this.lhs} ${this.op}= ${this.rhs};`+h}}class y extends s{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`${this.label}:`+h}}class d extends s{constructor(h){super(),this.label=h,this.names={}}render({_n:h}){return`break${this.label?` ${this.label}`:""};`+h}}class v extends s{constructor(h){super(),this.error=h}render({_n:h}){return`throw ${this.error};`+h}get names(){return this.error.names}}class $ extends s{constructor(h){super(),this.code=h}render({_n:h}){return`${this.code};`+h}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(h,P){return this.code=B(this.code,h,P),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class S extends s{constructor(h=[]){super(),this.nodes=h}render(h){return this.nodes.reduce((P,R)=>P+R.render(h),"")}optimizeNodes(){const{nodes:h}=this;let P=h.length;for(;P--;){const R=h[P].optimizeNodes();Array.isArray(R)?h.splice(P,1,...R):R?h[P]=R:h.splice(P,1)}return h.length>0?this:void 0}optimizeNames(h,P){const{nodes:R}=this;let K=R.length;for(;K--;){const W=R[K];W.optimizeNames(h,P)||(ee(h,W.names),R.splice(K,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((h,P)=>z(h,P.names),{})}}class w extends S{render(h){return"{"+h._n+super.render(h)+"}"+h._n}}class g extends S{}class f extends w{}f.kind="else";class l extends w{constructor(h,P){super(P),this.condition=h}render(h){let P=`if(${this.condition})`+super.render(h);return this.else&&(P+="else "+this.else.render(h)),P}optimizeNodes(){super.optimizeNodes();const h=this.condition;if(h===!0)return this.nodes;let P=this.else;if(P){const R=P.optimizeNodes();P=this.else=Array.isArray(R)?new f(R):R}if(P)return h===!1?P instanceof l?P:P.nodes:this.nodes.length?this:new l(ae(h),P instanceof l?[P]:P.nodes);if(!(h===!1||!this.nodes.length))return this}optimizeNames(h,P){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(h,P),!!(super.optimizeNames(h,P)||this.else))return this.condition=B(this.condition,h,P),this}get names(){const h=super.names;return U(h,this.condition),this.else&&z(h,this.else.names),h}}l.kind="if";class i extends w{}i.kind="for";class c extends i{constructor(h){super(),this.iteration=h}render(h){return`for(${this.iteration})`+super.render(h)}optimizeNames(h,P){if(super.optimizeNames(h,P))return this.iteration=B(this.iteration,h,P),this}get names(){return z(super.names,this.iteration.names)}}class p extends i{constructor(h,P,R,K){super(),this.varKind=h,this.name=P,this.from=R,this.to=K}render(h){const P=h.es5?r.varKinds.var:this.varKind,{name:R,from:K,to:W}=this;return`for(${P} ${R}=${K}; ${R}<${W}; ${R}++)`+super.render(h)}get names(){const h=U(super.names,this.from);return U(h,this.to)}}class b extends i{constructor(h,P,R,K){super(),this.loop=h,this.varKind=P,this.name=R,this.iterable=K}render(h){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(h)}optimizeNames(h,P){if(super.optimizeNames(h,P))return this.iterable=B(this.iterable,h,P),this}get names(){return z(super.names,this.iterable.names)}}class _ extends w{constructor(h,P,R){super(),this.name=h,this.args=P,this.async=R}render(h){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(h)}}_.kind="func";class O extends S{render(h){return"return "+super.render(h)}}O.kind="return";class C extends w{render(h){let P="try"+super.render(h);return this.catch&&(P+=this.catch.render(h)),this.finally&&(P+=this.finally.render(h)),P}optimizeNodes(){var h,P;return super.optimizeNodes(),(h=this.catch)===null||h===void 0||h.optimizeNodes(),(P=this.finally)===null||P===void 0||P.optimizeNodes(),this}optimizeNames(h,P){var R,K;return super.optimizeNames(h,P),(R=this.catch)===null||R===void 0||R.optimizeNames(h,P),(K=this.finally)===null||K===void 0||K.optimizeNames(h,P),this}get names(){const h=super.names;return this.catch&&z(h,this.catch.names),this.finally&&z(h,this.finally.names),h}}class V extends w{constructor(h){super(),this.error=h}render(h){return`catch(${this.error})`+super.render(h)}}V.kind="catch";class F extends w{render(h){return"finally"+super.render(h)}}F.kind="finally";class A{constructor(h,P={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...P,_n:P.lines?`
2
2
  `:""},this._extScope=h,this._scope=new r.Scope({parent:h}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(h){return this._scope.name(h)}scopeName(h){return this._extScope.name(h)}scopeValue(h,P){const R=this._extScope.value(h,P);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(h,P){return this._extScope.getValue(h,P)}scopeRefs(h){return this._extScope.scopeRefs(h,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(h,P,R,K){const W=this._scope.toName(P);return R!==void 0&&K&&(this._constants[W.str]=R),this._leafNode(new o(h,W,R)),W}const(h,P,R){return this._def(r.varKinds.const,h,P,R)}let(h,P,R){return this._def(r.varKinds.let,h,P,R)}var(h,P,R){return this._def(r.varKinds.var,h,P,R)}assign(h,P,R){return this._leafNode(new u(h,P,R))}add(h,P){return this._leafNode(new m(h,e.operators.ADD,P))}code(h){return typeof h=="function"?h():h!==t.nil&&this._leafNode(new $(h)),this}object(...h){const P=["{"];for(const[R,K]of h)P.length>1&&P.push(","),P.push(R),(R!==K||this.opts.es5)&&(P.push(":"),(0,t.addCodeArg)(P,K));return P.push("}"),new t._Code(P)}if(h,P,R){if(this._blockNode(new l(h)),P&&R)this.code(P).else().code(R).endIf();else if(P)this.code(P).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(h){return this._elseNode(new l(h))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(l,f)}_for(h,P){return this._blockNode(h),P&&this.code(P).endFor(),this}for(h,P){return this._for(new c(h),P)}forRange(h,P,R,K,W=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(h);return this._for(new p(W,Z,P,R),()=>K(Z))}forOf(h,P,R,K=r.varKinds.const){const W=this._scope.toName(h);if(this.opts.es5){const Z=P instanceof t.Name?P:this.var("_arr",P);return this.forRange("_i",0,(0,t._)`${Z}.length`,Y=>{this.var(W,(0,t._)`${Z}[${Y}]`),R(W)})}return this._for(new b("of",K,W,P),()=>R(W))}forIn(h,P,R,K=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(h,(0,t._)`Object.keys(${P})`,R);const W=this._scope.toName(h);return this._for(new b("in",K,W,P),()=>R(W))}endFor(){return this._endBlockNode(i)}label(h){return this._leafNode(new y(h))}break(h){return this._leafNode(new d(h))}return(h){const P=new O;if(this._blockNode(P),this.code(h),P.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(O)}try(h,P,R){if(!P&&!R)throw new Error('CodeGen: "try" without "catch" and "finally"');const K=new C;if(this._blockNode(K),this.code(h),P){const W=this.name("e");this._currNode=K.catch=new V(W),P(W)}return R&&(this._currNode=K.finally=new F,this.code(R)),this._endBlockNode(V,F)}throw(h){return this._leafNode(new v(h))}block(h,P){return this._blockStarts.push(this._nodes.length),h&&this.code(h).endBlock(P),this}endBlock(h){const P=this._blockStarts.pop();if(P===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-P;if(R<0||h!==void 0&&R!==h)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${h} expected`);return this._nodes.length=P,this}func(h,P=t.nil,R,K){return this._blockNode(new _(h,P,R)),K&&this.code(K).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(h=1){for(;h-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(h){return this._currNode.nodes.push(h),this}_blockNode(h){this._currNode.nodes.push(h),this._nodes.push(h)}_endBlockNode(h,P){const R=this._currNode;if(R instanceof h||P&&R instanceof P)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${P?`${h.kind}/${P.kind}`:h.kind}"`)}_elseNode(h){const P=this._currNode;if(!(P instanceof l))throw new Error('CodeGen: "else" without "if"');return this._currNode=P.else=h,this}get _root(){return this._nodes[0]}get _currNode(){const h=this._nodes;return h[h.length-1]}set _currNode(h){const P=this._nodes;P[P.length-1]=h}}e.CodeGen=A;function z(I,h){for(const P in h)I[P]=(I[P]||0)+(h[P]||0);return I}function U(I,h){return h instanceof t._CodeOrName?z(I,h.names):I}function B(I,h,P){if(I instanceof t.Name)return R(I);if(!K(I))return I;return new t._Code(I._items.reduce((W,Z)=>(Z instanceof t.Name&&(Z=R(Z)),Z instanceof t._Code?W.push(...Z._items):W.push(Z),W),[]));function R(W){const Z=P[W.str];return Z===void 0||h[W.str]!==1?W:(delete h[W.str],Z)}function K(W){return W instanceof t._Code&&W._items.some(Z=>Z instanceof t.Name&&h[Z.str]===1&&P[Z.str]!==void 0)}}function ee(I,h){for(const P in h)I[P]=(I[P]||0)-(h[P]||0)}function ae(I){return typeof I=="boolean"||typeof I=="number"||I===null?!I:(0,t._)`!${T(I)}`}e.not=ae;const se=k(e.operators.AND);function te(...I){return I.reduce(se)}e.and=te;const he=k(e.operators.OR);function M(...I){return I.reduce(he)}e.or=M;function k(I){return(h,P)=>h===t.nil?P:P===t.nil?h:(0,t._)`${T(h)} ${I} ${T(P)}`}function T(I){return I instanceof t.Name?I:(0,t._)`(${I})`}}(Xt)),Xt}var G={},Or;function Q(){if(Or)return G;Or=1,Object.defineProperty(G,"__esModule",{value:!0}),G.checkStrictMode=G.getErrorPath=G.Type=G.useFunc=G.setEvaluated=G.evaluatedPropsToName=G.mergeEvaluated=G.eachItem=G.unescapeJsonPointer=G.escapeJsonPointer=G.escapeFragment=G.unescapeFragment=G.schemaRefOrVal=G.schemaHasRulesButRef=G.schemaHasRules=G.checkUnknownRules=G.alwaysValidSchema=G.toHash=void 0;const e=x(),t=kt();function r(b){const _={};for(const O of b)_[O]=!0;return _}G.toHash=r;function n(b,_){return typeof _=="boolean"?_:Object.keys(_).length===0?!0:(a(b,_),!s(_,b.self.RULES.all))}G.alwaysValidSchema=n;function a(b,_=b.schema){const{opts:O,self:C}=b;if(!O.strictSchema||typeof _=="boolean")return;const V=C.RULES.keywords;for(const F in _)V[F]||p(b,`unknown keyword: "${F}"`)}G.checkUnknownRules=a;function s(b,_){if(typeof b=="boolean")return!b;for(const O in b)if(_[O])return!0;return!1}G.schemaHasRules=s;function o(b,_){if(typeof b=="boolean")return!b;for(const O in b)if(O!=="$ref"&&_.all[O])return!0;return!1}G.schemaHasRulesButRef=o;function u({topSchemaRef:b,schemaPath:_},O,C,V){if(!V){if(typeof O=="number"||typeof O=="boolean")return O;if(typeof O=="string")return(0,e._)`${O}`}return(0,e._)`${b}${_}${(0,e.getProperty)(C)}`}G.schemaRefOrVal=u;function m(b){return v(decodeURIComponent(b))}G.unescapeFragment=m;function y(b){return encodeURIComponent(d(b))}G.escapeFragment=y;function d(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=d;function v(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=v;function $(b,_){if(Array.isArray(b))for(const O of b)_(O);else _(b)}G.eachItem=$;function S({mergeNames:b,mergeToName:_,mergeValues:O,resultToName:C}){return(V,F,A,z)=>{const U=A===void 0?F:A instanceof e.Name?(F instanceof e.Name?b(V,F,A):_(V,F,A),A):F instanceof e.Name?(_(V,A,F),F):O(F,A);return z===e.Name&&!(U instanceof e.Name)?C(V,U):U}}G.mergeEvaluated={props:S({mergeNames:(b,_,O)=>b.if((0,e._)`${O} !== true && ${_} !== undefined`,()=>{b.if((0,e._)`${_} === true`,()=>b.assign(O,!0),()=>b.assign(O,(0,e._)`${O} || {}`).code((0,e._)`Object.assign(${O}, ${_})`))}),mergeToName:(b,_,O)=>b.if((0,e._)`${O} !== true`,()=>{_===!0?b.assign(O,!0):(b.assign(O,(0,e._)`${O} || {}`),g(b,O,_))}),mergeValues:(b,_)=>b===!0?!0:{...b,..._},resultToName:w}),items:S({mergeNames:(b,_,O)=>b.if((0,e._)`${O} !== true && ${_} !== undefined`,()=>b.assign(O,(0,e._)`${_} === true ? true : ${O} > ${_} ? ${O} : ${_}`)),mergeToName:(b,_,O)=>b.if((0,e._)`${O} !== true`,()=>b.assign(O,_===!0?!0:(0,e._)`${O} > ${_} ? ${O} : ${_}`)),mergeValues:(b,_)=>b===!0?!0:Math.max(b,_),resultToName:(b,_)=>b.var("items",_)})};function w(b,_){if(_===!0)return b.var("props",!0);const O=b.var("props",(0,e._)`{}`);return _!==void 0&&g(b,O,_),O}G.evaluatedPropsToName=w;function g(b,_,O){Object.keys(O).forEach(C=>b.assign((0,e._)`${_}${(0,e.getProperty)(C)}`,!0))}G.setEvaluated=g;const f={};function l(b,_){return b.scopeValue("func",{ref:_,code:f[_.code]||(f[_.code]=new t._Code(_.code))})}G.useFunc=l;var i;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(i||(G.Type=i={}));function c(b,_,O){if(b instanceof e.Name){const C=_===i.Num;return O?C?(0,e._)`"[" + ${b} + "]"`:(0,e._)`"['" + ${b} + "']"`:C?(0,e._)`"/" + ${b}`:(0,e._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return O?(0,e.getProperty)(b).toString():"/"+d(b)}G.getErrorPath=c;function p(b,_,O=b.opts.strictSchema){if(O){if(_=`strict mode: ${_}`,O===!0)throw new Error(_);b.self.logger.warn(_)}}return G.checkStrictMode=p,G}var We={},jr;function Se(){if(jr)return We;jr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=x(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return We.default=t,We}var kr;function Tt(){return kr||(kr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=x(),r=Q(),n=Se();e.keywordError={message:({keyword:f})=>(0,t.str)`must pass "${f}" keyword validation`},e.keyword$DataError={message:({keyword:f,schemaType:l})=>l?(0,t.str)`"${f}" keyword must be ${l} ($data)`:(0,t.str)`"${f}" keyword is invalid ($data)`};function a(f,l=e.keywordError,i,c){const{it:p}=f,{gen:b,compositeRule:_,allErrors:O}=p,C=v(f,l,i);c??(_||O)?m(b,C):y(p,(0,t._)`[${C}]`)}e.reportError=a;function s(f,l=e.keywordError,i){const{it:c}=f,{gen:p,compositeRule:b,allErrors:_}=c,O=v(f,l,i);m(p,O),b||_||y(c,n.default.vErrors)}e.reportExtraError=s;function o(f,l){f.assign(n.default.errors,l),f.if((0,t._)`${n.default.vErrors} !== null`,()=>f.if(l,()=>f.assign((0,t._)`${n.default.vErrors}.length`,l),()=>f.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function u({gen:f,keyword:l,schemaValue:i,data:c,errsCount:p,it:b}){if(p===void 0)throw new Error("ajv implementation error");const _=f.name("err");f.forRange("i",p,n.default.errors,O=>{f.const(_,(0,t._)`${n.default.vErrors}[${O}]`),f.if((0,t._)`${_}.instancePath === undefined`,()=>f.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,b.errorPath))),f.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${b.errSchemaPath}/${l}`),b.opts.verbose&&(f.assign((0,t._)`${_}.schema`,i),f.assign((0,t._)`${_}.data`,c))})}e.extendErrors=u;function m(f,l){const i=f.const("err",l);f.if((0,t._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${n.default.vErrors}.push(${i})`),f.code((0,t._)`${n.default.errors}++`)}function y(f,l){const{gen:i,validateName:c,schemaEnv:p}=f;p.$async?i.throw((0,t._)`new ${f.ValidationError}(${l})`):(i.assign((0,t._)`${c}.errors`,l),i.return(!1))}const d={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function v(f,l,i){const{createErrors:c}=f.it;return c===!1?(0,t._)`{}`:$(f,l,i)}function $(f,l,i={}){const{gen:c,it:p}=f,b=[S(p,i),w(f,i)];return g(f,l,b),c.object(...b)}function S({errorPath:f},{instancePath:l}){const i=l?(0,t.str)`${f}${(0,r.getErrorPath)(l,r.Type.Str)}`:f;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,i)]}function w({keyword:f,it:{errSchemaPath:l}},{schemaPath:i,parentSchema:c}){let p=c?l:(0,t.str)`${l}/${f}`;return i&&(p=(0,t.str)`${p}${(0,r.getErrorPath)(i,r.Type.Str)}`),[d.schemaPath,p]}function g(f,{params:l,message:i},c){const{keyword:p,data:b,schemaValue:_,it:O}=f,{opts:C,propertyName:V,topSchemaRef:F,schemaPath:A}=O;c.push([d.keyword,p],[d.params,typeof l=="function"?l(f):l||(0,t._)`{}`]),C.messages&&c.push([d.message,typeof i=="function"?i(f):i]),C.verbose&&c.push([d.schema,_],[d.parentSchema,(0,t._)`${F}${A}`],[n.default.data,b]),V&&c.push([d.propertyName,V])}}(Gt)),Gt}var Nr;function Js(){if(Nr)return Oe;Nr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.boolOrEmptySchema=Oe.topBoolOrEmptySchema=void 0;const e=Tt(),t=x(),r=Se(),n={message:"boolean schema is false"};function a(u){const{gen:m,schema:y,validateName:d}=u;y===!1?o(u,!1):typeof y=="object"&&y.$async===!0?m.return(r.default.data):(m.assign((0,t._)`${d}.errors`,null),m.return(!0))}Oe.topBoolOrEmptySchema=a;function s(u,m){const{gen:y,schema:d}=u;d===!1?(y.var(m,!1),o(u)):y.var(m,!0)}Oe.boolOrEmptySchema=s;function o(u,m){const{gen:y,data:d}=u,v={gen:y,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(v,n,void 0,m)}return Oe}var ue={},je={},Rr;function Zn(){if(Rr)return je;Rr=1,Object.defineProperty(je,"__esModule",{value:!0}),je.getRules=je.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(a){return typeof a=="string"&&t.has(a)}je.isJSONType=r;function n(){const a={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...a,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},a.number,a.string,a.array,a.object],post:{rules:[]},all:{},keywords:{}}}return je.getRules=n,je}var _e={},Ir;function Qn(){if(Ir)return _e;Ir=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:n,self:a},s){const o=a.RULES.types[s];return o&&o!==!0&&t(n,o)}_e.schemaHasRulesForType=e;function t(n,a){return a.rules.some(s=>r(n,s))}_e.shouldUseGroup=t;function r(n,a){var s;return n[a.keyword]!==void 0||((s=a.definition.implements)===null||s===void 0?void 0:s.some(o=>n[o]!==void 0))}return _e.shouldUseRule=r,_e}var Cr;function Nt(){if(Cr)return ue;Cr=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.reportTypeError=ue.checkDataTypes=ue.checkDataType=ue.coerceAndCheckDataType=ue.getJSONTypes=ue.getSchemaTypes=ue.DataType=void 0;const e=Zn(),t=Qn(),r=Tt(),n=x(),a=Q();var s;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(s||(ue.DataType=s={}));function o(i){const c=u(i.type);if(c.includes("null")){if(i.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!c.length&&i.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');i.nullable===!0&&c.push("null")}return c}ue.getSchemaTypes=o;function u(i){const c=Array.isArray(i)?i:i?[i]:[];if(c.every(e.isJSONType))return c;throw new Error("type must be JSONType or JSONType[]: "+c.join(","))}ue.getJSONTypes=u;function m(i,c){const{gen:p,data:b,opts:_}=i,O=d(c,_.coerceTypes),C=c.length>0&&!(O.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(i,c[0]));if(C){const V=w(c,b,_.strictNumbers,s.Wrong);p.if(V,()=>{O.length?v(i,c,O):f(i)})}return C}ue.coerceAndCheckDataType=m;const y=new Set(["string","number","integer","boolean","null"]);function d(i,c){return c?i.filter(p=>y.has(p)||c==="array"&&p==="array"):[]}function v(i,c,p){const{gen:b,data:_,opts:O}=i,C=b.let("dataType",(0,n._)`typeof ${_}`),V=b.let("coerced",(0,n._)`undefined`);O.coerceTypes==="array"&&b.if((0,n._)`${C} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>b.assign(_,(0,n._)`${_}[0]`).assign(C,(0,n._)`typeof ${_}`).if(w(c,_,O.strictNumbers),()=>b.assign(V,_))),b.if((0,n._)`${V} !== undefined`);for(const A of p)(y.has(A)||A==="array"&&O.coerceTypes==="array")&&F(A);b.else(),f(i),b.endIf(),b.if((0,n._)`${V} !== undefined`,()=>{b.assign(_,V),$(i,V)});function F(A){switch(A){case"string":b.elseIf((0,n._)`${C} == "number" || ${C} == "boolean"`).assign(V,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(V,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${C} == "boolean" || ${_} === null
3
3
  || (${C} == "string" && ${_} && ${_} == +${_})`).assign(V,(0,n._)`+${_}`);return;case"integer":b.elseIf((0,n._)`${C} === "boolean" || ${_} === null
4
4
  || (${C} === "string" && ${_} && ${_} == +${_} && !(${_} % 1))`).assign(V,(0,n._)`+${_}`);return;case"boolean":b.elseIf((0,n._)`${_} === "false" || ${_} === 0 || ${_} === null`).assign(V,!1).elseIf((0,n._)`${_} === "true" || ${_} === 1`).assign(V,!0);return;case"null":b.elseIf((0,n._)`${_} === "" || ${_} === 0 || ${_} === false`),b.assign(V,null);return;case"array":b.elseIf((0,n._)`${C} === "string" || ${C} === "number"
5
5
  || ${C} === "boolean" || ${_} === null`).assign(V,(0,n._)`[${_}]`)}}}function $({gen:i,parentData:c,parentDataProperty:p},b){i.if((0,n._)`${c} !== undefined`,()=>i.assign((0,n._)`${c}[${p}]`,b))}function S(i,c,p,b=s.Correct){const _=b===s.Correct?n.operators.EQ:n.operators.NEQ;let O;switch(i){case"null":return(0,n._)`${c} ${_} null`;case"array":O=(0,n._)`Array.isArray(${c})`;break;case"object":O=(0,n._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":O=C((0,n._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":O=C();break;default:return(0,n._)`typeof ${c} ${_} ${i}`}return b===s.Correct?O:(0,n.not)(O);function C(V=n.nil){return(0,n.and)((0,n._)`typeof ${c} == "number"`,V,p?(0,n._)`isFinite(${c})`:n.nil)}}ue.checkDataType=S;function w(i,c,p,b){if(i.length===1)return S(i[0],c,p,b);let _;const O=(0,a.toHash)(i);if(O.array&&O.object){const C=(0,n._)`typeof ${c} != "object"`;_=O.null?C:(0,n._)`!${c} || ${C}`,delete O.null,delete O.array,delete O.object}else _=n.nil;O.number&&delete O.integer;for(const C in O)_=(0,n.and)(_,S(C,c,p,b));return _}ue.checkDataTypes=w;const g={message:({schema:i})=>`must be ${i}`,params:({schema:i,schemaValue:c})=>typeof i=="string"?(0,n._)`{type: ${i}}`:(0,n._)`{type: ${c}}`};function f(i){const c=l(i);(0,r.reportError)(c,g)}ue.reportTypeError=f;function l(i){const{gen:c,data:p,schema:b}=i,_=(0,a.schemaRefOrVal)(i,b,"type");return{gen:c,keyword:"type",data:p,schema:b.type,schemaCode:_,schemaValue:_,parentSchema:b,params:{},it:i}}return ue}var qe={},Ar;function Ws(){if(Ar)return qe;Ar=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=x(),t=Q();function r(a,s){const{properties:o,items:u}=a.schema;if(s==="object"&&o)for(const m in o)n(a,m,o[m].default);else s==="array"&&Array.isArray(u)&&u.forEach((m,y)=>n(a,y,m.default))}qe.assignDefaults=r;function n(a,s,o){const{gen:u,compositeRule:m,data:y,opts:d}=a;if(o===void 0)return;const v=(0,e._)`${y}${(0,e.getProperty)(s)}`;if(m){(0,t.checkStrictMode)(a,`default is ignored for: ${v}`);return}let $=(0,e._)`${v} === undefined`;d.useDefaults==="empty"&&($=(0,e._)`${$} || ${v} === null || ${v} === ""`),u.if($,(0,e._)`${v} = ${(0,e.stringify)(o)}`)}return qe}var ge={},re={},Tr;function ve(){if(Tr)return re;Tr=1,Object.defineProperty(re,"__esModule",{value:!0}),re.validateUnion=re.validateArray=re.usePattern=re.callValidateCode=re.schemaProperties=re.allSchemaProperties=re.noPropertyInData=re.propertyInData=re.isOwnProperty=re.hasPropFunc=re.reportMissingProp=re.checkMissingProp=re.checkReportMissingProp=void 0;const e=x(),t=Q(),r=Se(),n=Q();function a(i,c){const{gen:p,data:b,it:_}=i;p.if(d(p,b,c,_.opts.ownProperties),()=>{i.setParams({missingProperty:(0,e._)`${c}`},!0),i.error()})}re.checkReportMissingProp=a;function s({gen:i,data:c,it:{opts:p}},b,_){return(0,e.or)(...b.map(O=>(0,e.and)(d(i,c,O,p.ownProperties),(0,e._)`${_} = ${O}`)))}re.checkMissingProp=s;function o(i,c){i.setParams({missingProperty:c},!0),i.error()}re.reportMissingProp=o;function u(i){return i.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}re.hasPropFunc=u;function m(i,c,p){return(0,e._)`${u(i)}.call(${c}, ${p})`}re.isOwnProperty=m;function y(i,c,p,b){const _=(0,e._)`${c}${(0,e.getProperty)(p)} !== undefined`;return b?(0,e._)`${_} && ${m(i,c,p)}`:_}re.propertyInData=y;function d(i,c,p,b){const _=(0,e._)`${c}${(0,e.getProperty)(p)} === undefined`;return b?(0,e.or)(_,(0,e.not)(m(i,c,p))):_}re.noPropertyInData=d;function v(i){return i?Object.keys(i).filter(c=>c!=="__proto__"):[]}re.allSchemaProperties=v;function $(i,c){return v(c).filter(p=>!(0,t.alwaysValidSchema)(i,c[p]))}re.schemaProperties=$;function S({schemaCode:i,data:c,it:{gen:p,topSchemaRef:b,schemaPath:_,errorPath:O},it:C},V,F,A){const z=A?(0,e._)`${i}, ${c}, ${b}${_}`:c,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,O)],[r.default.parentData,C.parentData],[r.default.parentDataProperty,C.parentDataProperty],[r.default.rootData,r.default.rootData]];C.opts.dynamicRef&&U.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const B=(0,e._)`${z}, ${p.object(...U)}`;return F!==e.nil?(0,e._)`${V}.call(${F}, ${B})`:(0,e._)`${V}(${B})`}re.callValidateCode=S;const w=(0,e._)`new RegExp`;function g({gen:i,it:{opts:c}},p){const b=c.unicodeRegExp?"u":"",{regExp:_}=c.code,O=_(p,b);return i.scopeValue("pattern",{key:O.toString(),ref:O,code:(0,e._)`${_.code==="new RegExp"?w:(0,n.useFunc)(i,_)}(${p}, ${b})`})}re.usePattern=g;function f(i){const{gen:c,data:p,keyword:b,it:_}=i,O=c.name("valid");if(_.allErrors){const V=c.let("valid",!0);return C(()=>c.assign(V,!1)),V}return c.var(O,!0),C(()=>c.break()),O;function C(V){const F=c.const("len",(0,e._)`${p}.length`);c.forRange("i",0,F,A=>{i.subschema({keyword:b,dataProp:A,dataPropType:t.Type.Num},O),c.if((0,e.not)(O),V)})}}re.validateArray=f;function l(i){const{gen:c,schema:p,keyword:b,it:_}=i;if(!Array.isArray(p))throw new Error("ajv implementation error");if(p.some(F=>(0,t.alwaysValidSchema)(_,F))&&!_.opts.unevaluated)return;const C=c.let("valid",!1),V=c.name("_valid");c.block(()=>p.forEach((F,A)=>{const z=i.subschema({keyword:b,schemaProp:A,compositeRule:!0},V);c.assign(C,(0,e._)`${C} || ${V}`),i.mergeValidEvaluated(z,V)||c.if((0,e.not)(C))})),i.result(C,()=>i.reset(),()=>i.error(!0))}return re.validateUnion=l,re}var qr;function Bs(){if(qr)return ge;qr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.validateKeywordUsage=ge.validSchemaType=ge.funcKeywordCode=ge.macroKeywordCode=void 0;const e=x(),t=Se(),r=ve(),n=Tt();function a($,S){const{gen:w,keyword:g,schema:f,parentSchema:l,it:i}=$,c=S.macro.call(i.self,f,l,i),p=y(w,g,c);i.opts.validateSchema!==!1&&i.self.validateSchema(c,!0);const b=w.name("valid");$.subschema({schema:c,schemaPath:e.nil,errSchemaPath:`${i.errSchemaPath}/${g}`,topSchemaRef:p,compositeRule:!0},b),$.pass(b,()=>$.error(!0))}ge.macroKeywordCode=a;function s($,S){var w;const{gen:g,keyword:f,schema:l,parentSchema:i,$data:c,it:p}=$;m(p,S);const b=!c&&S.compile?S.compile.call(p.self,l,i,p):S.validate,_=y(g,f,b),O=g.let("valid");$.block$data(O,C),$.ok((w=S.valid)!==null&&w!==void 0?w:O);function C(){if(S.errors===!1)A(),S.modifying&&o($),z(()=>$.error());else{const U=S.async?V():F();S.modifying&&o($),z(()=>u($,U))}}function V(){const U=g.let("ruleErrs",null);return g.try(()=>A((0,e._)`await `),B=>g.assign(O,!1).if((0,e._)`${B} instanceof ${p.ValidationError}`,()=>g.assign(U,(0,e._)`${B}.errors`),()=>g.throw(B))),U}function F(){const U=(0,e._)`${_}.errors`;return g.assign(U,null),A(e.nil),U}function A(U=S.async?(0,e._)`await `:e.nil){const B=p.opts.passContext?t.default.this:t.default.self,ee=!("compile"in S&&!c||S.schema===!1);g.assign(O,(0,e._)`${U}${(0,r.callValidateCode)($,_,B,ee)}`,S.modifying)}function z(U){var B;g.if((0,e.not)((B=S.valid)!==null&&B!==void 0?B:O),U)}}ge.funcKeywordCode=s;function o($){const{gen:S,data:w,it:g}=$;S.if(g.parentData,()=>S.assign(w,(0,e._)`${g.parentData}[${g.parentDataProperty}]`))}function u($,S){const{gen:w}=$;w.if((0,e._)`Array.isArray(${S})`,()=>{w.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${S} : ${t.default.vErrors}.concat(${S})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)($)},()=>$.error())}function m({schemaEnv:$},S){if(S.async&&!$.$async)throw new Error("async keyword in sync schema")}function y($,S,w){if(w===void 0)throw new Error(`keyword "${S}" failed to compile`);return $.scopeValue("keyword",typeof w=="function"?{ref:w}:{ref:w,code:(0,e.stringify)(w)})}function d($,S,w=!1){return!S.length||S.some(g=>g==="array"?Array.isArray($):g==="object"?$&&typeof $=="object"&&!Array.isArray($):typeof $==g||w&&typeof $>"u")}ge.validSchemaType=d;function v({schema:$,opts:S,self:w,errSchemaPath:g},f,l){if(Array.isArray(f.keyword)?!f.keyword.includes(l):f.keyword!==l)throw new Error("ajv implementation error");const i=f.dependencies;if(i?.some(c=>!Object.prototype.hasOwnProperty.call($,c)))throw new Error(`parent schema must have dependencies of ${l}: ${i.join(",")}`);if(f.validateSchema&&!f.validateSchema($[l])){const p=`keyword "${l}" value is invalid at path "${g}": `+w.errorsText(f.validateSchema.errors);if(S.validateSchema==="log")w.logger.error(p);else throw new Error(p)}}return ge.validateKeywordUsage=v,ge}var $e={},Vr;function Hs(){if(Vr)return $e;Vr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=x(),t=Q();function r(s,{keyword:o,schemaProp:u,schema:m,schemaPath:y,errSchemaPath:d,topSchemaRef:v}){if(o!==void 0&&m!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const $=s.schema[o];return u===void 0?{schema:$,schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${s.errSchemaPath}/${o}`}:{schema:$[u],schemaPath:(0,e._)`${s.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(u)}`,errSchemaPath:`${s.errSchemaPath}/${o}/${(0,t.escapeFragment)(u)}`}}if(m!==void 0){if(y===void 0||d===void 0||v===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:m,schemaPath:y,topSchemaRef:v,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function n(s,o,{dataProp:u,dataPropType:m,data:y,dataTypes:d,propertyName:v}){if(y!==void 0&&u!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:$}=o;if(u!==void 0){const{errorPath:w,dataPathArr:g,opts:f}=o,l=$.let("data",(0,e._)`${o.data}${(0,e.getProperty)(u)}`,!0);S(l),s.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(u,m,f.jsPropertySyntax)}`,s.parentDataProperty=(0,e._)`${u}`,s.dataPathArr=[...g,s.parentDataProperty]}if(y!==void 0){const w=y instanceof e.Name?y:$.let("data",y,!0);S(w),v!==void 0&&(s.propertyName=v)}d&&(s.dataTypes=d);function S(w){s.data=w,s.dataLevel=o.dataLevel+1,s.dataTypes=[],o.definedProperties=new Set,s.parentData=o.data,s.dataNames=[...o.dataNames,w]}}$e.extendSubschemaData=n;function a(s,{jtdDiscriminator:o,jtdMetadata:u,compositeRule:m,createErrors:y,allErrors:d}){m!==void 0&&(s.compositeRule=m),y!==void 0&&(s.createErrors=y),d!==void 0&&(s.allErrors=d),s.jtdDiscriminator=o,s.jtdMetadata=u}return $e.extendSubschemaMode=a,$e}var ce={},Qt,Mr;function es(){return Mr||(Mr=1,Qt=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,a,s;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,s[a]))return!1;for(a=n;a--!==0;){var o=s[a];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Qt}var er={exports:{}},Dr;function xs(){if(Dr)return er.exports;Dr=1;var e=er.exports=function(n,a,s){typeof a=="function"&&(s=a,a={}),s=a.cb||s;var o=typeof s=="function"?s:s.pre||function(){},u=s.post||function(){};t(a,o,u,n,"",n)};e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.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 t(n,a,s,o,u,m,y,d,v,$){if(o&&typeof o=="object"&&!Array.isArray(o)){a(o,u,m,y,d,v,$);for(var S in o){var w=o[S];if(Array.isArray(w)){if(S in e.arrayKeywords)for(var g=0;g<w.length;g++)t(n,a,s,w[g],u+"/"+S+"/"+g,m,u,S,o,g)}else if(S in e.propsKeywords){if(w&&typeof w=="object")for(var f in w)t(n,a,s,w[f],u+"/"+S+"/"+r(f),m,u,S,o,f)}else(S in e.keywords||n.allKeys&&!(S in e.skipKeywords))&&t(n,a,s,w,u+"/"+S,m,u,S,o)}s(o,u,m,y,d,v,$)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return er.exports}var zr;function qt(){if(zr)return ce;zr=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.getSchemaRefs=ce.resolveUrl=ce.normalizeId=ce._getFullPath=ce.getFullPath=ce.inlineRef=void 0;const e=Q(),t=es(),r=xs(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(g,f=!0){return typeof g=="boolean"?!0:f===!0?!o(g):f?u(g)<=f:!1}ce.inlineRef=a;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(g){for(const f in g){if(s.has(f))return!0;const l=g[f];if(Array.isArray(l)&&l.some(o)||typeof l=="object"&&o(l))return!0}return!1}function u(g){let f=0;for(const l in g){if(l==="$ref")return 1/0;if(f++,!n.has(l)&&(typeof g[l]=="object"&&(0,e.eachItem)(g[l],i=>f+=u(i)),f===1/0))return 1/0}return f}function m(g,f="",l){l!==!1&&(f=v(f));const i=g.parse(f);return y(g,i)}ce.getFullPath=m;function y(g,f){return g.serialize(f).split("#")[0]+"#"}ce._getFullPath=y;const d=/#\/?$/;function v(g){return g?g.replace(d,""):""}ce.normalizeId=v;function $(g,f,l){return l=v(l),g.resolve(f,l)}ce.resolveUrl=$;const S=/^[a-z_][-a-z0-9._]*$/i;function w(g,f){if(typeof g=="boolean")return{};const{schemaId:l,uriResolver:i}=this.opts,c=v(g[l]||f),p={"":c},b=m(i,c,!1),_={},O=new Set;return r(g,{allKeys:!0},(F,A,z,U)=>{if(U===void 0)return;const B=b+A;let ee=p[U];typeof F[l]=="string"&&(ee=ae.call(this,F[l])),se.call(this,F.$anchor),se.call(this,F.$dynamicAnchor),p[A]=ee;function ae(te){const he=this.opts.uriResolver.resolve;if(te=v(ee?he(ee,te):te),O.has(te))throw V(te);O.add(te);let M=this.refs[te];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?C(F,M.schema,te):te!==v(B)&&(te[0]==="#"?(C(F,_[te],te),_[te]=F):this.refs[te]=B),te}function se(te){if(typeof te=="string"){if(!S.test(te))throw new Error(`invalid anchor "${te}"`);ae.call(this,`#${te}`)}}}),_;function C(F,A,z){if(A!==void 0&&!t(F,A))throw V(z)}function V(F){return new Error(`reference "${F}" resolves to more than one schema`)}}return ce.getSchemaRefs=w,ce}var Fr;function Le(){if(Fr)return be;Fr=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getData=be.KeywordCxt=be.validateFunctionCode=void 0;const e=Js(),t=Nt(),r=Qn(),n=Nt(),a=Ws(),s=Bs(),o=Hs(),u=x(),m=Se(),y=qt(),d=Q(),v=Tt();function $(j){if(b(j)&&(O(j),p(j))){f(j);return}S(j,()=>(0,e.topBoolOrEmptySchema)(j))}be.validateFunctionCode=$;function S({gen:j,validateName:N,schema:q,schemaEnv:L,opts:H},X){H.code.es5?j.func(N,(0,u._)`${m.default.data}, ${m.default.valCxt}`,L.$async,()=>{j.code((0,u._)`"use strict"; ${i(q,H)}`),g(j,H),j.code(X)}):j.func(N,(0,u._)`${m.default.data}, ${w(H)}`,L.$async,()=>j.code(i(q,H)).code(X))}function w(j){return(0,u._)`{${m.default.instancePath}="", ${m.default.parentData}, ${m.default.parentDataProperty}, ${m.default.rootData}=${m.default.data}${j.dynamicRef?(0,u._)`, ${m.default.dynamicAnchors}={}`:u.nil}}={}`}function g(j,N){j.if(m.default.valCxt,()=>{j.var(m.default.instancePath,(0,u._)`${m.default.valCxt}.${m.default.instancePath}`),j.var(m.default.parentData,(0,u._)`${m.default.valCxt}.${m.default.parentData}`),j.var(m.default.parentDataProperty,(0,u._)`${m.default.valCxt}.${m.default.parentDataProperty}`),j.var(m.default.rootData,(0,u._)`${m.default.valCxt}.${m.default.rootData}`),N.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`${m.default.valCxt}.${m.default.dynamicAnchors}`)},()=>{j.var(m.default.instancePath,(0,u._)`""`),j.var(m.default.parentData,(0,u._)`undefined`),j.var(m.default.parentDataProperty,(0,u._)`undefined`),j.var(m.default.rootData,m.default.data),N.dynamicRef&&j.var(m.default.dynamicAnchors,(0,u._)`{}`)})}function f(j){const{schema:N,opts:q,gen:L}=j;S(j,()=>{q.$comment&&N.$comment&&U(j),F(j),L.let(m.default.vErrors,null),L.let(m.default.errors,0),q.unevaluated&&l(j),C(j),B(j)})}function l(j){const{gen:N,validateName:q}=j;j.evaluated=N.const("evaluated",(0,u._)`${q}.evaluated`),N.if((0,u._)`${j.evaluated}.dynamicProps`,()=>N.assign((0,u._)`${j.evaluated}.props`,(0,u._)`undefined`)),N.if((0,u._)`${j.evaluated}.dynamicItems`,()=>N.assign((0,u._)`${j.evaluated}.items`,(0,u._)`undefined`))}function i(j,N){const q=typeof j=="object"&&j[N.schemaId];return q&&(N.code.source||N.code.process)?(0,u._)`/*# sourceURL=${q} */`:u.nil}function c(j,N){if(b(j)&&(O(j),p(j))){_(j,N);return}(0,e.boolOrEmptySchema)(j,N)}function p({schema:j,self:N}){if(typeof j=="boolean")return!j;for(const q in j)if(N.RULES.all[q])return!0;return!1}function b(j){return typeof j.schema!="boolean"}function _(j,N){const{schema:q,gen:L,opts:H}=j;H.$comment&&q.$comment&&U(j),A(j),z(j);const X=L.const("_errs",m.default.errors);C(j,X),L.var(N,(0,u._)`${X} === ${m.default.errors}`)}function O(j){(0,d.checkUnknownRules)(j),V(j)}function C(j,N){if(j.opts.jtd)return ae(j,[],!1,N);const q=(0,t.getSchemaTypes)(j.schema),L=(0,t.coerceAndCheckDataType)(j,q);ae(j,q,!L,N)}function V(j){const{schema:N,errSchemaPath:q,opts:L,self:H}=j;N.$ref&&L.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(N,H.RULES)&&H.logger.warn(`$ref: keywords ignored in schema at path "${q}"`)}function F(j){const{schema:N,opts:q}=j;N.default!==void 0&&q.useDefaults&&q.strictSchema&&(0,d.checkStrictMode)(j,"default is ignored in the schema root")}function A(j){const N=j.schema[j.opts.schemaId];N&&(j.baseId=(0,y.resolveUrl)(j.opts.uriResolver,j.baseId,N))}function z(j){if(j.schema.$async&&!j.schemaEnv.$async)throw new Error("async schema in sync schema")}function U({gen:j,schemaEnv:N,schema:q,errSchemaPath:L,opts:H}){const X=q.$comment;if(H.$comment===!0)j.code((0,u._)`${m.default.self}.logger.log(${X})`);else if(typeof H.$comment=="function"){const ie=(0,u.str)`${L}/$comment`,ye=j.scopeValue("root",{ref:N.root});j.code((0,u._)`${m.default.self}.opts.$comment(${X}, ${ie}, ${ye}.schema)`)}}function B(j){const{gen:N,schemaEnv:q,validateName:L,ValidationError:H,opts:X}=j;q.$async?N.if((0,u._)`${m.default.errors} === 0`,()=>N.return(m.default.data),()=>N.throw((0,u._)`new ${H}(${m.default.vErrors})`)):(N.assign((0,u._)`${L}.errors`,m.default.vErrors),X.unevaluated&&ee(j),N.return((0,u._)`${m.default.errors} === 0`))}function ee({gen:j,evaluated:N,props:q,items:L}){q instanceof u.Name&&j.assign((0,u._)`${N}.props`,q),L instanceof u.Name&&j.assign((0,u._)`${N}.items`,L)}function ae(j,N,q,L){const{gen:H,schema:X,data:ie,allErrors:ye,opts:fe,self:de}=j,{RULES:oe}=de;if(X.$ref&&(fe.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(X,oe))){H.block(()=>K(j,"$ref",oe.all.$ref.definition));return}fe.jtd||te(j,N),H.block(()=>{for(const pe of oe.rules)Re(pe);Re(oe.post)});function Re(pe){(0,r.shouldUseGroup)(X,pe)&&(pe.type?(H.if((0,n.checkDataType)(pe.type,ie,fe.strictNumbers)),se(j,pe),N.length===1&&N[0]===pe.type&&q&&(H.else(),(0,n.reportTypeError)(j)),H.endIf()):se(j,pe),ye||H.if((0,u._)`${m.default.errors} === ${L||0}`))}}function se(j,N){const{gen:q,schema:L,opts:{useDefaults:H}}=j;H&&(0,a.assignDefaults)(j,N.type),q.block(()=>{for(const X of N.rules)(0,r.shouldUseRule)(L,X)&&K(j,X.keyword,X.definition,N.type)})}function te(j,N){j.schemaEnv.meta||!j.opts.strictTypes||(he(j,N),j.opts.allowUnionTypes||M(j,N),k(j,j.dataTypes))}function he(j,N){if(N.length){if(!j.dataTypes.length){j.dataTypes=N;return}N.forEach(q=>{I(j.dataTypes,q)||P(j,`type "${q}" not allowed by context "${j.dataTypes.join(",")}"`)}),h(j,N)}}function M(j,N){N.length>1&&!(N.length===2&&N.includes("null"))&&P(j,"use allowUnionTypes to allow union type keyword")}function k(j,N){const q=j.self.RULES.all;for(const L in q){const H=q[L];if(typeof H=="object"&&(0,r.shouldUseRule)(j.schema,H)){const{type:X}=H.definition;X.length&&!X.some(ie=>T(N,ie))&&P(j,`missing type "${X.join(",")}" for keyword "${L}"`)}}}function T(j,N){return j.includes(N)||N==="number"&&j.includes("integer")}function I(j,N){return j.includes(N)||N==="integer"&&j.includes("number")}function h(j,N){const q=[];for(const L of j.dataTypes)I(N,L)?q.push(L):N.includes("integer")&&L==="number"&&q.push("integer");j.dataTypes=q}function P(j,N){const q=j.schemaEnv.baseId+j.errSchemaPath;N+=` at "${q}" (strictTypes)`,(0,d.checkStrictMode)(j,N,j.opts.strictTypes)}class R{constructor(N,q,L){if((0,s.validateKeywordUsage)(N,q,L),this.gen=N.gen,this.allErrors=N.allErrors,this.keyword=L,this.data=N.data,this.schema=N.schema[L],this.$data=q.$data&&N.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(N,this.schema,L,this.$data),this.schemaType=q.schemaType,this.parentSchema=N.schema,this.params={},this.it=N,this.def=q,this.$data)this.schemaCode=N.gen.const("vSchema",Y(this.$data,N));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw new Error(`${L} value must be ${JSON.stringify(q.schemaType)}`);("code"in q?q.trackErrors:q.errors!==!1)&&(this.errsCount=N.gen.const("_errs",m.default.errors))}result(N,q,L){this.failResult((0,u.not)(N),q,L)}failResult(N,q,L){this.gen.if(N),L?L():this.error(),q?(this.gen.else(),q(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(N,q){this.failResult((0,u.not)(N),void 0,q)}fail(N){if(N===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(N),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(N){if(!this.$data)return this.fail(N);const{schemaCode:q}=this;this.fail((0,u._)`${q} !== undefined && (${(0,u.or)(this.invalid$data(),N)})`)}error(N,q,L){if(q){this.setParams(q),this._error(N,L),this.setParams({});return}this._error(N,L)}_error(N,q){(N?v.reportExtraError:v.reportError)(this,this.def.error,q)}$dataError(){(0,v.reportError)(this,this.def.$dataError||v.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,v.resetErrorsCount)(this.gen,this.errsCount)}ok(N){this.allErrors||this.gen.if(N)}setParams(N,q){q?Object.assign(this.params,N):this.params=N}block$data(N,q,L=u.nil){this.gen.block(()=>{this.check$data(N,L),q()})}check$data(N=u.nil,q=u.nil){if(!this.$data)return;const{gen:L,schemaCode:H,schemaType:X,def:ie}=this;L.if((0,u.or)((0,u._)`${H} === undefined`,q)),N!==u.nil&&L.assign(N,!0),(X.length||ie.validateSchema)&&(L.elseIf(this.invalid$data()),this.$dataError(),N!==u.nil&&L.assign(N,!1)),L.else()}invalid$data(){const{gen:N,schemaCode:q,schemaType:L,def:H,it:X}=this;return(0,u.or)(ie(),ye());function ie(){if(L.length){if(!(q instanceof u.Name))throw new Error("ajv implementation error");const fe=Array.isArray(L)?L:[L];return(0,u._)`${(0,n.checkDataTypes)(fe,q,X.opts.strictNumbers,n.DataType.Wrong)}`}return u.nil}function ye(){if(H.validateSchema){const fe=N.scopeValue("validate$data",{ref:H.validateSchema});return(0,u._)`!${fe}(${q})`}return u.nil}}subschema(N,q){const L=(0,o.getSubschema)(this.it,N);(0,o.extendSubschemaData)(L,this.it,N),(0,o.extendSubschemaMode)(L,N);const H={...this.it,...L,items:void 0,props:void 0};return c(H,q),H}mergeEvaluated(N,q){const{it:L,gen:H}=this;L.opts.unevaluated&&(L.props!==!0&&N.props!==void 0&&(L.props=d.mergeEvaluated.props(H,N.props,L.props,q)),L.items!==!0&&N.items!==void 0&&(L.items=d.mergeEvaluated.items(H,N.items,L.items,q)))}mergeValidEvaluated(N,q){const{it:L,gen:H}=this;if(L.opts.unevaluated&&(L.props!==!0||L.items!==!0))return H.if(q,()=>this.mergeEvaluated(N,u.Name)),!0}}be.KeywordCxt=R;function K(j,N,q,L){const H=new R(j,q,N);"code"in q?q.code(H,L):H.$data&&q.validate?(0,s.funcKeywordCode)(H,q):"macro"in q?(0,s.macroKeywordCode)(H,q):(q.compile||q.validate)&&(0,s.funcKeywordCode)(H,q)}const W=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(j,{dataLevel:N,dataNames:q,dataPathArr:L}){let H,X;if(j==="")return m.default.rootData;if(j[0]==="/"){if(!W.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);H=j,X=m.default.rootData}else{const de=Z.exec(j);if(!de)throw new Error(`Invalid JSON-pointer: ${j}`);const oe=+de[1];if(H=de[2],H==="#"){if(oe>=N)throw new Error(fe("property/index",oe));return L[N-oe]}if(oe>N)throw new Error(fe("data",oe));if(X=q[N-oe],!H)return X}let ie=X;const ye=H.split("/");for(const de of ye)de&&(X=(0,u._)`${X}${(0,u.getProperty)((0,d.unescapeJsonPointer)(de))}`,ie=(0,u._)`${ie} && ${X}`);return ie;function fe(de,oe){return`Cannot access ${de} ${oe} levels up, current level is ${N}`}}return be.getData=Y,be}var Be={},Lr;function Vt(){if(Lr)return Be;Lr=1,Object.defineProperty(Be,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Be.default=e,Be}var He={},Ur;function Ue(){if(Ur)return He;Ur=1,Object.defineProperty(He,"__esModule",{value:!0});const e=qt();class t extends Error{constructor(n,a,s,o){super(o||`can't resolve reference ${s} from id ${a}`),this.missingRef=(0,e.resolveUrl)(n,a,s),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return He.default=t,He}var me={},Kr;function Mt(){if(Kr)return me;Kr=1,Object.defineProperty(me,"__esModule",{value:!0}),me.resolveSchema=me.getCompilingSchema=me.resolveRef=me.compileSchema=me.SchemaEnv=void 0;const e=x(),t=Vt(),r=Se(),n=qt(),a=Q(),s=Le();class o{constructor(l){var i;this.refs={},this.dynamicAnchors={};let c;typeof l.schema=="object"&&(c=l.schema),this.schema=l.schema,this.schemaId=l.schemaId,this.root=l.root||this,this.baseId=(i=l.baseId)!==null&&i!==void 0?i:(0,n.normalizeId)(c?.[l.schemaId||"$id"]),this.schemaPath=l.schemaPath,this.localRefs=l.localRefs,this.meta=l.meta,this.$async=c?.$async,this.refs={}}}me.SchemaEnv=o;function u(f){const l=d.call(this,f);if(l)return l;const i=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:c,lines:p}=this.opts.code,{ownProperties:b}=this.opts,_=new e.CodeGen(this.scope,{es5:c,lines:p,ownProperties:b});let O;f.$async&&(O=_.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const C=_.scopeName("validate");f.validateName=C;const V={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,e.stringify)(f.schema)}:{ref:f.schema}),validateName:C,ValidationError:O,schema:f.schema,schemaEnv:f,rootId:i,baseId:f.baseId||i,schemaPath:e.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let F;try{this._compilations.add(f),(0,s.validateFunctionCode)(V),_.optimize(this.opts.code.optimize);const A=_.toString();F=`${_.scopeRefs(r.default.scope)}return ${A}`,this.opts.code.process&&(F=this.opts.code.process(F,f));const U=new Function(`${r.default.self}`,`${r.default.scope}`,F)(this,this.scope.get());if(this.scope.value(C,{ref:U}),U.errors=null,U.schema=f.schema,U.schemaEnv=f,f.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:C,validateCode:A,scopeValues:_._values}),this.opts.unevaluated){const{props:B,items:ee}=V;U.evaluated={props:B instanceof e.Name?void 0:B,items:ee instanceof e.Name?void 0:ee,dynamicProps:B instanceof e.Name,dynamicItems:ee instanceof e.Name},U.source&&(U.source.evaluated=(0,e.stringify)(U.evaluated))}return f.validate=U,f}catch(A){throw delete f.validate,delete f.validateName,F&&this.logger.error("Error compiling schema, function code:",F),A}finally{this._compilations.delete(f)}}me.compileSchema=u;function m(f,l,i){var c;i=(0,n.resolveUrl)(this.opts.uriResolver,l,i);const p=f.refs[i];if(p)return p;let b=$.call(this,f,i);if(b===void 0){const _=(c=f.localRefs)===null||c===void 0?void 0:c[i],{schemaId:O}=this.opts;_&&(b=new o({schema:_,schemaId:O,root:f,baseId:l}))}if(b!==void 0)return f.refs[i]=y.call(this,b)}me.resolveRef=m;function y(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:u.call(this,f)}function d(f){for(const l of this._compilations)if(v(l,f))return l}me.getCompilingSchema=d;function v(f,l){return f.schema===l.schema&&f.root===l.root&&f.baseId===l.baseId}function $(f,l){let i;for(;typeof(i=this.refs[l])=="string";)l=i;return i||this.schemas[l]||S.call(this,f,l)}function S(f,l){const i=this.opts.uriResolver.parse(l),c=(0,n._getFullPath)(this.opts.uriResolver,i);let p=(0,n.getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&c===p)return g.call(this,i,f);const b=(0,n.normalizeId)(c),_=this.refs[b]||this.schemas[b];if(typeof _=="string"){const O=S.call(this,f,_);return typeof O?.schema!="object"?void 0:g.call(this,i,O)}if(typeof _?.schema=="object"){if(_.validate||u.call(this,_),b===(0,n.normalizeId)(l)){const{schema:O}=_,{schemaId:C}=this.opts,V=O[C];return V&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,V)),new o({schema:O,schemaId:C,root:f,baseId:p})}return g.call(this,i,_)}}me.resolveSchema=S;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(f,{baseId:l,schema:i,root:c}){var p;if(((p=f.fragment)===null||p===void 0?void 0:p[0])!=="/")return;for(const O of f.fragment.slice(1).split("/")){if(typeof i=="boolean")return;const C=i[(0,a.unescapeFragment)(O)];if(C===void 0)return;i=C;const V=typeof i=="object"&&i[this.opts.schemaId];!w.has(O)&&V&&(l=(0,n.resolveUrl)(this.opts.uriResolver,l,V))}let b;if(typeof i!="boolean"&&i.$ref&&!(0,a.schemaHasRulesButRef)(i,this.RULES)){const O=(0,n.resolveUrl)(this.opts.uriResolver,l,i.$ref);b=S.call(this,c,O)}const{schemaId:_}=this.opts;if(b=b||new o({schema:i,schemaId:_,root:c,baseId:l}),b.schema!==b.root.schema)return b}return me}const Gs="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Xs="Meta-schema for $data reference (JSON AnySchema extension proposal)",Ys="object",Zs=["$data"],Qs={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ea=!1,ta={$id:Gs,description:Xs,type:Ys,required:Zs,properties:Qs,additionalProperties:ea};var xe={},Ve={exports:{}},tr,Jr;function ra(){return Jr||(Jr=1,tr={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),tr}var rr,Wr;function na(){if(Wr)return rr;Wr=1;const{HEX:e}=ra(),t=/^(?:(?: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;function r(g){if(u(g,".")<3)return{host:g,isIPV4:!1};const f=g.match(t)||[],[l]=f;return l?{host:o(l,"."),isIPV4:!0}:{host:g,isIPV4:!1}}function n(g,f=!1){let l="",i=!0;for(const c of g){if(e[c]===void 0)return;c!=="0"&&i===!0&&(i=!1),i||(l+=c)}return f&&l.length===0&&(l="0"),l}function a(g){let f=0;const l={error:!1,address:"",zone:""},i=[],c=[];let p=!1,b=!1,_=!1;function O(){if(c.length){if(p===!1){const C=n(c);if(C!==void 0)i.push(C);else return l.error=!0,!1}c.length=0}return!0}for(let C=0;C<g.length;C++){const V=g[C];if(!(V==="["||V==="]"))if(V===":"){if(b===!0&&(_=!0),!O())break;if(f++,i.push(":"),f>7){l.error=!0;break}C-1>=0&&g[C-1]===":"&&(b=!0);continue}else if(V==="%"){if(!O())break;p=!0}else{c.push(V);continue}}return c.length&&(p?l.zone=c.join(""):_?i.push(c.join("")):i.push(n(c))),l.address=i.join(""),l}function s(g){if(u(g,":")<2)return{host:g,isIPV6:!1};const f=a(g);if(f.error)return{host:g,isIPV6:!1};{let l=f.address,i=f.address;return f.zone&&(l+="%"+f.zone,i+="%25"+f.zone),{host:l,escapedHost:i,isIPV6:!0}}}function o(g,f){let l="",i=!0;const c=g.length;for(let p=0;p<c;p++){const b=g[p];b==="0"&&i?(p+1<=c&&g[p+1]===f||p+1===c)&&(l+=b,i=!1):(b===f?i=!0:i=!1,l+=b)}return l}function u(g,f){let l=0;for(let i=0;i<g.length;i++)g[i]===f&&l++;return l}const m=/^\.\.?\//u,y=/^\/\.(?:\/|$)/u,d=/^\/\.\.(?:\/|$)/u,v=/^\/?(?:.|\n)*?(?=\/|$)/u;function $(g){const f=[];for(;g.length;)if(g.match(m))g=g.replace(m,"");else if(g.match(y))g=g.replace(y,"/");else if(g.match(d))g=g.replace(d,"/"),f.pop();else if(g==="."||g==="..")g="";else{const l=g.match(v);if(l){const i=l[0];g=g.slice(i.length),f.push(i)}else throw new Error("Unexpected dot segment condition")}return f.join("")}function S(g,f){const l=f!==!0?escape:unescape;return g.scheme!==void 0&&(g.scheme=l(g.scheme)),g.userinfo!==void 0&&(g.userinfo=l(g.userinfo)),g.host!==void 0&&(g.host=l(g.host)),g.path!==void 0&&(g.path=l(g.path)),g.query!==void 0&&(g.query=l(g.query)),g.fragment!==void 0&&(g.fragment=l(g.fragment)),g}function w(g){const f=[];if(g.userinfo!==void 0&&(f.push(g.userinfo),f.push("@")),g.host!==void 0){let l=unescape(g.host);const i=r(l);if(i.isIPV4)l=i.host;else{const c=s(i.host);c.isIPV6===!0?l=`[${c.escapedHost}]`:l=g.host}f.push(l)}return(typeof g.port=="number"||typeof g.port=="string")&&(f.push(":"),f.push(String(g.port))),f.length?f.join(""):void 0}return rr={recomposeAuthority:w,normalizeComponentEncoding:S,removeDotSegments:$,normalizeIPv4:r,normalizeIPv6:s,stringArrayToHexStripped:n},rr}var nr,Br;function sa(){if(Br)return nr;Br=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(i){return typeof i.secure=="boolean"?i.secure:String(i.scheme).toLowerCase()==="wss"}function n(i){return i.host||(i.error=i.error||"HTTP URIs must have a host."),i}function a(i){const c=String(i.scheme).toLowerCase()==="https";return(i.port===(c?443:80)||i.port==="")&&(i.port=void 0),i.path||(i.path="/"),i}function s(i){return i.secure=r(i),i.resourceName=(i.path||"/")+(i.query?"?"+i.query:""),i.path=void 0,i.query=void 0,i}function o(i){if((i.port===(r(i)?443:80)||i.port==="")&&(i.port=void 0),typeof i.secure=="boolean"&&(i.scheme=i.secure?"wss":"ws",i.secure=void 0),i.resourceName){const[c,p]=i.resourceName.split("?");i.path=c&&c!=="/"?c:void 0,i.query=p,i.resourceName=void 0}return i.fragment=void 0,i}function u(i,c){if(!i.path)return i.error="URN can not be parsed",i;const p=i.path.match(t);if(p){const b=c.scheme||i.scheme||"urn";i.nid=p[1].toLowerCase(),i.nss=p[2];const _=`${b}:${c.nid||i.nid}`,O=l[_];i.path=void 0,O&&(i=O.parse(i,c))}else i.error=i.error||"URN can not be parsed.";return i}function m(i,c){const p=c.scheme||i.scheme||"urn",b=i.nid.toLowerCase(),_=`${p}:${c.nid||b}`,O=l[_];O&&(i=O.serialize(i,c));const C=i,V=i.nss;return C.path=`${b||c.nid}:${V}`,c.skipEscape=!0,C}function y(i,c){const p=i;return p.uuid=p.nss,p.nss=void 0,!c.tolerant&&(!p.uuid||!e.test(p.uuid))&&(p.error=p.error||"UUID is not valid."),p}function d(i){const c=i;return c.nss=(i.uuid||"").toLowerCase(),c}const v={scheme:"http",domainHost:!0,parse:n,serialize:a},$={scheme:"https",domainHost:v.domainHost,parse:n,serialize:a},S={scheme:"ws",domainHost:!0,parse:s,serialize:o},w={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},l={http:v,https:$,ws:S,wss:w,urn:{scheme:"urn",parse:u,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:y,serialize:d,skipNormalize:!0}};return nr=l,nr}var Hr;function aa(){if(Hr)return Ve.exports;Hr=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:a}=na(),s=sa();function o(f,l){return typeof f=="string"?f=d(w(f,l),l):typeof f=="object"&&(f=w(d(f,l),l)),f}function u(f,l,i){const c=Object.assign({scheme:"null"},i),p=m(w(f,c),w(l,c),c,!0);return d(p,{...c,skipEscape:!0})}function m(f,l,i,c){const p={};return c||(f=w(d(f,i),i),l=w(d(l,i),i)),i=i||{},!i.tolerant&&l.scheme?(p.scheme=l.scheme,p.userinfo=l.userinfo,p.host=l.host,p.port=l.port,p.path=r(l.path||""),p.query=l.query):(l.userinfo!==void 0||l.host!==void 0||l.port!==void 0?(p.userinfo=l.userinfo,p.host=l.host,p.port=l.port,p.path=r(l.path||""),p.query=l.query):(l.path?(l.path.charAt(0)==="/"?p.path=r(l.path):((f.userinfo!==void 0||f.host!==void 0||f.port!==void 0)&&!f.path?p.path="/"+l.path:f.path?p.path=f.path.slice(0,f.path.lastIndexOf("/")+1)+l.path:p.path=l.path,p.path=r(p.path)),p.query=l.query):(p.path=f.path,l.query!==void 0?p.query=l.query:p.query=f.query),p.userinfo=f.userinfo,p.host=f.host,p.port=f.port),p.scheme=f.scheme),p.fragment=l.fragment,p}function y(f,l,i){return typeof f=="string"?(f=unescape(f),f=d(a(w(f,i),!0),{...i,skipEscape:!0})):typeof f=="object"&&(f=d(a(f,!0),{...i,skipEscape:!0})),typeof l=="string"?(l=unescape(l),l=d(a(w(l,i),!0),{...i,skipEscape:!0})):typeof l=="object"&&(l=d(a(l,!0),{...i,skipEscape:!0})),f.toLowerCase()===l.toLowerCase()}function d(f,l){const i={host:f.host,scheme:f.scheme,userinfo:f.userinfo,port:f.port,path:f.path,query:f.query,nid:f.nid,nss:f.nss,uuid:f.uuid,fragment:f.fragment,reference:f.reference,resourceName:f.resourceName,secure:f.secure,error:""},c=Object.assign({},l),p=[],b=s[(c.scheme||i.scheme||"").toLowerCase()];b&&b.serialize&&b.serialize(i,c),i.path!==void 0&&(c.skipEscape?i.path=unescape(i.path):(i.path=escape(i.path),i.scheme!==void 0&&(i.path=i.path.split("%3A").join(":")))),c.reference!=="suffix"&&i.scheme&&p.push(i.scheme,":");const _=n(i);if(_!==void 0&&(c.reference!=="suffix"&&p.push("//"),p.push(_),i.path&&i.path.charAt(0)!=="/"&&p.push("/")),i.path!==void 0){let O=i.path;!c.absolutePath&&(!b||!b.absolutePath)&&(O=r(O)),_===void 0&&(O=O.replace(/^\/\//u,"/%2F")),p.push(O)}return i.query!==void 0&&p.push("?",i.query),i.fragment!==void 0&&p.push("#",i.fragment),p.join("")}const v=Array.from({length:127},(f,l)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(l)));function $(f){let l=0;for(let i=0,c=f.length;i<c;++i)if(l=f.charCodeAt(i),l>126||v[l])return!0;return!1}const S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(f,l){const i=Object.assign({},l),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},p=f.indexOf("%")!==-1;let b=!1;i.reference==="suffix"&&(f=(i.scheme?i.scheme+":":"")+"//"+f);const _=f.match(S);if(_){if(c.scheme=_[1],c.userinfo=_[3],c.host=_[4],c.port=parseInt(_[5],10),c.path=_[6]||"",c.query=_[7],c.fragment=_[8],isNaN(c.port)&&(c.port=_[5]),c.host){const C=t(c.host);if(C.isIPV4===!1){const V=e(C.host);c.host=V.host.toLowerCase(),b=V.isIPV6}else c.host=C.host,b=!0}c.scheme===void 0&&c.userinfo===void 0&&c.host===void 0&&c.port===void 0&&c.query===void 0&&!c.path?c.reference="same-document":c.scheme===void 0?c.reference="relative":c.fragment===void 0?c.reference="absolute":c.reference="uri",i.reference&&i.reference!=="suffix"&&i.reference!==c.reference&&(c.error=c.error||"URI is not a "+i.reference+" reference.");const O=s[(i.scheme||c.scheme||"").toLowerCase()];if(!i.unicodeSupport&&(!O||!O.unicodeSupport)&&c.host&&(i.domainHost||O&&O.domainHost)&&b===!1&&$(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(C){c.error=c.error||"Host's domain name can not be converted to ASCII: "+C}(!O||O&&!O.skipNormalize)&&(p&&c.scheme!==void 0&&(c.scheme=unescape(c.scheme)),p&&c.host!==void 0&&(c.host=unescape(c.host)),c.path&&(c.path=escape(unescape(c.path))),c.fragment&&(c.fragment=encodeURI(decodeURIComponent(c.fragment)))),O&&O.parse&&O.parse(c,i)}else c.error=c.error||"URI can not be parsed.";return c}const g={SCHEMES:s,normalize:o,resolve:u,resolveComponents:m,equal:y,serialize:d,parse:w};return Ve.exports=g,Ve.exports.default=g,Ve.exports.fastUri=g,Ve.exports}var xr;function ia(){if(xr)return xe;xr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=aa();return e.code='require("ajv/dist/runtime/uri").default',xe.default=e,xe}var Gr;function ts(){return Gr||(Gr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Le();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=x();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=Vt(),a=Ue(),s=Zn(),o=Mt(),u=x(),m=qt(),y=Nt(),d=Q(),v=ta,$=ia(),S=(M,k)=>new RegExp(M,k);S.code="new RegExp";const w=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={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."},l={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},i=200;function c(M){var k,T,I,h,P,R,K,W,Z,Y,j,N,q,L,H,X,ie,ye,fe,de,oe,Re,pe,Kt,Jt;const Te=M.strict,Wt=(k=M.code)===null||k===void 0?void 0:k.optimize,br=Wt===!0||Wt===void 0?1:Wt||0,_r=(I=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&I!==void 0?I:S,Fs=(h=M.uriResolver)!==null&&h!==void 0?h:$.default;return{strictSchema:(R=(P=M.strictSchema)!==null&&P!==void 0?P:Te)!==null&&R!==void 0?R:!0,strictNumbers:(W=(K=M.strictNumbers)!==null&&K!==void 0?K:Te)!==null&&W!==void 0?W:!0,strictTypes:(Y=(Z=M.strictTypes)!==null&&Z!==void 0?Z:Te)!==null&&Y!==void 0?Y:"log",strictTuples:(N=(j=M.strictTuples)!==null&&j!==void 0?j:Te)!==null&&N!==void 0?N:"log",strictRequired:(L=(q=M.strictRequired)!==null&&q!==void 0?q:Te)!==null&&L!==void 0?L:!1,code:M.code?{...M.code,optimize:br,regExp:_r}:{optimize:br,regExp:_r},loopRequired:(H=M.loopRequired)!==null&&H!==void 0?H:i,loopEnum:(X=M.loopEnum)!==null&&X!==void 0?X:i,meta:(ie=M.meta)!==null&&ie!==void 0?ie:!0,messages:(ye=M.messages)!==null&&ye!==void 0?ye:!0,inlineRefs:(fe=M.inlineRefs)!==null&&fe!==void 0?fe:!0,schemaId:(de=M.schemaId)!==null&&de!==void 0?de:"$id",addUsedSchema:(oe=M.addUsedSchema)!==null&&oe!==void 0?oe:!0,validateSchema:(Re=M.validateSchema)!==null&&Re!==void 0?Re:!0,validateFormats:(pe=M.validateFormats)!==null&&pe!==void 0?pe:!0,unicodeRegExp:(Kt=M.unicodeRegExp)!==null&&Kt!==void 0?Kt:!0,int32range:(Jt=M.int32range)!==null&&Jt!==void 0?Jt:!0,uriResolver:Fs}}class p{constructor(k={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,k=this.opts={...k,...c(k)};const{es5:T,lines:I}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:g,es5:T,lines:I}),this.logger=z(k.logger);const h=k.validateFormats;k.validateFormats=!1,this.RULES=(0,s.getRules)(),b.call(this,f,k,"NOT SUPPORTED"),b.call(this,l,k,"DEPRECATED","warn"),this._metaOpts=F.call(this),k.formats&&C.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&V.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),O.call(this),k.validateFormats=h}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:I}=this.opts;let h=v;I==="id"&&(h={...v},h.id=h.$id,delete h.$id),T&&k&&this.addMetaSchema(h,h[I],!1)}defaultMeta(){const{meta:k,schemaId:T}=this.opts;return this.opts.defaultMeta=typeof k=="object"?k[T]||k:void 0}validate(k,T){let I;if(typeof k=="string"){if(I=this.getSchema(k),!I)throw new Error(`no schema with key or ref "${k}"`)}else I=this.compile(k);const h=I(T);return"$async"in I||(this.errors=I.errors),h}compile(k,T){const I=this._addSchema(k,T);return I.validate||this._compileSchemaEnv(I)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:I}=this.opts;return h.call(this,k,T);async function h(Y,j){await P.call(this,Y.$schema);const N=this._addSchema(Y,j);return N.validate||R.call(this,N)}async function P(Y){Y&&!this.getSchema(Y)&&await h.call(this,{$ref:Y},!0)}async function R(Y){try{return this._compileSchemaEnv(Y)}catch(j){if(!(j instanceof a.default))throw j;return K.call(this,j),await W.call(this,j.missingSchema),R.call(this,Y)}}function K({missingSchema:Y,missingRef:j}){if(this.refs[Y])throw new Error(`AnySchema ${Y} is loaded but ${j} cannot be resolved`)}async function W(Y){const j=await Z.call(this,Y);this.refs[Y]||await P.call(this,j.$schema),this.refs[Y]||this.addSchema(j,Y,T)}async function Z(Y){const j=this._loading[Y];if(j)return j;try{return await(this._loading[Y]=I(Y))}finally{delete this._loading[Y]}}}addSchema(k,T,I,h=this.opts.validateSchema){if(Array.isArray(k)){for(const R of k)this.addSchema(R,void 0,I,h);return this}let P;if(typeof k=="object"){const{schemaId:R}=this.opts;if(P=k[R],P!==void 0&&typeof P!="string")throw new Error(`schema ${R} must be string`)}return T=(0,m.normalizeId)(T||P),this._checkUnique(T),this.schemas[T]=this._addSchema(k,I,T,h,!0),this}addMetaSchema(k,T,I=this.opts.validateSchema){return this.addSchema(k,T,!0,I),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let I;if(I=k.$schema,I!==void 0&&typeof I!="string")throw new Error("$schema must be a string");if(I=I||this.opts.defaultMeta||this.defaultMeta(),!I)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const h=this.validate(I,k);if(!h&&T){const P="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(P);else throw new Error(P)}return h}getSchema(k){let T;for(;typeof(T=_.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:I}=this.opts,h=new o.SchemaEnv({schema:{},schemaId:I});if(T=o.resolveSchema.call(this,h,k),!T)return;this.refs[k]=T}return T.validate||this._compileSchemaEnv(T)}removeSchema(k){if(k instanceof RegExp)return this._removeAllSchemas(this.schemas,k),this._removeAllSchemas(this.refs,k),this;switch(typeof k){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const T=_.call(this,k);return typeof T=="object"&&this._cache.delete(T.schema),delete this.schemas[k],delete this.refs[k],this}case"object":{const T=k;this._cache.delete(T);let I=k[this.opts.schemaId];return I&&(I=(0,m.normalizeId)(I),delete this.schemas[I],delete this.refs[I]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(k){for(const T of k)this.addKeyword(T);return this}addKeyword(k,T){let I;if(typeof k=="string")I=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=I);else if(typeof k=="object"&&T===void 0){if(T=k,I=T.keyword,Array.isArray(I)&&!I.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,I,T),!T)return(0,d.eachItem)(I,P=>ee.call(this,P)),this;se.call(this,T);const h={...T,type:(0,y.getJSONTypes)(T.type),schemaType:(0,y.getJSONTypes)(T.schemaType)};return(0,d.eachItem)(I,h.type.length===0?P=>ee.call(this,P,h):P=>h.type.forEach(R=>ee.call(this,P,h,R))),this}getKeyword(k){const T=this.RULES.all[k];return typeof T=="object"?T.definition:!!T}removeKeyword(k){const{RULES:T}=this;delete T.keywords[k],delete T.all[k];for(const I of T.rules){const h=I.rules.findIndex(P=>P.keyword===k);h>=0&&I.rules.splice(h,1)}return this}addFormat(k,T){return typeof T=="string"&&(T=new RegExp(T)),this.formats[k]=T,this}errorsText(k=this.errors,{separator:T=", ",dataVar:I="data"}={}){return!k||k.length===0?"No errors":k.map(h=>`${I}${h.instancePath} ${h.message}`).reduce((h,P)=>h+T+P)}$dataMetaSchema(k,T){const I=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const h of T){const P=h.split("/").slice(1);let R=k;for(const K of P)R=R[K];for(const K in I){const W=I[K];if(typeof W!="object")continue;const{$data:Z}=W.definition,Y=R[K];Z&&Y&&(R[K]=he(Y))}}return k}_removeAllSchemas(k,T){for(const I in k){const h=k[I];(!T||T.test(I))&&(typeof h=="string"?delete k[I]:h&&!h.meta&&(this._cache.delete(h.schema),delete k[I]))}}_addSchema(k,T,I,h=this.opts.validateSchema,P=this.opts.addUsedSchema){let R;const{schemaId:K}=this.opts;if(typeof k=="object")R=k[K];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof k!="boolean")throw new Error("schema must be object or boolean")}let W=this._cache.get(k);if(W!==void 0)return W;I=(0,m.normalizeId)(R||I);const Z=m.getSchemaRefs.call(this,k,I);return W=new o.SchemaEnv({schema:k,schemaId:K,meta:T,baseId:I,localRefs:Z}),this._cache.set(W.schema,W),P&&!I.startsWith("#")&&(I&&this._checkUnique(I),this.refs[I]=W),h&&this.validateSchema(k,!0),W}_checkUnique(k){if(this.schemas[k]||this.refs[k])throw new Error(`schema with key or id "${k}" already exists`)}_compileSchemaEnv(k){if(k.meta?this._compileMetaSchema(k):o.compileSchema.call(this,k),!k.validate)throw new Error("ajv implementation error");return k.validate}_compileMetaSchema(k){const T=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,k)}finally{this.opts=T}}}p.ValidationError=n.default,p.MissingRefError=a.default,e.default=p;function b(M,k,T,I="error"){for(const h in M){const P=h;P in k&&this.logger[I](`${T}: option ${h}. ${M[P]}`)}}function _(M){return M=(0,m.normalizeId)(M),this.schemas[M]||this.refs[M]}function O(){const M=this.opts.schemas;if(M)if(Array.isArray(M))this.addSchema(M);else for(const k in M)this.addSchema(M[k],k)}function C(){for(const M in this.opts.formats){const k=this.opts.formats[M];k&&this.addFormat(M,k)}}function V(M){if(Array.isArray(M)){this.addVocabulary(M);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const k in M){const T=M[k];T.keyword||(T.keyword=k),this.addKeyword(T)}}function F(){const M={...this.opts};for(const k of w)delete M[k];return M}const A={log(){},warn(){},error(){}};function z(M){if(M===!1)return A;if(M===void 0)return console;if(M.log&&M.warn&&M.error)return M;throw new Error("logger must implement log, warn and error methods")}const U=/^[a-z_$][a-z0-9_$:-]*$/i;function B(M,k){const{RULES:T}=this;if((0,d.eachItem)(M,I=>{if(T.keywords[I])throw new Error(`Keyword ${I} is already defined`);if(!U.test(I))throw new Error(`Keyword ${I} has invalid name`)}),!!k&&k.$data&&!("code"in k||"validate"in k))throw new Error('$data keyword must have "code" or "validate" function')}function ee(M,k,T){var I;const h=k?.post;if(T&&h)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:P}=this;let R=h?P.post:P.rules.find(({type:W})=>W===T);if(R||(R={type:T,rules:[]},P.rules.push(R)),P.keywords[M]=!0,!k)return;const K={keyword:M,definition:{...k,type:(0,y.getJSONTypes)(k.type),schemaType:(0,y.getJSONTypes)(k.schemaType)}};k.before?ae.call(this,R,K,k.before):R.rules.push(K),P.all[M]=K,(I=k.implements)===null||I===void 0||I.forEach(W=>this.addKeyword(W))}function ae(M,k,T){const I=M.rules.findIndex(h=>h.keyword===T);I>=0?M.rules.splice(I,0,k):(M.rules.push(k),this.logger.warn(`rule ${T} is not defined`))}function se(M){let{metaSchema:k}=M;k!==void 0&&(M.$data&&this.opts.$data&&(k=he(k)),M.validateSchema=this.compile(k,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function he(M){return{anyOf:[M,te]}}}(xt)),xt}var Ge={},Xe={},Ye={},Xr;function oa(){if(Xr)return Ye;Xr=1,Object.defineProperty(Ye,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Ye.default=e,Ye}var Pe={},Yr;function rs(){if(Yr)return Pe;Yr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.callRef=Pe.getValidate=void 0;const e=Ue(),t=ve(),r=x(),n=Se(),a=Mt(),s=Q(),o={keyword:"$ref",schemaType:"string",code(y){const{gen:d,schema:v,it:$}=y,{baseId:S,schemaEnv:w,validateName:g,opts:f,self:l}=$,{root:i}=w;if((v==="#"||v==="#/")&&S===i.baseId)return p();const c=a.resolveRef.call(l,i,S,v);if(c===void 0)throw new e.default($.opts.uriResolver,S,v);if(c instanceof a.SchemaEnv)return b(c);return _(c);function p(){if(w===i)return m(y,g,w,w.$async);const O=d.scopeValue("root",{ref:i});return m(y,(0,r._)`${O}.validate`,i,i.$async)}function b(O){const C=u(y,O);m(y,C,O,O.$async)}function _(O){const C=d.scopeValue("schema",f.code.source===!0?{ref:O,code:(0,r.stringify)(O)}:{ref:O}),V=d.name("valid"),F=y.subschema({schema:O,dataTypes:[],schemaPath:r.nil,topSchemaRef:C,errSchemaPath:v},V);y.mergeEvaluated(F),y.ok(V)}}};function u(y,d){const{gen:v}=y;return d.validate?v.scopeValue("validate",{ref:d.validate}):(0,r._)`${v.scopeValue("wrapper",{ref:d})}.validate`}Pe.getValidate=u;function m(y,d,v,$){const{gen:S,it:w}=y,{allErrors:g,schemaEnv:f,opts:l}=w,i=l.passContext?n.default.this:r.nil;$?c():p();function c(){if(!f.$async)throw new Error("async schema referenced by sync schema");const O=S.let("valid");S.try(()=>{S.code((0,r._)`await ${(0,t.callValidateCode)(y,d,i)}`),_(d),g||S.assign(O,!0)},C=>{S.if((0,r._)`!(${C} instanceof ${w.ValidationError})`,()=>S.throw(C)),b(C),g||S.assign(O,!1)}),y.ok(O)}function p(){y.result((0,t.callValidateCode)(y,d,i),()=>_(d),()=>b(d))}function b(O){const C=(0,r._)`${O}.errors`;S.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${C} : ${n.default.vErrors}.concat(${C})`),S.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(O){var C;if(!w.opts.unevaluated)return;const V=(C=v?.validate)===null||C===void 0?void 0:C.evaluated;if(w.props!==!0)if(V&&!V.dynamicProps)V.props!==void 0&&(w.props=s.mergeEvaluated.props(S,V.props,w.props));else{const F=S.var("props",(0,r._)`${O}.evaluated.props`);w.props=s.mergeEvaluated.props(S,F,w.props,r.Name)}if(w.items!==!0)if(V&&!V.dynamicItems)V.items!==void 0&&(w.items=s.mergeEvaluated.items(S,V.items,w.items));else{const F=S.var("items",(0,r._)`${O}.evaluated.items`);w.items=s.mergeEvaluated.items(S,F,w.items,r.Name)}}}return Pe.callRef=m,Pe.default=o,Pe}var Zr;function ns(){if(Zr)return Xe;Zr=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=oa(),t=rs(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Xe.default=r,Xe}var Ze={},Qe={},Qr;function ua(){if(Qr)return Qe;Qr=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=x(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:s,schemaCode:o})=>(0,e.str)`must be ${r[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0,e._)`{comparison: ${r[s].okStr}, limit: ${o}}`},a={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:o,data:u,schemaCode:m}=s;s.fail$data((0,e._)`${u} ${r[o].fail} ${m} || isNaN(${u})`)}};return Qe.default=a,Qe}var et={},en;function ca(){if(en)return et;en=1,Object.defineProperty(et,"__esModule",{value:!0});const e=x(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:a,data:s,schemaCode:o,it:u}=n,m=u.opts.multipleOfPrecision,y=a.let("res"),d=m?(0,e._)`Math.abs(Math.round(${y}) - ${y}) > 1e-${m}`:(0,e._)`${y} !== parseInt(${y})`;n.fail$data((0,e._)`(${o} === 0 || (${y} = ${s}/${o}, ${d}))`)}};return et.default=r,et}var tt={},rt={},tn;function la(){if(tn)return rt;tn=1,Object.defineProperty(rt,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,a=0,s;for(;a<r;)n++,s=t.charCodeAt(a++),s>=55296&&s<=56319&&a<r&&(s=t.charCodeAt(a),(s&64512)===56320&&a++);return n}return rt.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',rt}var rn;function fa(){if(rn)return tt;rn=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=x(),t=Q(),r=la(),a={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:o}){const u=s==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${o} characters`},params:({schemaCode:s})=>(0,e._)`{limit: ${s}}`},code(s){const{keyword:o,data:u,schemaCode:m,it:y}=s,d=o==="maxLength"?e.operators.GT:e.operators.LT,v=y.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(s.gen,r.default)}(${u})`;s.fail$data((0,e._)`${v} ${d} ${m}`)}};return tt.default=a,tt}var nt={},nn;function da(){if(nn)return nt;nn=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=ve(),t=x(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,t.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,t._)`{pattern: ${a}}`},code(a){const{data:s,$data:o,schema:u,schemaCode:m,it:y}=a,d=y.opts.unicodeRegExp?"u":"",v=o?(0,t._)`(new RegExp(${m}, ${d}))`:(0,e.usePattern)(a,u);a.fail$data((0,t._)`!${v}.test(${s})`)}};return nt.default=n,nt}var st={},sn;function ma(){if(sn)return st;sn=1,Object.defineProperty(st,"__esModule",{value:!0});const e=x(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:o}=n,u=a==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${s}).length ${u} ${o}`)}};return st.default=r,st}var at={},an;function ha(){if(an)return at;an=1,Object.defineProperty(at,"__esModule",{value:!0});const e=ve(),t=x(),r=Q(),a={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,t.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,t._)`{missingProperty: ${s}}`},code(s){const{gen:o,schema:u,schemaCode:m,data:y,$data:d,it:v}=s,{opts:$}=v;if(!d&&u.length===0)return;const S=u.length>=$.loopRequired;if(v.allErrors?w():g(),$.strictRequired){const i=s.parentSchema.properties,{definedProperties:c}=s.it;for(const p of u)if(i?.[p]===void 0&&!c.has(p)){const b=v.schemaEnv.baseId+v.errSchemaPath,_=`required property "${p}" is not defined at "${b}" (strictRequired)`;(0,r.checkStrictMode)(v,_,v.opts.strictRequired)}}function w(){if(S||d)s.block$data(t.nil,f);else for(const i of u)(0,e.checkReportMissingProp)(s,i)}function g(){const i=o.let("missing");if(S||d){const c=o.let("valid",!0);s.block$data(c,()=>l(i,c)),s.ok(c)}else o.if((0,e.checkMissingProp)(s,u,i)),(0,e.reportMissingProp)(s,i),o.else()}function f(){o.forOf("prop",m,i=>{s.setParams({missingProperty:i}),o.if((0,e.noPropertyInData)(o,y,i,$.ownProperties),()=>s.error())})}function l(i,c){s.setParams({missingProperty:i}),o.forOf(i,m,()=>{o.assign(c,(0,e.propertyInData)(o,y,i,$.ownProperties)),o.if((0,t.not)(c),()=>{s.error(),o.break()})},t.nil)}}};return at.default=a,at}var it={},on;function pa(){if(on)return it;on=1,Object.defineProperty(it,"__esModule",{value:!0});const e=x(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:a}){const s=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${a} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:a,data:s,schemaCode:o}=n,u=a==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${s}.length ${u} ${o}`)}};return it.default=r,it}var ot={},ut={},un;function fr(){if(un)return ut;un=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=es();return e.code='require("ajv/dist/runtime/equal").default',ut.default=e,ut}var cn;function ya(){if(cn)return ot;cn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=Nt(),t=x(),r=Q(),n=fr(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:u}})=>(0,t.str)`must NOT have duplicate items (items ## ${u} and ${o} are identical)`,params:({params:{i:o,j:u}})=>(0,t._)`{i: ${o}, j: ${u}}`},code(o){const{gen:u,data:m,$data:y,schema:d,parentSchema:v,schemaCode:$,it:S}=o;if(!y&&!d)return;const w=u.let("valid"),g=v.items?(0,e.getSchemaTypes)(v.items):[];o.block$data(w,f,(0,t._)`${$} === false`),o.ok(w);function f(){const p=u.let("i",(0,t._)`${m}.length`),b=u.let("j");o.setParams({i:p,j:b}),u.assign(w,!0),u.if((0,t._)`${p} > 1`,()=>(l()?i:c)(p,b))}function l(){return g.length>0&&!g.some(p=>p==="object"||p==="array")}function i(p,b){const _=u.name("item"),O=(0,e.checkDataTypes)(g,_,S.opts.strictNumbers,e.DataType.Wrong),C=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${p}--;`,()=>{u.let(_,(0,t._)`${m}[${p}]`),u.if(O,(0,t._)`continue`),g.length>1&&u.if((0,t._)`typeof ${_} == "string"`,(0,t._)`${_} += "_"`),u.if((0,t._)`typeof ${C}[${_}] == "number"`,()=>{u.assign(b,(0,t._)`${C}[${_}]`),o.error(),u.assign(w,!1).break()}).code((0,t._)`${C}[${_}] = ${p}`)})}function c(p,b){const _=(0,r.useFunc)(u,n.default),O=u.name("outer");u.label(O).for((0,t._)`;${p}--;`,()=>u.for((0,t._)`${b} = ${p}; ${b}--;`,()=>u.if((0,t._)`${_}(${m}[${p}], ${m}[${b}])`,()=>{o.error(),u.assign(w,!1).break(O)})))}}};return ot.default=s,ot}var ct={},ln;function ga(){if(ln)return ct;ln=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=x(),t=Q(),r=fr(),a={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0,e._)`{allowedValue: ${s}}`},code(s){const{gen:o,data:u,$data:m,schemaCode:y,schema:d}=s;m||d&&typeof d=="object"?s.fail$data((0,e._)`!${(0,t.useFunc)(o,r.default)}(${u}, ${y})`):s.fail((0,e._)`${d} !== ${u}`)}};return ct.default=a,ct}var lt={},fn;function va(){if(fn)return lt;fn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=x(),t=Q(),r=fr(),a={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0,e._)`{allowedValues: ${s}}`},code(s){const{gen:o,data:u,$data:m,schema:y,schemaCode:d,it:v}=s;if(!m&&y.length===0)throw new Error("enum must have non-empty array");const $=y.length>=v.opts.loopEnum;let S;const w=()=>S??(S=(0,t.useFunc)(o,r.default));let g;if($||m)g=o.let("valid"),s.block$data(g,f);else{if(!Array.isArray(y))throw new Error("ajv implementation error");const i=o.const("vSchema",d);g=(0,e.or)(...y.map((c,p)=>l(i,p)))}s.pass(g);function f(){o.assign(g,!1),o.forOf("v",d,i=>o.if((0,e._)`${w()}(${u}, ${i})`,()=>o.assign(g,!0).break()))}function l(i,c){const p=y[c];return typeof p=="object"&&p!==null?(0,e._)`${w()}(${u}, ${i}[${c}])`:(0,e._)`${u} === ${p}`}}};return lt.default=a,lt}var dn;function ss(){if(dn)return Ze;dn=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=ua(),t=ca(),r=fa(),n=da(),a=ma(),s=ha(),o=pa(),u=ya(),m=ga(),y=va(),d=[e.default,t.default,r.default,n.default,a.default,s.default,o.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},m.default,y.default];return Ze.default=d,Ze}var ft={},Ie={},mn;function as(){if(mn)return Ie;mn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateAdditionalItems=void 0;const e=x(),t=Q(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,e._)`{limit: ${s}}`},code(s){const{parentSchema:o,it:u}=s,{items:m}=o;if(!Array.isArray(m)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}a(s,m)}};function a(s,o){const{gen:u,schema:m,data:y,keyword:d,it:v}=s;v.items=!0;const $=u.const("len",(0,e._)`${y}.length`);if(m===!1)s.setParams({len:o.length}),s.pass((0,e._)`${$} <= ${o.length}`);else if(typeof m=="object"&&!(0,t.alwaysValidSchema)(v,m)){const w=u.var("valid",(0,e._)`${$} <= ${o.length}`);u.if((0,e.not)(w),()=>S(w)),s.ok(w)}function S(w){u.forRange("i",o.length,$,g=>{s.subschema({keyword:d,dataProp:g,dataPropType:t.Type.Num},w),v.allErrors||u.if((0,e.not)(w),()=>u.break())})}}return Ie.validateAdditionalItems=a,Ie.default=n,Ie}var dt={},Ce={},hn;function is(){if(hn)return Ce;hn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.validateTuple=void 0;const e=x(),t=Q(),r=ve(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:o,it:u}=s;if(Array.isArray(o))return a(s,"additionalItems",o);u.items=!0,!(0,t.alwaysValidSchema)(u,o)&&s.ok((0,r.validateArray)(s))}};function a(s,o,u=s.schema){const{gen:m,parentSchema:y,data:d,keyword:v,it:$}=s;g(y),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(m,u.length,$.items));const S=m.name("valid"),w=m.const("len",(0,e._)`${d}.length`);u.forEach((f,l)=>{(0,t.alwaysValidSchema)($,f)||(m.if((0,e._)`${w} > ${l}`,()=>s.subschema({keyword:v,schemaProp:l,dataProp:l},S)),s.ok(S))});function g(f){const{opts:l,errSchemaPath:i}=$,c=u.length,p=c===f.minItems&&(c===f.maxItems||f[o]===!1);if(l.strictTuples&&!p){const b=`"${v}" is ${c}-tuple, but minItems or maxItems/${o} are not specified or different at path "${i}"`;(0,t.checkStrictMode)($,b,l.strictTuples)}}}return Ce.validateTuple=a,Ce.default=n,Ce}var pn;function ba(){if(pn)return dt;pn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=is(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return dt.default=t,dt}var mt={},yn;function _a(){if(yn)return mt;yn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=x(),t=Q(),r=ve(),n=as(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:u,parentSchema:m,it:y}=o,{prefixItems:d}=m;y.items=!0,!(0,t.alwaysValidSchema)(y,u)&&(d?(0,n.validateAdditionalItems)(o,d):o.ok((0,r.validateArray)(o)))}};return mt.default=s,mt}var ht={},gn;function $a(){if(gn)return ht;gn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:a,max:s}})=>s===void 0?(0,e.str)`must contain at least ${a} valid item(s)`:(0,e.str)`must contain at least ${a} and no more than ${s} valid item(s)`,params:({params:{min:a,max:s}})=>s===void 0?(0,e._)`{minContains: ${a}}`:(0,e._)`{minContains: ${a}, maxContains: ${s}}`},code(a){const{gen:s,schema:o,parentSchema:u,data:m,it:y}=a;let d,v;const{minContains:$,maxContains:S}=u;y.opts.next?(d=$===void 0?1:$,v=S):d=1;const w=s.const("len",(0,e._)`${m}.length`);if(a.setParams({min:d,max:v}),v===void 0&&d===0){(0,t.checkStrictMode)(y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(v!==void 0&&d>v){(0,t.checkStrictMode)(y,'"minContains" > "maxContains" is always invalid'),a.fail();return}if((0,t.alwaysValidSchema)(y,o)){let c=(0,e._)`${w} >= ${d}`;v!==void 0&&(c=(0,e._)`${c} && ${w} <= ${v}`),a.pass(c);return}y.items=!0;const g=s.name("valid");v===void 0&&d===1?l(g,()=>s.if(g,()=>s.break())):d===0?(s.let(g,!0),v!==void 0&&s.if((0,e._)`${m}.length > 0`,f)):(s.let(g,!1),f()),a.result(g,()=>a.reset());function f(){const c=s.name("_valid"),p=s.let("count",0);l(c,()=>s.if(c,()=>i(p)))}function l(c,p){s.forRange("i",0,w,b=>{a.subschema({keyword:"contains",dataProp:b,dataPropType:t.Type.Num,compositeRule:!0},c),p()})}function i(c){s.code((0,e._)`${c}++`),v===void 0?s.if((0,e._)`${c} >= ${d}`,()=>s.assign(g,!0).break()):(s.if((0,e._)`${c} > ${v}`,()=>s.assign(g,!1).break()),d===1?s.assign(g,!0):s.if((0,e._)`${c} >= ${d}`,()=>s.assign(g,!0)))}}};return ht.default=n,ht}var sr={},vn;function os(){return vn||(vn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=x(),r=Q(),n=ve();e.error={message:({params:{property:m,depsCount:y,deps:d}})=>{const v=y===1?"property":"properties";return(0,t.str)`must have ${v} ${d} when property ${m} is present`},params:({params:{property:m,depsCount:y,deps:d,missingProperty:v}})=>(0,t._)`{property: ${m},
6
6
  missingProperty: ${v},
7
7
  depsCount: ${y},
8
- deps: ${d}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[y,d]=s(m);o(m,y),u(m,d)}};function s({schema:m}){const y={},d={};for(const v in m){if(v==="__proto__")continue;const $=Array.isArray(m[v])?y:d;$[v]=m[v]}return[y,d]}function o(m,y=m.schema){const{gen:d,data:v,it:$}=m;if(Object.keys(y).length===0)return;const S=d.let("missing");for(const w in y){const g=y[w];if(g.length===0)continue;const f=(0,n.propertyInData)(d,v,w,$.opts.ownProperties);m.setParams({property:w,depsCount:g.length,deps:g.join(", ")}),$.allErrors?d.if(f,()=>{for(const l of g)(0,n.checkReportMissingProp)(m,l)}):(d.if((0,t._)`${f} && (${(0,n.checkMissingProp)(m,g,S)})`),(0,n.reportMissingProp)(m,S),d.else())}}e.validatePropertyDeps=o;function u(m,y=m.schema){const{gen:d,data:v,keyword:$,it:S}=m,w=d.name("valid");for(const g in y)(0,r.alwaysValidSchema)(S,y[g])||(d.if((0,n.propertyInData)(d,v,g,S.opts.ownProperties),()=>{const f=m.subschema({keyword:$,schemaProp:g},w);m.mergeValidEvaluated(f,w)},()=>d.var(w,!0)),m.ok(w))}e.validateSchemaDeps=u,e.default=a}(sr)),sr}var pt={},bn;function wa(){if(bn)return pt;bn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,e._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:o,data:u,it:m}=a;if((0,t.alwaysValidSchema)(m,o))return;const y=s.name("valid");s.forIn("key",u,d=>{a.setParams({propertyName:d}),a.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},y),s.if((0,e.not)(y),()=>{a.error(!0),m.allErrors||s.break()})}),a.ok(y)}};return pt.default=n,pt}var yt={},_n;function us(){if(_n)return yt;_n=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=ve(),t=x(),r=Se(),n=Q(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:u,schema:m,parentSchema:y,data:d,errsCount:v,it:$}=o;if(!v)throw new Error("ajv implementation error");const{allErrors:S,opts:w}=$;if($.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const g=(0,e.allSchemaProperties)(y.properties),f=(0,e.allSchemaProperties)(y.patternProperties);l(),o.ok((0,t._)`${v} === ${r.default.errors}`);function l(){u.forIn("key",d,_=>{!g.length&&!f.length?p(_):u.if(i(_),()=>p(_))})}function i(_){let O;if(g.length>8){const C=(0,n.schemaRefOrVal)($,y.properties,"properties");O=(0,e.isOwnProperty)(u,C,_)}else g.length?O=(0,t.or)(...g.map(C=>(0,t._)`${_} === ${C}`)):O=t.nil;return f.length&&(O=(0,t.or)(O,...f.map(C=>(0,t._)`${(0,e.usePattern)(o,C)}.test(${_})`))),(0,t.not)(O)}function c(_){u.code((0,t._)`delete ${d}[${_}]`)}function p(_){if(w.removeAdditional==="all"||w.removeAdditional&&m===!1){c(_);return}if(m===!1){o.setParams({additionalProperty:_}),o.error(),S||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const O=u.name("valid");w.removeAdditional==="failing"?(b(_,O,!1),u.if((0,t.not)(O),()=>{o.reset(),c(_)})):(b(_,O),S||u.if((0,t.not)(O),()=>u.break()))}}function b(_,O,C){const V={keyword:"additionalProperties",dataProp:_,dataPropType:n.Type.Str};C===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(V,O)}}};return yt.default=s,yt}var gt={},$n;function Sa(){if($n)return gt;$n=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Le(),t=ve(),r=Q(),n=us(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:o,schema:u,parentSchema:m,data:y,it:d}=s;d.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(d,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(u);for(const f of v)d.definedProperties.add(f);d.opts.unevaluated&&v.length&&d.props!==!0&&(d.props=r.mergeEvaluated.props(o,(0,r.toHash)(v),d.props));const $=v.filter(f=>!(0,r.alwaysValidSchema)(d,u[f]));if($.length===0)return;const S=o.name("valid");for(const f of $)w(f)?g(f):(o.if((0,t.propertyInData)(o,y,f,d.opts.ownProperties)),g(f),d.allErrors||o.else().var(S,!0),o.endIf()),s.it.definedProperties.add(f),s.ok(S);function w(f){return d.opts.useDefaults&&!d.compositeRule&&u[f].default!==void 0}function g(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},S)}}};return gt.default=a,gt}var vt={},wn;function Pa(){if(wn)return vt;wn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=ve(),t=x(),r=Q(),n=Q(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:o,schema:u,data:m,parentSchema:y,it:d}=s,{opts:v}=d,$=(0,e.allSchemaProperties)(u),S=$.filter(p=>(0,r.alwaysValidSchema)(d,u[p]));if($.length===0||S.length===$.length&&(!d.opts.unevaluated||d.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&y.properties,g=o.name("valid");d.props!==!0&&!(d.props instanceof t.Name)&&(d.props=(0,n.evaluatedPropsToName)(o,d.props));const{props:f}=d;l();function l(){for(const p of $)w&&i(p),d.allErrors?c(p):(o.var(g,!0),c(p),o.if(g))}function i(p){for(const b in w)new RegExp(p).test(b)&&(0,r.checkStrictMode)(d,`property ${b} matches pattern ${p} (use allowMatchingProperties)`)}function c(p){o.forIn("key",m,b=>{o.if((0,t._)`${(0,e.usePattern)(s,p)}.test(${b})`,()=>{const _=S.includes(p);_||s.subschema({keyword:"patternProperties",schemaProp:p,dataProp:b,dataPropType:n.Type.Str},g),d.opts.unevaluated&&f!==!0?o.assign((0,t._)`${f}[${b}]`,!0):!_&&!d.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return vt.default=a,vt}var bt={},Sn;function Ea(){if(Sn)return bt;Sn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Q(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:a,it:s}=r;if((0,e.alwaysValidSchema)(s,a)){r.fail();return}const o=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return bt.default=t,bt}var _t={},Pn;function Oa(){if(Pn)return _t;Pn=1,Object.defineProperty(_t,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ve().validateUnion,error:{message:"must match a schema in anyOf"}};return _t.default=t,_t}var $t={},En;function ja(){if(En)return $t;En=1,Object.defineProperty($t,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,e._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:o,parentSchema:u,it:m}=a;if(!Array.isArray(o))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const y=o,d=s.let("valid",!1),v=s.let("passing",null),$=s.name("_valid");a.setParams({passing:v}),s.block(S),a.result(d,()=>a.reset(),()=>a.error(!0));function S(){y.forEach((w,g)=>{let f;(0,t.alwaysValidSchema)(m,w)?s.var($,!0):f=a.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},$),g>0&&s.if((0,e._)`${$} && ${d}`).assign(d,!1).assign(v,(0,e._)`[${v}, ${g}]`).else(),s.if($,()=>{s.assign(d,!0),s.assign(v,g),f&&a.mergeEvaluated(f,e.Name)})})}}};return $t.default=n,$t}var wt={},On;function ka(){if(On)return wt;On=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Q(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:a,it:s}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");const o=n.name("valid");a.forEach((u,m)=>{if((0,e.alwaysValidSchema)(s,u))return;const y=r.subschema({keyword:"allOf",schemaProp:m},o);r.ok(o),r.mergeEvaluated(y)})}};return wt.default=t,wt}var St={},jn;function Na(){if(jn)return St;jn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:u,it:m}=s;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const y=a(m,"then"),d=a(m,"else");if(!y&&!d)return;const v=o.let("valid",!0),$=o.name("_valid");if(S(),s.reset(),y&&d){const g=o.let("ifClause");s.setParams({ifClause:g}),o.if($,w("then",g),w("else",g))}else y?o.if($,w("then")):o.if((0,e.not)($),w("else"));s.pass(v,()=>s.error(!0));function S(){const g=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);s.mergeEvaluated(g)}function w(g,f){return()=>{const l=s.subschema({keyword:g},$);o.assign(v,$),s.mergeValidEvaluated(l,v),f?o.assign(f,(0,e._)`${g}`):s.setParams({ifClause:g})}}}};function a(s,o){const u=s.schema[o];return u!==void 0&&!(0,t.alwaysValidSchema)(s,u)}return St.default=n,St}var Pt={},kn;function Ra(){if(kn)return Pt;kn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=Q(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:a}){n.if===void 0&&(0,e.checkStrictMode)(a,`"${r}" without "if" is ignored`)}};return Pt.default=t,Pt}var Nn;function cs(){if(Nn)return ft;Nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=as(),t=ba(),r=is(),n=_a(),a=$a(),s=os(),o=wa(),u=us(),m=Sa(),y=Pa(),d=Ea(),v=Oa(),$=ja(),S=ka(),w=Na(),g=Ra();function f(l=!1){const i=[d.default,v.default,$.default,S.default,w.default,g.default,o.default,u.default,s.default,m.default,y.default];return l?i.push(t.default,n.default):i.push(e.default,r.default),i.push(a.default),i}return ft.default=f,ft}var Et={},Ot={},Rn;function Ia(){if(Rn)return Ot;Rn=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=x(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,a){const{gen:s,data:o,$data:u,schema:m,schemaCode:y,it:d}=n,{opts:v,errSchemaPath:$,schemaEnv:S,self:w}=d;if(!v.validateFormats)return;u?g():f();function g(){const l=s.scopeValue("formats",{ref:w.formats,code:v.code.formats}),i=s.const("fDef",(0,e._)`${l}[${y}]`),c=s.let("fType"),p=s.let("format");s.if((0,e._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>s.assign(c,(0,e._)`${i}.type || "string"`).assign(p,(0,e._)`${i}.validate`),()=>s.assign(c,(0,e._)`"string"`).assign(p,i)),n.fail$data((0,e.or)(b(),_()));function b(){return v.strictSchema===!1?e.nil:(0,e._)`${y} && !${p}`}function _(){const O=S.$async?(0,e._)`(${i}.async ? await ${p}(${o}) : ${p}(${o}))`:(0,e._)`${p}(${o})`,C=(0,e._)`(typeof ${p} == "function" ? ${O} : ${p}.test(${o}))`;return(0,e._)`${p} && ${p} !== true && ${c} === ${a} && !${C}`}}function f(){const l=w.formats[m];if(!l){b();return}if(l===!0)return;const[i,c,p]=_(l);i===a&&n.pass(O());function b(){if(v.strictSchema===!1){w.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function _(C){const V=C instanceof RegExp?(0,e.regexpCode)(C):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(m)}`:void 0,F=s.scopeValue("formats",{key:m,ref:C,code:V});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,e._)`${F}.validate`]:["string",C,F]}function O(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!S.$async)throw new Error("async format in sync schema");return(0,e._)`await ${p}(${o})`}return typeof c=="function"?(0,e._)`${p}(${o})`:(0,e._)`${p}.test(${o})`}}}};return Ot.default=r,Ot}var In;function ls(){if(In)return Et;In=1,Object.defineProperty(Et,"__esModule",{value:!0});const t=[Ia().default];return Et.default=t,Et}var ke={},Cn;function fs(){return Cn||(Cn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.contentVocabulary=ke.metadataVocabulary=void 0,ke.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ke.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ke}var An;function ds(){if(An)return Ge;An=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=ns(),t=ss(),r=cs(),n=ls(),a=fs(),s=[e.default,t.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return Ge.default=s,Ge}var jt={},Me={},Tn;function Ca(){if(Tn)return Me;Tn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.DiscrError=void 0;var e;return function(t){t.Tag="tag",t.Mapping="mapping"}(e||(Me.DiscrError=e={})),Me}var qn;function ms(){if(qn)return jt;qn=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=x(),t=Ca(),r=Mt(),n=Ue(),a=Q(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:y}})=>(0,e._)`{error: ${u}, tag: ${y}, tagValue: ${m}}`},code(u){const{gen:m,data:y,schema:d,parentSchema:v,it:$}=u,{oneOf:S}=v;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=d.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!S)throw new Error("discriminator: requires oneOf keyword");const g=m.let("valid",!1),f=m.const("tag",(0,e._)`${y}${(0,e.getProperty)(w)}`);m.if((0,e._)`typeof ${f} == "string"`,()=>l(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:f,tagName:w})),u.ok(g);function l(){const p=c();m.if(!1);for(const b in p)m.elseIf((0,e._)`${f} === ${b}`),m.assign(g,i(p[b]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:f,tagName:w}),m.endIf()}function i(p){const b=m.name("valid"),_=u.subschema({keyword:"oneOf",schemaProp:p},b);return u.mergeEvaluated(_,e.Name),b}function c(){var p;const b={},_=C(v);let O=!0;for(let A=0;A<S.length;A++){let z=S[A];if(z?.$ref&&!(0,a.schemaHasRulesButRef)(z,$.self.RULES)){const B=z.$ref;if(z=r.resolveRef.call($.self,$.schemaEnv.root,$.baseId,B),z instanceof r.SchemaEnv&&(z=z.schema),z===void 0)throw new n.default($.opts.uriResolver,$.baseId,B)}const U=(p=z?.properties)===null||p===void 0?void 0:p[w];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);O=O&&(_||C(z)),V(U,A)}if(!O)throw new Error(`discriminator: "${w}" must be required`);return b;function C({required:A}){return Array.isArray(A)&&A.includes(w)}function V(A,z){if(A.const)F(A.const,z);else if(A.enum)for(const U of A.enum)F(U,z);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function F(A,z){if(typeof A!="string"||A in b)throw new Error(`discriminator: "${w}" values must be unique strings`);b[A]=z}}}};return jt.default=o,jt}const Aa="http://json-schema.org/draft-07/schema#",Ta="http://json-schema.org/draft-07/schema#",qa="Core schema meta-schema",Va={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ma=["object","boolean"],Da={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},za={$schema:Aa,$id:Ta,title:qa,definitions:Va,type:Ma,properties:Da,default:!0};var Vn;function hs(){return Vn||(Vn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ts(),n=ds(),a=ms(),s=za,o=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(w,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var y=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var d=x();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var v=Vt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return v.default}});var $=Ue();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})}(Je,Je.exports)),Je.exports}var Mn;function Fa(){return Mn||(Mn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=hs(),r=x(),n=r.operators,a={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:({keyword:u,schemaCode:m})=>(0,r.str)`should be ${a[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,r._)`{comparison: ${a[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:m,data:y,schemaCode:d,keyword:v,it:$}=u,{opts:S,self:w}=$;if(!S.validateFormats)return;const g=new t.KeywordCxt($,w.RULES.all.format.definition,"format");g.$data?f():l();function f(){const c=m.scopeValue("formats",{ref:w.formats,code:S.code.formats}),p=m.const("fmt",(0,r._)`${c}[${g.schemaCode}]`);u.fail$data((0,r.or)((0,r._)`typeof ${p} != "object"`,(0,r._)`${p} instanceof RegExp`,(0,r._)`typeof ${p}.compare != "function"`,i(p)))}function l(){const c=g.schema,p=w.formats[c];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${v}": format "${c}" does not define "compare" function`);const b=m.scopeValue("formats",{key:c,ref:p,code:S.code.formats?(0,r._)`${S.code.formats}${(0,r.getProperty)(c)}`:void 0});u.fail$data(i(b))}function i(c){return(0,r._)`${c}.compare(${y}, ${d}) ${a[v].fail} 0`}},dependencies:["format"]};const o=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=o}(Ht)),Ht}var Dn;function La(){return Dn||(Dn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ks(),n=Fa(),a=x(),s=new a.Name("fullFormats"),o=new a.Name("fastFormats"),u=(y,d={keywords:!0})=>{if(Array.isArray(d))return m(y,d,r.fullFormats,s),y;const[v,$]=d.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s],S=d.formats||r.formatNames;return m(y,S,v,$),d.keywords&&(0,n.default)(y),y};u.get=(y,d="full")=>{const $=(d==="fast"?r.fastFormats:r.fullFormats)[y];if(!$)throw new Error(`Unknown format "${y}"`);return $};function m(y,d,v,$){var S,w;(S=(w=y.opts.code).formats)!==null&&S!==void 0||(w.formats=(0,a._)`require("ajv-formats/dist/formats").${$}`);for(const g of d)y.addFormat(g,v[g])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u}(Ke,Ke.exports)),Ke.exports}var Ua=La();const Ka=lr(Ua);function dr(e){return e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function ps(e){const t=dr(e.instancePath||"");if(e.keyword==="required"){const r=e.params.missingProperty;if(r!=null)return[...t,r]}if(e.keyword==="additionalProperties"){const r=e.params.additionalProperty;if(r!=null)return[...t,r]}if(e.keyword==="unevaluatedProperties"){const r=e.params.unevaluatedProperty;if(r!=null)return[...t,r]}return t.length>0?t:void 0}function ys(e){return e.message??`${e.keyword} validation failed`}function gs(e){return e.reduce((t,r)=>{const n=ps(r);if(n==null)return t;let a=t;for(const s of n){const o=s;a.dependencies==null&&(a.dependencies={}),a.dependencies[o]==null&&(a.dependencies[o]={}),a=a.dependencies[o]}return a.message=ys(r),t},{})}function Dt(e){const t=gs(e);return D.a.invalid(t)}function Ja(e){const t={keyword:"x:ui",schemaType:["string","object"],errors:!1,validate:()=>!0};e.addKeyword(t)}let Rt=new WeakMap;function Wa(){Rt=new WeakMap}function Ba(e){Rt.delete(e)}function Ha(){return{ajvInstances:0}}function zt(e,t){let r=Rt.get(e);r==null&&(r=new WeakMap,Rt.set(e,r));const n=r.get(t);if(n)return n;const a=e.compile(t);return r.set(t,a),a}async function zn(e,t,r){const n=(await(()=>{switch(e){case"2020-12":return Promise.resolve().then(()=>require("./2020-gUs7l1CJ.cjs")).then(s=>s._2020);case"2019-09":return Promise.resolve().then(()=>require("./2019-BFDr925O.cjs")).then(s=>s._2019);case"draft-07":return Promise.resolve().then(()=>Yi)}})()).default,a=new n({meta:r,strictSchema:!1,allErrors:!0,removeAdditional:t});switch(e){case"2020-12":a.opts.defaultMeta="https://json-schema.org/draft/2020-12/schema";break;case"2019-09":a.opts.defaultMeta="https://json-schema.org/draft/2019-09/schema";break;case"draft-07":a.opts.defaultMeta="http://json-schema.org/draft-07/schema#";break}return Ka(a),Ja(a),a}function xa(e){return e==null||e.includes("draft/2020-12")?"2020-12":e.includes("draft/2019-09")?"2019-09":"draft-07"}function Ga(e){const t=e.indexOf("#");return t>=0?e.slice(0,t):e}function or(e,t=!0){if(Array.isArray(e))return e.map(r=>or(r,!1));if(e!=null&&typeof e=="object"){const r=e,n={};for(const[a,s]of Object.entries(r))!t&&(a==="$id"||a==="$schema"||a==="$dynamicAnchor")||(n[a]=or(s,!1));return n}return e}function Fn(e){const t=new Set,r=n=>{if(n!=null){if(Array.isArray(n)){for(const a of n)r(a);return}if(typeof n=="object"){const a=n,s=a.$ref;typeof s=="string"&&s.length>0&&s[0]!=="#"&&t.add(Ga(s));for(const o of Object.values(a))r(o)}}};return r(e),[...t]}function vs(e,t){for(const r of t){const n=r.$id;if(typeof n=="string"&&n.length>0&&!e.getSchema(n))try{e.addSchema(r)}catch{}}}async function Xa(e,t,r,n){if(r==null)return null;const a=new Set;if(n&&n.length>0)for(const u of n){const m=u.$id;typeof m=="string"&&m.length>0&&a.add(m)}const s=[],o=5;for(let u=0;u<o;u++){const m=Fn(t),y=s.flatMap($=>Fn($)),d=new Set([...m,...y]),v=[];for(const $ of d)if(!a.has($)){if(e.getSchema($)){a.add($);continue}v.push($)}if(v.length===0)return null;try{const $=await r(v);if(!Array.isArray($)||$.length===0)return null;vs(e,$);for(const S of $){const w=S.$id;typeof w=="string"&&w.length>0&&(a.add(w),s.push(S))}}catch($){return`refResolver failed: ${$ instanceof Error?$.message:String($)}`}}return"refResolver reached iteration limit while resolving external $refs"}async function bs(e,t){try{const r=xa(e.$schema),n=t?.sanitizeAdditional===!1?!1:t?.sanitizeAdditional??!1,a=d=>typeof d=="string"&&d.endsWith("#")?d.slice(0,-1):d??"",s=e.$id,o=a(s);if(o!==""&&new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft-07/schema"]).has(o)){const d=await zn(r,n,!1),v=or(e);try{d.addMetaSchema(v)}catch{}const $=d.getSchema(s??o)??d.compile(v);return{ok:!0,value:{ajv:d,validate:$}}}const m=await zn(r,n,!0);if(t?.externalSchemas&&t.externalSchemas.length>0&&vs(m,t.externalSchemas),t?.refResolver){const d=await Xa(m,e,t.refResolver,t.externalSchemas);if(d!=null)return{ok:!1,error:d}}const y=m.compile(e);return{ok:!0,value:{ajv:m,validate:y}}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}class Ft{schema;definition;horizontal;path;ajv;isPropertyRequired;suppressLabel;schemaConflicts;notViolations;constructor(t){const{schema:r,definition:n,horizontal:a,path:s,ajv:o,isPropertyRequired:u,suppressLabel:m,schemaConflicts:y,notViolations:d}=t;this.schema=r,this.definition=n,this.horizontal=a,this.path=s,this.ajv=o,this.isPropertyRequired=u??!1,this.suppressLabel=m??!1,this.schemaConflicts=y??[],this.notViolations=d??[]}with=t=>new Ft({schema:t.schema??this.schema,definition:t.definition??this.definition,horizontal:t.horizontal??this.horizontal,path:t.path??this.path,ajv:t.ajv??this.ajv,isPropertyRequired:t.isPropertyRequired??this.isPropertyRequired,suppressLabel:t.suppressLabel??this.suppressLabel,schemaConflicts:t.schemaConflicts??this.schemaConflicts,notViolations:t.notViolations??this.notViolations});append=t=>this.with({path:[...this.path,t]});get isRoot(){return this.path.length===0}get name(){const t=this.path[this.path.length-1];if(typeof t=="string")return t}get widgetName(){return this.path.map(String).join(".")}get widgetLabel(){const t=this.name;return(typeof this.definition=="object"&&this.definition!==null?this.definition.title:void 0)??(t!=null?J._t(J.gt(t)):void 0)}hasRequiredProperty=t=>typeof this.definition=="boolean"?!1:this.definition.required!=null&&this.definition.required.includes(t);get nullable(){return this.definition.nullable??!1}get isNullable(){return this.nullable||this.hasType("null")||this.hasEnumValue(null)||this.hasConstValue(null)||(this.anyOf?.some(t=>t.isNullable)??!1)||(this.oneOf?.some(t=>t.isNullable)??!1)}get isOptional(){return!this.isPropertyRequired}get shouldShowPresenceToggle(){return!(!this.isOptional||this.isRoot||(this.isNullable||this.isOptional)&&this.isPrimitive)}get isPrimitive(){if(typeof this.definition=="boolean")return!1;const t=this.definition;if(t.const!==void 0||t.enum!==void 0)return!0;if(t.type){const r=Array.isArray(t.type)?t.type:[t.type],n=["string","number","integer","boolean"];return r.every(a=>n.includes(a))}return!1}get isReadOnly(){return typeof this.definition=="boolean"?!1:!!this.definition.readOnly}get isWriteOnly(){return typeof this.definition=="boolean"?!1:!!this.definition.writeOnly}get isDeprecated(){return typeof this.definition=="boolean"?!1:!!this.definition.deprecated}get shouldIgnoreReadOnly(){if(typeof this.definition=="boolean")return!1;const t=this.definition["x:ui"];return t&&typeof t=="object"?!!t.ignoreReadOnly:!1}get shouldShowWriteOnly(){if(typeof this.definition=="boolean")return!1;const t=this.definition["x:ui"];return t&&typeof t=="object"?!!t.showWriteOnly:!1}get anyOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.anyOf)?this.definition.anyOf.map(t=>this.with({definition:t})):void 0}get oneOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.oneOf)?this.definition.oneOf.map(t=>this.with({definition:t})):void 0}get allOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.allOf)?this.definition.allOf.map(t=>this.with({definition:t})):void 0}hasType=t=>this.definition===!0?!0:this.definition===!1?!1:Array.isArray(this.definition.type)?this.definition.type.includes(t):this.definition.type===t;hasEnumValue=t=>typeof this.definition=="boolean"?!1:Array.isArray(this.definition.enum)?this.definition.enum.includes(t):!1;hasConstValue=t=>typeof this.definition=="boolean"?!1:this.definition.const===t;get description(){if(typeof this.definition!="boolean")return this.definition.description}get examples(){if(typeof this.definition!="boolean")return this.definition.examples}get default(){if(typeof this.definition!="boolean")return this.definition.default}}function Ya(e,t){if(typeof e=="boolean"||typeof t=="boolean")return t;const r={...e};for(const[n,a]of Object.entries(t))n==="required"&&Array.isArray(e.required)&&Array.isArray(a)?r.required=[...new Set([...e.required,...a])]:n==="properties"&&e.properties&&typeof a=="object"&&a!=null?r.properties={...e.properties,...a}:r[n]=a;return r}function Za(e,t){if(typeof e=="boolean"||typeof t=="boolean")return e===t;const r=e.type,n=t.type;return!(r!=null&&n!=null&&r!==n||r==="string"&&n==="string"&&(e.minLength!=null&&t.maxLength!=null&&e.minLength>t.maxLength||e.maxLength!=null&&t.minLength!=null&&e.maxLength<t.minLength)||(r==="number"||r==="integer")&&(n==="number"||n==="integer")&&(e.minimum!=null&&t.maximum!=null&&e.minimum>t.maximum||e.maximum!=null&&t.minimum!=null&&e.maximum<t.minimum))}function Qa(e,t,r,n){if(typeof t=="boolean"||typeof r=="boolean")return{path:n,message:`Property "${e}" has conflicting boolean schema definitions in allOf branches`,conflictingValues:[t,r]};const a=t.type,s=r.type;if(a!=null&&s!=null&&a!==s){const o=Array.isArray(a)?a:[a],u=Array.isArray(s)?s:[s];return{path:n,message:`Property "${e}" has conflicting types: ${o.join("|")} vs ${u.join("|")}`,conflictingValues:[t,r]}}if(a===s&&a==="string"){const o=[];if(t.minLength!=null&&r.maxLength!=null&&t.minLength>r.maxLength&&o.push(`minLength ${t.minLength} > maxLength ${r.maxLength}`),t.maxLength!=null&&r.minLength!=null&&t.maxLength<r.minLength&&o.push(`maxLength ${t.maxLength} < minLength ${r.minLength}`),o.length>0)return{path:n,message:`Property "${e}" has conflicting string constraints: ${o.join(", ")}`,conflictingValues:[t,r]}}if(a===s&&(a==="number"||a==="integer")){const o=[];if(t.minimum!=null&&r.maximum!=null&&t.minimum>r.maximum&&o.push(`minimum ${t.minimum} > maximum ${r.maximum}`),t.maximum!=null&&r.minimum!=null&&t.maximum<r.minimum&&o.push(`maximum ${t.maximum} < minimum ${r.minimum}`),o.length>0)return{path:n,message:`Property "${e}" has conflicting numeric constraints: ${o.join(", ")}`,conflictingValues:[t,r]}}return Za(t,r)?null:{path:n,message:`Property "${e}" has conflicting definitions in allOf branches`,conflictingValues:[t,r]}}function Lt(e,t=[]){const r=[],n={},a=[],s=[],o={};for(const u of e){if(u.type!=null){const l=Array.isArray(u.type)?u.type:[u.type],i=new Set(l.map(c=>c));i.has("number")&&i.add("integer"),a.push(i)}if(Array.isArray(u.required)&&s.push(...u.required),u.properties!=null)for(const[l,i]of Object.entries(u.properties)){if(o[l]!=null&&o[l]!==i){const c=o[l],p=Qa(l,c,i,[...t,"properties",l]);p!=null&&r.push(p)}o[l]!=null?o[l]=Ya(o[l],i):o[l]=i}const{type:m,required:y,properties:d,allOf:v,additionalProperties:$,patternProperties:S,minProperties:w,maxProperties:g,...f}=u;$!=null&&n.additionalProperties!=null&&n.additionalProperties!==$&&r.push({path:[...t,"additionalProperties"],message:`Conflicting additionalProperties values in allOf: ${n.additionalProperties} vs ${$}`,conflictingValues:[n.additionalProperties,$]}),w!=null&&n.maxProperties!=null&&w>n.maxProperties&&r.push({path:[...t,"minProperties"],message:`minProperties ${w} conflicts with existing maxProperties ${n.maxProperties}`,conflictingValues:[w,n.maxProperties]}),g!=null&&n.minProperties!=null&&g<n.minProperties&&r.push({path:[...t,"maxProperties"],message:`maxProperties ${g} conflicts with existing minProperties ${n.minProperties}`,conflictingValues:[g,n.minProperties]}),Object.assign(n,f),$!=null&&(n.additionalProperties=$),S!=null&&(n.patternProperties=S),w!=null&&(n.minProperties=w),g!=null&&(n.maxProperties=g)}if(a.length>0){let u=null;for(const y of a)if(u==null)u=new Set(y);else{const d=new Set;for(const v of u)y.has(v)&&d.add(v);u=d}const m=Array.from(u??[]);if(m.length===0){const y=a.map(d=>Array.from(d));r.push({path:[...t,"type"],message:"Incompatible types in allOf (no common types)",conflictingValues:y})}else m.length===1?n.type=m[0]:n.type=m}return s.length>0&&(n.required=[...new Set(s)]),Object.keys(o).length>0&&(n.properties=o),{mergedSchema:n,conflicts:r}}function _s(e,t,r,n=[]){if(!r)return null;try{if(zt(r,e)(t)){const o=e.title||"disallowed schema";return{path:n,message:`Value matches ${o}`,notSchema:e}}return null}catch{return null}}function $s(e,t,r,n=[]){const a=[],s=[],o=mr(e,t,r);o&&a.push(o);const u=Array.isArray(e.required)?[...e.required]:[];if(typeof t=="object"&&t!=null&&!Array.isArray(t)){const v=t,$=e.dependentRequired;if($){for(const[g,f]of Object.entries($))if(Object.prototype.hasOwnProperty.call(v,g))for(const l of f)u.push(l)}const S=e.dependencies;if(S){for(const[g,f]of Object.entries(S))if(Object.prototype.hasOwnProperty.call(v,g))if(Array.isArray(f))for(const l of f)u.push(l);else typeof f=="object"&&f&&a.push(f)}const w=e.dependentSchemas;if(w)for(const[g,f]of Object.entries(w))Object.prototype.hasOwnProperty.call(v,g)&&a.push(f)}const m=[e,...a],{mergedSchema:y,conflicts:d}=Lt(m,n);if(u.length>0){const v=new Set([...y.required??[],...u]);y.required=[...v]}return s.push(...d),{effective:y,conflicts:s}}function mr(e,t,r){if(!r||!e.if||typeof e.if!="object")return null;try{if(zt(r,e.if)(t)){const s=e.then;if(s&&typeof s=="object")return s}else{const s=e.else;if(s&&typeof s=="object")return s}}catch{}return null}function Ae(e,t,r){const n=new Set;if(!t||typeof t!="object")return n;if(e.properties&&Object.keys(e.properties).forEach(o=>{o in t&&n.add(o)}),e.patternProperties&&Object.keys(t).forEach(o=>{Object.keys(e.patternProperties).forEach(u=>{try{new RegExp(u).test(o)&&n.add(o)}catch{}})}),e.additionalProperties===!0||e.additionalProperties&&typeof e.additionalProperties=="object"){const o=new Set;e.properties&&Object.keys(e.properties).forEach(u=>{u in t&&o.add(u)}),e.patternProperties&&Object.keys(t).forEach(u=>{Object.keys(e.patternProperties).forEach(m=>{try{new RegExp(m).test(u)&&o.add(u)}catch{}})}),Object.keys(t).forEach(u=>{o.has(u)||n.add(u)})}e.allOf&&e.allOf.forEach(o=>{typeof o=="object"&&Ae(o,t,r).forEach(m=>n.add(m))});const a=mr(e,t,r);a&&Ae(a,t,r).forEach(u=>n.add(u));const s=e.dependentSchemas;return s&&Object.keys(s).forEach(o=>{if(o in t){const u=s[o];typeof u=="object"&&Ae(u,t,r).forEach(y=>n.add(y))}}),e.dependencies&&Object.keys(e.dependencies).forEach(o=>{if(o in t){const u=e.dependencies[o];typeof u=="object"&&!Array.isArray(u)&&Ae(u,t,r).forEach(y=>n.add(y))}}),n}function we({ctx:e}){const{examples:t,default:r}=e;let{description:n}=e;n==null&&t!=null&&r!=null&&(Array.isArray(t)?n=`example: ${t[0]}`:n=`example: ${t}`);const a=[];if(e.isDeprecated&&a.push("deprecated"),e.isReadOnly&&!e.shouldIgnoreReadOnly&&a.push("read-only"),e.isWriteOnly&&!e.shouldShowWriteOnly&&a.push("write-only"),a.length>0){const s=`(${a.join(", ")})`;n=n?`${n} ${s}`:s}return{label:e.suppressLabel?void 0:e.widgetLabel,description:n,required:e.isPropertyRequired,layout:e.horizontal?"horizontal":"vertical"}}function De(e,t){if(e.default!=null)return t(e.default);if(Array.isArray(e.examples))return t(e.examples[0]);if(e.examples!=null)return t(e.examples)}function ws(e){return e==null?1:Math.round(e)}function Ss(e){const{options:t,selected:r,onChange:n,mode:a="auto",size:s="sm",keyFor:o=d=>String(d),parseKey:u=d=>d}=e,m=t.length;if((a==="auto"?m<=3?"segmented":"select":a)==="segmented"){const d=Object.fromEntries(t.map(v=>[o(v.value),v.label]));return J.SegmentedInput({options:d,value:E.Value.map(r,v=>o(v)),onChange:v=>n(u(v)),size:s})}return J.NativeSelect({options:t.map(d=>({type:"value",value:d.value,label:d.label})),value:r,onChange:n})}function Ps({ctx:e,showSelector:t,selector:r,inner:n}){return e.isRoot?t?D.Stack(E.attr.class("bc-stack--gap-2"),r,n):n:D.InputWrapper({...we({ctx:e}),content:t?D.Stack(E.attr.class("bc-stack--gap-2 bc-stack--align-start"),r,n):n})}function ei(e,t){if(e===null)return t.includes("null")?"null":null;switch(typeof e){case"string":return t.includes("string")?"string":null;case"number":return Number.isInteger(e)&&t.includes("integer")?"integer":t.includes("number")?"number":null;case"boolean":return t.includes("boolean")?"boolean":null;case"object":return Array.isArray(e)?t.includes("array")?"array":null:t.includes("object")?"object":null;default:return null}}function ti(e,t){try{switch(t){case"string":return e==null?{ok:!0,value:void 0}:{ok:!0,value:String(e)};case"number":{if(typeof e=="number")return{ok:!0,value:e};if(typeof e=="string"){const r=Number(e);return Number.isFinite(r)?{ok:!0,value:r}:{ok:!1}}return typeof e=="boolean"?{ok:!0,value:e?1:0}:{ok:!1}}case"integer":return typeof e=="number"&&Number.isInteger(e)?{ok:!0,value:e}:typeof e=="string"?/^[-+]?\d+$/.test(e.trim())?{ok:!0,value:parseInt(e,10)}:{ok:!1}:typeof e=="boolean"?{ok:!0,value:e?1:0}:{ok:!1};case"boolean":{if(typeof e=="boolean")return{ok:!0,value:e};if(typeof e=="string"){const r=e.trim().toLowerCase();return r==="true"||r==="1"||r==="yes"?{ok:!0,value:!0}:r==="false"||r==="0"||r==="no"?{ok:!0,value:!1}:{ok:!1}}return typeof e=="number"?{ok:!0,value:e!==0}:{ok:!1}}case"array":return Array.isArray(e)?{ok:!0,value:e}:{ok:!1};case"object":return e!=null&&typeof e=="object"&&!Array.isArray(e)?{ok:!0,value:e}:{ok:!1};case"null":return{ok:!0,value:null}}}catch{return{ok:!1}}}function ri(e){switch(e){case"null":return null;case"array":return[];case"object":return{};default:return}}function ni(e){if(typeof e=="boolean")return{};const t=e["x:ui"];if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const r=t;return{unionDefault:typeof r.unionDefault=="string"?r.unionDefault:void 0,confirmBranchChange:!!r.confirmBranchChange,selector:r.selector==="segmented"||r.selector==="select"?r.selector:void 0}}return{}}const ar=["description","comment","notes","text"];function si(e){if(typeof e=="boolean")return ar;const t=e["x:ui"];return t&&Array.isArray(t.textAreaTriggers)?[...ar,...t.textAreaTriggers]:ar}function Es(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(t!=null&&(typeof t=="string"||typeof t=="object"&&t!==null))return t}function hr(e,t){if(typeof e=="boolean")return;const r=Es(e);if(typeof r=="object"&&typeof r.widget=="string")return{widget:r.widget,source:"explicit-widget",options:r};const n=typeof r=="string"?r:typeof r=="object"&&typeof r.format=="string"?r.format:void 0;if(n)return{widget:n,source:"explicit-format",options:typeof r=="object"?r:void 0};if(typeof e.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[e.format]||e.format,source:"schema-format"};if(e.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(e.contentMediaType!=null||e.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:e.contentMediaType,encoding:e.contentEncoding}};if(e.enum!=null)return{widget:"enum",source:"constraints"};if(e.const!=null)return{widget:"const",source:"constraints"};if((e.type==="number"||e.type==="integer"||Array.isArray(e.type)&&e.type.some(s=>s==="number"||s==="integer"))&&e.minimum!=null&&e.maximum!=null)return e.maximum-e.minimum<=5&&e.minimum>=0&&e.minimum<=1&&(e.multipleOf==null||e.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:e.maximum}}:{widget:"slider",source:"constraints",options:{min:e.minimum,max:e.maximum,step:e.multipleOf}};if(e.type==="string"){if(e.minLength!=null&&e.minLength>20||e.maxLength!=null&&e.maxLength>100)return{widget:"textarea",source:"heuristics"};if(t){const s=t.toLowerCase();if(s.includes("password")||s.includes("secret"))return{widget:"password",source:"heuristics"};if(s.includes("email"))return{widget:"email",source:"heuristics"};if(s.includes("url")||s.includes("link"))return{widget:"url",source:"heuristics"};if(s.includes("color"))return{widget:"color",source:"heuristics"};if(si(e).some(u=>s.includes(u.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}function ai(e){const{definition:t}=e;if(typeof t=="boolean")return;const r={pattern:t.pattern,minLength:t.minLength,maxLength:t.maxLength},n=hr(t,e.name),a=n?.widget;if(a!=null)switch(a){case"binary":return{...r,format:"binary",...n?.options};case"date":return{...r,format:"date"};case"date-time":return{...r,format:"date-time"};case"email":return{...r,format:"email"};case"markdown":return{...r,format:"markdown"};case"password":return{...r,format:"password"};case"textarea":return{...r,format:"textarea"};case"time":return{...r,format:"time"};case"uuid":return{format:"uuid"};case"url":return{...r,format:"url"};case"uri":return{...r,format:"uri"};case"uri-reference":return{...r,format:"uri-reference"};case"hostname":return{...r,format:"hostname"};case"ipv4":return{...r,format:"ipv4"};case"ipv6":return{...r,format:"ipv6"};case"regex":return{...r,format:"regex"};case"duration":return{...r,format:"duration"};case"color":return{...r,format:"color"}}}const ii=e=>{const{value:t,onBlur:r,onChange:n,onInput:a,after:s,disabled:o,...u}=e,m=J.NullableResetAfter(t,o,n);return J.Base64Input({...u,value:E.Value.map(t,y=>y??void 0),onChange:n!=null?y=>n(y??null):void 0,onInput:a!=null?y=>a(y??null):void 0,onBlur:r,after:s!=null?E.Fragment(m,s):m})};function Ln({ctx:e,options:t,controller:r}){const n=ai(e);switch(n?.format){case"email":return D.Control(J.NullableEmailInput,{...t,controller:J.transformNullToUndefined(r)});case"date":return D.MappedControl(J.NullableDateInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:new Date(a),fromInput:a=>a?.toISOString().split("T")[0]??null});case"date-time":return D.MappedControl(J.NullableDateTimeInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:new Date(a),fromInput:a=>a?.toISOString()??null});case"time":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"HH:MM:SS"});case"password":return D.Control(J.NullablePasswordInput,{...t,controller:J.transformNullToUndefined(r)});case"binary":{const{definition:a}=e,s=typeof a=="object"?a["x:ui"]:void 0;return n.mediaType&&(n.mediaType.startsWith("image/")||n.mediaType.startsWith("video/")||n.mediaType.startsWith("audio/")||n.mediaType==="application/pdf"||s?.preferFileUpload===!0)?D.Control(ii,{...t,controller:J.transformNullToUndefined(r),mode:"compact",accept:n.mediaType||"*/*",maxFileSize:(typeof s?.maxBytes=="number"?s.maxBytes:void 0)||(typeof s?.maxFileSize=="number"?s.maxFileSize:void 0),showFileList:!0}):D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r),placeholder:"Paste base64-encoded data",rows:3})}case"uri":case"url":return D.Control(J.NullableUrlInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"https://example.com"});case"uri-reference":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"Enter URL..."});case"hostname":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"example.com"});case"ipv4":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"192.168.1.1"});case"ipv6":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"2001:db8::1"});case"regex":return D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r),placeholder:"^[a-zA-Z0-9]+$",rows:3});case"duration":return J.WithTemporal(({Duration:a})=>D.MappedControl(J.NullableDurationInput,{...t,controller:J.transformNullToUndefined(r),toInput:s=>s==null?null:a.from(s),fromInput:s=>s?.toString?.()??null}));case"color":return D.Control(J.ColorSwatchInput,{...t,controller:r,displayValue:!0});case"uuid":return D.Control(J.NullableUUIDInput,{...t,controller:J.transformNullToUndefined(r)});case"textarea":return D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r)});default:return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r)})}}function It({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r={...we({ctx:e}),placeholder:De(e.definition,String),disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated};if(e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle))return Ln({ctx:e,options:r,controller:t});const a=hr(e.definition,e.name)?.widget;if(a!=null&&["url","uri","uri-reference","hostname","ipv4","ipv6","regex","duration","binary","markdown","time","color"].includes(a))return Ln({ctx:e,options:r,controller:t});switch(a){case"email":return D.Control(D.EmailInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"password":return D.Control(D.PasswordInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"uuid":return D.Control(J.UUIDInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"textarea":return D.Control(J.TextArea,{...r,controller:J.transformEmptyStringToUndefined(t)});default:return D.Control(Ne.TextInput,{...r,controller:J.transformEmptyStringToUndefined(t)})}}function oi(e){const t=hr(e.definition,e.name);if(t?.widget==="slider")return{widget:"slider",options:t.options};if(t?.widget==="rating")return{widget:"rating",options:t.options};const r=e.definition,n=typeof r=="object"?r["x:ui"]:void 0;return n?.displayFormat==="currency"?{widget:"currency",options:{currency:typeof n?.currency=="string"?n.currency:"USD"}}:n?.displayFormat==="percent"?{widget:"percent"}:{widget:"number"}}function ze({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r=e.definition,n=oi(e),a={...we({ctx:e}),placeholder:De(e.definition,String),min:r.minimum,max:r.maximum,step:r.multipleOf,disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated},s=e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle);switch(n.widget){case"rating":const o=(typeof n.options?.max=="number"?n.options.max:r.maximum)||5;return s?D.Control(J.NullableRatingInput,{...a,max:o,controller:t}):D.Control(J.RatingInput,{...a,max:o,controller:t});case"slider":return s?D.Control(J.NullableSliderInput,{...a,controller:t}):D.Control(J.SliderInput,{...a,controller:t});case"currency":const u=typeof n.options?.currency=="string"?n.options.currency:"USD";return s?D.Control(J.MaskInput,{...a,mask:Un(u),controller:t}):D.Control(J.MaskInput,{...a,mask:Un(u),controller:t});case"percent":return s?D.Control(J.MaskInput,{...a,mask:Kn(),controller:t}):D.Control(J.MaskInput,{...a,mask:Kn(),controller:t});default:return s?D.Control(J.NullableNumberInput,{...a,controller:t}):D.Control(J.NumberInput,{...a,controller:t})}}function Un(e){return`${ui(e)} 000,000.00`}function Kn(){return"000.00%"}function ui(e){return{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$"}[e.toUpperCase()]||e}function Ct({ctx:e,controller:t}){return ze({ctx:e.with({definition:{...e.definition,multipleOf:ws(e.definition.multipleOf)}}),controller:t})}function At({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r={...we({ctx:e}),disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated},n=D.Control(D.CheckboxInput,{...r,controller:t});return!e.isNullable||e.isOptional&&!e.shouldShowPresenceToggle?n:D.Control(D.CheckboxInput,{...r,controller:t,after:J.NullableResetAfter(t.signal,t.disabled,a=>t.change(a))})}function pr({controller:e}){return E.WithElement(()=>{e.change(null)})}let ir=new WeakMap,Jn=new WeakMap;function Os(e,t){const r=typeof t=="object"&&t!=null?t:null;if(r!=null){const o=ir.get(r)?.get(e);if(o!=null)return o}let n=e;const a=new Set;for(;js(n);){const s=n.$ref;if(!s.startsWith("#")){console.warn(`resolveRef: external $ref not supported here: ${s}`);break}if(a.has(s)){console.warn(`resolveRef: cycle detected while resolving in-document $ref chain: ${[...a,s].join(" -> ")}`);break}a.add(s);const o=ks(t,s);if(!Ut(o)){console.warn(`resolveRef: could not resolve JSON Pointer ${s}`);break}const{$ref:u,...m}=n;n={...o,...m}}if(r!=null){let s=ir.get(r);s==null&&(s=new WeakMap,ir.set(r,s)),s.set(e,n)}return n}function js(e){return Ut(e)&&typeof e.$ref=="string"}function Ut(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function ks(e,t){if(!t.startsWith("#"))return;if(t==="#")return e;if(typeof e!="object"||e==null)return;const r=e;let n=Jn.get(r);n==null&&(n=new Map,Jn.set(r,n));const a=n.get(t);if(a!==void 0)return a;const s=dr(t);let o=e;for(const u of s){if(!Ut(o)&&!Array.isArray(o)){n.set(t,void 0);return}o=o[u]}return n.set(t,o),o}function Ns(e,t,r){let n=e;const a=new Set,s=(o,u)=>{const{$ref:m,...y}=u;return{...o,...y}};for(;js(n);){const o=n.$ref;if(a.has(o)){console.warn(`resolveAnyRef: cycle detected while resolving $ref chain: ${[...a,o].join(" -> ")}`);break}if(a.add(o),o.startsWith("#")){const v=ks(t,o);if(!Ut(v)){console.warn(`resolveAnyRef: could not resolve JSON Pointer ${o}`);break}n=s(v,n);continue}if(!r){console.warn(`resolveAnyRef: external $ref without AJV not resolved: ${o}`);break}const u=o.indexOf("#"),m=u>=0?o.slice(0,u):o;let y=r.getSchema(o)||r.getSchema(m);if(!y)try{y=r.compile({$ref:o})}catch{}const d=y?.schema;if(!d||typeof d!="object"){console.warn(`resolveAnyRef: AJV could not provide schema for ${o}`);break}n=s(d,n)}return n}function ci({conflicts:e}){return e.length===0?E.Empty:D.Notice({variant:"warning",tone:"prominent",title:"Schema Conflicts Detected",class:"bc-schema-conflicts-banner"},E.html.ul(E.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>E.html.li(E.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?E.html.code(E.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function li({violations:e}){return e.length===0?E.Empty:D.Notice({variant:"danger",tone:"prominent",title:"Schema Violations Detected",class:"bc-not-violations-banner"},E.html.ul(E.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>E.html.li(E.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?E.html.code(E.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function fi({ctx:e,controller:t,content:r}){const n=E.Value.map(t.signal,o=>o!==void 0),a=e.widgetLabel??"Property",s=o=>{if(o){const u=e.default;if(u!==void 0)t.change(u);else{const m=e.definition;m.type==="string"?t.change(""):m.type==="number"||m.type==="integer"?t.change(0):m.type==="boolean"?t.change(!1):m.type==="array"?t.change([]):m.type==="object"?t.change({}):t.change(null)}}else t.change(void 0)};return D.Stack(E.OnDispose(()=>E.Value.dispose(n)),E.html.div(E.attr.class("bc-presence-toggle"),D.InputWrapper({layout:"horizontal",label:`Include ${a}`,content:J.Switch({value:n,onChange:s,size:"xs"})})),E.When(n,()=>r))}function ne(e,t,r){const n=e.schemaConflicts.length>0,a=e.notViolations.length>0,s=e.shouldShowPresenceToggle&&r!=null;let o=t;return s&&r!=null&&(o=fi({ctx:e,controller:r,content:t})),!n&&!a?o:D.Stack(E.attr.class("bc-stack--gap-2"),a?li({violations:e.notViolations}):null,n?ci({conflicts:e.schemaConflicts}):null,o)}function Rs(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(!t||!t.visibleIf)return;const r=t.visibleIf;if(typeof r=="string"||typeof r=="object"&&r!==null)return r}function di(e){if(e.startsWith("!"))return{field:e.slice(1),operator:"falsy"};if(e.includes("!=")){const[t,r]=e.split("!=",2);return{field:t.trim(),operator:"notEquals",value:Wn(r.trim())}}if(e.includes("=")){const[t,r]=e.split("=",2);return{field:t.trim(),operator:"equals",value:Wn(r.trim())}}return{field:e.trim(),operator:"truthy"}}function Wn(e){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e!=="undefined")return/^-?\d+(\.\d+)?$/.test(e)?parseFloat(e):e}function mi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const a of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else n=n[a]}return n}function ur(e,t){const r=mi(t,e.field);switch(e.operator){case"equals":return r===e.value;case"notEquals":return r!==e.value;case"truthy":return!!r;case"falsy":return!r;case"contains":return typeof r=="string"&&typeof e.value=="string"||Array.isArray(r)?r.includes(e.value):!1;case"notContains":return typeof r=="string"&&typeof e.value=="string"||Array.isArray(r)?!r.includes(e.value):!0;case"greaterThan":return typeof r=="number"&&typeof e.value=="number"&&r>e.value;case"lessThan":return typeof r=="number"&&typeof e.value=="number"&&r<e.value;case"greaterThanOrEqual":return typeof r=="number"&&typeof e.value=="number"&&r>=e.value;case"lessThanOrEqual":return typeof r=="number"&&typeof e.value=="number"&&r<=e.value;case"in":return Array.isArray(e.values)&&e.values.includes(r);case"notIn":return!Array.isArray(e.values)||!e.values.includes(r);default:return!1}}function Is(e,t){const r=e.conditions.map(n=>"operator"in n&&["and","or","not"].includes(n.operator)?Is(n,t):ur(n,t));switch(e.operator){case"and":return r.every(Boolean);case"or":return r.some(Boolean);case"not":return!r[0];default:return!1}}function hi(e,t){try{if(typeof e=="string"){const r=di(e);return ur(r,t)}return"operator"in e&&["and","or","not"].includes(e.operator)?Is(e,t):ur(e,t)}catch(r){return console.warn("Error evaluating visibility condition:",r),!0}}function pi(e,t){return E.computedOf(t)(r=>hi(e,r))}const Bn={behavior:"hide",clearOnHide:!1};function yi({ctx:e,controller:t,children:r,options:n=Bn}){const a=Rs(e.definition);if(!a)return r;const s={...Bn,...n},o=gi(t),u=pi(a,o);switch(s.clearOnHide&&u.on(m=>{!m&&t.signal.value!==void 0&&t.change(void 0)}),s.behavior){case"unmount":return E.When(u,()=>r,()=>E.Fragment());case"hide":default:return E.When(u,()=>r,()=>E.Fragment(r))}}function gi(e){return e.signal}function Cs({ctx:e,controller:t}){const r=e.definition;return J.NativeSelectControl({...we({ctx:e}),options:(r.enum??[]).map(n=>({type:"value",value:n,label:String(n)})),controller:t})}function As({ctx:e,controller:t}){const r=e.definition;return E.Fragment(E.WithElement(()=>{E.Value.get(t.signal)!==r.const&&t.change(r.const)}),J.Group(D.MutedLabel(e.widgetLabel,": "),D.Label(String(r.const))))}function vi(e,t,r){const{controller:n,effCtx:a,patternProps:s,apSchema:o,canRemove:u,lockKeyAfterSet:m,validatePropertyName:y}=r,d=n.field(e),v=E.prop(e),$=E.prop(null);let S=o;if(t){const l=Object.keys(s).find(i=>{try{return new RegExp(i).test(e)}catch{return!1}});if(l){const i=s[l];i!==!1&&typeof i=="object"&&(S=i)}}const w=l=>{const i=(l??"").trim();if(!i||i===e||Object.prototype.hasOwnProperty.call(E.Value.get(n.signal)??{},i))return;const c=y(i);if(!c.ok){$.set(c.message);return}$.set(null);const p={...E.Value.get(n.signal)??{}},b=p[e];delete p[e],p[i]=b,n.change(p)},g=E.Use(Ne.BeatUII18n,l=>D.CloseButton({size:"xs",label:l.$.removeItem,disabled:!u(Object.keys(E.Value.get(n.signal)??{}).length),onClick:()=>{const i=Object.keys(E.Value.get(n.signal)??{}).length;if(!u(i))return;const c={...E.Value.get(n.signal)??{}};delete c[e],n.change(c)}})),f=E.Value.map(d.signal,l=>m&&l!=null);return E.html.div(E.OnDispose(v,$,()=>E.Value.dispose(f)),E.attr.class("bc-object-helpers__row"),E.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:v,onChange:w,disabled:E.computedOf(n.disabled,f)((l,i)=>l||i)}),error:E.Ensure($,l=>E.html.div(E.attr.class("bc-object-helpers__error"),l)),description:Object.keys(s).length>0?E.html.div(E.attr.class("bc-object-helpers__description"),"Allowed patterns: ",Object.keys(s).join(", ")):null}),E.html.div(Ee({ctx:a.with({definition:S,suppressLabel:!0}).append(e),controller:d})),E.html.div(E.attr.class("bc-object-helpers__remove"),g))}function bi(e,t,r){const{controller:n,effCtx:a,patternProps:s,apSchema:o,unevaluatedProps:u,canRemove:m,lockKeyAfterSet:y,validatePropertyName:d}=r,v=n.field(e),$=E.prop(e),S=E.prop(null);let w;if(u&&typeof u=="object")w=u;else if(t){const i=Object.keys(s).find(c=>{try{return new RegExp(c).test(e)}catch{return!1}});if(i){const c=s[i];c!==!1&&typeof c=="object"?w=c:w=o}else w=o}else w=o;const g=i=>{const c=(i??"").trim();if(!c||c===e||Object.prototype.hasOwnProperty.call(E.Value.get(n.signal)??{},c))return;const p=d(c);if(!p.ok){S.set(p.message);return}S.set(null);const b={...E.Value.get(n.signal)??{}},_=b[e];delete b[e],b[c]=_,n.change(b)},f=E.Use(Ne.BeatUII18n,i=>D.CloseButton({size:"xs",label:i.$.removeItem,disabled:!m(Object.keys(E.Value.get(n.signal)??{}).length),onClick:()=>{const c=Object.keys(E.Value.get(n.signal)??{}).length;if(!m(c))return;const p={...E.Value.get(n.signal)??{}};delete p[e],n.change(p)}})),l=E.Value.map(v.signal,i=>y&&i!=null);return E.html.div(E.OnDispose($,S,()=>E.Value.dispose(l)),E.attr.class("bc-object-helpers__row"),E.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:$,onChange:g,disabled:E.computedOf(n.disabled,l)((i,c)=>i||c)}),error:E.Ensure(S,i=>E.html.div(E.attr.class("bc-object-helpers__error"),i)),description:E.html.div(E.attr.class("bc-object-helpers__description"),u===!1?"Unevaluated property (not allowed by schema)":"Unevaluated property",Object.keys(s).length>0?E.html.span(" • Allowed patterns: ",Object.keys(s).join(", ")):null)}),E.html.div(Ee({ctx:a.with({definition:w,suppressLabel:!0}).append(e),controller:v})),E.html.div(E.attr.class("bc-object-helpers__remove"),f))}function _i(e){if(typeof e.definition=="boolean")return;const t=Es(e.definition);if(typeof t!="object")return;const r={};return typeof t.format=="string"&&["fieldset","tabs","accordion","group","grid"].includes(t.format)&&(r.format=t.format),Array.isArray(t.order)&&(r.order=t.order.filter(n=>typeof n=="string")),t.groups&&typeof t.groups=="object"&&(r.groups=t.groups),(typeof t.cols=="number"||t.cols&&typeof t.cols=="object")&&(r.cols=t.cols),Object.keys(r).length>0?r:void 0}function $i({title:e,children:t}){return E.html.fieldset(E.attr.class("bc-fieldset"),e?E.html.legend(E.attr.class("bc-fieldset__legend"),e):null,E.html.div(E.attr.class("bc-fieldset__content"),D.Stack(E.attr.class("bc-stack--gap-1"),...t)))}function wi({title:e,children:t}){return J.Card({variant:"outlined",size:"md"},D.Stack(E.attr.class("bc-stack--gap-1"),e?D.Label(e):null,...t))}function Si({cols:e=1,children:t}){const r=typeof e=="number"?`bc-schema-grid bc-schema-grid--cols-${e}`:E.computedOf(e)(n=>{if(typeof n=="number")return`bc-schema-grid bc-schema-grid--cols-${n}`;if(n&&typeof n=="object"){const a=["bc-schema-grid"];return n.sm&&a.push(`bc-schema-grid--cols-sm-${n.sm}`),n.md&&a.push(`bc-schema-grid--cols-md-${n.md}`),n.lg&&a.push(`bc-schema-grid--cols-lg-${n.lg}`),n.xl&&a.push(`bc-schema-grid--cols-xl-${n.xl}`),n["2xl"]&&a.push(`bc-schema-grid--cols-2xl-${n["2xl"]}`),a.join(" ")}return"bc-schema-grid bc-schema-grid--cols-1"});return E.html.div(E.attr.class(r),E.attr.class("bc-schema-grid--gap-4"),...t)}function Pi({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ei({title:"Properties",children:t});const r=E.prop(Object.keys(e)[0]),n=Object.entries(e);return E.html.div(E.OnDispose(r),E.attr.class("bc-tabs"),E.html.div(E.attr.class("bc-tabs__header"),E.attr.role("tablist"),...n.map(([a],s)=>E.html.button(E.attr.type("button"),E.attr.class("bc-tabs__tab"),E.attr.class(E.computedOf(r)(o=>o===a?"bc-tabs__tab--active":"")),E.attr.role("tab"),E.attr.tabindex(r.map(o=>o===a?0:-1)),E.on.click(()=>r.set(a)),E.on.keydown(o=>{switch(o.key){case"ArrowLeft":o.preventDefault();const u=s>0?s-1:n.length-1;r.set(n[u][0]);break;case"ArrowRight":o.preventDefault();const m=s<n.length-1?s+1:0;r.set(n[m][0]);break;case"Home":o.preventDefault(),r.set(n[0][0]);break;case"End":o.preventDefault(),r.set(n[n.length-1][0]);break}}),a))),E.html.div(E.attr.class("bc-tabs__content"),...n.map(([a,s])=>E.html.div(E.attr.class("bc-tabs__panel"),E.attr.class(E.computedOf(r)(o=>o===a?"bc-tabs__panel--active":"bc-tabs__panel--hidden")),E.attr.role("tabpanel"),D.Stack(E.attr.class("bc-stack--gap-1"),...t.filter((o,u)=>s.length===0||u<s.length))))))}function Ei({title:e,children:t}){return E.html.div(E.attr.class("bc-tabs"),E.html.div(E.attr.class("bc-tabs__header"),E.html.div(E.attr.class("bc-tabs__tab bc-tabs__tab--active"),e)),E.html.div(E.attr.class("bc-tabs__content"),E.html.div(E.attr.class("bc-tabs__panel bc-tabs__panel--active"),D.Stack(E.attr.class("bc-stack--gap-1"),...t))))}function Oi({groups:e,children:t}){if(!e||Object.keys(e).length===0)return ji({title:"Properties",children:t});const r=Object.entries(e),n=E.prop(new Set([r[0]?.[0]].filter(Boolean)));return E.html.div(E.OnDispose(n),E.attr.class("bc-accordion"),...r.map(([a,s])=>{const o=E.computedOf(n)(u=>u.has(a));return E.html.div(E.OnDispose(o),E.attr.class("bc-accordion__item"),E.html.button(E.attr.type("button"),E.attr.class("bc-accordion__header"),E.aria.expanded(o),E.on.click(()=>{const u=n.value,m=new Set(u);m.has(a)?m.delete(a):m.add(a),n.set(m)}),E.on.keydown(u=>{if(u.key==="Enter"||u.key===" "){u.preventDefault();const m=n.value,y=new Set(m);y.has(a)?y.delete(a):y.add(a),n.set(y)}}),E.html.span(a),Ne.Icon({icon:E.computedOf(o)(u=>u?"chevron-up":"chevron-down"),size:"sm"})),E.html.div(E.attr.class("bc-accordion__content"),E.attr.class(E.computedOf(o)(u=>u?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(E.attr.class("bc-stack--gap-1"),...t.filter((u,m)=>s.length===0||m<s.length))))}))}function ji({title:e,children:t}){const r=E.prop(!0);return E.html.div(E.OnDispose(r),E.attr.class("bc-accordion"),E.html.div(E.attr.class("bc-accordion__item"),E.html.button(E.attr.type("button"),E.attr.class("bc-accordion__header"),E.on.click(()=>r.set(!r.value)),E.html.span(e),Ne.Icon({icon:E.computedOf(r)(n=>n?"chevron-up":"chevron-down"),size:"sm"})),E.html.div(E.attr.class("bc-accordion__content"),E.attr.class(E.computedOf(r)(n=>n?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(E.attr.class("bc-stack--gap-1"),...t))))}function Hn(e,t,r){const n=new Map;r.forEach((o,u)=>{e[u]&&n.set(o,e[u])});let a=e;if(t.order&&t.order.length>0){const o=new Map,u=[];t.order.forEach(m=>{const y=n.get(m);y&&o.set(m,y)}),r.forEach((m,y)=>{!t.order.includes(m)&&e[y]&&u.push(e[y])}),a=[...Array.from(o.values()),...u]}let s;if(t.groups&&Object.keys(t.groups).length>0){s={};const o=new Set;Object.entries(t.groups).forEach(([m,y])=>{s[m]=[],y.forEach(d=>{const v=n.get(d);v&&(s[m].push(v),o.add(v))})});const u=a.filter(m=>!o.has(m));u.length>0&&(s.Other=u)}return{orderedChildren:a,groupedChildren:s}}function ki(e,t,r,n=[]){if(!e||!e.format){if(e?.order){const{orderedChildren:u}=Hn(r,e,n);return D.Stack(E.attr.class("bc-stack--gap-1"),...u)}return D.Stack(E.attr.class("bc-stack--gap-1"),...r)}const a=t.widgetLabel||t.name,{orderedChildren:s,groupedChildren:o}=Hn(r,e,n);switch(e.format){case"fieldset":return $i({title:a,children:s});case"group":return wi({title:a,children:s});case"grid":return Si({cols:e.cols,children:s});case"tabs":return Pi({groups:o||e.groups,children:o?Object.values(o).flat():s});case"accordion":return Oi({groups:o||e.groups,children:o?Object.values(o).flat():s});default:return D.Stack(E.attr.class("bc-stack--gap-1"),...s)}}function yr({ctx:e,controller:t}){return E.MapSignal(t.signal,r=>{const n=e.definition,{effective:a,conflicts:s}=$s(n,r,e.ajv,e.path),o=e.with({definition:a,schemaConflicts:[...e.schemaConflicts,...s]}),u=a.properties??{},m=new Set(Object.keys(u)),y=Object.keys(r??{}),d=y.filter(h=>!m.has(h)),v=a.unevaluatedProperties,$=Ae(a,r??{},e.ajv),S=d.filter(h=>!$.has(h)),w=d.filter(h=>$.has(h)),g=a.additionalProperties??!0,f=g!==!1,l=g===!0||g===void 0?{}:g,i=a.minProperties??0,c=a.maxProperties??1/0;let p=!0,b=null;v===!1?(p=!1,b="No unevaluated properties are allowed by schema"):v&&typeof v=="object"&&(p=!0);const _=f&&p&&y.length<c,O=h=>h>i,C=a.patternProperties??{},V=Object.keys(C).filter(Boolean).map(h=>{try{return new RegExp(h)}catch{return null}}).filter(h=>h!=null),F=a.propertyNames,A=h=>{const P=(h??"").trim();if(P==="")return{ok:!1,message:"Key cannot be empty"};if(F===!1)return{ok:!1,message:"No property names are allowed by schema"};if(F&&typeof F=="object"&&e.ajv)try{const R=e.ajv.compile(F);if(!R(P))return{ok:!1,message:R.errors?.[0]?.message??"Invalid property name"}}catch{}if(!f&&!m.has(P)){if(V.length===0)return{ok:!1,message:"Only declared properties are allowed"};if(!V.some(K=>K.test(P)))return{ok:!1,message:`Key must match one of: ${Object.keys(C).join(", ")}`}}return{ok:!0}},z=a["x:ui"],U=!!(z&&typeof z=="object"&&z.lockKeyAfterSet),B=h=>{const P=De(h,K=>K);if(P!==void 0)return P;const R=h.type;if(R==="string")return"";if(R==="number"||R==="integer")return 0;if(R==="boolean")return!1;if(R==="array")return[];if(R==="object")return{}},ee=(h,P)=>{const R=h,K=Z=>P.has(Z)?!1:A(Z).ok;if(K(R))return R;let W=1;for(;P.has(R+W)||!K(R+W);)W++;return R+W},ae=E.Use(Ne.BeatUII18n,h=>Ne.Button({variant:"outline",disabled:!_,onClick:()=>{if(!_)return;const P=new Set(Object.keys(E.Value.get(t.signal)??{})),R=ee("property",P);if(!A(R).ok)return;let W=l;v&&typeof v=="object"&&(W=v);const Z=B(W),Y={...E.Value.get(t.signal)??{},[R]:Z};t.change(Y)}},E.attr.title(b),h.$.addLabel)),se=_i(o),te=Ls.f(u).filter(([,h])=>h!==!1),M=[...te.map(([h])=>h),...w,...S],k=[...te.map(([h,P])=>{const R=h,K=t.field(R);return Ee({ctx:o.with({definition:P,isPropertyRequired:Array.isArray(a.required)?a.required.includes(R):o.hasRequiredProperty(R),suppressLabel:!1}).append(R),controller:K})}),...w.map(h=>{const P=V.some(R=>R.test(h));return vi(h,P,{controller:t,effCtx:o,patternProps:C,apSchema:l,canRemove:O,lockKeyAfterSet:U,validatePropertyName:A})}),...S.map(h=>{const P=V.some(R=>R.test(h));return bi(h,P,{controller:t,effCtx:o,patternProps:C,apSchema:l,unevaluatedProps:v,canRemove:O,lockKeyAfterSet:U,validatePropertyName:A})}),f?ae:null].filter(Boolean),T=ki(se,o,k,M);return!o.suppressLabel&&o.name!=null&&(!se||!["fieldset","group"].includes(se.format||""))?D.InputWrapper({...we({ctx:o}),content:T}):T})}function Ni(e,t,r){const a=e.definition.oneOf;if(!Array.isArray(a)||a.length===0)return{matchingBranch:-1,validBranches:[],isAmbiguous:!1,hasNoMatch:!0};const s=a.map(d=>{if(typeof d=="object"&&d!=null&&"$ref"in d){const v=d.$ref;if(typeof v=="string"&&v.startsWith("#"))return Os(d,e.schema)}return d}),o=[];for(let d=0;d<s.length;d++){const v=s[d];if(typeof v=="boolean"){v===!0&&o.push(d);continue}if(r)try{zt(r,v)(t)&&o.push(d)}catch($){console.warn(`Failed to compile oneOf branch ${d}:`,$),xn(v,t)&&o.push(d)}else xn(v,t)&&o.push(d)}const u=o.length>1,m=o.length===0;return{matchingBranch:o.length===1?o[0]:-1,validBranches:o,isAmbiguous:u,hasNoMatch:m}}function xn(e,t){if("const"in e)return e.const===t;if(Array.isArray(e.enum))return e.enum.includes(t);if(e.type!=null){const r=Array.isArray(e.type)?e.type:[e.type],n=Ri(t);if(n==="unknown"||!r.includes(n))return!1}if(e.properties&&typeof t=="object"&&t!=null){const r=t;for(const[n,a]of Object.entries(e.properties))if(typeof a=="object"&&a!=null&&"const"in a&&r[n]!==a.const)return!1}return!0}function Ri(e){return e===null?"null":Array.isArray(e)?"array":typeof e=="object"?"object":typeof e=="string"?"string":typeof e=="number"?Number.isInteger(e)?"integer":"number":typeof e=="boolean"?"boolean":"unknown"}function Ii(e,t,r=`Option ${t+1}`){if(typeof e=="boolean")return e?"Any Value":"No Value";if(e.title)return e.title;if(e.properties){for(const[n,a]of Object.entries(e.properties))if(typeof a=="object"&&a!=null&&"const"in a){const s=a.const;if(typeof s=="string")return`${n}: ${s}`}}return"const"in e&&typeof e.const=="string"?e.const:e.type?(Array.isArray(e.type)?e.type:[e.type]).join(" | "):r}function Gn(e,t,r){const n=Ni(e,t,r);return n.matchingBranch!==-1?n.matchingBranch:-1}function Ci(e){if(typeof e=="boolean")return{discriminator:null,type:null};if(e.discriminator&&typeof e.discriminator=="object"){const r=e.discriminator;if(typeof r.propertyName=="string")return{discriminator:{propertyName:r.propertyName,mapping:r.mapping||{}},type:"openapi"}}const t=e["x:ui"];return t?.discriminatorKey&&typeof t.discriminatorKey=="string"?{discriminator:{key:t.discriminatorKey,mapping:t.discriminatorMapping||{}},type:"beatui"}:{discriminator:null,type:null}}function Ai(e,t,r){if(!t.discriminator||!r||typeof r!="object")return null;const{discriminator:n,type:a}=t;if(a==="openapi"){const s=n,o=r[s.propertyName];if(o==null)return null;if(s.mapping&&s.mapping[o]){const u=s.mapping[o];return Ti(e,u)}return Xn(e,s.propertyName,o)}if(a==="beatui"){const s=n,o=r[s.key];if(o==null)return null;if(s.mapping&&s.mapping[o]!=null){const u=s.mapping[o];return u>=0&&u<e.length?u:null}return Xn(e,s.key,o)}return null}function Ti(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(typeof n=="object"&&n.$ref===t)return r}return null}function Xn(e,t,r){for(let n=0;n<e.length;n++){const a=e[n];if(typeof a!="object")continue;const s=a.properties;if(s&&s[t]){const o=s[t];if(typeof o=="object"&&o.const===r||typeof o=="object"&&Array.isArray(o.enum)&&o.enum.length===1&&o.enum[0]===r)return n}if(a.const===r)return n}return null}function Ts({ctx:e,controller:t}){const r=e.definition.anyOf;return Vs({ctx:e,controller:t,kind:"anyOf",variants:r})}function qs({ctx:e,controller:t}){const r=e.definition.oneOf;return Vs({ctx:e,controller:t,kind:"oneOf",variants:r})}function qi({ctx:e,controller:t}){const n=e.definition.allOf.filter(u=>typeof u=="object").map(u=>Ns(u,e.schema,e.ajv)),{mergedSchema:a,conflicts:s}=Lt(n,e.path),o=e.with({definition:a,schemaConflicts:[...e.schemaConflicts,...s]});return Ee({ctx:o,controller:t})}function Vs({ctx:e,controller:t,kind:r,variants:n}){const a=n.map((g,f)=>Ii(g,f,`${r} ${f+1}`)),s=typeof e.definition=="boolean"?{discriminator:null,type:null}:Ci(e.definition),o=E.computedOf(t.signal,e.ajv)((g,f)=>{if(r==="oneOf"){if(s.discriminator){const l=Ai(n,s,g);if(l!==null)return l}return Gn(e,g,f)}return Gn(e,g,f)}),u=E.Value.get(o),m=E.prop(u>=0?u:0);t.onDispose(m.dispose);let y=!1;const d=o.on(g=>{!y&&g>=0&&m.set(g)});t.onDispose(d);const v=n.length,$=g=>{y=!0,m.set(g)},S=v>1?Ss({options:n.map((g,f)=>({value:f,label:a[f]})),selected:m,onChange:$}):"",w=E.MapSignal(m,g=>Ee({ctx:e.with({definition:n[E.Value.get(g)],suppressLabel:!e.isRoot}),controller:t}));return E.Fragment(E.OnDispose(o,m),Ps({ctx:e,showSelector:v>1,selector:S,inner:w}))}function Ee({ctx:e,controller:t}){const r=typeof e.definition=="boolean"?{}:e.definition;let n=r?.$ref?Os(r,e.schema):r,a=e.with({definition:n});if(n?.allOf!=null){const o=n.allOf.filter(u=>typeof u=="object"&&u!==null);if(o.length>0){const u=o.map($=>Ns($,e.schema,e.ajv)),{mergedSchema:m,conflicts:y}=Lt(u,e.path),{allOf:d,...v}=n;n={...v,...m},a=e.with({definition:n,schemaConflicts:[...e.schemaConflicts,...y]})}}let s=[...a.notViolations];if(n?.not!=null&&typeof n.not=="object"){const o=E.Value.get(t.signal),u=_s(n.not,o,a.ajv,a.path);u&&(s=[...s,u],a=a.with({notViolations:s}))}if(n==null)return le(a,t,ne(a,Fe({ctx:a,controller:t}),t));if(n.enum!=null)return le(a,t,ne(a,Cs({ctx:a,controller:t}),t));if(n.const!=null)return le(a,t,ne(a,As({ctx:a,controller:t}),t));if(n.anyOf!=null)return le(a,t,ne(a,Ts({ctx:a,controller:t}),t));if(n.oneOf!=null)return le(a,t,ne(a,qs({ctx:a,controller:t}),t));if(n?.type==null)return ne(a,Fe({ctx:a,controller:t}),t);if(Array.isArray(n.type)){const u=n.type.filter(m=>m!=="null");if(u.length===1&&["string","number","integer","boolean"].includes(u[0]))switch(u[0]){case"number":return ne(a,ze({ctx:a,controller:t}),t);case"integer":return ne(a,Ct({ctx:a,controller:t}),t);case"string":return ne(a,It({ctx:a,controller:t}),t);case"boolean":return ne(a,At({ctx:a,controller:t}),t)}return le(a,t,ne(a,vr({ctx:a,controller:t}),t))}switch(n.type){case"number":return le(a,t,ne(a,ze({ctx:a,controller:t}),t));case"integer":return le(a,t,ne(a,Ct({ctx:a,controller:t}),t));case"string":return le(a,t,ne(a,It({ctx:a,controller:t}),t));case"boolean":return le(a,t,ne(a,At({ctx:a,controller:t}),t));case"array":return le(a,t,ne(a,gr({ctx:a,controller:t instanceof D.ArrayController?t:t.array()}),t));case"object":{const o=yr({ctx:a,controller:t instanceof D.ObjectController?t:t.object()});return a.isRoot?le(a,t,ne(a,o,t)):le(a,t,ne(a,E.html.div(E.attr.class("bc-json-schema-object"),o),t))}case"null":return le(a,t,ne(a,pr({controller:t}),t));default:return console.warn("Unknown type",n.type),le(a,t,ne(a,E.html.div(E.attr.class("bc-json-schema-unknown"),"Unknown"),t))}}function Ms({schema:e,controller:t,ajv:r}){const n=new Ft({schema:e,definition:e,horizontal:!1,isPropertyRequired:!1,path:[],ajv:r});return e===!0?Fe({ctx:n,controller:t}):e===!1?E.Fragment():Ee({ctx:n,controller:t})}function le(e,t,r){return Rs(e.definition)?yi({ctx:e,controller:t,children:r,options:{behavior:"hide",clearOnHide:!1}}):r}function Vi(e){return e.prefixItems!=null?{isTuple:!0,prefixItems:e.prefixItems,additionalItemsSchema:Array.isArray(e.items)?!0:e.items??!0,tupleLabels:Yn(e)}:Array.isArray(e.items)?{isTuple:!0,prefixItems:e.items,additionalItemsSchema:e.additionalItems??!0,tupleLabels:Yn(e)}:{isTuple:!1,prefixItems:[],additionalItemsSchema:e.items??!0}}function Yn(e){if(typeof e=="boolean")return;const t=e["x:ui"];return Array.isArray(t?.tupleLabels)?t.tupleLabels:void 0}function gr({ctx:e,controller:t}){const r=e.definition,n=Vi(r),a=E.computedOf(t.signal)(d=>{const v=d?.length??0;return!(r.maxItems!=null&&v>=r.maxItems||n.isTuple&&v>=n.prefixItems.length&&n.additionalItemsSchema===!1)}),s=E.computedOf(t.signal)(d=>{const v=d?.length??0;return r.minItems==null||v>r.minItems}),o=E.computedOf(t.signal)(d=>{if(!r.uniqueItems||!d)return new Set;const v=new Map,$=new Set;for(let S=0;S<d.length;S++){const w=JSON.stringify(d[S]);v.has(w)?($.add(v.get(w)),$.add(S)):v.set(w,S)}return $}),u=E.computedOf(t.signal)(d=>{if(!r.contains||!d)return{matchingIndices:new Set,count:0,isValid:!0};const v=new Set;let $=0;if(e.ajv)try{const f=e.ajv.compile(r.contains);for(let l=0;l<d.length;l++)f(d[l])&&(v.add(l),$++)}catch{}else{const f=r.contains,l=i=>{if(typeof f=="boolean")return f;if(typeof f!="object"||f==null)return!1;const c=f,p=c.type;if(p==="integer"||p==="number")return!(typeof i!="number"||!Number.isFinite(i)||p==="integer"&&!Number.isInteger(i)||typeof c.minimum=="number"&&i<c.minimum||typeof c.exclusiveMinimum=="number"&&i<=c.exclusiveMinimum||typeof c.maximum=="number"&&i>c.maximum||typeof c.exclusiveMaximum=="number"&&i>=c.exclusiveMaximum||typeof c.multipleOf=="number"&&i%c.multipleOf!==0);if(p==="string"){if(typeof i!="string"||typeof c.minLength=="number"&&i.length<c.minLength||typeof c.maxLength=="number"&&i.length>c.maxLength)return!1;if(typeof c.pattern=="string")try{if(!new RegExp(c.pattern).test(i))return!1}catch{}return!0}return!1};for(let i=0;i<d.length;i++)l(d[i])&&(v.add(i),$++)}const S=r.minContains??(r.contains?1:0),w=r.maxContains,g=$>=S&&(w==null||$<=w);return{matchingIndices:v,count:$,isValid:g,minContains:S,maxContains:w}}),m=r.contains?u.map(d=>{const v=typeof r.contains=="object"&&r.contains.title?r.contains.title:"required pattern";if(!d.isValid){if(d.count<(d.minContains??0))return`Must contain at least ${d.minContains??0} item(s) matching ${v} (currently ${d.count})`;if(d.maxContains!=null&&d.count>d.maxContains)return`Must contain at most ${d.maxContains} item(s) matching ${v} (currently ${d.count})`}return`Contains ${d.count} item(s) matching ${v}`}):null,y=J.ListControl({...we({ctx:e}),createItem:()=>{const d=t.signal.value?.length??0;if(n.isTuple&&d<n.prefixItems.length){const v=n.prefixItems[d];return De(v,()=>{})}else return De(n.additionalItemsSchema,()=>{})},controller:t,showAdd:!0,addDisabled:E.computedOf(a)(d=>!d),showRemove:!0,removeDisabled:E.computedOf(s)(d=>!d),element:d=>{const v=d.item,$=d.position.index;let S,w;n.isTuple&&$<n.prefixItems.length?(S=n.prefixItems[$],n.tupleLabels?.[$]?w=n.tupleLabels[$]:typeof S=="object"&&S.title?w=S.title:w=`Item ${$+1}`):(S=n.additionalItemsSchema,n.isTuple&&(w=`Additional Item ${$-n.prefixItems.length+1}`));const g=Ee({ctx:e.with({definition:S}).append($),controller:v}),f=o.map(p=>p.has($)),l=u.map(p=>p.matchingIndices.has($));let i=g;w&&n.isTuple&&(i=D.Stack(E.attr.class("bc-stack--gap-1"),D.Label(E.attr.class("bc-array-control__item-label"),w),i));const c=[];return r.uniqueItems&&c.push(E.When(f,()=>D.Label(E.attr.class("bc-array-control__indicator bc-array-control__indicator--error"),"⚠️ Duplicate value"))),r.contains&&c.push(E.When(l,()=>D.Label(E.attr.class("bc-array-control__indicator bc-array-control__indicator--success"),"✓ Matches required pattern"))),c.length>0?D.Stack(E.attr.class("bc-stack--gap-1"),i,...c):i}});return r.contains&&m?D.Stack(E.attr.class("bc-stack--gap-2"),y,E.MapSignal(E.computedOf(u,m)((d,v)=>({info:d,summary:v})),({info:d,summary:v})=>D.Label(E.attr.class(d.isValid?"bc-array-control__summary bc-array-control__summary--success":"bc-array-control__summary bc-array-control__summary--error"),v))):E.Fragment(E.OnDispose(a,s,o,u),y)}function Mi(e){return e.map(t=>({key:t,label:J._t(t),detect:r=>ei(r,[t])===t,convert:r=>ti(r,t),defaultValue:()=>ri(t)}))}function vr({ctx:e,controller:t}){const r=e.definition;let n=r.type??[];const a=ni(r),s=n.includes("null"),o=n.filter(S=>S!=="null"&&(S==="string"||S==="number"||S==="integer"||S==="boolean")),u=s&&o.length===n.length-1;u&&(n=o);const m=Mi(n),y=new J.UnionController(t.path,t.change,t.signal,t.status,{disabled:t.disabled},m);t.onDispose(()=>y.dispose());const d=S=>Ss({options:n.map(w=>({value:w,label:J._t(w)})),selected:y.activeBranch,onChange:S,mode:a.selector??"auto"}),v=S=>{y.switchToBranch(S,a.confirmBranchChange)},$=E.MapSignal(y.activeBranch,S=>{const w=E.Value.get(S),g=y.getBranchController(w);if(u&&(w==="number"||w==="integer")){const l=r;return D.Control(J.NullableNumberInput,{...we({ctx:e.with({suppressLabel:!e.isRoot})}),controller:g,min:l.minimum,max:l.maximum,step:w==="integer"?ws(l.multipleOf):l.multipleOf})}const f=e.with({definition:{...r,type:w},suppressLabel:!e.isRoot});switch(w){case"string":return It({ctx:f,controller:g});case"number":return ze({ctx:f,controller:g});case"integer":return Ct({ctx:f,controller:g});case"boolean":return At({ctx:f,controller:g});case"null":return pr({controller:g});case"array":{const l=g.array();return gr({ctx:f,controller:l})}case"object":{const l=g.object();return yr({ctx:f,controller:l})}default:return D.Control(J.NullableNumberInput,{...we({ctx:f}),controller:g})}});return Ps({ctx:e,showSelector:n.length>1,selector:d(v),inner:$})}function Fe({ctx:e,controller:t}){return e.definition===!0?Fe({ctx:e.with({definition:{type:["string","number","object","array","boolean","null"]}}),controller:t}):vr({ctx:e.with({definition:{...e.definition,type:["string","number","object","array","boolean","null"]}}),controller:t})}function Di(e){if(typeof e=="boolean")return[];const t=e["x:ui"];return!t||!Array.isArray(t.crossField)?[]:t.crossField.filter(r=>typeof r=="object"&&r!=null&&typeof r.id=="string"&&Array.isArray(r.fields)&&typeof r.validate=="function")}function zi(e,t,r=!1){const n=[],a=[...t].sort((s,o)=>(o.priority||0)-(s.priority||0));for(const s of a)if(!(s.onSubmitOnly&&!r))try{const o={};for(const m of s.fields)o[m]=Fi(e,m);const u=s.validate(o,e);if(!u.valid){const m=s.targets||s.fields;if(u.fieldErrors)for(const[y,d]of Object.entries(u.fieldErrors))n.push({instancePath:`/${y}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields,context:u.context},message:d});else{const y=u.message||s.message||"Cross-field validation failed";for(const d of m)n.push({instancePath:`/${d}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields,context:u.context},message:y})}}}catch(o){console.warn(`Error in cross-field validation rule ${s.id}:`,o);const u=s.targets?.[0]||s.fields[0];n.push({instancePath:`/${u}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields},message:"Cross-field validation error"})}return n.length>0?Dt(n):D.a.valid}function Fi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const a of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else n=n[a]}return n}function Li(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(!t)return;const r={};Array.isArray(t.when)&&(r.when=t.when.filter(a=>typeof a=="object"&&a!=null&&"watch"in a&&"condition"in a)),Array.isArray(t.crossField)&&(r.crossField=t.crossField.filter(a=>typeof a=="object"&&a!=null&&Array.isArray(a.fields)&&typeof a.validate=="function"));const n=Di(e);return n.length>0&&(r.crossFieldRules=n),Array.isArray(t.async)&&(r.async=t.async.filter(a=>typeof a=="object"&&a!=null&&typeof a.validate=="function")),Object.keys(r).length>0?r:void 0}function cr(e,t){if(!e.startsWith("$."))throw new Error(`Invalid JSONPath: ${e}. Must start with '$.'.`);const r=e.slice(2).split(/[.\[\]]/).filter(Boolean);let n=t;for(const a of r){if(n==null)return;if(typeof n=="object"&&!Array.isArray(n))n=n[a];else if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else return}return n}function Ui(e,t){try{if(typeof e.condition=="function"){const n=(Array.isArray(e.watch)?e.watch:[e.watch]).map(a=>cr(a,t));return e.condition(n.length===1?n[0]:n,t)}return typeof e.condition=="string"?!!cr(e.condition,t):!1}catch(r){return console.warn("Error evaluating conditional validation:",r),!1}}function Ki(e,t,r,n){const a=[];if(n&&!n(e)&&n.errors&&a.push(...n.errors),r.when){for(const s of r.when)if(Ui(s,t)?s.then:s.else,s.validate)try{const u=s.validate(e,t);u&&a.push({instancePath:"",schemaPath:"#/x:ui/when",keyword:"conditional",params:{},message:u})}catch(u){console.warn("Error in conditional validation:",u)}}if(r.crossField)for(const s of r.crossField)try{const o={};for(const m of s.fields)o[m]=cr(`$.${m}`,t);const u=s.validate(o,t);if(u){const m=s.target||s.fields[0];a.push({instancePath:`/${m}`,schemaPath:"#/x:ui/crossField",keyword:"crossField",params:{fields:s.fields},message:s.message||u})}}catch(o){console.warn("Error in cross-field validation:",o)}if(r.crossFieldRules&&r.crossFieldRules.length>0){const s=zi(t,r.crossFieldRules);if(s.type==="invalid"){const o=Ji(s);a.push(...o)}}return a.length>0?Dt(a):D.a.valid}function Ji(e){if(e.type==="valid")return[];const t=[];function r(n,a=""){if(n.message&&t.push({instancePath:a,schemaPath:"#/crossField",keyword:"crossField",params:{},message:n.message}),n.dependencies)for(const[s,o]of Object.entries(n.dependencies)){const u=a?`${a}/${s}`:`/${s}`;r(o,u)}}return r(e.error),t}function Wi(e,t){const r=new Set;if(e.when)for(const n of e.when)(Array.isArray(n.watch)?n.watch:[n.watch]).forEach(s=>r.add(s));if(e.crossField)for(const n of e.crossField)n.fields.forEach(a=>r.add(a));return{watchedPaths:Array.from(r),shouldRevalidate:n=>Array.from(r).some(a=>n.startsWith(a)||a.startsWith(n))}}function Bi(e){if(typeof e=="boolean")return[];const t=e["x:ui"];return!t||!Array.isArray(t.async)?[]:t.async.filter(r=>typeof r=="object"&&r!=null&&typeof r.id=="string"&&typeof r.field=="string"&&typeof r.validate=="function")}class Hi{timeouts=new Map;validationStates=new Map;abortControllers=new Map;getValidationState(t){return this.validationStates.has(t)||this.validationStates.set(t,E.prop({isValidating:!1,result:D.a.valid,lastValidatedValue:void 0,lastValidatedAt:0})),this.validationStates.get(t)}async validateField(t,r,n,a=!1){const s=`${t.field}_${t.id}`,o=this.getValidationState(s),u=this.timeouts.get(s);u!==void 0&&clearTimeout(u);const m=this.abortControllers.get(s);if(m&&m.abort(),!a&&o.value.lastValidatedValue===r)return;if(t.minLength&&typeof r=="string"&&r.length<t.minLength){o.set({...o.value,result:D.a.valid,isValidating:!1});return}const y=setTimeout(async()=>{const d=new AbortController;this.abortControllers.set(s,d),o.set({...o.value,isValidating:!0,result:t.loadingMessage?D.a.invalid({message:t.loadingMessage}):o.value.result});try{const v=await t.validate(r,n);if(d.signal.aborted)return;const $=v.valid?D.a.valid:D.a.invalid({message:v.message||"Async validation failed",context:v.context});o.set({isValidating:!1,result:$,lastValidatedValue:r,lastValidatedAt:Date.now()})}catch(v){if(d.signal.aborted)return;const $=v instanceof Error?v.message:"Async validation error";o.set({isValidating:!1,result:D.a.invalid({message:$}),lastValidatedValue:r,lastValidatedAt:Date.now()})}finally{this.abortControllers.delete(s),this.timeouts.delete(s)}},a?0:t.debounce||300);this.timeouts.set(s,y)}cancelAll(){for(const t of this.timeouts.values())clearTimeout(t);this.timeouts.clear();for(const t of this.abortControllers.values())t.abort();this.abortControllers.clear()}getAllValidationResults(){const t={};for(const[r,n]of this.validationStates.entries()){const a=n.value;!a.isValidating&&a.result.type==="invalid"&&(t[r]=a.result)}return t}isValidating(){for(const t of this.validationStates.values())if(t.value.isValidating)return!0;return!1}dispose(){this.cancelAll();for(const t of this.validationStates.values())t.dispose();this.validationStates.clear()}}function xi(e){const t=globalThis.structuredClone;return typeof t=="function"?t(e):JSON.parse(JSON.stringify(e))}function Gi(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}}function Xi({schema:e,initialValue:t,externalSchemas:r,refResolver:n,sanitizeAdditional:a,validationMode:s,validateDebounceMs:o},u){return E.Async(bs(e,{externalSchemas:r,refResolver:n,sanitizeAdditional:a}),m=>{if(m.ok){const{ajv:y,validate:d}=m.value,v=Li(e),$=Bi(e),S=$.length>0?new Hi:null,w=s??"touchedOrSubmit",g=F=>{const A=d(F);let z;return A?z=D.a.valid:z=Dt(d.errors??[]),v?Ki(F,F,v,d):z},{controller:f,setStatus:l}=D.useController({initialValue:t,validationMode:w,validateDebounceMs:o,validate:w==="onSubmit"?void 0:g}),i=v?Wi(v):null,c=a!==!1;let p=!1;const b=c?f.signal.on(F=>{if(p)return;const A=xi(F);d(A)&&!Gi(A,F)&&(p=!0,f.change(A),p=!1)}):()=>{},_=i?f.signal.on((F,A)=>{A!=null&&JSON.stringify(F)!==JSON.stringify(A)&&setTimeout(()=>{const U=f.status.value;l(U)},10)}):()=>{},O=S&&$.length>0?f.signal.on(F=>{for(const A of $)S.validateField(A,F,F)}):()=>{},C=()=>{b(),_(),O(),S?.dispose(),f.dispose()},V=E.Fragment(E.OnDispose(C),Ms({schema:e,controller:f,ajv:y}));return u({Form:V,controller:f,setStatus:l})}return E.html.div(E.attr.class("bc-json-schema-form__error"),m.error)})}var Ds=hs();const zs=lr(Ds),Yi=Us({__proto__:null,default:zs},[Ds]);function Zi(e,t){const n=(t?.ajv??new zs({allErrors:!0})).compile(e);return{"~standard":{version:1,vendor:"ajv",validate:a=>n(a)?{value:a}:{issues:Qi(n.errors??[])},types:void 0}}}function Qi(e){return e.map(t=>({message:eo(t),path:to(t)}))}function eo(e){return e.message??`${e.keyword} validation failed`}function to(e){const t=ro(e.instancePath||"");if(e.keyword==="required"){const r=e.params.missingProperty;if(r!=null)return[...t,r]}if(e.keyword==="additionalProperties"){const r=e.params.additionalProperty;if(r!=null)return[...t,r]}if(e.keyword==="unevaluatedProperties"){const r=e.params.unevaluatedProperty;if(r!=null)return[...t,r]}return t.length>0?t:void 0}function ro(e){return e?e.split("/").slice(1).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~")).map(r=>no(r)?Number(r):r):[]}function no(e){return/^\d+$/.test(e)}exports.JSONSchemaAllOf=qi;exports.JSONSchemaAny=Fe;exports.JSONSchemaAnyOf=Ts;exports.JSONSchemaArray=gr;exports.JSONSchemaBoolean=At;exports.JSONSchemaConst=As;exports.JSONSchemaControl=Ms;exports.JSONSchemaEnum=Cs;exports.JSONSchemaForm=Xi;exports.JSONSchemaGenericControl=Ee;exports.JSONSchemaInteger=Ct;exports.JSONSchemaNull=pr;exports.JSONSchemaNumber=ze;exports.JSONSchemaObject=yr;exports.JSONSchemaOneOf=qs;exports.JSONSchemaString=It;exports.JSONSchemaUnion=vr;exports.SchemaContext=Ft;exports.ajvErrorsToControllerValidation=Dt;exports.ajvErrorsToDependencies=gs;exports.buildMessage=ys;exports.buildPath=ps;exports.clearCaches=Wa;exports.clearCachesForAjv=Ba;exports.compileWithCache=zt;exports.composeEffectiveObjectSchema=$s;exports.createAJVStandardSchema=Zi;exports.evaluateIfThenElseOverlay=mr;exports.evaluateNotViolation=_s;exports.getAjvForSchema=bs;exports.getCacheStats=Ha;exports.getDefaultExportFromCjs=lr;exports.getEvaluatedProperties=Ae;exports.jsonPointerToSegments=dr;exports.mergeAllOf=Lt;exports.requireApplicator=cs;exports.requireCodegen=x;exports.requireCompile=Mt;exports.requireCore=ts;exports.requireCore$1=ns;exports.requireDependencies=os;exports.requireDiscriminator=ms;exports.requireDraft7=ds;exports.requireFormat=ls;exports.requireMetadata=fs;exports.requireNames=Se;exports.requireRef=rs;exports.requireRef_error=Ue;exports.requireUtil=Q;exports.requireValidate=Le;exports.requireValidation=ss;exports.requireValidation_error=Vt;
8
+ deps: ${d}}`};const a={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(m){const[y,d]=s(m);o(m,y),u(m,d)}};function s({schema:m}){const y={},d={};for(const v in m){if(v==="__proto__")continue;const $=Array.isArray(m[v])?y:d;$[v]=m[v]}return[y,d]}function o(m,y=m.schema){const{gen:d,data:v,it:$}=m;if(Object.keys(y).length===0)return;const S=d.let("missing");for(const w in y){const g=y[w];if(g.length===0)continue;const f=(0,n.propertyInData)(d,v,w,$.opts.ownProperties);m.setParams({property:w,depsCount:g.length,deps:g.join(", ")}),$.allErrors?d.if(f,()=>{for(const l of g)(0,n.checkReportMissingProp)(m,l)}):(d.if((0,t._)`${f} && (${(0,n.checkMissingProp)(m,g,S)})`),(0,n.reportMissingProp)(m,S),d.else())}}e.validatePropertyDeps=o;function u(m,y=m.schema){const{gen:d,data:v,keyword:$,it:S}=m,w=d.name("valid");for(const g in y)(0,r.alwaysValidSchema)(S,y[g])||(d.if((0,n.propertyInData)(d,v,g,S.opts.ownProperties),()=>{const f=m.subschema({keyword:$,schemaProp:g},w);m.mergeValidEvaluated(f,w)},()=>d.var(w,!0)),m.ok(w))}e.validateSchemaDeps=u,e.default=a}(sr)),sr}var pt={},bn;function wa(){if(bn)return pt;bn=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:a})=>(0,e._)`{propertyName: ${a.propertyName}}`},code(a){const{gen:s,schema:o,data:u,it:m}=a;if((0,t.alwaysValidSchema)(m,o))return;const y=s.name("valid");s.forIn("key",u,d=>{a.setParams({propertyName:d}),a.subschema({keyword:"propertyNames",data:d,dataTypes:["string"],propertyName:d,compositeRule:!0},y),s.if((0,e.not)(y),()=>{a.error(!0),m.allErrors||s.break()})}),a.ok(y)}};return pt.default=n,pt}var yt={},_n;function us(){if(_n)return yt;_n=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=ve(),t=x(),r=Se(),n=Q(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:u,schema:m,parentSchema:y,data:d,errsCount:v,it:$}=o;if(!v)throw new Error("ajv implementation error");const{allErrors:S,opts:w}=$;if($.props=!0,w.removeAdditional!=="all"&&(0,n.alwaysValidSchema)($,m))return;const g=(0,e.allSchemaProperties)(y.properties),f=(0,e.allSchemaProperties)(y.patternProperties);l(),o.ok((0,t._)`${v} === ${r.default.errors}`);function l(){u.forIn("key",d,_=>{!g.length&&!f.length?p(_):u.if(i(_),()=>p(_))})}function i(_){let O;if(g.length>8){const C=(0,n.schemaRefOrVal)($,y.properties,"properties");O=(0,e.isOwnProperty)(u,C,_)}else g.length?O=(0,t.or)(...g.map(C=>(0,t._)`${_} === ${C}`)):O=t.nil;return f.length&&(O=(0,t.or)(O,...f.map(C=>(0,t._)`${(0,e.usePattern)(o,C)}.test(${_})`))),(0,t.not)(O)}function c(_){u.code((0,t._)`delete ${d}[${_}]`)}function p(_){if(w.removeAdditional==="all"||w.removeAdditional&&m===!1){c(_);return}if(m===!1){o.setParams({additionalProperty:_}),o.error(),S||u.break();return}if(typeof m=="object"&&!(0,n.alwaysValidSchema)($,m)){const O=u.name("valid");w.removeAdditional==="failing"?(b(_,O,!1),u.if((0,t.not)(O),()=>{o.reset(),c(_)})):(b(_,O),S||u.if((0,t.not)(O),()=>u.break()))}}function b(_,O,C){const V={keyword:"additionalProperties",dataProp:_,dataPropType:n.Type.Str};C===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(V,O)}}};return yt.default=s,yt}var gt={},$n;function Sa(){if($n)return gt;$n=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Le(),t=ve(),r=Q(),n=us(),a={keyword:"properties",type:"object",schemaType:"object",code(s){const{gen:o,schema:u,parentSchema:m,data:y,it:d}=s;d.opts.removeAdditional==="all"&&m.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(d,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(u);for(const f of v)d.definedProperties.add(f);d.opts.unevaluated&&v.length&&d.props!==!0&&(d.props=r.mergeEvaluated.props(o,(0,r.toHash)(v),d.props));const $=v.filter(f=>!(0,r.alwaysValidSchema)(d,u[f]));if($.length===0)return;const S=o.name("valid");for(const f of $)w(f)?g(f):(o.if((0,t.propertyInData)(o,y,f,d.opts.ownProperties)),g(f),d.allErrors||o.else().var(S,!0),o.endIf()),s.it.definedProperties.add(f),s.ok(S);function w(f){return d.opts.useDefaults&&!d.compositeRule&&u[f].default!==void 0}function g(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},S)}}};return gt.default=a,gt}var vt={},wn;function Pa(){if(wn)return vt;wn=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=ve(),t=x(),r=Q(),n=Q(),a={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:o,schema:u,data:m,parentSchema:y,it:d}=s,{opts:v}=d,$=(0,e.allSchemaProperties)(u),S=$.filter(p=>(0,r.alwaysValidSchema)(d,u[p]));if($.length===0||S.length===$.length&&(!d.opts.unevaluated||d.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&y.properties,g=o.name("valid");d.props!==!0&&!(d.props instanceof t.Name)&&(d.props=(0,n.evaluatedPropsToName)(o,d.props));const{props:f}=d;l();function l(){for(const p of $)w&&i(p),d.allErrors?c(p):(o.var(g,!0),c(p),o.if(g))}function i(p){for(const b in w)new RegExp(p).test(b)&&(0,r.checkStrictMode)(d,`property ${b} matches pattern ${p} (use allowMatchingProperties)`)}function c(p){o.forIn("key",m,b=>{o.if((0,t._)`${(0,e.usePattern)(s,p)}.test(${b})`,()=>{const _=S.includes(p);_||s.subschema({keyword:"patternProperties",schemaProp:p,dataProp:b,dataPropType:n.Type.Str},g),d.opts.unevaluated&&f!==!0?o.assign((0,t._)`${f}[${b}]`,!0):!_&&!d.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return vt.default=a,vt}var bt={},Sn;function Ea(){if(Sn)return bt;Sn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Q(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:a,it:s}=r;if((0,e.alwaysValidSchema)(s,a)){r.fail();return}const o=n.name("valid");r.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return bt.default=t,bt}var _t={},Pn;function Oa(){if(Pn)return _t;Pn=1,Object.defineProperty(_t,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ve().validateUnion,error:{message:"must match a schema in anyOf"}};return _t.default=t,_t}var $t={},En;function ja(){if(En)return $t;En=1,Object.defineProperty($t,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:a})=>(0,e._)`{passingSchemas: ${a.passing}}`},code(a){const{gen:s,schema:o,parentSchema:u,it:m}=a;if(!Array.isArray(o))throw new Error("ajv implementation error");if(m.opts.discriminator&&u.discriminator)return;const y=o,d=s.let("valid",!1),v=s.let("passing",null),$=s.name("_valid");a.setParams({passing:v}),s.block(S),a.result(d,()=>a.reset(),()=>a.error(!0));function S(){y.forEach((w,g)=>{let f;(0,t.alwaysValidSchema)(m,w)?s.var($,!0):f=a.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},$),g>0&&s.if((0,e._)`${$} && ${d}`).assign(d,!1).assign(v,(0,e._)`[${v}, ${g}]`).else(),s.if($,()=>{s.assign(d,!0),s.assign(v,g),f&&a.mergeEvaluated(f,e.Name)})})}}};return $t.default=n,$t}var wt={},On;function ka(){if(On)return wt;On=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Q(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:a,it:s}=r;if(!Array.isArray(a))throw new Error("ajv implementation error");const o=n.name("valid");a.forEach((u,m)=>{if((0,e.alwaysValidSchema)(s,u))return;const y=r.subschema({keyword:"allOf",schemaProp:m},o);r.ok(o),r.mergeEvaluated(y)})}};return wt.default=t,wt}var St={},jn;function Na(){if(jn)return St;jn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=x(),t=Q(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0,e._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:u,it:m}=s;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(m,'"if" without "then" and "else" is ignored');const y=a(m,"then"),d=a(m,"else");if(!y&&!d)return;const v=o.let("valid",!0),$=o.name("_valid");if(S(),s.reset(),y&&d){const g=o.let("ifClause");s.setParams({ifClause:g}),o.if($,w("then",g),w("else",g))}else y?o.if($,w("then")):o.if((0,e.not)($),w("else"));s.pass(v,()=>s.error(!0));function S(){const g=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);s.mergeEvaluated(g)}function w(g,f){return()=>{const l=s.subschema({keyword:g},$);o.assign(v,$),s.mergeValidEvaluated(l,v),f?o.assign(f,(0,e._)`${g}`):s.setParams({ifClause:g})}}}};function a(s,o){const u=s.schema[o];return u!==void 0&&!(0,t.alwaysValidSchema)(s,u)}return St.default=n,St}var Pt={},kn;function Ra(){if(kn)return Pt;kn=1,Object.defineProperty(Pt,"__esModule",{value:!0});const e=Q(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:a}){n.if===void 0&&(0,e.checkStrictMode)(a,`"${r}" without "if" is ignored`)}};return Pt.default=t,Pt}var Nn;function cs(){if(Nn)return ft;Nn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=as(),t=ba(),r=is(),n=_a(),a=$a(),s=os(),o=wa(),u=us(),m=Sa(),y=Pa(),d=Ea(),v=Oa(),$=ja(),S=ka(),w=Na(),g=Ra();function f(l=!1){const i=[d.default,v.default,$.default,S.default,w.default,g.default,o.default,u.default,s.default,m.default,y.default];return l?i.push(t.default,n.default):i.push(e.default,r.default),i.push(a.default),i}return ft.default=f,ft}var Et={},Ot={},Rn;function Ia(){if(Rn)return Ot;Rn=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=x(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,a){const{gen:s,data:o,$data:u,schema:m,schemaCode:y,it:d}=n,{opts:v,errSchemaPath:$,schemaEnv:S,self:w}=d;if(!v.validateFormats)return;u?g():f();function g(){const l=s.scopeValue("formats",{ref:w.formats,code:v.code.formats}),i=s.const("fDef",(0,e._)`${l}[${y}]`),c=s.let("fType"),p=s.let("format");s.if((0,e._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>s.assign(c,(0,e._)`${i}.type || "string"`).assign(p,(0,e._)`${i}.validate`),()=>s.assign(c,(0,e._)`"string"`).assign(p,i)),n.fail$data((0,e.or)(b(),_()));function b(){return v.strictSchema===!1?e.nil:(0,e._)`${y} && !${p}`}function _(){const O=S.$async?(0,e._)`(${i}.async ? await ${p}(${o}) : ${p}(${o}))`:(0,e._)`${p}(${o})`,C=(0,e._)`(typeof ${p} == "function" ? ${O} : ${p}.test(${o}))`;return(0,e._)`${p} && ${p} !== true && ${c} === ${a} && !${C}`}}function f(){const l=w.formats[m];if(!l){b();return}if(l===!0)return;const[i,c,p]=_(l);i===a&&n.pass(O());function b(){if(v.strictSchema===!1){w.logger.warn(C());return}throw new Error(C());function C(){return`unknown format "${m}" ignored in schema at path "${$}"`}}function _(C){const V=C instanceof RegExp?(0,e.regexpCode)(C):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(m)}`:void 0,F=s.scopeValue("formats",{key:m,ref:C,code:V});return typeof C=="object"&&!(C instanceof RegExp)?[C.type||"string",C.validate,(0,e._)`${F}.validate`]:["string",C,F]}function O(){if(typeof l=="object"&&!(l instanceof RegExp)&&l.async){if(!S.$async)throw new Error("async format in sync schema");return(0,e._)`await ${p}(${o})`}return typeof c=="function"?(0,e._)`${p}(${o})`:(0,e._)`${p}.test(${o})`}}}};return Ot.default=r,Ot}var In;function ls(){if(In)return Et;In=1,Object.defineProperty(Et,"__esModule",{value:!0});const t=[Ia().default];return Et.default=t,Et}var ke={},Cn;function fs(){return Cn||(Cn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.contentVocabulary=ke.metadataVocabulary=void 0,ke.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ke.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ke}var An;function ds(){if(An)return Ge;An=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=ns(),t=ss(),r=cs(),n=ls(),a=fs(),s=[e.default,t.default,(0,r.default)(),n.default,a.metadataVocabulary,a.contentVocabulary];return Ge.default=s,Ge}var jt={},Me={},Tn;function Ca(){if(Tn)return Me;Tn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.DiscrError=void 0;var e;return function(t){t.Tag="tag",t.Mapping="mapping"}(e||(Me.DiscrError=e={})),Me}var qn;function ms(){if(qn)return jt;qn=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=x(),t=Ca(),r=Mt(),n=Ue(),a=Q(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:m}})=>u===t.DiscrError.Tag?`tag "${m}" must be string`:`value of tag "${m}" must be in oneOf`,params:({params:{discrError:u,tag:m,tagName:y}})=>(0,e._)`{error: ${u}, tag: ${y}, tagValue: ${m}}`},code(u){const{gen:m,data:y,schema:d,parentSchema:v,it:$}=u,{oneOf:S}=v;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=d.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(d.mapping)throw new Error("discriminator: mapping is not supported");if(!S)throw new Error("discriminator: requires oneOf keyword");const g=m.let("valid",!1),f=m.const("tag",(0,e._)`${y}${(0,e.getProperty)(w)}`);m.if((0,e._)`typeof ${f} == "string"`,()=>l(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:f,tagName:w})),u.ok(g);function l(){const p=c();m.if(!1);for(const b in p)m.elseIf((0,e._)`${f} === ${b}`),m.assign(g,i(p[b]));m.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:f,tagName:w}),m.endIf()}function i(p){const b=m.name("valid"),_=u.subschema({keyword:"oneOf",schemaProp:p},b);return u.mergeEvaluated(_,e.Name),b}function c(){var p;const b={},_=C(v);let O=!0;for(let A=0;A<S.length;A++){let z=S[A];if(z?.$ref&&!(0,a.schemaHasRulesButRef)(z,$.self.RULES)){const B=z.$ref;if(z=r.resolveRef.call($.self,$.schemaEnv.root,$.baseId,B),z instanceof r.SchemaEnv&&(z=z.schema),z===void 0)throw new n.default($.opts.uriResolver,$.baseId,B)}const U=(p=z?.properties)===null||p===void 0?void 0:p[w];if(typeof U!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${w}"`);O=O&&(_||C(z)),V(U,A)}if(!O)throw new Error(`discriminator: "${w}" must be required`);return b;function C({required:A}){return Array.isArray(A)&&A.includes(w)}function V(A,z){if(A.const)F(A.const,z);else if(A.enum)for(const U of A.enum)F(U,z);else throw new Error(`discriminator: "properties/${w}" must have "const" or "enum"`)}function F(A,z){if(typeof A!="string"||A in b)throw new Error(`discriminator: "${w}" values must be unique strings`);b[A]=z}}}};return jt.default=o,jt}const Aa="http://json-schema.org/draft-07/schema#",Ta="http://json-schema.org/draft-07/schema#",qa="Core schema meta-schema",Va={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Ma=["object","boolean"],Da={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},za={$schema:Aa,$id:Ta,title:qa,definitions:Va,type:Ma,properties:Da,default:!0};var Vn;function hs(){return Vn||(Vn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=ts(),n=ds(),a=ms(),s=za,o=["/properties"],u="http://json-schema.org/draft-07/schema";class m extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(w,u,!1),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}}t.Ajv=m,e.exports=t=m,e.exports.Ajv=m,Object.defineProperty(t,"__esModule",{value:!0}),t.default=m;var y=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var d=x();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var v=Vt();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return v.default}});var $=Ue();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return $.default}})}(Je,Je.exports)),Je.exports}var Mn;function Fa(){return Mn||(Mn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=hs(),r=x(),n=r.operators,a={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},s={message:({keyword:u,schemaCode:m})=>(0,r.str)`should be ${a[u].okStr} ${m}`,params:({keyword:u,schemaCode:m})=>(0,r._)`{comparison: ${a[u].okStr}, limit: ${m}}`};e.formatLimitDefinition={keyword:Object.keys(a),type:"string",schemaType:"string",$data:!0,error:s,code(u){const{gen:m,data:y,schemaCode:d,keyword:v,it:$}=u,{opts:S,self:w}=$;if(!S.validateFormats)return;const g=new t.KeywordCxt($,w.RULES.all.format.definition,"format");g.$data?f():l();function f(){const c=m.scopeValue("formats",{ref:w.formats,code:S.code.formats}),p=m.const("fmt",(0,r._)`${c}[${g.schemaCode}]`);u.fail$data((0,r.or)((0,r._)`typeof ${p} != "object"`,(0,r._)`${p} instanceof RegExp`,(0,r._)`typeof ${p}.compare != "function"`,i(p)))}function l(){const c=g.schema,p=w.formats[c];if(!p||p===!0)return;if(typeof p!="object"||p instanceof RegExp||typeof p.compare!="function")throw new Error(`"${v}": format "${c}" does not define "compare" function`);const b=m.scopeValue("formats",{key:c,ref:p,code:S.code.formats?(0,r._)`${S.code.formats}${(0,r.getProperty)(c)}`:void 0});u.fail$data(i(b))}function i(c){return(0,r._)`${c}.compare(${y}, ${d}) ${a[v].fail} 0`}},dependencies:["format"]};const o=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=o}(Ht)),Ht}var Dn;function La(){return Dn||(Dn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ks(),n=Fa(),a=x(),s=new a.Name("fullFormats"),o=new a.Name("fastFormats"),u=(y,d={keywords:!0})=>{if(Array.isArray(d))return m(y,d,r.fullFormats,s),y;const[v,$]=d.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s],S=d.formats||r.formatNames;return m(y,S,v,$),d.keywords&&(0,n.default)(y),y};u.get=(y,d="full")=>{const $=(d==="fast"?r.fastFormats:r.fullFormats)[y];if(!$)throw new Error(`Unknown format "${y}"`);return $};function m(y,d,v,$){var S,w;(S=(w=y.opts.code).formats)!==null&&S!==void 0||(w.formats=(0,a._)`require("ajv-formats/dist/formats").${$}`);for(const g of d)y.addFormat(g,v[g])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u}(Ke,Ke.exports)),Ke.exports}var Ua=La();const Ka=lr(Ua);function dr(e){return e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function ps(e){const t=dr(e.instancePath||"");if(e.keyword==="required"){const r=e.params.missingProperty;if(r!=null)return[...t,r]}if(e.keyword==="additionalProperties"){const r=e.params.additionalProperty;if(r!=null)return[...t,r]}if(e.keyword==="unevaluatedProperties"){const r=e.params.unevaluatedProperty;if(r!=null)return[...t,r]}return t.length>0?t:void 0}function ys(e){return e.message??`${e.keyword} validation failed`}function gs(e){return e.reduce((t,r)=>{const n=ps(r);if(n==null)return t;let a=t;for(const s of n){const o=s;a.dependencies==null&&(a.dependencies={}),a.dependencies[o]==null&&(a.dependencies[o]={}),a=a.dependencies[o]}return a.message=ys(r),t},{})}function Dt(e){const t=gs(e);return D.a.invalid(t)}function Ja(e){const t={keyword:"x:ui",schemaType:["string","object"],errors:!1,validate:()=>!0};e.addKeyword(t)}let Rt=new WeakMap;function Wa(){Rt=new WeakMap}function Ba(e){Rt.delete(e)}function Ha(){return{ajvInstances:0}}function zt(e,t){let r=Rt.get(e);r==null&&(r=new WeakMap,Rt.set(e,r));const n=r.get(t);if(n)return n;const a=e.compile(t);return r.set(t,a),a}async function zn(e,t,r){const n=(await(()=>{switch(e){case"2020-12":return Promise.resolve().then(()=>require("./2020--7erNwhp.cjs")).then(s=>s._2020);case"2019-09":return Promise.resolve().then(()=>require("./2019-BbqYDdRN.cjs")).then(s=>s._2019);case"draft-07":return Promise.resolve().then(()=>Yi)}})()).default,a=new n({meta:r,strictSchema:!1,allErrors:!0,removeAdditional:t});switch(e){case"2020-12":a.opts.defaultMeta="https://json-schema.org/draft/2020-12/schema";break;case"2019-09":a.opts.defaultMeta="https://json-schema.org/draft/2019-09/schema";break;case"draft-07":a.opts.defaultMeta="http://json-schema.org/draft-07/schema#";break}return Ka(a),Ja(a),a}function xa(e){return e==null||e.includes("draft/2020-12")?"2020-12":e.includes("draft/2019-09")?"2019-09":"draft-07"}function Ga(e){const t=e.indexOf("#");return t>=0?e.slice(0,t):e}function or(e,t=!0){if(Array.isArray(e))return e.map(r=>or(r,!1));if(e!=null&&typeof e=="object"){const r=e,n={};for(const[a,s]of Object.entries(r))!t&&(a==="$id"||a==="$schema"||a==="$dynamicAnchor")||(n[a]=or(s,!1));return n}return e}function Fn(e){const t=new Set,r=n=>{if(n!=null){if(Array.isArray(n)){for(const a of n)r(a);return}if(typeof n=="object"){const a=n,s=a.$ref;typeof s=="string"&&s.length>0&&s[0]!=="#"&&t.add(Ga(s));for(const o of Object.values(a))r(o)}}};return r(e),[...t]}function vs(e,t){for(const r of t){const n=r.$id;if(typeof n=="string"&&n.length>0&&!e.getSchema(n))try{e.addSchema(r)}catch{}}}async function Xa(e,t,r,n){if(r==null)return null;const a=new Set;if(n&&n.length>0)for(const u of n){const m=u.$id;typeof m=="string"&&m.length>0&&a.add(m)}const s=[],o=5;for(let u=0;u<o;u++){const m=Fn(t),y=s.flatMap($=>Fn($)),d=new Set([...m,...y]),v=[];for(const $ of d)if(!a.has($)){if(e.getSchema($)){a.add($);continue}v.push($)}if(v.length===0)return null;try{const $=await r(v);if(!Array.isArray($)||$.length===0)return null;vs(e,$);for(const S of $){const w=S.$id;typeof w=="string"&&w.length>0&&(a.add(w),s.push(S))}}catch($){return`refResolver failed: ${$ instanceof Error?$.message:String($)}`}}return"refResolver reached iteration limit while resolving external $refs"}async function bs(e,t){try{const r=xa(e.$schema),n=t?.sanitizeAdditional===!1?!1:t?.sanitizeAdditional??!1,a=d=>typeof d=="string"&&d.endsWith("#")?d.slice(0,-1):d??"",s=e.$id,o=a(s);if(o!==""&&new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft-07/schema"]).has(o)){const d=await zn(r,n,!1),v=or(e);try{d.addMetaSchema(v)}catch{}const $=d.getSchema(s??o)??d.compile(v);return{ok:!0,value:{ajv:d,validate:$}}}const m=await zn(r,n,!0);if(t?.externalSchemas&&t.externalSchemas.length>0&&vs(m,t.externalSchemas),t?.refResolver){const d=await Xa(m,e,t.refResolver,t.externalSchemas);if(d!=null)return{ok:!1,error:d}}const y=m.compile(e);return{ok:!0,value:{ajv:m,validate:y}}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}class Ft{schema;definition;horizontal;path;ajv;isPropertyRequired;suppressLabel;schemaConflicts;notViolations;constructor(t){const{schema:r,definition:n,horizontal:a,path:s,ajv:o,isPropertyRequired:u,suppressLabel:m,schemaConflicts:y,notViolations:d}=t;this.schema=r,this.definition=n,this.horizontal=a,this.path=s,this.ajv=o,this.isPropertyRequired=u??!1,this.suppressLabel=m??!1,this.schemaConflicts=y??[],this.notViolations=d??[]}with=t=>new Ft({schema:t.schema??this.schema,definition:t.definition??this.definition,horizontal:t.horizontal??this.horizontal,path:t.path??this.path,ajv:t.ajv??this.ajv,isPropertyRequired:t.isPropertyRequired??this.isPropertyRequired,suppressLabel:t.suppressLabel??this.suppressLabel,schemaConflicts:t.schemaConflicts??this.schemaConflicts,notViolations:t.notViolations??this.notViolations});append=t=>this.with({path:[...this.path,t]});get isRoot(){return this.path.length===0}get name(){const t=this.path[this.path.length-1];if(typeof t=="string")return t}get widgetName(){return this.path.map(String).join(".")}get widgetLabel(){const t=this.name;return(typeof this.definition=="object"&&this.definition!==null?this.definition.title:void 0)??(t!=null?J._t(J.gt(t)):void 0)}hasRequiredProperty=t=>typeof this.definition=="boolean"?!1:this.definition.required!=null&&this.definition.required.includes(t);get nullable(){return this.definition.nullable??!1}get isNullable(){return this.nullable||this.hasType("null")||this.hasEnumValue(null)||this.hasConstValue(null)||(this.anyOf?.some(t=>t.isNullable)??!1)||(this.oneOf?.some(t=>t.isNullable)??!1)}get isOptional(){return!this.isPropertyRequired}get shouldShowPresenceToggle(){return!(!this.isOptional||this.isRoot||(this.isNullable||this.isOptional)&&this.isPrimitive)}get isPrimitive(){if(typeof this.definition=="boolean")return!1;const t=this.definition;if(t.const!==void 0||t.enum!==void 0)return!0;if(t.type){const r=Array.isArray(t.type)?t.type:[t.type],n=["string","number","integer","boolean"];return r.every(a=>n.includes(a))}return!1}get isReadOnly(){return typeof this.definition=="boolean"?!1:!!this.definition.readOnly}get isWriteOnly(){return typeof this.definition=="boolean"?!1:!!this.definition.writeOnly}get isDeprecated(){return typeof this.definition=="boolean"?!1:!!this.definition.deprecated}get shouldIgnoreReadOnly(){if(typeof this.definition=="boolean")return!1;const t=this.definition["x:ui"];return t&&typeof t=="object"?!!t.ignoreReadOnly:!1}get shouldShowWriteOnly(){if(typeof this.definition=="boolean")return!1;const t=this.definition["x:ui"];return t&&typeof t=="object"?!!t.showWriteOnly:!1}get anyOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.anyOf)?this.definition.anyOf.map(t=>this.with({definition:t})):void 0}get oneOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.oneOf)?this.definition.oneOf.map(t=>this.with({definition:t})):void 0}get allOf(){if(typeof this.definition!="boolean")return Array.isArray(this.definition.allOf)?this.definition.allOf.map(t=>this.with({definition:t})):void 0}hasType=t=>this.definition===!0?!0:this.definition===!1?!1:Array.isArray(this.definition.type)?this.definition.type.includes(t):this.definition.type===t;hasEnumValue=t=>typeof this.definition=="boolean"?!1:Array.isArray(this.definition.enum)?this.definition.enum.includes(t):!1;hasConstValue=t=>typeof this.definition=="boolean"?!1:this.definition.const===t;get description(){if(typeof this.definition!="boolean")return this.definition.description}get examples(){if(typeof this.definition!="boolean")return this.definition.examples}get default(){if(typeof this.definition!="boolean")return this.definition.default}}function Ya(e,t){if(typeof e=="boolean"||typeof t=="boolean")return t;const r={...e};for(const[n,a]of Object.entries(t))n==="required"&&Array.isArray(e.required)&&Array.isArray(a)?r.required=[...new Set([...e.required,...a])]:n==="properties"&&e.properties&&typeof a=="object"&&a!=null?r.properties={...e.properties,...a}:r[n]=a;return r}function Za(e,t){if(typeof e=="boolean"||typeof t=="boolean")return e===t;const r=e.type,n=t.type;return!(r!=null&&n!=null&&r!==n||r==="string"&&n==="string"&&(e.minLength!=null&&t.maxLength!=null&&e.minLength>t.maxLength||e.maxLength!=null&&t.minLength!=null&&e.maxLength<t.minLength)||(r==="number"||r==="integer")&&(n==="number"||n==="integer")&&(e.minimum!=null&&t.maximum!=null&&e.minimum>t.maximum||e.maximum!=null&&t.minimum!=null&&e.maximum<t.minimum))}function Qa(e,t,r,n){if(typeof t=="boolean"||typeof r=="boolean")return{path:n,message:`Property "${e}" has conflicting boolean schema definitions in allOf branches`,conflictingValues:[t,r]};const a=t.type,s=r.type;if(a!=null&&s!=null&&a!==s){const o=Array.isArray(a)?a:[a],u=Array.isArray(s)?s:[s];return{path:n,message:`Property "${e}" has conflicting types: ${o.join("|")} vs ${u.join("|")}`,conflictingValues:[t,r]}}if(a===s&&a==="string"){const o=[];if(t.minLength!=null&&r.maxLength!=null&&t.minLength>r.maxLength&&o.push(`minLength ${t.minLength} > maxLength ${r.maxLength}`),t.maxLength!=null&&r.minLength!=null&&t.maxLength<r.minLength&&o.push(`maxLength ${t.maxLength} < minLength ${r.minLength}`),o.length>0)return{path:n,message:`Property "${e}" has conflicting string constraints: ${o.join(", ")}`,conflictingValues:[t,r]}}if(a===s&&(a==="number"||a==="integer")){const o=[];if(t.minimum!=null&&r.maximum!=null&&t.minimum>r.maximum&&o.push(`minimum ${t.minimum} > maximum ${r.maximum}`),t.maximum!=null&&r.minimum!=null&&t.maximum<r.minimum&&o.push(`maximum ${t.maximum} < minimum ${r.minimum}`),o.length>0)return{path:n,message:`Property "${e}" has conflicting numeric constraints: ${o.join(", ")}`,conflictingValues:[t,r]}}return Za(t,r)?null:{path:n,message:`Property "${e}" has conflicting definitions in allOf branches`,conflictingValues:[t,r]}}function Lt(e,t=[]){const r=[],n={},a=[],s=[],o={};for(const u of e){if(u.type!=null){const l=Array.isArray(u.type)?u.type:[u.type],i=new Set(l.map(c=>c));i.has("number")&&i.add("integer"),a.push(i)}if(Array.isArray(u.required)&&s.push(...u.required),u.properties!=null)for(const[l,i]of Object.entries(u.properties)){if(o[l]!=null&&o[l]!==i){const c=o[l],p=Qa(l,c,i,[...t,"properties",l]);p!=null&&r.push(p)}o[l]!=null?o[l]=Ya(o[l],i):o[l]=i}const{type:m,required:y,properties:d,allOf:v,additionalProperties:$,patternProperties:S,minProperties:w,maxProperties:g,...f}=u;$!=null&&n.additionalProperties!=null&&n.additionalProperties!==$&&r.push({path:[...t,"additionalProperties"],message:`Conflicting additionalProperties values in allOf: ${n.additionalProperties} vs ${$}`,conflictingValues:[n.additionalProperties,$]}),w!=null&&n.maxProperties!=null&&w>n.maxProperties&&r.push({path:[...t,"minProperties"],message:`minProperties ${w} conflicts with existing maxProperties ${n.maxProperties}`,conflictingValues:[w,n.maxProperties]}),g!=null&&n.minProperties!=null&&g<n.minProperties&&r.push({path:[...t,"maxProperties"],message:`maxProperties ${g} conflicts with existing minProperties ${n.minProperties}`,conflictingValues:[g,n.minProperties]}),Object.assign(n,f),$!=null&&(n.additionalProperties=$),S!=null&&(n.patternProperties=S),w!=null&&(n.minProperties=w),g!=null&&(n.maxProperties=g)}if(a.length>0){let u=null;for(const y of a)if(u==null)u=new Set(y);else{const d=new Set;for(const v of u)y.has(v)&&d.add(v);u=d}const m=Array.from(u??[]);if(m.length===0){const y=a.map(d=>Array.from(d));r.push({path:[...t,"type"],message:"Incompatible types in allOf (no common types)",conflictingValues:y})}else m.length===1?n.type=m[0]:n.type=m}return s.length>0&&(n.required=[...new Set(s)]),Object.keys(o).length>0&&(n.properties=o),{mergedSchema:n,conflicts:r}}function _s(e,t,r,n=[]){if(!r)return null;try{if(zt(r,e)(t)){const o=e.title||"disallowed schema";return{path:n,message:`Value matches ${o}`,notSchema:e}}return null}catch{return null}}function $s(e,t,r,n=[]){const a=[],s=[],o=mr(e,t,r);o&&a.push(o);const u=Array.isArray(e.required)?[...e.required]:[];if(typeof t=="object"&&t!=null&&!Array.isArray(t)){const v=t,$=e.dependentRequired;if($){for(const[g,f]of Object.entries($))if(Object.prototype.hasOwnProperty.call(v,g))for(const l of f)u.push(l)}const S=e.dependencies;if(S){for(const[g,f]of Object.entries(S))if(Object.prototype.hasOwnProperty.call(v,g))if(Array.isArray(f))for(const l of f)u.push(l);else typeof f=="object"&&f&&a.push(f)}const w=e.dependentSchemas;if(w)for(const[g,f]of Object.entries(w))Object.prototype.hasOwnProperty.call(v,g)&&a.push(f)}const m=[e,...a],{mergedSchema:y,conflicts:d}=Lt(m,n);if(u.length>0){const v=new Set([...y.required??[],...u]);y.required=[...v]}return s.push(...d),{effective:y,conflicts:s}}function mr(e,t,r){if(!r||!e.if||typeof e.if!="object")return null;try{if(zt(r,e.if)(t)){const s=e.then;if(s&&typeof s=="object")return s}else{const s=e.else;if(s&&typeof s=="object")return s}}catch{}return null}function Ae(e,t,r){const n=new Set;if(!t||typeof t!="object")return n;if(e.properties&&Object.keys(e.properties).forEach(o=>{o in t&&n.add(o)}),e.patternProperties&&Object.keys(t).forEach(o=>{Object.keys(e.patternProperties).forEach(u=>{try{new RegExp(u).test(o)&&n.add(o)}catch{}})}),e.additionalProperties===!0||e.additionalProperties&&typeof e.additionalProperties=="object"){const o=new Set;e.properties&&Object.keys(e.properties).forEach(u=>{u in t&&o.add(u)}),e.patternProperties&&Object.keys(t).forEach(u=>{Object.keys(e.patternProperties).forEach(m=>{try{new RegExp(m).test(u)&&o.add(u)}catch{}})}),Object.keys(t).forEach(u=>{o.has(u)||n.add(u)})}e.allOf&&e.allOf.forEach(o=>{typeof o=="object"&&Ae(o,t,r).forEach(m=>n.add(m))});const a=mr(e,t,r);a&&Ae(a,t,r).forEach(u=>n.add(u));const s=e.dependentSchemas;return s&&Object.keys(s).forEach(o=>{if(o in t){const u=s[o];typeof u=="object"&&Ae(u,t,r).forEach(y=>n.add(y))}}),e.dependencies&&Object.keys(e.dependencies).forEach(o=>{if(o in t){const u=e.dependencies[o];typeof u=="object"&&!Array.isArray(u)&&Ae(u,t,r).forEach(y=>n.add(y))}}),n}function we({ctx:e}){const{examples:t,default:r}=e;let{description:n}=e;n==null&&t!=null&&r!=null&&(Array.isArray(t)?n=`example: ${t[0]}`:n=`example: ${t}`);const a=[];if(e.isDeprecated&&a.push("deprecated"),e.isReadOnly&&!e.shouldIgnoreReadOnly&&a.push("read-only"),e.isWriteOnly&&!e.shouldShowWriteOnly&&a.push("write-only"),a.length>0){const s=`(${a.join(", ")})`;n=n?`${n} ${s}`:s}return{label:e.suppressLabel?void 0:e.widgetLabel,description:n,required:e.isPropertyRequired,layout:e.horizontal?"horizontal":"vertical"}}function De(e,t){if(e.default!=null)return t(e.default);if(Array.isArray(e.examples))return t(e.examples[0]);if(e.examples!=null)return t(e.examples)}function ws(e){return e==null?1:Math.round(e)}function Ss(e){const{options:t,selected:r,onChange:n,mode:a="auto",size:s="sm",keyFor:o=d=>String(d),parseKey:u=d=>d}=e,m=t.length;if((a==="auto"?m<=3?"segmented":"select":a)==="segmented"){const d=Object.fromEntries(t.map(v=>[o(v.value),v.label]));return J.SegmentedInput({options:d,value:E.Value.map(r,v=>o(v)),onChange:v=>n(u(v)),size:s})}return J.NativeSelect({options:t.map(d=>({type:"value",value:d.value,label:d.label})),value:r,onChange:n})}function Ps({ctx:e,showSelector:t,selector:r,inner:n}){return e.isRoot?t?D.Stack(E.attr.class("bc-stack--gap-2"),r,n):n:D.InputWrapper({...we({ctx:e}),content:t?D.Stack(E.attr.class("bc-stack--gap-2 bc-stack--align-start"),r,n):n})}function ei(e,t){if(e===null)return t.includes("null")?"null":null;switch(typeof e){case"string":return t.includes("string")?"string":null;case"number":return Number.isInteger(e)&&t.includes("integer")?"integer":t.includes("number")?"number":null;case"boolean":return t.includes("boolean")?"boolean":null;case"object":return Array.isArray(e)?t.includes("array")?"array":null:t.includes("object")?"object":null;default:return null}}function ti(e,t){try{switch(t){case"string":return e==null?{ok:!0,value:void 0}:{ok:!0,value:String(e)};case"number":{if(typeof e=="number")return{ok:!0,value:e};if(typeof e=="string"){const r=Number(e);return Number.isFinite(r)?{ok:!0,value:r}:{ok:!1}}return typeof e=="boolean"?{ok:!0,value:e?1:0}:{ok:!1}}case"integer":return typeof e=="number"&&Number.isInteger(e)?{ok:!0,value:e}:typeof e=="string"?/^[-+]?\d+$/.test(e.trim())?{ok:!0,value:parseInt(e,10)}:{ok:!1}:typeof e=="boolean"?{ok:!0,value:e?1:0}:{ok:!1};case"boolean":{if(typeof e=="boolean")return{ok:!0,value:e};if(typeof e=="string"){const r=e.trim().toLowerCase();return r==="true"||r==="1"||r==="yes"?{ok:!0,value:!0}:r==="false"||r==="0"||r==="no"?{ok:!0,value:!1}:{ok:!1}}return typeof e=="number"?{ok:!0,value:e!==0}:{ok:!1}}case"array":return Array.isArray(e)?{ok:!0,value:e}:{ok:!1};case"object":return e!=null&&typeof e=="object"&&!Array.isArray(e)?{ok:!0,value:e}:{ok:!1};case"null":return{ok:!0,value:null}}}catch{return{ok:!1}}}function ri(e){switch(e){case"null":return null;case"array":return[];case"object":return{};default:return}}function ni(e){if(typeof e=="boolean")return{};const t=e["x:ui"];if(t!=null&&typeof t=="object"&&!Array.isArray(t)){const r=t;return{unionDefault:typeof r.unionDefault=="string"?r.unionDefault:void 0,confirmBranchChange:!!r.confirmBranchChange,selector:r.selector==="segmented"||r.selector==="select"?r.selector:void 0}}return{}}const ar=["description","comment","notes","text"];function si(e){if(typeof e=="boolean")return ar;const t=e["x:ui"];return t&&Array.isArray(t.textAreaTriggers)?[...ar,...t.textAreaTriggers]:ar}function Es(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(t!=null&&(typeof t=="string"||typeof t=="object"&&t!==null))return t}function hr(e,t){if(typeof e=="boolean")return;const r=Es(e);if(typeof r=="object"&&typeof r.widget=="string")return{widget:r.widget,source:"explicit-widget",options:r};const n=typeof r=="string"?r:typeof r=="object"&&typeof r.format=="string"?r.format:void 0;if(n)return{widget:n,source:"explicit-format",options:typeof r=="object"?r:void 0};if(typeof e.format=="string")return{widget:{datetime:"date-time",base64:"binary",bytes:"binary",iri:"uri","iri-reference":"uri-reference","idn-hostname":"hostname"}[e.format]||e.format,source:"schema-format"};if(e.contentMediaType==="text/markdown")return{widget:"markdown",source:"schema-media"};if(e.contentMediaType!=null||e.contentEncoding==="base64")return{widget:"binary",source:"schema-media",options:{mediaType:e.contentMediaType,encoding:e.contentEncoding}};if(e.enum!=null)return{widget:"enum",source:"constraints"};if(e.const!=null)return{widget:"const",source:"constraints"};if((e.type==="number"||e.type==="integer"||Array.isArray(e.type)&&e.type.some(s=>s==="number"||s==="integer"))&&e.minimum!=null&&e.maximum!=null)return e.maximum-e.minimum<=5&&e.minimum>=0&&e.minimum<=1&&(e.multipleOf==null||e.multipleOf>=1)?{widget:"rating",source:"constraints",options:{max:e.maximum}}:{widget:"slider",source:"constraints",options:{min:e.minimum,max:e.maximum,step:e.multipleOf}};if(e.type==="string"){if(e.minLength!=null&&e.minLength>20||e.maxLength!=null&&e.maxLength>100)return{widget:"textarea",source:"heuristics"};if(t){const s=t.toLowerCase();if(s.includes("password")||s.includes("secret"))return{widget:"password",source:"heuristics"};if(s.includes("email"))return{widget:"email",source:"heuristics"};if(s.includes("url")||s.includes("link"))return{widget:"url",source:"heuristics"};if(s.includes("color"))return{widget:"color",source:"heuristics"};if(si(e).some(u=>s.includes(u.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}function ai(e){const{definition:t}=e;if(typeof t=="boolean")return;const r={pattern:t.pattern,minLength:t.minLength,maxLength:t.maxLength},n=hr(t,e.name),a=n?.widget;if(a!=null)switch(a){case"binary":return{...r,format:"binary",...n?.options};case"date":return{...r,format:"date"};case"date-time":return{...r,format:"date-time"};case"email":return{...r,format:"email"};case"markdown":return{...r,format:"markdown"};case"password":return{...r,format:"password"};case"textarea":return{...r,format:"textarea"};case"time":return{...r,format:"time"};case"uuid":return{format:"uuid"};case"url":return{...r,format:"url"};case"uri":return{...r,format:"uri"};case"uri-reference":return{...r,format:"uri-reference"};case"hostname":return{...r,format:"hostname"};case"ipv4":return{...r,format:"ipv4"};case"ipv6":return{...r,format:"ipv6"};case"regex":return{...r,format:"regex"};case"duration":return{...r,format:"duration"};case"color":return{...r,format:"color"}}}const ii=e=>{const{value:t,onBlur:r,onChange:n,onInput:a,after:s,disabled:o,...u}=e,m=J.NullableResetAfter(t,o,n);return J.Base64Input({...u,value:E.Value.map(t,y=>y??void 0),onChange:n!=null?y=>n(y??null):void 0,onInput:a!=null?y=>a(y??null):void 0,onBlur:r,after:s!=null?E.Fragment(m,s):m})};function Ln({ctx:e,options:t,controller:r}){const n=ai(e);switch(n?.format){case"email":return D.Control(J.NullableEmailInput,{...t,controller:J.transformNullToUndefined(r)});case"date":return D.MappedControl(J.NullableDateInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:new Date(a),fromInput:a=>a?.toISOString().split("T")[0]??null});case"date-time":return D.MappedControl(J.NullableDateTimeInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:new Date(a),fromInput:a=>a?.toISOString()??null});case"time":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"HH:MM:SS"});case"password":return D.Control(J.NullablePasswordInput,{...t,controller:J.transformNullToUndefined(r)});case"binary":{const{definition:a}=e,s=typeof a=="object"?a["x:ui"]:void 0;return n.mediaType&&(n.mediaType.startsWith("image/")||n.mediaType.startsWith("video/")||n.mediaType.startsWith("audio/")||n.mediaType==="application/pdf"||s?.preferFileUpload===!0)?D.Control(ii,{...t,controller:J.transformNullToUndefined(r),mode:"compact",accept:n.mediaType||"*/*",maxFileSize:(typeof s?.maxBytes=="number"?s.maxBytes:void 0)||(typeof s?.maxFileSize=="number"?s.maxFileSize:void 0),showFileList:!0}):D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r),placeholder:"Paste base64-encoded data",rows:3})}case"uri":case"url":return D.Control(J.NullableUrlInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"https://example.com"});case"uri-reference":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"Enter URL..."});case"hostname":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"example.com"});case"ipv4":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"192.168.1.1"});case"ipv6":return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r),placeholder:"2001:db8::1"});case"regex":return D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r),placeholder:"^[a-zA-Z0-9]+$",rows:3});case"duration":return J.WithTemporal(({Duration:a})=>D.MappedControl(J.NullableDurationInput,{...t,controller:J.transformNullToUndefined(r),toInput:s=>s==null?null:a.from(s),fromInput:s=>s?.toString?.()??null}));case"color":return D.Control(J.ColorSwatchInput,{...t,controller:r,displayValue:!0});case"uuid":return D.Control(J.NullableUUIDInput,{...t,controller:J.transformNullToUndefined(r)});case"textarea":return D.Control(J.NullableTextArea,{...t,controller:J.transformNullToUndefined(r)});default:return D.Control(J.NullableTextInput,{...t,controller:J.transformNullToUndefined(r)})}}function It({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r={...we({ctx:e}),placeholder:De(e.definition,String),disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated};if(e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle))return Ln({ctx:e,options:r,controller:t});const a=hr(e.definition,e.name)?.widget;if(a!=null&&["url","uri","uri-reference","hostname","ipv4","ipv6","regex","duration","binary","markdown","time","color"].includes(a))return Ln({ctx:e,options:r,controller:t});switch(a){case"email":return D.Control(D.EmailInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"password":return D.Control(D.PasswordInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"uuid":return D.Control(J.UUIDInput,{...r,controller:J.transformEmptyStringToUndefined(t)});case"textarea":return D.Control(J.TextArea,{...r,controller:J.transformEmptyStringToUndefined(t)});default:return D.Control(Ne.TextInput,{...r,controller:J.transformEmptyStringToUndefined(t)})}}function oi(e){const t=hr(e.definition,e.name);if(t?.widget==="slider")return{widget:"slider",options:t.options};if(t?.widget==="rating")return{widget:"rating",options:t.options};const r=e.definition,n=typeof r=="object"?r["x:ui"]:void 0;return n?.displayFormat==="currency"?{widget:"currency",options:{currency:typeof n?.currency=="string"?n.currency:"USD"}}:n?.displayFormat==="percent"?{widget:"percent"}:{widget:"number"}}function ze({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r=e.definition,n=oi(e),a={...we({ctx:e}),placeholder:De(e.definition,String),min:r.minimum,max:r.maximum,step:r.multipleOf,disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated},s=e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle);switch(n.widget){case"rating":const o=(typeof n.options?.max=="number"?n.options.max:r.maximum)||5;return s?D.Control(J.NullableRatingInput,{...a,max:o,controller:t}):D.Control(J.RatingInput,{...a,max:o,controller:t});case"slider":return s?D.Control(J.NullableSliderInput,{...a,controller:t}):D.Control(J.SliderInput,{...a,controller:t});case"currency":const u=typeof n.options?.currency=="string"?n.options.currency:"USD";return s?D.Control(J.MaskInput,{...a,mask:Un(u),controller:t}):D.Control(J.MaskInput,{...a,mask:Un(u),controller:t});case"percent":return s?D.Control(J.MaskInput,{...a,mask:Kn(),controller:t}):D.Control(J.MaskInput,{...a,mask:Kn(),controller:t});default:return s?D.Control(J.NullableNumberInput,{...a,controller:t}):D.Control(J.NumberInput,{...a,controller:t})}}function Un(e){return`${ui(e)} 000,000.00`}function Kn(){return"000.00%"}function ui(e){return{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$"}[e.toUpperCase()]||e}function Ct({ctx:e,controller:t}){return ze({ctx:e.with({definition:{...e.definition,multipleOf:ws(e.definition.multipleOf)}}),controller:t})}function At({ctx:e,controller:t}){if(e.isWriteOnly&&!e.shouldShowWriteOnly)return E.Fragment();const r={...we({ctx:e}),disabled:e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated},n=D.Control(D.CheckboxInput,{...r,controller:t});return!e.isNullable||e.isOptional&&!e.shouldShowPresenceToggle?n:D.Control(D.CheckboxInput,{...r,controller:t,after:J.NullableResetAfter(t.signal,t.disabled,a=>t.change(a))})}function pr({controller:e}){return E.WithElement(()=>{e.change(null)})}let ir=new WeakMap,Jn=new WeakMap;function Os(e,t){const r=typeof t=="object"&&t!=null?t:null;if(r!=null){const o=ir.get(r)?.get(e);if(o!=null)return o}let n=e;const a=new Set;for(;js(n);){const s=n.$ref;if(!s.startsWith("#")){console.warn(`resolveRef: external $ref not supported here: ${s}`);break}if(a.has(s)){console.warn(`resolveRef: cycle detected while resolving in-document $ref chain: ${[...a,s].join(" -> ")}`);break}a.add(s);const o=ks(t,s);if(!Ut(o)){console.warn(`resolveRef: could not resolve JSON Pointer ${s}`);break}const{$ref:u,...m}=n;n={...o,...m}}if(r!=null){let s=ir.get(r);s==null&&(s=new WeakMap,ir.set(r,s)),s.set(e,n)}return n}function js(e){return Ut(e)&&typeof e.$ref=="string"}function Ut(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function ks(e,t){if(!t.startsWith("#"))return;if(t==="#")return e;if(typeof e!="object"||e==null)return;const r=e;let n=Jn.get(r);n==null&&(n=new Map,Jn.set(r,n));const a=n.get(t);if(a!==void 0)return a;const s=dr(t);let o=e;for(const u of s){if(!Ut(o)&&!Array.isArray(o)){n.set(t,void 0);return}o=o[u]}return n.set(t,o),o}function Ns(e,t,r){let n=e;const a=new Set,s=(o,u)=>{const{$ref:m,...y}=u;return{...o,...y}};for(;js(n);){const o=n.$ref;if(a.has(o)){console.warn(`resolveAnyRef: cycle detected while resolving $ref chain: ${[...a,o].join(" -> ")}`);break}if(a.add(o),o.startsWith("#")){const v=ks(t,o);if(!Ut(v)){console.warn(`resolveAnyRef: could not resolve JSON Pointer ${o}`);break}n=s(v,n);continue}if(!r){console.warn(`resolveAnyRef: external $ref without AJV not resolved: ${o}`);break}const u=o.indexOf("#"),m=u>=0?o.slice(0,u):o;let y=r.getSchema(o)||r.getSchema(m);if(!y)try{y=r.compile({$ref:o})}catch{}const d=y?.schema;if(!d||typeof d!="object"){console.warn(`resolveAnyRef: AJV could not provide schema for ${o}`);break}n=s(d,n)}return n}function ci({conflicts:e}){return e.length===0?E.Empty:D.Notice({variant:"warning",tone:"prominent",title:"Schema Conflicts Detected",class:"bc-schema-conflicts-banner"},E.html.ul(E.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>E.html.li(E.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?E.html.code(E.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function li({violations:e}){return e.length===0?E.Empty:D.Notice({variant:"danger",tone:"prominent",title:"Schema Violations Detected",class:"bc-not-violations-banner"},E.html.ul(E.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>E.html.li(E.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?E.html.code(E.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function fi({ctx:e,controller:t,content:r}){const n=E.Value.map(t.signal,o=>o!==void 0),a=e.widgetLabel??"Property",s=o=>{if(o){const u=e.default;if(u!==void 0)t.change(u);else{const m=e.definition;m.type==="string"?t.change(""):m.type==="number"||m.type==="integer"?t.change(0):m.type==="boolean"?t.change(!1):m.type==="array"?t.change([]):m.type==="object"?t.change({}):t.change(null)}}else t.change(void 0)};return D.Stack(E.OnDispose(()=>E.Value.dispose(n)),E.html.div(E.attr.class("bc-presence-toggle"),D.InputWrapper({layout:"horizontal",label:`Include ${a}`,content:J.Switch({value:n,onChange:s,size:"xs"})})),E.When(n,()=>r))}function ne(e,t,r){const n=e.schemaConflicts.length>0,a=e.notViolations.length>0,s=e.shouldShowPresenceToggle&&r!=null;let o=t;return s&&r!=null&&(o=fi({ctx:e,controller:r,content:t})),!n&&!a?o:D.Stack(E.attr.class("bc-stack--gap-2"),a?li({violations:e.notViolations}):null,n?ci({conflicts:e.schemaConflicts}):null,o)}function Rs(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(!t||!t.visibleIf)return;const r=t.visibleIf;if(typeof r=="string"||typeof r=="object"&&r!==null)return r}function di(e){if(e.startsWith("!"))return{field:e.slice(1),operator:"falsy"};if(e.includes("!=")){const[t,r]=e.split("!=",2);return{field:t.trim(),operator:"notEquals",value:Wn(r.trim())}}if(e.includes("=")){const[t,r]=e.split("=",2);return{field:t.trim(),operator:"equals",value:Wn(r.trim())}}return{field:e.trim(),operator:"truthy"}}function Wn(e){if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(e!=="undefined")return/^-?\d+(\.\d+)?$/.test(e)?parseFloat(e):e}function mi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const a of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else n=n[a]}return n}function ur(e,t){const r=mi(t,e.field);switch(e.operator){case"equals":return r===e.value;case"notEquals":return r!==e.value;case"truthy":return!!r;case"falsy":return!r;case"contains":return typeof r=="string"&&typeof e.value=="string"||Array.isArray(r)?r.includes(e.value):!1;case"notContains":return typeof r=="string"&&typeof e.value=="string"||Array.isArray(r)?!r.includes(e.value):!0;case"greaterThan":return typeof r=="number"&&typeof e.value=="number"&&r>e.value;case"lessThan":return typeof r=="number"&&typeof e.value=="number"&&r<e.value;case"greaterThanOrEqual":return typeof r=="number"&&typeof e.value=="number"&&r>=e.value;case"lessThanOrEqual":return typeof r=="number"&&typeof e.value=="number"&&r<=e.value;case"in":return Array.isArray(e.values)&&e.values.includes(r);case"notIn":return!Array.isArray(e.values)||!e.values.includes(r);default:return!1}}function Is(e,t){const r=e.conditions.map(n=>"operator"in n&&["and","or","not"].includes(n.operator)?Is(n,t):ur(n,t));switch(e.operator){case"and":return r.every(Boolean);case"or":return r.some(Boolean);case"not":return!r[0];default:return!1}}function hi(e,t){try{if(typeof e=="string"){const r=di(e);return ur(r,t)}return"operator"in e&&["and","or","not"].includes(e.operator)?Is(e,t):ur(e,t)}catch(r){return console.warn("Error evaluating visibility condition:",r),!0}}function pi(e,t){return E.computedOf(t)(r=>hi(e,r))}const Bn={behavior:"hide",clearOnHide:!1};function yi({ctx:e,controller:t,children:r,options:n=Bn}){const a=Rs(e.definition);if(!a)return r;const s={...Bn,...n},o=gi(t),u=pi(a,o);switch(s.clearOnHide&&u.on(m=>{!m&&t.signal.value!==void 0&&t.change(void 0)}),s.behavior){case"unmount":return E.When(u,()=>r,()=>E.Fragment());case"hide":default:return E.When(u,()=>r,()=>E.Fragment(r))}}function gi(e){return e.signal}function Cs({ctx:e,controller:t}){const r=e.definition;return J.NativeSelectControl({...we({ctx:e}),options:(r.enum??[]).map(n=>({type:"value",value:n,label:String(n)})),controller:t})}function As({ctx:e,controller:t}){const r=e.definition;return E.Fragment(E.WithElement(()=>{E.Value.get(t.signal)!==r.const&&t.change(r.const)}),J.Group(D.MutedLabel(e.widgetLabel,": "),D.Label(String(r.const))))}function vi(e,t,r){const{controller:n,effCtx:a,patternProps:s,apSchema:o,canRemove:u,lockKeyAfterSet:m,validatePropertyName:y}=r,d=n.field(e),v=E.prop(e),$=E.prop(null);let S=o;if(t){const l=Object.keys(s).find(i=>{try{return new RegExp(i).test(e)}catch{return!1}});if(l){const i=s[l];i!==!1&&typeof i=="object"&&(S=i)}}const w=l=>{const i=(l??"").trim();if(!i||i===e||Object.prototype.hasOwnProperty.call(E.Value.get(n.signal)??{},i))return;const c=y(i);if(!c.ok){$.set(c.message);return}$.set(null);const p={...E.Value.get(n.signal)??{}},b=p[e];delete p[e],p[i]=b,n.change(p)},g=E.Use(Ne.BeatUII18n,l=>D.CloseButton({size:"xs",label:l.$.removeItem,disabled:!u(Object.keys(E.Value.get(n.signal)??{}).length),onClick:()=>{const i=Object.keys(E.Value.get(n.signal)??{}).length;if(!u(i))return;const c={...E.Value.get(n.signal)??{}};delete c[e],n.change(c)}})),f=E.Value.map(d.signal,l=>m&&l!=null);return E.html.div(E.OnDispose(v,$,()=>E.Value.dispose(f)),E.attr.class("bc-object-helpers__row"),E.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:v,onChange:w,disabled:E.computedOf(n.disabled,f)((l,i)=>l||i)}),error:E.Ensure($,l=>E.html.div(E.attr.class("bc-object-helpers__error"),l)),description:Object.keys(s).length>0?E.html.div(E.attr.class("bc-object-helpers__description"),"Allowed patterns: ",Object.keys(s).join(", ")):null}),E.html.div(Ee({ctx:a.with({definition:S,suppressLabel:!0}).append(e),controller:d})),E.html.div(E.attr.class("bc-object-helpers__remove"),g))}function bi(e,t,r){const{controller:n,effCtx:a,patternProps:s,apSchema:o,unevaluatedProps:u,canRemove:m,lockKeyAfterSet:y,validatePropertyName:d}=r,v=n.field(e),$=E.prop(e),S=E.prop(null);let w;if(u&&typeof u=="object")w=u;else if(t){const i=Object.keys(s).find(c=>{try{return new RegExp(c).test(e)}catch{return!1}});if(i){const c=s[i];c!==!1&&typeof c=="object"?w=c:w=o}else w=o}else w=o;const g=i=>{const c=(i??"").trim();if(!c||c===e||Object.prototype.hasOwnProperty.call(E.Value.get(n.signal)??{},c))return;const p=d(c);if(!p.ok){S.set(p.message);return}S.set(null);const b={...E.Value.get(n.signal)??{}},_=b[e];delete b[e],b[c]=_,n.change(b)},f=E.Use(Ne.BeatUII18n,i=>D.CloseButton({size:"xs",label:i.$.removeItem,disabled:!m(Object.keys(E.Value.get(n.signal)??{}).length),onClick:()=>{const c=Object.keys(E.Value.get(n.signal)??{}).length;if(!m(c))return;const p={...E.Value.get(n.signal)??{}};delete p[e],n.change(p)}})),l=E.Value.map(v.signal,i=>y&&i!=null);return E.html.div(E.OnDispose($,S,()=>E.Value.dispose(l)),E.attr.class("bc-object-helpers__row"),E.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:$,onChange:g,disabled:E.computedOf(n.disabled,l)((i,c)=>i||c)}),error:E.Ensure(S,i=>E.html.div(E.attr.class("bc-object-helpers__error"),i)),description:E.html.div(E.attr.class("bc-object-helpers__description"),u===!1?"Unevaluated property (not allowed by schema)":"Unevaluated property",Object.keys(s).length>0?E.html.span(" • Allowed patterns: ",Object.keys(s).join(", ")):null)}),E.html.div(Ee({ctx:a.with({definition:w,suppressLabel:!0}).append(e),controller:v})),E.html.div(E.attr.class("bc-object-helpers__remove"),f))}function _i(e){if(typeof e.definition=="boolean")return;const t=Es(e.definition);if(typeof t!="object")return;const r={};return typeof t.format=="string"&&["fieldset","tabs","accordion","group","grid"].includes(t.format)&&(r.format=t.format),Array.isArray(t.order)&&(r.order=t.order.filter(n=>typeof n=="string")),t.groups&&typeof t.groups=="object"&&(r.groups=t.groups),(typeof t.cols=="number"||t.cols&&typeof t.cols=="object")&&(r.cols=t.cols),Object.keys(r).length>0?r:void 0}function $i({title:e,children:t}){return E.html.fieldset(E.attr.class("bc-fieldset"),e?E.html.legend(E.attr.class("bc-fieldset__legend"),e):null,E.html.div(E.attr.class("bc-fieldset__content"),D.Stack(E.attr.class("bc-stack--gap-1"),...t)))}function wi({title:e,children:t}){return J.Card({variant:"outlined",size:"md"},D.Stack(E.attr.class("bc-stack--gap-1"),e?D.Label(e):null,...t))}function Si({cols:e=1,children:t}){const r=typeof e=="number"?`bc-schema-grid bc-schema-grid--cols-${e}`:E.computedOf(e)(n=>{if(typeof n=="number")return`bc-schema-grid bc-schema-grid--cols-${n}`;if(n&&typeof n=="object"){const a=["bc-schema-grid"];return n.sm&&a.push(`bc-schema-grid--cols-sm-${n.sm}`),n.md&&a.push(`bc-schema-grid--cols-md-${n.md}`),n.lg&&a.push(`bc-schema-grid--cols-lg-${n.lg}`),n.xl&&a.push(`bc-schema-grid--cols-xl-${n.xl}`),n["2xl"]&&a.push(`bc-schema-grid--cols-2xl-${n["2xl"]}`),a.join(" ")}return"bc-schema-grid bc-schema-grid--cols-1"});return E.html.div(E.attr.class(r),E.attr.class("bc-schema-grid--gap-4"),...t)}function Pi({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ei({title:"Properties",children:t});const r=E.prop(Object.keys(e)[0]),n=Object.entries(e);return E.html.div(E.OnDispose(r),E.attr.class("bc-tabs"),E.html.div(E.attr.class("bc-tabs__header"),E.attr.role("tablist"),...n.map(([a],s)=>E.html.button(E.attr.type("button"),E.attr.class("bc-tabs__tab"),E.attr.class(E.computedOf(r)(o=>o===a?"bc-tabs__tab--active":"")),E.attr.role("tab"),E.attr.tabindex(r.map(o=>o===a?0:-1)),E.on.click(()=>r.set(a)),E.on.keydown(o=>{switch(o.key){case"ArrowLeft":o.preventDefault();const u=s>0?s-1:n.length-1;r.set(n[u][0]);break;case"ArrowRight":o.preventDefault();const m=s<n.length-1?s+1:0;r.set(n[m][0]);break;case"Home":o.preventDefault(),r.set(n[0][0]);break;case"End":o.preventDefault(),r.set(n[n.length-1][0]);break}}),a))),E.html.div(E.attr.class("bc-tabs__content"),...n.map(([a,s])=>E.html.div(E.attr.class("bc-tabs__panel"),E.attr.class(E.computedOf(r)(o=>o===a?"bc-tabs__panel--active":"bc-tabs__panel--hidden")),E.attr.role("tabpanel"),D.Stack(E.attr.class("bc-stack--gap-1"),...t.filter((o,u)=>s.length===0||u<s.length))))))}function Ei({title:e,children:t}){return E.html.div(E.attr.class("bc-tabs"),E.html.div(E.attr.class("bc-tabs__header"),E.html.div(E.attr.class("bc-tabs__tab bc-tabs__tab--active"),e)),E.html.div(E.attr.class("bc-tabs__content"),E.html.div(E.attr.class("bc-tabs__panel bc-tabs__panel--active"),D.Stack(E.attr.class("bc-stack--gap-1"),...t))))}function Oi({groups:e,children:t}){if(!e||Object.keys(e).length===0)return ji({title:"Properties",children:t});const r=Object.entries(e),n=E.prop(new Set([r[0]?.[0]].filter(Boolean)));return E.html.div(E.OnDispose(n),E.attr.class("bc-accordion"),...r.map(([a,s])=>{const o=E.computedOf(n)(u=>u.has(a));return E.html.div(E.OnDispose(o),E.attr.class("bc-accordion__item"),E.html.button(E.attr.type("button"),E.attr.class("bc-accordion__header"),E.aria.expanded(o),E.on.click(()=>{const u=n.value,m=new Set(u);m.has(a)?m.delete(a):m.add(a),n.set(m)}),E.on.keydown(u=>{if(u.key==="Enter"||u.key===" "){u.preventDefault();const m=n.value,y=new Set(m);y.has(a)?y.delete(a):y.add(a),n.set(y)}}),E.html.span(a),Ne.Icon({icon:E.computedOf(o)(u=>u?"chevron-up":"chevron-down"),size:"sm"})),E.html.div(E.attr.class("bc-accordion__content"),E.attr.class(E.computedOf(o)(u=>u?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(E.attr.class("bc-stack--gap-1"),...t.filter((u,m)=>s.length===0||m<s.length))))}))}function ji({title:e,children:t}){const r=E.prop(!0);return E.html.div(E.OnDispose(r),E.attr.class("bc-accordion"),E.html.div(E.attr.class("bc-accordion__item"),E.html.button(E.attr.type("button"),E.attr.class("bc-accordion__header"),E.on.click(()=>r.set(!r.value)),E.html.span(e),Ne.Icon({icon:E.computedOf(r)(n=>n?"chevron-up":"chevron-down"),size:"sm"})),E.html.div(E.attr.class("bc-accordion__content"),E.attr.class(E.computedOf(r)(n=>n?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(E.attr.class("bc-stack--gap-1"),...t))))}function Hn(e,t,r){const n=new Map;r.forEach((o,u)=>{e[u]&&n.set(o,e[u])});let a=e;if(t.order&&t.order.length>0){const o=new Map,u=[];t.order.forEach(m=>{const y=n.get(m);y&&o.set(m,y)}),r.forEach((m,y)=>{!t.order.includes(m)&&e[y]&&u.push(e[y])}),a=[...Array.from(o.values()),...u]}let s;if(t.groups&&Object.keys(t.groups).length>0){s={};const o=new Set;Object.entries(t.groups).forEach(([m,y])=>{s[m]=[],y.forEach(d=>{const v=n.get(d);v&&(s[m].push(v),o.add(v))})});const u=a.filter(m=>!o.has(m));u.length>0&&(s.Other=u)}return{orderedChildren:a,groupedChildren:s}}function ki(e,t,r,n=[]){if(!e||!e.format){if(e?.order){const{orderedChildren:u}=Hn(r,e,n);return D.Stack(E.attr.class("bc-stack--gap-1"),...u)}return D.Stack(E.attr.class("bc-stack--gap-1"),...r)}const a=t.widgetLabel||t.name,{orderedChildren:s,groupedChildren:o}=Hn(r,e,n);switch(e.format){case"fieldset":return $i({title:a,children:s});case"group":return wi({title:a,children:s});case"grid":return Si({cols:e.cols,children:s});case"tabs":return Pi({groups:o||e.groups,children:o?Object.values(o).flat():s});case"accordion":return Oi({groups:o||e.groups,children:o?Object.values(o).flat():s});default:return D.Stack(E.attr.class("bc-stack--gap-1"),...s)}}function yr({ctx:e,controller:t}){return E.MapSignal(t.signal,r=>{const n=e.definition,{effective:a,conflicts:s}=$s(n,r,e.ajv,e.path),o=e.with({definition:a,schemaConflicts:[...e.schemaConflicts,...s]}),u=a.properties??{},m=new Set(Object.keys(u)),y=Object.keys(r??{}),d=y.filter(h=>!m.has(h)),v=a.unevaluatedProperties,$=Ae(a,r??{},e.ajv),S=d.filter(h=>!$.has(h)),w=d.filter(h=>$.has(h)),g=a.additionalProperties??!0,f=g!==!1,l=g===!0||g===void 0?{}:g,i=a.minProperties??0,c=a.maxProperties??1/0;let p=!0,b=null;v===!1?(p=!1,b="No unevaluated properties are allowed by schema"):v&&typeof v=="object"&&(p=!0);const _=f&&p&&y.length<c,O=h=>h>i,C=a.patternProperties??{},V=Object.keys(C).filter(Boolean).map(h=>{try{return new RegExp(h)}catch{return null}}).filter(h=>h!=null),F=a.propertyNames,A=h=>{const P=(h??"").trim();if(P==="")return{ok:!1,message:"Key cannot be empty"};if(F===!1)return{ok:!1,message:"No property names are allowed by schema"};if(F&&typeof F=="object"&&e.ajv)try{const R=e.ajv.compile(F);if(!R(P))return{ok:!1,message:R.errors?.[0]?.message??"Invalid property name"}}catch{}if(!f&&!m.has(P)){if(V.length===0)return{ok:!1,message:"Only declared properties are allowed"};if(!V.some(K=>K.test(P)))return{ok:!1,message:`Key must match one of: ${Object.keys(C).join(", ")}`}}return{ok:!0}},z=a["x:ui"],U=!!(z&&typeof z=="object"&&z.lockKeyAfterSet),B=h=>{const P=De(h,K=>K);if(P!==void 0)return P;const R=h.type;if(R==="string")return"";if(R==="number"||R==="integer")return 0;if(R==="boolean")return!1;if(R==="array")return[];if(R==="object")return{}},ee=(h,P)=>{const R=h,K=Z=>P.has(Z)?!1:A(Z).ok;if(K(R))return R;let W=1;for(;P.has(R+W)||!K(R+W);)W++;return R+W},ae=E.Use(Ne.BeatUII18n,h=>Ne.Button({variant:"outline",disabled:!_,onClick:()=>{if(!_)return;const P=new Set(Object.keys(E.Value.get(t.signal)??{})),R=ee("property",P);if(!A(R).ok)return;let W=l;v&&typeof v=="object"&&(W=v);const Z=B(W),Y={...E.Value.get(t.signal)??{},[R]:Z};t.change(Y)}},E.attr.title(b),h.$.addLabel)),se=_i(o),te=Ls.f(u).filter(([,h])=>h!==!1),M=[...te.map(([h])=>h),...w,...S],k=[...te.map(([h,P])=>{const R=h,K=t.field(R);return Ee({ctx:o.with({definition:P,isPropertyRequired:Array.isArray(a.required)?a.required.includes(R):o.hasRequiredProperty(R),suppressLabel:!1}).append(R),controller:K})}),...w.map(h=>{const P=V.some(R=>R.test(h));return vi(h,P,{controller:t,effCtx:o,patternProps:C,apSchema:l,canRemove:O,lockKeyAfterSet:U,validatePropertyName:A})}),...S.map(h=>{const P=V.some(R=>R.test(h));return bi(h,P,{controller:t,effCtx:o,patternProps:C,apSchema:l,unevaluatedProps:v,canRemove:O,lockKeyAfterSet:U,validatePropertyName:A})}),f?ae:null].filter(Boolean),T=ki(se,o,k,M);return!o.suppressLabel&&o.name!=null&&(!se||!["fieldset","group"].includes(se.format||""))?D.InputWrapper({...we({ctx:o}),content:T}):T})}function Ni(e,t,r){const a=e.definition.oneOf;if(!Array.isArray(a)||a.length===0)return{matchingBranch:-1,validBranches:[],isAmbiguous:!1,hasNoMatch:!0};const s=a.map(d=>{if(typeof d=="object"&&d!=null&&"$ref"in d){const v=d.$ref;if(typeof v=="string"&&v.startsWith("#"))return Os(d,e.schema)}return d}),o=[];for(let d=0;d<s.length;d++){const v=s[d];if(typeof v=="boolean"){v===!0&&o.push(d);continue}if(r)try{zt(r,v)(t)&&o.push(d)}catch($){console.warn(`Failed to compile oneOf branch ${d}:`,$),xn(v,t)&&o.push(d)}else xn(v,t)&&o.push(d)}const u=o.length>1,m=o.length===0;return{matchingBranch:o.length===1?o[0]:-1,validBranches:o,isAmbiguous:u,hasNoMatch:m}}function xn(e,t){if("const"in e)return e.const===t;if(Array.isArray(e.enum))return e.enum.includes(t);if(e.type!=null){const r=Array.isArray(e.type)?e.type:[e.type],n=Ri(t);if(n==="unknown"||!r.includes(n))return!1}if(e.properties&&typeof t=="object"&&t!=null){const r=t;for(const[n,a]of Object.entries(e.properties))if(typeof a=="object"&&a!=null&&"const"in a&&r[n]!==a.const)return!1}return!0}function Ri(e){return e===null?"null":Array.isArray(e)?"array":typeof e=="object"?"object":typeof e=="string"?"string":typeof e=="number"?Number.isInteger(e)?"integer":"number":typeof e=="boolean"?"boolean":"unknown"}function Ii(e,t,r=`Option ${t+1}`){if(typeof e=="boolean")return e?"Any Value":"No Value";if(e.title)return e.title;if(e.properties){for(const[n,a]of Object.entries(e.properties))if(typeof a=="object"&&a!=null&&"const"in a){const s=a.const;if(typeof s=="string")return`${n}: ${s}`}}return"const"in e&&typeof e.const=="string"?e.const:e.type?(Array.isArray(e.type)?e.type:[e.type]).join(" | "):r}function Gn(e,t,r){const n=Ni(e,t,r);return n.matchingBranch!==-1?n.matchingBranch:-1}function Ci(e){if(typeof e=="boolean")return{discriminator:null,type:null};if(e.discriminator&&typeof e.discriminator=="object"){const r=e.discriminator;if(typeof r.propertyName=="string")return{discriminator:{propertyName:r.propertyName,mapping:r.mapping||{}},type:"openapi"}}const t=e["x:ui"];return t?.discriminatorKey&&typeof t.discriminatorKey=="string"?{discriminator:{key:t.discriminatorKey,mapping:t.discriminatorMapping||{}},type:"beatui"}:{discriminator:null,type:null}}function Ai(e,t,r){if(!t.discriminator||!r||typeof r!="object")return null;const{discriminator:n,type:a}=t;if(a==="openapi"){const s=n,o=r[s.propertyName];if(o==null)return null;if(s.mapping&&s.mapping[o]){const u=s.mapping[o];return Ti(e,u)}return Xn(e,s.propertyName,o)}if(a==="beatui"){const s=n,o=r[s.key];if(o==null)return null;if(s.mapping&&s.mapping[o]!=null){const u=s.mapping[o];return u>=0&&u<e.length?u:null}return Xn(e,s.key,o)}return null}function Ti(e,t){for(let r=0;r<e.length;r++){const n=e[r];if(typeof n=="object"&&n.$ref===t)return r}return null}function Xn(e,t,r){for(let n=0;n<e.length;n++){const a=e[n];if(typeof a!="object")continue;const s=a.properties;if(s&&s[t]){const o=s[t];if(typeof o=="object"&&o.const===r||typeof o=="object"&&Array.isArray(o.enum)&&o.enum.length===1&&o.enum[0]===r)return n}if(a.const===r)return n}return null}function Ts({ctx:e,controller:t}){const r=e.definition.anyOf;return Vs({ctx:e,controller:t,kind:"anyOf",variants:r})}function qs({ctx:e,controller:t}){const r=e.definition.oneOf;return Vs({ctx:e,controller:t,kind:"oneOf",variants:r})}function qi({ctx:e,controller:t}){const n=e.definition.allOf.filter(u=>typeof u=="object").map(u=>Ns(u,e.schema,e.ajv)),{mergedSchema:a,conflicts:s}=Lt(n,e.path),o=e.with({definition:a,schemaConflicts:[...e.schemaConflicts,...s]});return Ee({ctx:o,controller:t})}function Vs({ctx:e,controller:t,kind:r,variants:n}){const a=n.map((g,f)=>Ii(g,f,`${r} ${f+1}`)),s=typeof e.definition=="boolean"?{discriminator:null,type:null}:Ci(e.definition),o=E.computedOf(t.signal,e.ajv)((g,f)=>{if(r==="oneOf"){if(s.discriminator){const l=Ai(n,s,g);if(l!==null)return l}return Gn(e,g,f)}return Gn(e,g,f)}),u=E.Value.get(o),m=E.prop(u>=0?u:0);t.onDispose(m.dispose);let y=!1;const d=o.on(g=>{!y&&g>=0&&m.set(g)});t.onDispose(d);const v=n.length,$=g=>{y=!0,m.set(g)},S=v>1?Ss({options:n.map((g,f)=>({value:f,label:a[f]})),selected:m,onChange:$}):"",w=E.MapSignal(m,g=>Ee({ctx:e.with({definition:n[E.Value.get(g)],suppressLabel:!e.isRoot}),controller:t}));return E.Fragment(E.OnDispose(o,m),Ps({ctx:e,showSelector:v>1,selector:S,inner:w}))}function Ee({ctx:e,controller:t}){const r=typeof e.definition=="boolean"?{}:e.definition;let n=r?.$ref?Os(r,e.schema):r,a=e.with({definition:n});if(n?.allOf!=null){const o=n.allOf.filter(u=>typeof u=="object"&&u!==null);if(o.length>0){const u=o.map($=>Ns($,e.schema,e.ajv)),{mergedSchema:m,conflicts:y}=Lt(u,e.path),{allOf:d,...v}=n;n={...v,...m},a=e.with({definition:n,schemaConflicts:[...e.schemaConflicts,...y]})}}let s=[...a.notViolations];if(n?.not!=null&&typeof n.not=="object"){const o=E.Value.get(t.signal),u=_s(n.not,o,a.ajv,a.path);u&&(s=[...s,u],a=a.with({notViolations:s}))}if(n==null)return le(a,t,ne(a,Fe({ctx:a,controller:t}),t));if(n.enum!=null)return le(a,t,ne(a,Cs({ctx:a,controller:t}),t));if(n.const!=null)return le(a,t,ne(a,As({ctx:a,controller:t}),t));if(n.anyOf!=null)return le(a,t,ne(a,Ts({ctx:a,controller:t}),t));if(n.oneOf!=null)return le(a,t,ne(a,qs({ctx:a,controller:t}),t));if(n?.type==null)return ne(a,Fe({ctx:a,controller:t}),t);if(Array.isArray(n.type)){const u=n.type.filter(m=>m!=="null");if(u.length===1&&["string","number","integer","boolean"].includes(u[0]))switch(u[0]){case"number":return ne(a,ze({ctx:a,controller:t}),t);case"integer":return ne(a,Ct({ctx:a,controller:t}),t);case"string":return ne(a,It({ctx:a,controller:t}),t);case"boolean":return ne(a,At({ctx:a,controller:t}),t)}return le(a,t,ne(a,vr({ctx:a,controller:t}),t))}switch(n.type){case"number":return le(a,t,ne(a,ze({ctx:a,controller:t}),t));case"integer":return le(a,t,ne(a,Ct({ctx:a,controller:t}),t));case"string":return le(a,t,ne(a,It({ctx:a,controller:t}),t));case"boolean":return le(a,t,ne(a,At({ctx:a,controller:t}),t));case"array":return le(a,t,ne(a,gr({ctx:a,controller:t instanceof D.ArrayController?t:t.array()}),t));case"object":{const o=yr({ctx:a,controller:t instanceof D.ObjectController?t:t.object()});return a.isRoot?le(a,t,ne(a,o,t)):le(a,t,ne(a,E.html.div(E.attr.class("bc-json-schema-object"),o),t))}case"null":return le(a,t,ne(a,pr({controller:t}),t));default:return console.warn("Unknown type",n.type),le(a,t,ne(a,E.html.div(E.attr.class("bc-json-schema-unknown"),"Unknown"),t))}}function Ms({schema:e,controller:t,ajv:r}){const n=new Ft({schema:e,definition:e,horizontal:!1,isPropertyRequired:!1,path:[],ajv:r});return e===!0?Fe({ctx:n,controller:t}):e===!1?E.Fragment():Ee({ctx:n,controller:t})}function le(e,t,r){return Rs(e.definition)?yi({ctx:e,controller:t,children:r,options:{behavior:"hide",clearOnHide:!1}}):r}function Vi(e){return e.prefixItems!=null?{isTuple:!0,prefixItems:e.prefixItems,additionalItemsSchema:Array.isArray(e.items)?!0:e.items??!0,tupleLabels:Yn(e)}:Array.isArray(e.items)?{isTuple:!0,prefixItems:e.items,additionalItemsSchema:e.additionalItems??!0,tupleLabels:Yn(e)}:{isTuple:!1,prefixItems:[],additionalItemsSchema:e.items??!0}}function Yn(e){if(typeof e=="boolean")return;const t=e["x:ui"];return Array.isArray(t?.tupleLabels)?t.tupleLabels:void 0}function gr({ctx:e,controller:t}){const r=e.definition,n=Vi(r),a=E.computedOf(t.signal)(d=>{const v=d?.length??0;return!(r.maxItems!=null&&v>=r.maxItems||n.isTuple&&v>=n.prefixItems.length&&n.additionalItemsSchema===!1)}),s=E.computedOf(t.signal)(d=>{const v=d?.length??0;return r.minItems==null||v>r.minItems}),o=E.computedOf(t.signal)(d=>{if(!r.uniqueItems||!d)return new Set;const v=new Map,$=new Set;for(let S=0;S<d.length;S++){const w=JSON.stringify(d[S]);v.has(w)?($.add(v.get(w)),$.add(S)):v.set(w,S)}return $}),u=E.computedOf(t.signal)(d=>{if(!r.contains||!d)return{matchingIndices:new Set,count:0,isValid:!0};const v=new Set;let $=0;if(e.ajv)try{const f=e.ajv.compile(r.contains);for(let l=0;l<d.length;l++)f(d[l])&&(v.add(l),$++)}catch{}else{const f=r.contains,l=i=>{if(typeof f=="boolean")return f;if(typeof f!="object"||f==null)return!1;const c=f,p=c.type;if(p==="integer"||p==="number")return!(typeof i!="number"||!Number.isFinite(i)||p==="integer"&&!Number.isInteger(i)||typeof c.minimum=="number"&&i<c.minimum||typeof c.exclusiveMinimum=="number"&&i<=c.exclusiveMinimum||typeof c.maximum=="number"&&i>c.maximum||typeof c.exclusiveMaximum=="number"&&i>=c.exclusiveMaximum||typeof c.multipleOf=="number"&&i%c.multipleOf!==0);if(p==="string"){if(typeof i!="string"||typeof c.minLength=="number"&&i.length<c.minLength||typeof c.maxLength=="number"&&i.length>c.maxLength)return!1;if(typeof c.pattern=="string")try{if(!new RegExp(c.pattern).test(i))return!1}catch{}return!0}return!1};for(let i=0;i<d.length;i++)l(d[i])&&(v.add(i),$++)}const S=r.minContains??(r.contains?1:0),w=r.maxContains,g=$>=S&&(w==null||$<=w);return{matchingIndices:v,count:$,isValid:g,minContains:S,maxContains:w}}),m=r.contains?u.map(d=>{const v=typeof r.contains=="object"&&r.contains.title?r.contains.title:"required pattern";if(!d.isValid){if(d.count<(d.minContains??0))return`Must contain at least ${d.minContains??0} item(s) matching ${v} (currently ${d.count})`;if(d.maxContains!=null&&d.count>d.maxContains)return`Must contain at most ${d.maxContains} item(s) matching ${v} (currently ${d.count})`}return`Contains ${d.count} item(s) matching ${v}`}):null,y=J.ListControl({...we({ctx:e}),createItem:()=>{const d=t.signal.value?.length??0;if(n.isTuple&&d<n.prefixItems.length){const v=n.prefixItems[d];return De(v,()=>{})}else return De(n.additionalItemsSchema,()=>{})},controller:t,showAdd:!0,addDisabled:E.computedOf(a)(d=>!d),showRemove:!0,removeDisabled:E.computedOf(s)(d=>!d),element:d=>{const v=d.item,$=d.position.index;let S,w;n.isTuple&&$<n.prefixItems.length?(S=n.prefixItems[$],n.tupleLabels?.[$]?w=n.tupleLabels[$]:typeof S=="object"&&S.title?w=S.title:w=`Item ${$+1}`):(S=n.additionalItemsSchema,n.isTuple&&(w=`Additional Item ${$-n.prefixItems.length+1}`));const g=Ee({ctx:e.with({definition:S}).append($),controller:v}),f=o.map(p=>p.has($)),l=u.map(p=>p.matchingIndices.has($));let i=g;w&&n.isTuple&&(i=D.Stack(E.attr.class("bc-stack--gap-1"),D.Label(E.attr.class("bc-array-control__item-label"),w),i));const c=[];return r.uniqueItems&&c.push(E.When(f,()=>D.Label(E.attr.class("bc-array-control__indicator bc-array-control__indicator--error"),"⚠️ Duplicate value"))),r.contains&&c.push(E.When(l,()=>D.Label(E.attr.class("bc-array-control__indicator bc-array-control__indicator--success"),"✓ Matches required pattern"))),c.length>0?D.Stack(E.attr.class("bc-stack--gap-1"),i,...c):i}});return r.contains&&m?D.Stack(E.attr.class("bc-stack--gap-2"),y,E.MapSignal(E.computedOf(u,m)((d,v)=>({info:d,summary:v})),({info:d,summary:v})=>D.Label(E.attr.class(d.isValid?"bc-array-control__summary bc-array-control__summary--success":"bc-array-control__summary bc-array-control__summary--error"),v))):E.Fragment(E.OnDispose(a,s,o,u),y)}function Mi(e){return e.map(t=>({key:t,label:J._t(t),detect:r=>ei(r,[t])===t,convert:r=>ti(r,t),defaultValue:()=>ri(t)}))}function vr({ctx:e,controller:t}){const r=e.definition;let n=r.type??[];const a=ni(r),s=n.includes("null"),o=n.filter(S=>S!=="null"&&(S==="string"||S==="number"||S==="integer"||S==="boolean")),u=s&&o.length===n.length-1;u&&(n=o);const m=Mi(n),y=new J.UnionController(t.path,t.change,t.signal,t.status,{disabled:t.disabled},m);t.onDispose(()=>y.dispose());const d=S=>Ss({options:n.map(w=>({value:w,label:J._t(w)})),selected:y.activeBranch,onChange:S,mode:a.selector??"auto"}),v=S=>{y.switchToBranch(S,a.confirmBranchChange)},$=E.MapSignal(y.activeBranch,S=>{const w=E.Value.get(S),g=y.getBranchController(w);if(u&&(w==="number"||w==="integer")){const l=r;return D.Control(J.NullableNumberInput,{...we({ctx:e.with({suppressLabel:!e.isRoot})}),controller:g,min:l.minimum,max:l.maximum,step:w==="integer"?ws(l.multipleOf):l.multipleOf})}const f=e.with({definition:{...r,type:w},suppressLabel:!e.isRoot});switch(w){case"string":return It({ctx:f,controller:g});case"number":return ze({ctx:f,controller:g});case"integer":return Ct({ctx:f,controller:g});case"boolean":return At({ctx:f,controller:g});case"null":return pr({controller:g});case"array":{const l=g.array();return gr({ctx:f,controller:l})}case"object":{const l=g.object();return yr({ctx:f,controller:l})}default:return D.Control(J.NullableNumberInput,{...we({ctx:f}),controller:g})}});return Ps({ctx:e,showSelector:n.length>1,selector:d(v),inner:$})}function Fe({ctx:e,controller:t}){return e.definition===!0?Fe({ctx:e.with({definition:{type:["string","number","object","array","boolean","null"]}}),controller:t}):vr({ctx:e.with({definition:{...e.definition,type:["string","number","object","array","boolean","null"]}}),controller:t})}function Di(e){if(typeof e=="boolean")return[];const t=e["x:ui"];return!t||!Array.isArray(t.crossField)?[]:t.crossField.filter(r=>typeof r=="object"&&r!=null&&typeof r.id=="string"&&Array.isArray(r.fields)&&typeof r.validate=="function")}function zi(e,t,r=!1){const n=[],a=[...t].sort((s,o)=>(o.priority||0)-(s.priority||0));for(const s of a)if(!(s.onSubmitOnly&&!r))try{const o={};for(const m of s.fields)o[m]=Fi(e,m);const u=s.validate(o,e);if(!u.valid){const m=s.targets||s.fields;if(u.fieldErrors)for(const[y,d]of Object.entries(u.fieldErrors))n.push({instancePath:`/${y}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields,context:u.context},message:d});else{const y=u.message||s.message||"Cross-field validation failed";for(const d of m)n.push({instancePath:`/${d}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields,context:u.context},message:y})}}}catch(o){console.warn(`Error in cross-field validation rule ${s.id}:`,o);const u=s.targets?.[0]||s.fields[0];n.push({instancePath:`/${u}`,schemaPath:`#/x:ui/crossField/${s.id}`,keyword:"crossField",params:{ruleId:s.id,fields:s.fields},message:"Cross-field validation error"})}return n.length>0?Dt(n):D.a.valid}function Fi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const a of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else n=n[a]}return n}function Li(e){if(typeof e=="boolean")return;const t=e["x:ui"];if(!t)return;const r={};Array.isArray(t.when)&&(r.when=t.when.filter(a=>typeof a=="object"&&a!=null&&"watch"in a&&"condition"in a)),Array.isArray(t.crossField)&&(r.crossField=t.crossField.filter(a=>typeof a=="object"&&a!=null&&Array.isArray(a.fields)&&typeof a.validate=="function"));const n=Di(e);return n.length>0&&(r.crossFieldRules=n),Array.isArray(t.async)&&(r.async=t.async.filter(a=>typeof a=="object"&&a!=null&&typeof a.validate=="function")),Object.keys(r).length>0?r:void 0}function cr(e,t){if(!e.startsWith("$."))throw new Error(`Invalid JSONPath: ${e}. Must start with '$.'.`);const r=e.slice(2).split(/[.\[\]]/).filter(Boolean);let n=t;for(const a of r){if(n==null)return;if(typeof n=="object"&&!Array.isArray(n))n=n[a];else if(Array.isArray(n)){const s=parseInt(a,10);if(!isNaN(s))n=n[s];else return}else return}return n}function Ui(e,t){try{if(typeof e.condition=="function"){const n=(Array.isArray(e.watch)?e.watch:[e.watch]).map(a=>cr(a,t));return e.condition(n.length===1?n[0]:n,t)}return typeof e.condition=="string"?!!cr(e.condition,t):!1}catch(r){return console.warn("Error evaluating conditional validation:",r),!1}}function Ki(e,t,r,n){const a=[];if(n&&!n(e)&&n.errors&&a.push(...n.errors),r.when){for(const s of r.when)if(Ui(s,t)?s.then:s.else,s.validate)try{const u=s.validate(e,t);u&&a.push({instancePath:"",schemaPath:"#/x:ui/when",keyword:"conditional",params:{},message:u})}catch(u){console.warn("Error in conditional validation:",u)}}if(r.crossField)for(const s of r.crossField)try{const o={};for(const m of s.fields)o[m]=cr(`$.${m}`,t);const u=s.validate(o,t);if(u){const m=s.target||s.fields[0];a.push({instancePath:`/${m}`,schemaPath:"#/x:ui/crossField",keyword:"crossField",params:{fields:s.fields},message:s.message||u})}}catch(o){console.warn("Error in cross-field validation:",o)}if(r.crossFieldRules&&r.crossFieldRules.length>0){const s=zi(t,r.crossFieldRules);if(s.type==="invalid"){const o=Ji(s);a.push(...o)}}return a.length>0?Dt(a):D.a.valid}function Ji(e){if(e.type==="valid")return[];const t=[];function r(n,a=""){if(n.message&&t.push({instancePath:a,schemaPath:"#/crossField",keyword:"crossField",params:{},message:n.message}),n.dependencies)for(const[s,o]of Object.entries(n.dependencies)){const u=a?`${a}/${s}`:`/${s}`;r(o,u)}}return r(e.error),t}function Wi(e,t){const r=new Set;if(e.when)for(const n of e.when)(Array.isArray(n.watch)?n.watch:[n.watch]).forEach(s=>r.add(s));if(e.crossField)for(const n of e.crossField)n.fields.forEach(a=>r.add(a));return{watchedPaths:Array.from(r),shouldRevalidate:n=>Array.from(r).some(a=>n.startsWith(a)||a.startsWith(n))}}function Bi(e){if(typeof e=="boolean")return[];const t=e["x:ui"];return!t||!Array.isArray(t.async)?[]:t.async.filter(r=>typeof r=="object"&&r!=null&&typeof r.id=="string"&&typeof r.field=="string"&&typeof r.validate=="function")}class Hi{timeouts=new Map;validationStates=new Map;abortControllers=new Map;getValidationState(t){return this.validationStates.has(t)||this.validationStates.set(t,E.prop({isValidating:!1,result:D.a.valid,lastValidatedValue:void 0,lastValidatedAt:0})),this.validationStates.get(t)}async validateField(t,r,n,a=!1){const s=`${t.field}_${t.id}`,o=this.getValidationState(s),u=this.timeouts.get(s);u!==void 0&&clearTimeout(u);const m=this.abortControllers.get(s);if(m&&m.abort(),!a&&o.value.lastValidatedValue===r)return;if(t.minLength&&typeof r=="string"&&r.length<t.minLength){o.set({...o.value,result:D.a.valid,isValidating:!1});return}const y=setTimeout(async()=>{const d=new AbortController;this.abortControllers.set(s,d),o.set({...o.value,isValidating:!0,result:t.loadingMessage?D.a.invalid({message:t.loadingMessage}):o.value.result});try{const v=await t.validate(r,n);if(d.signal.aborted)return;const $=v.valid?D.a.valid:D.a.invalid({message:v.message||"Async validation failed",context:v.context});o.set({isValidating:!1,result:$,lastValidatedValue:r,lastValidatedAt:Date.now()})}catch(v){if(d.signal.aborted)return;const $=v instanceof Error?v.message:"Async validation error";o.set({isValidating:!1,result:D.a.invalid({message:$}),lastValidatedValue:r,lastValidatedAt:Date.now()})}finally{this.abortControllers.delete(s),this.timeouts.delete(s)}},a?0:t.debounce||300);this.timeouts.set(s,y)}cancelAll(){for(const t of this.timeouts.values())clearTimeout(t);this.timeouts.clear();for(const t of this.abortControllers.values())t.abort();this.abortControllers.clear()}getAllValidationResults(){const t={};for(const[r,n]of this.validationStates.entries()){const a=n.value;!a.isValidating&&a.result.type==="invalid"&&(t[r]=a.result)}return t}isValidating(){for(const t of this.validationStates.values())if(t.value.isValidating)return!0;return!1}dispose(){this.cancelAll();for(const t of this.validationStates.values())t.dispose();this.validationStates.clear()}}function xi(e){const t=globalThis.structuredClone;return typeof t=="function"?t(e):JSON.parse(JSON.stringify(e))}function Gi(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}}function Xi({schema:e,initialValue:t,externalSchemas:r,refResolver:n,sanitizeAdditional:a,validationMode:s,validateDebounceMs:o},u){return E.Async(bs(e,{externalSchemas:r,refResolver:n,sanitizeAdditional:a}),m=>{if(m.ok){const{ajv:y,validate:d}=m.value,v=Li(e),$=Bi(e),S=$.length>0?new Hi:null,w=s??"touchedOrSubmit",g=F=>{const A=d(F);let z;return A?z=D.a.valid:z=Dt(d.errors??[]),v?Ki(F,F,v,d):z},{controller:f,setStatus:l}=D.useController({initialValue:t,validationMode:w,validateDebounceMs:o,validate:w==="onSubmit"?void 0:g}),i=v?Wi(v):null,c=a!==!1;let p=!1;const b=c?f.signal.on(F=>{if(p)return;const A=xi(F);d(A)&&!Gi(A,F)&&(p=!0,f.change(A),p=!1)}):()=>{},_=i?f.signal.on((F,A)=>{A!=null&&JSON.stringify(F)!==JSON.stringify(A)&&setTimeout(()=>{const U=f.status.value;l(U)},10)}):()=>{},O=S&&$.length>0?f.signal.on(F=>{for(const A of $)S.validateField(A,F,F)}):()=>{},C=()=>{b(),_(),O(),S?.dispose(),f.dispose()},V=E.Fragment(E.OnDispose(C),Ms({schema:e,controller:f,ajv:y}));return u({Form:V,controller:f,setStatus:l})}return E.html.div(E.attr.class("bc-json-schema-form__error"),m.error)})}var Ds=hs();const zs=lr(Ds),Yi=Us({__proto__:null,default:zs},[Ds]);function Zi(e,t){const n=(t?.ajv??new zs({allErrors:!0})).compile(e);return{"~standard":{version:1,vendor:"ajv",validate:a=>n(a)?{value:a}:{issues:Qi(n.errors??[])},types:void 0}}}function Qi(e){return e.map(t=>({message:eo(t),path:to(t)}))}function eo(e){return e.message??`${e.keyword} validation failed`}function to(e){const t=ro(e.instancePath||"");if(e.keyword==="required"){const r=e.params.missingProperty;if(r!=null)return[...t,r]}if(e.keyword==="additionalProperties"){const r=e.params.additionalProperty;if(r!=null)return[...t,r]}if(e.keyword==="unevaluatedProperties"){const r=e.params.unevaluatedProperty;if(r!=null)return[...t,r]}return t.length>0?t:void 0}function ro(e){return e?e.split("/").slice(1).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~")).map(r=>no(r)?Number(r):r):[]}function no(e){return/^\d+$/.test(e)}exports.JSONSchemaAllOf=qi;exports.JSONSchemaAny=Fe;exports.JSONSchemaAnyOf=Ts;exports.JSONSchemaArray=gr;exports.JSONSchemaBoolean=At;exports.JSONSchemaConst=As;exports.JSONSchemaControl=Ms;exports.JSONSchemaEnum=Cs;exports.JSONSchemaForm=Xi;exports.JSONSchemaGenericControl=Ee;exports.JSONSchemaInteger=Ct;exports.JSONSchemaNull=pr;exports.JSONSchemaNumber=ze;exports.JSONSchemaObject=yr;exports.JSONSchemaOneOf=qs;exports.JSONSchemaString=It;exports.JSONSchemaUnion=vr;exports.SchemaContext=Ft;exports.ajvErrorsToControllerValidation=Dt;exports.ajvErrorsToDependencies=gs;exports.buildMessage=ys;exports.buildPath=ps;exports.clearCaches=Wa;exports.clearCachesForAjv=Ba;exports.compileWithCache=zt;exports.composeEffectiveObjectSchema=$s;exports.createAJVStandardSchema=Zi;exports.evaluateIfThenElseOverlay=mr;exports.evaluateNotViolation=_s;exports.getAjvForSchema=bs;exports.getCacheStats=Ha;exports.getDefaultExportFromCjs=lr;exports.getEvaluatedProperties=Ae;exports.jsonPointerToSegments=dr;exports.mergeAllOf=Lt;exports.requireApplicator=cs;exports.requireCodegen=x;exports.requireCompile=Mt;exports.requireCore=ts;exports.requireCore$1=ns;exports.requireDependencies=os;exports.requireDiscriminator=ms;exports.requireDraft7=ds;exports.requireFormat=ls;exports.requireMetadata=fs;exports.requireNames=Se;exports.requireRef=rs;exports.requireRef_error=Ue;exports.requireUtil=Q;exports.requireValidate=Le;exports.requireValidation=ss;exports.requireValidation_error=Vt;