@tempots/beatui 0.58.0 → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{2019-DH5GYJC9.js → 2019-D8FDunSq.js} +2 -2
- package/dist/{2019-B4jrQ2Q8.cjs → 2019-Dks2DDHw.cjs} +1 -1
- package/dist/{2020-BVrVGeh-.cjs → 2020-C8VDmyg1.cjs} +1 -1
- package/dist/{2020-C3vh26yT.js → 2020-Db2sT3RF.js} +2 -2
- package/dist/beatui.css +40 -55
- package/dist/beatui.tailwind.css +40 -55
- package/dist/{index-Dhaodhgr.cjs → index-BAa_FdQV.cjs} +2 -2
- package/dist/{index-gZaps7_A.js → index-C86Mq1ak.js} +3 -3
- package/dist/{index-COM8WyaG.cjs → index-Do9WmZEc.cjs} +1 -1
- package/dist/{index-Dd3PocYl.js → index-M6PBne67.js} +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +2 -2
- package/dist/json-schema/index.cjs.js +1 -1
- package/dist/json-schema/index.es.js +1 -1
- package/dist/{utils-DzKhEJ__.js → utils-byyCrT3S.js} +32 -33
- package/dist/utils-sDRkbnf9.cjs +1 -0
- package/package.json +1 -1
- package/dist/utils-dY__yBXk.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";const D=require("./notice-D8w_39td.cjs"),J=require("./utils-dY__yBXk.cjs"),O=require("@tempots/dom"),Ne=require("./translations-t-neYabN.cjs"),Ks=require("./colors-B9fcMxa_.cjs");function Js(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}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={},Sr;function Ws(){return Sr||(Sr=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(a,o),time:t(d(!0),y),"date-time":t($(!0),S),"iso-time":t(d(),h),"iso-date-time":t($(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"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:P},float:{type:"number",validate:I},double:{type:"number",validate:I},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,h),"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)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(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:s[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 d(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],me=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*me,C=ee-M*me-(T<0?1:0);return(C===23||C===-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 h(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=d(A);return function(B){const ee=B.split(v);return ee.length===2&&a(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=/\/|:/,l=/^(?:[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 f(A){return g.test(A)&&l.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 P(A){return Number.isInteger(A)}function I(){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 xt={},Je={exports:{}},Ht={},be={},Oe={},Gt={},Xt={},Yt={},Er;function kt(){return Er||(Er=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 s(f,...i){const c=[f[0]];let p=0;for(;p<i.length;)u(c,i[p]),c.push(f[++p]);return new n(c)}e._=s;const a=new n("+");function o(f,...i){const c=[S(f[0])];let p=0;for(;p<i.length;)c.push(a),u(c,i[p]),c.push(a,S(f[++p]));return d(c),new n(c)}e.str=o;function u(f,i){i instanceof n?f.push(...i._items):i instanceof r?f.push(i):f.push(v(i))}e.addCodeArg=u;function d(f){let i=1;for(;i<f.length-1;){if(f[i]===a){const c=y(f[i-1],f[i+1]);if(c!==void 0){f.splice(i-1,3,c);continue}f[i++]="+"}i++}}function y(f,i){if(i==='""')return f;if(f==='""')return i;if(typeof f=="string")return i instanceof r||f[f.length-1]!=='"'?void 0:typeof i!="string"?`${f.slice(0,-1)}${i}"`:i[0]==='"'?f.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(f instanceof r))return`"${f}${i.slice(1)}`}function h(f,i){return i.emptyStr()?f:f.emptyStr()?i:o`${f}${i}`}e.strConcat=h;function v(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:S(Array.isArray(f)?f.join(","):f)}function $(f){return new n(S(f))}e.stringify=$;function S(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=S;function w(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new n(`.${f}`):s`[${f}]`}e.getProperty=w;function g(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new n(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=g;function l(f){return new n(f.toString())}e.regexpCode=l}(Yt)),Yt}var Zt={},Pr;function Or(){return Pr||(Pr=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(d){d[d.Started=0]="Started",d[d.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 s{constructor({prefixes:y,parent:h}={}){this._names={},this._prefixes=y,this._parent=h}toName(y){return y instanceof t.Name?y:this.name(y)}name(y){return new t.Name(this._newName(y))}_newName(y){const h=this._names[y]||this._nameGroup(y);return`${y}${h.index++}`}_nameGroup(y){var h,v;if(!((v=(h=this._parent)===null||h===void 0?void 0:h._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=s;class a extends t.Name{constructor(y,h){super(h),this.prefix=y}setValue(y,{property:h,itemIndex:v}){this.value=y,this.scopePath=(0,t._)`.${new t.Name(h)}[${v}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class u extends s{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 a(y,this._newName(y))}value(y,h){var v;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(y),{prefix:S}=$,w=(v=h.key)!==null&&v!==void 0?v:h.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 l=this._scope[S]||(this._scope[S]=[]),f=l.length;return l[f]=h.ref,$.setValue(h,{property:S,itemIndex:f}),$}getValue(y,h){const v=this._values[y];if(v)return v.get(h)}scopeRefs(y,h=this._values){return this._reduceValues(h,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,h,v){return this._reduceValues(y,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},h,v)}_reduceValues(y,h,v={},$){let S=t.nil;for(const w in y){const g=y[w];if(!g)continue;const l=v[w]=v[w]||new Map;g.forEach(f=>{if(l.has(f))return;l.set(f,n.Started);let i=h(f);if(i){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;S=(0,t._)`${S}${c} ${f} = ${i};${this.opts._n}`}else if(i=$?.(f))S=(0,t._)`${S}${i}${this.opts._n}`;else throw new r(f);l.set(f,n.Completed)})}return S}}e.ValueScope=u}(Zt)),Zt}var jr;function H(){return jr||(jr=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=Or();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 s=Or();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.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 a{optimizeNodes(){return this}optimizeNames(m,E){return this}}class o extends a{constructor(m,E,R){super(),this.varKind=m,this.name=E,this.rhs=R}render({es5:m,_n:E}){const R=m?r.varKinds.var:this.varKind,K=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${K};`+E}optimizeNames(m,E){if(m[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,m,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(m,E,R){super(),this.lhs=m,this.rhs=E,this.sideEffects=R}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,E){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,m,E),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(m,this.rhs)}}class d extends u{constructor(m,E,R,K){super(m,R,K),this.op=E}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class y extends a{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class h extends a{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class v extends a{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class $ extends a{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,E){return this.code=B(this.code,m,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class S extends a{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((E,R)=>E+R.render(m),"")}optimizeNodes(){const{nodes:m}=this;let E=m.length;for(;E--;){const R=m[E].optimizeNodes();Array.isArray(R)?m.splice(E,1,...R):R?m[E]=R:m.splice(E,1)}return m.length>0?this:void 0}optimizeNames(m,E){const{nodes:R}=this;let K=R.length;for(;K--;){const W=R[K];W.optimizeNames(m,E)||(ee(m,W.names),R.splice(K,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((m,E)=>z(m,E.names),{})}}class w extends S{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class g extends S{}class l extends w{}l.kind="else";class f extends w{constructor(m,E){super(E),this.condition=m}render(m){let E=`if(${this.condition})`+super.render(m);return this.else&&(E+="else "+this.else.render(m)),E}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let E=this.else;if(E){const R=E.optimizeNodes();E=this.else=Array.isArray(R)?new l(R):R}if(E)return m===!1?E instanceof f?E:E.nodes:this.nodes.length?this:new f(ae(m),E instanceof f?[E]:E.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,E){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(m,E),!!(super.optimizeNames(m,E)||this.else))return this.condition=B(this.condition,m,E),this}get names(){const m=super.names;return U(m,this.condition),this.else&&z(m,this.else.names),m}}f.kind="if";class i extends w{}i.kind="for";class c extends i{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,E){if(super.optimizeNames(m,E))return this.iteration=B(this.iteration,m,E),this}get names(){return z(super.names,this.iteration.names)}}class p extends i{constructor(m,E,R,K){super(),this.varKind=m,this.name=E,this.from=R,this.to=K}render(m){const E=m.es5?r.varKinds.var:this.varKind,{name:R,from:K,to:W}=this;return`for(${E} ${R}=${K}; ${R}<${W}; ${R}++)`+super.render(m)}get names(){const m=U(super.names,this.from);return U(m,this.to)}}class b extends i{constructor(m,E,R,K){super(),this.loop=m,this.varKind=E,this.name=R,this.iterable=K}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,E){if(super.optimizeNames(m,E))return this.iterable=B(this.iterable,m,E),this}get names(){return z(super.names,this.iterable.names)}}class _ extends w{constructor(m,E,R){super(),this.name=m,this.args=E,this.async=R}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}_.kind="func";class P extends S{render(m){return"return "+super.render(m)}}P.kind="return";class I extends w{render(m){let E="try"+super.render(m);return this.catch&&(E+=this.catch.render(m)),this.finally&&(E+=this.finally.render(m)),E}optimizeNodes(){var m,E;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(m,E){var R,K;return super.optimizeNames(m,E),(R=this.catch)===null||R===void 0||R.optimizeNames(m,E),(K=this.finally)===null||K===void 0||K.optimizeNames(m,E),this}get names(){const m=super.names;return this.catch&&z(m,this.catch.names),this.finally&&z(m,this.finally.names),m}}class V extends w{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}V.kind="catch";class F extends w{render(m){return"finally"+super.render(m)}}F.kind="finally";class A{constructor(m,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
1
|
+
"use strict";const D=require("./notice-D8w_39td.cjs"),J=require("./utils-sDRkbnf9.cjs"),O=require("@tempots/dom"),Ne=require("./translations-t-neYabN.cjs"),Ks=require("./colors-B9fcMxa_.cjs");function Js(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const a=Object.getOwnPropertyDescriptor(n,s);a&&Object.defineProperty(e,s,a.get?a:{enumerable:!0,get:()=>n[s]})}}}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={},Sr;function Ws(){return Sr||(Sr=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(a,o),time:t(d(!0),y),"date-time":t($(!0),S),"iso-time":t(d(),h),"iso-date-time":t($(),w),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:f,"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:P},float:{type:"number",validate:I},double:{type:"number",validate:I},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,h),"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)$/,s=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(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:s[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 d(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],me=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*me,C=ee-M*me-(T<0?1:0);return(C===23||C===-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 h(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=d(A);return function(B){const ee=B.split(v);return ee.length===2&&a(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=/\/|:/,l=/^(?:[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 f(A){return g.test(A)&&l.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 P(A){return Number.isInteger(A)}function I(){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 xt={},Je={exports:{}},Ht={},be={},Oe={},Gt={},Xt={},Yt={},Er;function kt(){return Er||(Er=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 s(f,...i){const c=[f[0]];let p=0;for(;p<i.length;)u(c,i[p]),c.push(f[++p]);return new n(c)}e._=s;const a=new n("+");function o(f,...i){const c=[S(f[0])];let p=0;for(;p<i.length;)c.push(a),u(c,i[p]),c.push(a,S(f[++p]));return d(c),new n(c)}e.str=o;function u(f,i){i instanceof n?f.push(...i._items):i instanceof r?f.push(i):f.push(v(i))}e.addCodeArg=u;function d(f){let i=1;for(;i<f.length-1;){if(f[i]===a){const c=y(f[i-1],f[i+1]);if(c!==void 0){f.splice(i-1,3,c);continue}f[i++]="+"}i++}}function y(f,i){if(i==='""')return f;if(f==='""')return i;if(typeof f=="string")return i instanceof r||f[f.length-1]!=='"'?void 0:typeof i!="string"?`${f.slice(0,-1)}${i}"`:i[0]==='"'?f.slice(0,-1)+i.slice(1):void 0;if(typeof i=="string"&&i[0]==='"'&&!(f instanceof r))return`"${f}${i.slice(1)}`}function h(f,i){return i.emptyStr()?f:f.emptyStr()?i:o`${f}${i}`}e.strConcat=h;function v(f){return typeof f=="number"||typeof f=="boolean"||f===null?f:S(Array.isArray(f)?f.join(","):f)}function $(f){return new n(S(f))}e.stringify=$;function S(f){return JSON.stringify(f).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=S;function w(f){return typeof f=="string"&&e.IDENTIFIER.test(f)?new n(`.${f}`):s`[${f}]`}e.getProperty=w;function g(f){if(typeof f=="string"&&e.IDENTIFIER.test(f))return new n(`${f}`);throw new Error(`CodeGen: invalid export name: ${f}, use explicit $id name mapping`)}e.getEsmExportName=g;function l(f){return new n(f.toString())}e.regexpCode=l}(Yt)),Yt}var Zt={},Pr;function Or(){return Pr||(Pr=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(d){d[d.Started=0]="Started",d[d.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 s{constructor({prefixes:y,parent:h}={}){this._names={},this._prefixes=y,this._parent=h}toName(y){return y instanceof t.Name?y:this.name(y)}name(y){return new t.Name(this._newName(y))}_newName(y){const h=this._names[y]||this._nameGroup(y);return`${y}${h.index++}`}_nameGroup(y){var h,v;if(!((v=(h=this._parent)===null||h===void 0?void 0:h._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=s;class a extends t.Name{constructor(y,h){super(h),this.prefix=y}setValue(y,{property:h,itemIndex:v}){this.value=y,this.scopePath=(0,t._)`.${new t.Name(h)}[${v}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class u extends s{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 a(y,this._newName(y))}value(y,h){var v;if(h.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const $=this.toName(y),{prefix:S}=$,w=(v=h.key)!==null&&v!==void 0?v:h.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 l=this._scope[S]||(this._scope[S]=[]),f=l.length;return l[f]=h.ref,$.setValue(h,{property:S,itemIndex:f}),$}getValue(y,h){const v=this._values[y];if(v)return v.get(h)}scopeRefs(y,h=this._values){return this._reduceValues(h,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,h,v){return this._reduceValues(y,$=>{if($.value===void 0)throw new Error(`CodeGen: name "${$}" has no value`);return $.value.code},h,v)}_reduceValues(y,h,v={},$){let S=t.nil;for(const w in y){const g=y[w];if(!g)continue;const l=v[w]=v[w]||new Map;g.forEach(f=>{if(l.has(f))return;l.set(f,n.Started);let i=h(f);if(i){const c=this.opts.es5?e.varKinds.var:e.varKinds.const;S=(0,t._)`${S}${c} ${f} = ${i};${this.opts._n}`}else if(i=$?.(f))S=(0,t._)`${S}${i}${this.opts._n}`;else throw new r(f);l.set(f,n.Completed)})}return S}}e.ValueScope=u}(Zt)),Zt}var jr;function H(){return jr||(jr=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=Or();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 s=Or();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return s.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 a{optimizeNodes(){return this}optimizeNames(m,E){return this}}class o extends a{constructor(m,E,R){super(),this.varKind=m,this.name=E,this.rhs=R}render({es5:m,_n:E}){const R=m?r.varKinds.var:this.varKind,K=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${K};`+E}optimizeNames(m,E){if(m[this.name.str])return this.rhs&&(this.rhs=B(this.rhs,m,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(m,E,R){super(),this.lhs=m,this.rhs=E,this.sideEffects=R}render({_n:m}){return`${this.lhs} = ${this.rhs};`+m}optimizeNames(m,E){if(!(this.lhs instanceof t.Name&&!m[this.lhs.str]&&!this.sideEffects))return this.rhs=B(this.rhs,m,E),this}get names(){const m=this.lhs instanceof t.Name?{}:{...this.lhs.names};return U(m,this.rhs)}}class d extends u{constructor(m,E,R,K){super(m,R,K),this.op=E}render({_n:m}){return`${this.lhs} ${this.op}= ${this.rhs};`+m}}class y extends a{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`${this.label}:`+m}}class h extends a{constructor(m){super(),this.label=m,this.names={}}render({_n:m}){return`break${this.label?` ${this.label}`:""};`+m}}class v extends a{constructor(m){super(),this.error=m}render({_n:m}){return`throw ${this.error};`+m}get names(){return this.error.names}}class $ extends a{constructor(m){super(),this.code=m}render({_n:m}){return`${this.code};`+m}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(m,E){return this.code=B(this.code,m,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class S extends a{constructor(m=[]){super(),this.nodes=m}render(m){return this.nodes.reduce((E,R)=>E+R.render(m),"")}optimizeNodes(){const{nodes:m}=this;let E=m.length;for(;E--;){const R=m[E].optimizeNodes();Array.isArray(R)?m.splice(E,1,...R):R?m[E]=R:m.splice(E,1)}return m.length>0?this:void 0}optimizeNames(m,E){const{nodes:R}=this;let K=R.length;for(;K--;){const W=R[K];W.optimizeNames(m,E)||(ee(m,W.names),R.splice(K,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((m,E)=>z(m,E.names),{})}}class w extends S{render(m){return"{"+m._n+super.render(m)+"}"+m._n}}class g extends S{}class l extends w{}l.kind="else";class f extends w{constructor(m,E){super(E),this.condition=m}render(m){let E=`if(${this.condition})`+super.render(m);return this.else&&(E+="else "+this.else.render(m)),E}optimizeNodes(){super.optimizeNodes();const m=this.condition;if(m===!0)return this.nodes;let E=this.else;if(E){const R=E.optimizeNodes();E=this.else=Array.isArray(R)?new l(R):R}if(E)return m===!1?E instanceof f?E:E.nodes:this.nodes.length?this:new f(ae(m),E instanceof f?[E]:E.nodes);if(!(m===!1||!this.nodes.length))return this}optimizeNames(m,E){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(m,E),!!(super.optimizeNames(m,E)||this.else))return this.condition=B(this.condition,m,E),this}get names(){const m=super.names;return U(m,this.condition),this.else&&z(m,this.else.names),m}}f.kind="if";class i extends w{}i.kind="for";class c extends i{constructor(m){super(),this.iteration=m}render(m){return`for(${this.iteration})`+super.render(m)}optimizeNames(m,E){if(super.optimizeNames(m,E))return this.iteration=B(this.iteration,m,E),this}get names(){return z(super.names,this.iteration.names)}}class p extends i{constructor(m,E,R,K){super(),this.varKind=m,this.name=E,this.from=R,this.to=K}render(m){const E=m.es5?r.varKinds.var:this.varKind,{name:R,from:K,to:W}=this;return`for(${E} ${R}=${K}; ${R}<${W}; ${R}++)`+super.render(m)}get names(){const m=U(super.names,this.from);return U(m,this.to)}}class b extends i{constructor(m,E,R,K){super(),this.loop=m,this.varKind=E,this.name=R,this.iterable=K}render(m){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(m)}optimizeNames(m,E){if(super.optimizeNames(m,E))return this.iterable=B(this.iterable,m,E),this}get names(){return z(super.names,this.iterable.names)}}class _ extends w{constructor(m,E,R){super(),this.name=m,this.args=E,this.async=R}render(m){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(m)}}_.kind="func";class P extends S{render(m){return"return "+super.render(m)}}P.kind="return";class I extends w{render(m){let E="try"+super.render(m);return this.catch&&(E+=this.catch.render(m)),this.finally&&(E+=this.finally.render(m)),E}optimizeNodes(){var m,E;return super.optimizeNodes(),(m=this.catch)===null||m===void 0||m.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(m,E){var R,K;return super.optimizeNames(m,E),(R=this.catch)===null||R===void 0||R.optimizeNames(m,E),(K=this.finally)===null||K===void 0||K.optimizeNames(m,E),this}get names(){const m=super.names;return this.catch&&z(m,this.catch.names),this.finally&&z(m,this.finally.names),m}}class V extends w{constructor(m){super(),this.error=m}render(m){return`catch(${this.error})`+super.render(m)}}V.kind="catch";class F extends w{render(m){return"finally"+super.render(m)}}F.kind="finally";class A{constructor(m,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
2
2
|
`:""},this._extScope=m,this._scope=new r.Scope({parent:m}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(m){return this._scope.name(m)}scopeName(m){return this._extScope.name(m)}scopeValue(m,E){const R=this._extScope.value(m,E);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(m,E){return this._extScope.getValue(m,E)}scopeRefs(m){return this._extScope.scopeRefs(m,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(m,E,R,K){const W=this._scope.toName(E);return R!==void 0&&K&&(this._constants[W.str]=R),this._leafNode(new o(m,W,R)),W}const(m,E,R){return this._def(r.varKinds.const,m,E,R)}let(m,E,R){return this._def(r.varKinds.let,m,E,R)}var(m,E,R){return this._def(r.varKinds.var,m,E,R)}assign(m,E,R){return this._leafNode(new u(m,E,R))}add(m,E){return this._leafNode(new d(m,e.operators.ADD,E))}code(m){return typeof m=="function"?m():m!==t.nil&&this._leafNode(new $(m)),this}object(...m){const E=["{"];for(const[R,K]of m)E.length>1&&E.push(","),E.push(R),(R!==K||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,K));return E.push("}"),new t._Code(E)}if(m,E,R){if(this._blockNode(new f(m)),E&&R)this.code(E).else().code(R).endIf();else if(E)this.code(E).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(m){return this._elseNode(new f(m))}else(){return this._elseNode(new l)}endIf(){return this._endBlockNode(f,l)}_for(m,E){return this._blockNode(m),E&&this.code(E).endFor(),this}for(m,E){return this._for(new c(m),E)}forRange(m,E,R,K,W=this.opts.es5?r.varKinds.var:r.varKinds.let){const Z=this._scope.toName(m);return this._for(new p(W,Z,E,R),()=>K(Z))}forOf(m,E,R,K=r.varKinds.const){const W=this._scope.toName(m);if(this.opts.es5){const Z=E instanceof t.Name?E:this.var("_arr",E);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,E),()=>R(W))}forIn(m,E,R,K=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(m,(0,t._)`Object.keys(${E})`,R);const W=this._scope.toName(m);return this._for(new b("in",K,W,E),()=>R(W))}endFor(){return this._endBlockNode(i)}label(m){return this._leafNode(new y(m))}break(m){return this._leafNode(new h(m))}return(m){const E=new P;if(this._blockNode(E),this.code(m),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(P)}try(m,E,R){if(!E&&!R)throw new Error('CodeGen: "try" without "catch" and "finally"');const K=new I;if(this._blockNode(K),this.code(m),E){const W=this.name("e");this._currNode=K.catch=new V(W),E(W)}return R&&(this._currNode=K.finally=new F,this.code(R)),this._endBlockNode(V,F)}throw(m){return this._leafNode(new v(m))}block(m,E){return this._blockStarts.push(this._nodes.length),m&&this.code(m).endBlock(E),this}endBlock(m){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-E;if(R<0||m!==void 0&&R!==m)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${m} expected`);return this._nodes.length=E,this}func(m,E=t.nil,R,K){return this._blockNode(new _(m,E,R)),K&&this.code(K).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(m=1){for(;m-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(m){return this._currNode.nodes.push(m),this}_blockNode(m){this._currNode.nodes.push(m),this._nodes.push(m)}_endBlockNode(m,E){const R=this._currNode;if(R instanceof m||E&&R instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${m.kind}/${E.kind}`:m.kind}"`)}_elseNode(m){const E=this._currNode;if(!(E instanceof f))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=m,this}get _root(){return this._nodes[0]}get _currNode(){const m=this._nodes;return m[m.length-1]}set _currNode(m){const E=this._nodes;E[E.length-1]=m}}e.CodeGen=A;function z(C,m){for(const E in m)C[E]=(C[E]||0)+(m[E]||0);return C}function U(C,m){return m instanceof t._CodeOrName?z(C,m.names):C}function B(C,m,E){if(C instanceof t.Name)return R(C);if(!K(C))return C;return new t._Code(C._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=E[W.str];return Z===void 0||m[W.str]!==1?W:(delete m[W.str],Z)}function K(W){return W instanceof t._Code&&W._items.some(Z=>Z instanceof t.Name&&m[Z.str]===1&&E[Z.str]!==void 0)}}function ee(C,m){for(const E in m)C[E]=(C[E]||0)-(m[E]||0)}function ae(C){return typeof C=="boolean"||typeof C=="number"||C===null?!C:(0,t._)`!${T(C)}`}e.not=ae;const se=k(e.operators.AND);function te(...C){return C.reduce(se)}e.and=te;const me=k(e.operators.OR);function M(...C){return C.reduce(me)}e.or=M;function k(C){return(m,E)=>m===t.nil?E:E===t.nil?m:(0,t._)`${T(m)} ${C} ${T(E)}`}function T(C){return C instanceof t.Name?C:(0,t._)`(${C})`}}(Xt)),Xt}var G={},kr;function Q(){if(kr)return G;kr=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=H(),t=kt();function r(b){const _={};for(const P of b)_[P]=!0;return _}G.toHash=r;function n(b,_){return typeof _=="boolean"?_:Object.keys(_).length===0?!0:(s(b,_),!a(_,b.self.RULES.all))}G.alwaysValidSchema=n;function s(b,_=b.schema){const{opts:P,self:I}=b;if(!P.strictSchema||typeof _=="boolean")return;const V=I.RULES.keywords;for(const F in _)V[F]||p(b,`unknown keyword: "${F}"`)}G.checkUnknownRules=s;function a(b,_){if(typeof b=="boolean")return!b;for(const P in b)if(_[P])return!0;return!1}G.schemaHasRules=a;function o(b,_){if(typeof b=="boolean")return!b;for(const P in b)if(P!=="$ref"&&_.all[P])return!0;return!1}G.schemaHasRulesButRef=o;function u({topSchemaRef:b,schemaPath:_},P,I,V){if(!V){if(typeof P=="number"||typeof P=="boolean")return P;if(typeof P=="string")return(0,e._)`${P}`}return(0,e._)`${b}${_}${(0,e.getProperty)(I)}`}G.schemaRefOrVal=u;function d(b){return v(decodeURIComponent(b))}G.unescapeFragment=d;function y(b){return encodeURIComponent(h(b))}G.escapeFragment=y;function h(b){return typeof b=="number"?`${b}`:b.replace(/~/g,"~0").replace(/\//g,"~1")}G.escapeJsonPointer=h;function v(b){return b.replace(/~1/g,"/").replace(/~0/g,"~")}G.unescapeJsonPointer=v;function $(b,_){if(Array.isArray(b))for(const P of b)_(P);else _(b)}G.eachItem=$;function S({mergeNames:b,mergeToName:_,mergeValues:P,resultToName:I}){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):P(F,A);return z===e.Name&&!(U instanceof e.Name)?I(V,U):U}}G.mergeEvaluated={props:S({mergeNames:(b,_,P)=>b.if((0,e._)`${P} !== true && ${_} !== undefined`,()=>{b.if((0,e._)`${_} === true`,()=>b.assign(P,!0),()=>b.assign(P,(0,e._)`${P} || {}`).code((0,e._)`Object.assign(${P}, ${_})`))}),mergeToName:(b,_,P)=>b.if((0,e._)`${P} !== true`,()=>{_===!0?b.assign(P,!0):(b.assign(P,(0,e._)`${P} || {}`),g(b,P,_))}),mergeValues:(b,_)=>b===!0?!0:{...b,..._},resultToName:w}),items:S({mergeNames:(b,_,P)=>b.if((0,e._)`${P} !== true && ${_} !== undefined`,()=>b.assign(P,(0,e._)`${_} === true ? true : ${P} > ${_} ? ${P} : ${_}`)),mergeToName:(b,_,P)=>b.if((0,e._)`${P} !== true`,()=>b.assign(P,_===!0?!0:(0,e._)`${P} > ${_} ? ${P} : ${_}`)),mergeValues:(b,_)=>b===!0?!0:Math.max(b,_),resultToName:(b,_)=>b.var("items",_)})};function w(b,_){if(_===!0)return b.var("props",!0);const P=b.var("props",(0,e._)`{}`);return _!==void 0&&g(b,P,_),P}G.evaluatedPropsToName=w;function g(b,_,P){Object.keys(P).forEach(I=>b.assign((0,e._)`${_}${(0,e.getProperty)(I)}`,!0))}G.setEvaluated=g;const l={};function f(b,_){return b.scopeValue("func",{ref:_,code:l[_.code]||(l[_.code]=new t._Code(_.code))})}G.useFunc=f;var i;(function(b){b[b.Num=0]="Num",b[b.Str=1]="Str"})(i||(G.Type=i={}));function c(b,_,P){if(b instanceof e.Name){const I=_===i.Num;return P?I?(0,e._)`"[" + ${b} + "]"`:(0,e._)`"['" + ${b} + "']"`:I?(0,e._)`"/" + ${b}`:(0,e._)`"/" + ${b}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return P?(0,e.getProperty)(b).toString():"/"+h(b)}G.getErrorPath=c;function p(b,_,P=b.opts.strictSchema){if(P){if(_=`strict mode: ${_}`,P===!0)throw new Error(_);b.self.logger.warn(_)}}return G.checkStrictMode=p,G}var We={},Nr;function Se(){if(Nr)return We;Nr=1,Object.defineProperty(We,"__esModule",{value:!0});const e=H(),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 Rr;function Tt(){return Rr||(Rr=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=H(),r=Q(),n=Se();e.keywordError={message:({keyword:l})=>(0,t.str)`must pass "${l}" keyword validation`},e.keyword$DataError={message:({keyword:l,schemaType:f})=>f?(0,t.str)`"${l}" keyword must be ${f} ($data)`:(0,t.str)`"${l}" keyword is invalid ($data)`};function s(l,f=e.keywordError,i,c){const{it:p}=l,{gen:b,compositeRule:_,allErrors:P}=p,I=v(l,f,i);c??(_||P)?d(b,I):y(p,(0,t._)`[${I}]`)}e.reportError=s;function a(l,f=e.keywordError,i){const{it:c}=l,{gen:p,compositeRule:b,allErrors:_}=c,P=v(l,f,i);d(p,P),b||_||y(c,n.default.vErrors)}e.reportExtraError=a;function o(l,f){l.assign(n.default.errors,f),l.if((0,t._)`${n.default.vErrors} !== null`,()=>l.if(f,()=>l.assign((0,t._)`${n.default.vErrors}.length`,f),()=>l.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function u({gen:l,keyword:f,schemaValue:i,data:c,errsCount:p,it:b}){if(p===void 0)throw new Error("ajv implementation error");const _=l.name("err");l.forRange("i",p,n.default.errors,P=>{l.const(_,(0,t._)`${n.default.vErrors}[${P}]`),l.if((0,t._)`${_}.instancePath === undefined`,()=>l.assign((0,t._)`${_}.instancePath`,(0,t.strConcat)(n.default.instancePath,b.errorPath))),l.assign((0,t._)`${_}.schemaPath`,(0,t.str)`${b.errSchemaPath}/${f}`),b.opts.verbose&&(l.assign((0,t._)`${_}.schema`,i),l.assign((0,t._)`${_}.data`,c))})}e.extendErrors=u;function d(l,f){const i=l.const("err",f);l.if((0,t._)`${n.default.vErrors} === null`,()=>l.assign(n.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${n.default.vErrors}.push(${i})`),l.code((0,t._)`${n.default.errors}++`)}function y(l,f){const{gen:i,validateName:c,schemaEnv:p}=l;p.$async?i.throw((0,t._)`new ${l.ValidationError}(${f})`):(i.assign((0,t._)`${c}.errors`,f),i.return(!1))}const h={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(l,f,i){const{createErrors:c}=l.it;return c===!1?(0,t._)`{}`:$(l,f,i)}function $(l,f,i={}){const{gen:c,it:p}=l,b=[S(p,i),w(l,i)];return g(l,f,b),c.object(...b)}function S({errorPath:l},{instancePath:f}){const i=f?(0,t.str)`${l}${(0,r.getErrorPath)(f,r.Type.Str)}`:l;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,i)]}function w({keyword:l,it:{errSchemaPath:f}},{schemaPath:i,parentSchema:c}){let p=c?f:(0,t.str)`${f}/${l}`;return i&&(p=(0,t.str)`${p}${(0,r.getErrorPath)(i,r.Type.Str)}`),[h.schemaPath,p]}function g(l,{params:f,message:i},c){const{keyword:p,data:b,schemaValue:_,it:P}=l,{opts:I,propertyName:V,topSchemaRef:F,schemaPath:A}=P;c.push([h.keyword,p],[h.params,typeof f=="function"?f(l):f||(0,t._)`{}`]),I.messages&&c.push([h.message,typeof i=="function"?i(l):i]),I.verbose&&c.push([h.schema,_],[h.parentSchema,(0,t._)`${F}${A}`],[n.default.data,b]),V&&c.push([h.propertyName,V])}}(Gt)),Gt}var Cr;function Bs(){if(Cr)return Oe;Cr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.boolOrEmptySchema=Oe.topBoolOrEmptySchema=void 0;const e=Tt(),t=H(),r=Se(),n={message:"boolean schema is false"};function s(u){const{gen:d,schema:y,validateName:h}=u;y===!1?o(u,!1):typeof y=="object"&&y.$async===!0?d.return(r.default.data):(d.assign((0,t._)`${h}.errors`,null),d.return(!0))}Oe.topBoolOrEmptySchema=s;function a(u,d){const{gen:y,schema:h}=u;h===!1?(y.var(d,!1),o(u)):y.var(d,!0)}Oe.boolOrEmptySchema=a;function o(u,d){const{gen:y,data:h}=u,v={gen:y,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,e.reportError)(v,n,void 0,d)}return Oe}var ue={},je={},Ir;function es(){if(Ir)return je;Ir=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(s){return typeof s=="string"&&t.has(s)}je.isJSONType=r;function n(){const s={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...s,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},s.number,s.string,s.array,s.object],post:{rules:[]},all:{},keywords:{}}}return je.getRules=n,je}var _e={},Ar;function ts(){if(Ar)return _e;Ar=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.shouldUseRule=_e.shouldUseGroup=_e.schemaHasRulesForType=void 0;function e({schema:n,self:s},a){const o=s.RULES.types[a];return o&&o!==!0&&t(n,o)}_e.schemaHasRulesForType=e;function t(n,s){return s.rules.some(a=>r(n,a))}_e.shouldUseGroup=t;function r(n,s){var a;return n[s.keyword]!==void 0||((a=s.definition.implements)===null||a===void 0?void 0:a.some(o=>n[o]!==void 0))}return _e.shouldUseRule=r,_e}var Tr;function Nt(){if(Tr)return ue;Tr=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=es(),t=ts(),r=Tt(),n=H(),s=Q();var a;(function(i){i[i.Correct=0]="Correct",i[i.Wrong=1]="Wrong"})(a||(ue.DataType=a={}));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 d(i,c){const{gen:p,data:b,opts:_}=i,P=h(c,_.coerceTypes),I=c.length>0&&!(P.length===0&&c.length===1&&(0,t.schemaHasRulesForType)(i,c[0]));if(I){const V=w(c,b,_.strictNumbers,a.Wrong);p.if(V,()=>{P.length?v(i,c,P):l(i)})}return I}ue.coerceAndCheckDataType=d;const y=new Set(["string","number","integer","boolean","null"]);function h(i,c){return c?i.filter(p=>y.has(p)||c==="array"&&p==="array"):[]}function v(i,c,p){const{gen:b,data:_,opts:P}=i,I=b.let("dataType",(0,n._)`typeof ${_}`),V=b.let("coerced",(0,n._)`undefined`);P.coerceTypes==="array"&&b.if((0,n._)`${I} == 'object' && Array.isArray(${_}) && ${_}.length == 1`,()=>b.assign(_,(0,n._)`${_}[0]`).assign(I,(0,n._)`typeof ${_}`).if(w(c,_,P.strictNumbers),()=>b.assign(V,_))),b.if((0,n._)`${V} !== undefined`);for(const A of p)(y.has(A)||A==="array"&&P.coerceTypes==="array")&&F(A);b.else(),l(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._)`${I} == "number" || ${I} == "boolean"`).assign(V,(0,n._)`"" + ${_}`).elseIf((0,n._)`${_} === null`).assign(V,(0,n._)`""`);return;case"number":b.elseIf((0,n._)`${I} == "boolean" || ${_} === null
|
|
3
3
|
|| (${I} == "string" && ${_} && ${_} == +${_})`).assign(V,(0,n._)`+${_}`);return;case"integer":b.elseIf((0,n._)`${I} === "boolean" || ${_} === null
|
|
4
4
|
|| (${I} === "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._)`${I} === "string" || ${I} === "number"
|
|
5
5
|
|| ${I} === "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=a.Correct){const _=b===a.Correct?n.operators.EQ:n.operators.NEQ;let P;switch(i){case"null":return(0,n._)`${c} ${_} null`;case"array":P=(0,n._)`Array.isArray(${c})`;break;case"object":P=(0,n._)`${c} && typeof ${c} == "object" && !Array.isArray(${c})`;break;case"integer":P=I((0,n._)`!(${c} % 1) && !isNaN(${c})`);break;case"number":P=I();break;default:return(0,n._)`typeof ${c} ${_} ${i}`}return b===a.Correct?P:(0,n.not)(P);function I(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 P=(0,s.toHash)(i);if(P.array&&P.object){const I=(0,n._)`typeof ${c} != "object"`;_=P.null?I:(0,n._)`!${c} || ${I}`,delete P.null,delete P.array,delete P.object}else _=n.nil;P.number&&delete P.integer;for(const I in P)_=(0,n.and)(_,S(I,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 l(i){const c=f(i);(0,r.reportError)(c,g)}ue.reportTypeError=l;function f(i){const{gen:c,data:p,schema:b}=i,_=(0,s.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={},qr;function xs(){if(qr)return qe;qr=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.assignDefaults=void 0;const e=H(),t=Q();function r(s,a){const{properties:o,items:u}=s.schema;if(a==="object"&&o)for(const d in o)n(s,d,o[d].default);else a==="array"&&Array.isArray(u)&&u.forEach((d,y)=>n(s,y,d.default))}qe.assignDefaults=r;function n(s,a,o){const{gen:u,compositeRule:d,data:y,opts:h}=s;if(o===void 0)return;const v=(0,e._)`${y}${(0,e.getProperty)(a)}`;if(d){(0,t.checkStrictMode)(s,`default is ignored for: ${v}`);return}let $=(0,e._)`${v} === undefined`;h.useDefaults==="empty"&&($=(0,e._)`${$} || ${v} === null || ${v} === ""`),u.if($,(0,e._)`${v} = ${(0,e.stringify)(o)}`)}return qe}var ge={},re={},Vr;function ve(){if(Vr)return re;Vr=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=H(),t=Q(),r=Se(),n=Q();function s(i,c){const{gen:p,data:b,it:_}=i;p.if(h(p,b,c,_.opts.ownProperties),()=>{i.setParams({missingProperty:(0,e._)`${c}`},!0),i.error()})}re.checkReportMissingProp=s;function a({gen:i,data:c,it:{opts:p}},b,_){return(0,e.or)(...b.map(P=>(0,e.and)(h(i,c,P,p.ownProperties),(0,e._)`${_} = ${P}`)))}re.checkMissingProp=a;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 d(i,c,p){return(0,e._)`${u(i)}.call(${c}, ${p})`}re.isOwnProperty=d;function y(i,c,p,b){const _=(0,e._)`${c}${(0,e.getProperty)(p)} !== undefined`;return b?(0,e._)`${_} && ${d(i,c,p)}`:_}re.propertyInData=y;function h(i,c,p,b){const _=(0,e._)`${c}${(0,e.getProperty)(p)} === undefined`;return b?(0,e.or)(_,(0,e.not)(d(i,c,p))):_}re.noPropertyInData=h;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:P},it:I},V,F,A){const z=A?(0,e._)`${i}, ${c}, ${b}${_}`:c,U=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,P)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];I.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,P=_(p,b);return i.scopeValue("pattern",{key:P.toString(),ref:P,code:(0,e._)`${_.code==="new RegExp"?w:(0,n.useFunc)(i,_)}(${p}, ${b})`})}re.usePattern=g;function l(i){const{gen:c,data:p,keyword:b,it:_}=i,P=c.name("valid");if(_.allErrors){const V=c.let("valid",!0);return I(()=>c.assign(V,!1)),V}return c.var(P,!0),I(()=>c.break()),P;function I(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},P),c.if((0,e.not)(P),V)})}}re.validateArray=l;function f(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 I=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(I,(0,e._)`${I} || ${V}`),i.mergeValidEvaluated(z,V)||c.if((0,e.not)(I))})),i.result(I,()=>i.reset(),()=>i.error(!0))}return re.validateUnion=f,re}var Mr;function Hs(){if(Mr)return ge;Mr=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.validateKeywordUsage=ge.validSchemaType=ge.funcKeywordCode=ge.macroKeywordCode=void 0;const e=H(),t=Se(),r=ve(),n=Tt();function s($,S){const{gen:w,keyword:g,schema:l,parentSchema:f,it:i}=$,c=S.macro.call(i.self,l,f,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=s;function a($,S){var w;const{gen:g,keyword:l,schema:f,parentSchema:i,$data:c,it:p}=$;d(p,S);const b=!c&&S.compile?S.compile.call(p.self,f,i,p):S.validate,_=y(g,l,b),P=g.let("valid");$.block$data(P,I),$.ok((w=S.valid)!==null&&w!==void 0?w:P);function I(){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(P,!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(P,(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:P),U)}}ge.funcKeywordCode=a;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 d({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 h($,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=h;function v({schema:$,opts:S,self:w,errSchemaPath:g},l,f){if(Array.isArray(l.keyword)?!l.keyword.includes(f):l.keyword!==f)throw new Error("ajv implementation error");const i=l.dependencies;if(i?.some(c=>!Object.prototype.hasOwnProperty.call($,c)))throw new Error(`parent schema must have dependencies of ${f}: ${i.join(",")}`);if(l.validateSchema&&!l.validateSchema($[f])){const p=`keyword "${f}" value is invalid at path "${g}": `+w.errorsText(l.validateSchema.errors);if(S.validateSchema==="log")w.logger.error(p);else throw new Error(p)}}return ge.validateKeywordUsage=v,ge}var $e={},Dr;function Gs(){if(Dr)return $e;Dr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.extendSubschemaMode=$e.extendSubschemaData=$e.getSubschema=void 0;const e=H(),t=Q();function r(a,{keyword:o,schemaProp:u,schema:d,schemaPath:y,errSchemaPath:h,topSchemaRef:v}){if(o!==void 0&&d!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const $=a.schema[o];return u===void 0?{schema:$,schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:$[u],schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(u)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,t.escapeFragment)(u)}`}}if(d!==void 0){if(y===void 0||h===void 0||v===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:d,schemaPath:y,topSchemaRef:v,errSchemaPath:h}}throw new Error('either "keyword" or "schema" must be passed')}$e.getSubschema=r;function n(a,o,{dataProp:u,dataPropType:d,data:y,dataTypes:h,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:l}=o,f=$.let("data",(0,e._)`${o.data}${(0,e.getProperty)(u)}`,!0);S(f),a.errorPath=(0,e.str)`${w}${(0,t.getErrorPath)(u,d,l.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${u}`,a.dataPathArr=[...g,a.parentDataProperty]}if(y!==void 0){const w=y instanceof e.Name?y:$.let("data",y,!0);S(w),v!==void 0&&(a.propertyName=v)}h&&(a.dataTypes=h);function S(w){a.data=w,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,w]}}$e.extendSubschemaData=n;function s(a,{jtdDiscriminator:o,jtdMetadata:u,compositeRule:d,createErrors:y,allErrors:h}){d!==void 0&&(a.compositeRule=d),y!==void 0&&(a.createErrors=y),h!==void 0&&(a.allErrors=h),a.jtdDiscriminator=o,a.jtdMetadata=u}return $e.extendSubschemaMode=s,$e}var ce={},Qt,zr;function rs(){return zr||(zr=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,s,a;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))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(a=Object.keys(t),n=a.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=n;s--!==0;){var o=a[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Qt}var er={exports:{}},Fr;function Xs(){if(Fr)return er.exports;Fr=1;var e=er.exports=function(n,s,a){typeof s=="function"&&(a=s,s={}),a=s.cb||a;var o=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};t(s,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,s,a,o,u,d,y,h,v,$){if(o&&typeof o=="object"&&!Array.isArray(o)){s(o,u,d,y,h,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,s,a,w[g],u+"/"+S+"/"+g,d,u,S,o,g)}else if(S in e.propsKeywords){if(w&&typeof w=="object")for(var l in w)t(n,s,a,w[l],u+"/"+S+"/"+r(l),d,u,S,o,l)}else(S in e.keywords||n.allKeys&&!(S in e.skipKeywords))&&t(n,s,a,w,u+"/"+S,d,u,S,o)}a(o,u,d,y,h,v,$)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return er.exports}var Lr;function qt(){if(Lr)return ce;Lr=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=rs(),r=Xs(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(g,l=!0){return typeof g=="boolean"?!0:l===!0?!o(g):l?u(g)<=l:!1}ce.inlineRef=s;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(g){for(const l in g){if(a.has(l))return!0;const f=g[l];if(Array.isArray(f)&&f.some(o)||typeof f=="object"&&o(f))return!0}return!1}function u(g){let l=0;for(const f in g){if(f==="$ref")return 1/0;if(l++,!n.has(f)&&(typeof g[f]=="object"&&(0,e.eachItem)(g[f],i=>l+=u(i)),l===1/0))return 1/0}return l}function d(g,l="",f){f!==!1&&(l=v(l));const i=g.parse(l);return y(g,i)}ce.getFullPath=d;function y(g,l){return g.serialize(l).split("#")[0]+"#"}ce._getFullPath=y;const h=/#\/?$/;function v(g){return g?g.replace(h,""):""}ce.normalizeId=v;function $(g,l,f){return f=v(f),g.resolve(l,f)}ce.resolveUrl=$;const S=/^[a-z_][-a-z0-9._]*$/i;function w(g,l){if(typeof g=="boolean")return{};const{schemaId:f,uriResolver:i}=this.opts,c=v(g[f]||l),p={"":c},b=d(i,c,!1),_={},P=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[f]=="string"&&(ee=ae.call(this,F[f])),se.call(this,F.$anchor),se.call(this,F.$dynamicAnchor),p[A]=ee;function ae(te){const me=this.opts.uriResolver.resolve;if(te=v(ee?me(ee,te):te),P.has(te))throw V(te);P.add(te);let M=this.refs[te];return typeof M=="string"&&(M=this.refs[M]),typeof M=="object"?I(F,M.schema,te):te!==v(B)&&(te[0]==="#"?(I(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 I(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 Ur;function Le(){if(Ur)return be;Ur=1,Object.defineProperty(be,"__esModule",{value:!0}),be.getData=be.KeywordCxt=be.validateFunctionCode=void 0;const e=Bs(),t=Nt(),r=ts(),n=Nt(),s=xs(),a=Hs(),o=Gs(),u=H(),d=Se(),y=qt(),h=Q(),v=Tt();function $(j){if(b(j)&&(P(j),p(j))){l(j);return}S(j,()=>(0,e.topBoolOrEmptySchema)(j))}be.validateFunctionCode=$;function S({gen:j,validateName:N,schema:q,schemaEnv:L,opts:x},X){x.code.es5?j.func(N,(0,u._)`${d.default.data}, ${d.default.valCxt}`,L.$async,()=>{j.code((0,u._)`"use strict"; ${i(q,x)}`),g(j,x),j.code(X)}):j.func(N,(0,u._)`${d.default.data}, ${w(x)}`,L.$async,()=>j.code(i(q,x)).code(X))}function w(j){return(0,u._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${j.dynamicRef?(0,u._)`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`}function g(j,N){j.if(d.default.valCxt,()=>{j.var(d.default.instancePath,(0,u._)`${d.default.valCxt}.${d.default.instancePath}`),j.var(d.default.parentData,(0,u._)`${d.default.valCxt}.${d.default.parentData}`),j.var(d.default.parentDataProperty,(0,u._)`${d.default.valCxt}.${d.default.parentDataProperty}`),j.var(d.default.rootData,(0,u._)`${d.default.valCxt}.${d.default.rootData}`),N.dynamicRef&&j.var(d.default.dynamicAnchors,(0,u._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{j.var(d.default.instancePath,(0,u._)`""`),j.var(d.default.parentData,(0,u._)`undefined`),j.var(d.default.parentDataProperty,(0,u._)`undefined`),j.var(d.default.rootData,d.default.data),N.dynamicRef&&j.var(d.default.dynamicAnchors,(0,u._)`{}`)})}function l(j){const{schema:N,opts:q,gen:L}=j;S(j,()=>{q.$comment&&N.$comment&&U(j),F(j),L.let(d.default.vErrors,null),L.let(d.default.errors,0),q.unevaluated&&f(j),I(j),B(j)})}function f(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)&&(P(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:x}=j;x.$comment&&q.$comment&&U(j),A(j),z(j);const X=L.const("_errs",d.default.errors);I(j,X),L.var(N,(0,u._)`${X} === ${d.default.errors}`)}function P(j){(0,h.checkUnknownRules)(j),V(j)}function I(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:x}=j;N.$ref&&L.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(N,x.RULES)&&x.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,h.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:x}){const X=q.$comment;if(x.$comment===!0)j.code((0,u._)`${d.default.self}.logger.log(${X})`);else if(typeof x.$comment=="function"){const ie=(0,u.str)`${L}/$comment`,ye=j.scopeValue("root",{ref:N.root});j.code((0,u._)`${d.default.self}.opts.$comment(${X}, ${ie}, ${ye}.schema)`)}}function B(j){const{gen:N,schemaEnv:q,validateName:L,ValidationError:x,opts:X}=j;q.$async?N.if((0,u._)`${d.default.errors} === 0`,()=>N.return(d.default.data),()=>N.throw((0,u._)`new ${x}(${d.default.vErrors})`)):(N.assign((0,u._)`${L}.errors`,d.default.vErrors),X.unevaluated&&ee(j),N.return((0,u._)`${d.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:x,schema:X,data:ie,allErrors:ye,opts:fe,self:de}=j,{RULES:oe}=de;if(X.$ref&&(fe.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(X,oe))){x.block(()=>K(j,"$ref",oe.all.$ref.definition));return}fe.jtd||te(j,N),x.block(()=>{for(const pe of oe.rules)Re(pe);Re(oe.post)});function Re(pe){(0,r.shouldUseGroup)(X,pe)&&(pe.type?(x.if((0,n.checkDataType)(pe.type,ie,fe.strictNumbers)),se(j,pe),N.length===1&&N[0]===pe.type&&q&&(x.else(),(0,n.reportTypeError)(j)),x.endIf()):se(j,pe),ye||x.if((0,u._)`${d.default.errors} === ${L||0}`))}}function se(j,N){const{gen:q,schema:L,opts:{useDefaults:x}}=j;x&&(0,s.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||(me(j,N),j.opts.allowUnionTypes||M(j,N),k(j,j.dataTypes))}function me(j,N){if(N.length){if(!j.dataTypes.length){j.dataTypes=N;return}N.forEach(q=>{C(j.dataTypes,q)||E(j,`type "${q}" not allowed by context "${j.dataTypes.join(",")}"`)}),m(j,N)}}function M(j,N){N.length>1&&!(N.length===2&&N.includes("null"))&&E(j,"use allowUnionTypes to allow union type keyword")}function k(j,N){const q=j.self.RULES.all;for(const L in q){const x=q[L];if(typeof x=="object"&&(0,r.shouldUseRule)(j.schema,x)){const{type:X}=x.definition;X.length&&!X.some(ie=>T(N,ie))&&E(j,`missing type "${X.join(",")}" for keyword "${L}"`)}}}function T(j,N){return j.includes(N)||N==="number"&&j.includes("integer")}function C(j,N){return j.includes(N)||N==="integer"&&j.includes("number")}function m(j,N){const q=[];for(const L of j.dataTypes)C(N,L)?q.push(L):N.includes("integer")&&L==="number"&&q.push("integer");j.dataTypes=q}function E(j,N){const q=j.schemaEnv.baseId+j.errSchemaPath;N+=` at "${q}" (strictTypes)`,(0,h.checkStrictMode)(j,N,j.opts.strictTypes)}class R{constructor(N,q,L){if((0,a.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,h.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,a.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",d.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:x,schemaType:X,def:ie}=this;L.if((0,u.or)((0,u._)`${x} === 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:x,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(x.validateSchema){const fe=N.scopeValue("validate$data",{ref:x.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 x={...this.it,...L,items:void 0,props:void 0};return c(x,q),x}mergeEvaluated(N,q){const{it:L,gen:x}=this;L.opts.unevaluated&&(L.props!==!0&&N.props!==void 0&&(L.props=h.mergeEvaluated.props(x,N.props,L.props,q)),L.items!==!0&&N.items!==void 0&&(L.items=h.mergeEvaluated.items(x,N.items,L.items,q)))}mergeValidEvaluated(N,q){const{it:L,gen:x}=this;if(L.opts.unevaluated&&(L.props!==!0||L.items!==!0))return x.if(q,()=>this.mergeEvaluated(N,u.Name)),!0}}be.KeywordCxt=R;function K(j,N,q,L){const x=new R(j,q,N);"code"in q?q.code(x,L):x.$data&&q.validate?(0,a.funcKeywordCode)(x,q):"macro"in q?(0,a.macroKeywordCode)(x,q):(q.compile||q.validate)&&(0,a.funcKeywordCode)(x,q)}const W=/^\/(?:[^~]|~0|~1)*$/,Z=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Y(j,{dataLevel:N,dataNames:q,dataPathArr:L}){let x,X;if(j==="")return d.default.rootData;if(j[0]==="/"){if(!W.test(j))throw new Error(`Invalid JSON-pointer: ${j}`);x=j,X=d.default.rootData}else{const de=Z.exec(j);if(!de)throw new Error(`Invalid JSON-pointer: ${j}`);const oe=+de[1];if(x=de[2],x==="#"){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],!x)return X}let ie=X;const ye=x.split("/");for(const de of ye)de&&(X=(0,u._)`${X}${(0,u.getProperty)((0,h.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={},Kr;function Vt(){if(Kr)return Be;Kr=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 xe={},Jr;function Ue(){if(Jr)return xe;Jr=1,Object.defineProperty(xe,"__esModule",{value:!0});const e=qt();class t extends Error{constructor(n,s,a,o){super(o||`can't resolve reference ${a} from id ${s}`),this.missingRef=(0,e.resolveUrl)(n,s,a),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return xe.default=t,xe}var he={},Wr;function Mt(){if(Wr)return he;Wr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.resolveSchema=he.getCompilingSchema=he.resolveRef=he.compileSchema=he.SchemaEnv=void 0;const e=H(),t=Vt(),r=Se(),n=qt(),s=Q(),a=Le();class o{constructor(f){var i;this.refs={},this.dynamicAnchors={};let c;typeof f.schema=="object"&&(c=f.schema),this.schema=f.schema,this.schemaId=f.schemaId,this.root=f.root||this,this.baseId=(i=f.baseId)!==null&&i!==void 0?i:(0,n.normalizeId)(c?.[f.schemaId||"$id"]),this.schemaPath=f.schemaPath,this.localRefs=f.localRefs,this.meta=f.meta,this.$async=c?.$async,this.refs={}}}he.SchemaEnv=o;function u(l){const f=h.call(this,l);if(f)return f;const i=(0,n.getFullPath)(this.opts.uriResolver,l.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 P;l.$async&&(P=_.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");l.validateName=I;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:l.schema,code:(0,e.stringify)(l.schema)}:{ref:l.schema}),validateName:I,ValidationError:P,schema:l.schema,schemaEnv:l,rootId:i,baseId:l.baseId||i,schemaPath:e.nil,errSchemaPath:l.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let F;try{this._compilations.add(l),(0,a.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,l));const U=new Function(`${r.default.self}`,`${r.default.scope}`,F)(this,this.scope.get());if(this.scope.value(I,{ref:U}),U.errors=null,U.schema=l.schema,U.schemaEnv=l,l.$async&&(U.$async=!0),this.opts.code.source===!0&&(U.source={validateName:I,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 l.validate=U,l}catch(A){throw delete l.validate,delete l.validateName,F&&this.logger.error("Error compiling schema, function code:",F),A}finally{this._compilations.delete(l)}}he.compileSchema=u;function d(l,f,i){var c;i=(0,n.resolveUrl)(this.opts.uriResolver,f,i);const p=l.refs[i];if(p)return p;let b=$.call(this,l,i);if(b===void 0){const _=(c=l.localRefs)===null||c===void 0?void 0:c[i],{schemaId:P}=this.opts;_&&(b=new o({schema:_,schemaId:P,root:l,baseId:f}))}if(b!==void 0)return l.refs[i]=y.call(this,b)}he.resolveRef=d;function y(l){return(0,n.inlineRef)(l.schema,this.opts.inlineRefs)?l.schema:l.validate?l:u.call(this,l)}function h(l){for(const f of this._compilations)if(v(f,l))return f}he.getCompilingSchema=h;function v(l,f){return l.schema===f.schema&&l.root===f.root&&l.baseId===f.baseId}function $(l,f){let i;for(;typeof(i=this.refs[f])=="string";)f=i;return i||this.schemas[f]||S.call(this,l,f)}function S(l,f){const i=this.opts.uriResolver.parse(f),c=(0,n._getFullPath)(this.opts.uriResolver,i);let p=(0,n.getFullPath)(this.opts.uriResolver,l.baseId,void 0);if(Object.keys(l.schema).length>0&&c===p)return g.call(this,i,l);const b=(0,n.normalizeId)(c),_=this.refs[b]||this.schemas[b];if(typeof _=="string"){const P=S.call(this,l,_);return typeof P?.schema!="object"?void 0:g.call(this,i,P)}if(typeof _?.schema=="object"){if(_.validate||u.call(this,_),b===(0,n.normalizeId)(f)){const{schema:P}=_,{schemaId:I}=this.opts,V=P[I];return V&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,V)),new o({schema:P,schemaId:I,root:l,baseId:p})}return g.call(this,i,_)}}he.resolveSchema=S;const w=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(l,{baseId:f,schema:i,root:c}){var p;if(((p=l.fragment)===null||p===void 0?void 0:p[0])!=="/")return;for(const P of l.fragment.slice(1).split("/")){if(typeof i=="boolean")return;const I=i[(0,s.unescapeFragment)(P)];if(I===void 0)return;i=I;const V=typeof i=="object"&&i[this.opts.schemaId];!w.has(P)&&V&&(f=(0,n.resolveUrl)(this.opts.uriResolver,f,V))}let b;if(typeof i!="boolean"&&i.$ref&&!(0,s.schemaHasRulesButRef)(i,this.RULES)){const P=(0,n.resolveUrl)(this.opts.uriResolver,f,i.$ref);b=S.call(this,c,P)}const{schemaId:_}=this.opts;if(b=b||new o({schema:i,schemaId:_,root:c,baseId:f}),b.schema!==b.root.schema)return b}return he}const Ys="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",Zs="Meta-schema for $data reference (JSON AnySchema extension proposal)",Qs="object",ea=["$data"],ta={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},ra=!1,na={$id:Ys,description:Zs,type:Qs,required:ea,properties:ta,additionalProperties:ra};var He={},Ve={exports:{}},tr,Br;function sa(){return Br||(Br=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,xr;function aa(){if(xr)return rr;xr=1;const{HEX:e}=sa(),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 l=g.match(t)||[],[f]=l;return f?{host:o(f,"."),isIPV4:!0}:{host:g,isIPV4:!1}}function n(g,l=!1){let f="",i=!0;for(const c of g){if(e[c]===void 0)return;c!=="0"&&i===!0&&(i=!1),i||(f+=c)}return l&&f.length===0&&(f="0"),f}function s(g){let l=0;const f={error:!1,address:"",zone:""},i=[],c=[];let p=!1,b=!1,_=!1;function P(){if(c.length){if(p===!1){const I=n(c);if(I!==void 0)i.push(I);else return f.error=!0,!1}c.length=0}return!0}for(let I=0;I<g.length;I++){const V=g[I];if(!(V==="["||V==="]"))if(V===":"){if(b===!0&&(_=!0),!P())break;if(l++,i.push(":"),l>7){f.error=!0;break}I-1>=0&&g[I-1]===":"&&(b=!0);continue}else if(V==="%"){if(!P())break;p=!0}else{c.push(V);continue}}return c.length&&(p?f.zone=c.join(""):_?i.push(c.join("")):i.push(n(c))),f.address=i.join(""),f}function a(g){if(u(g,":")<2)return{host:g,isIPV6:!1};const l=s(g);if(l.error)return{host:g,isIPV6:!1};{let f=l.address,i=l.address;return l.zone&&(f+="%"+l.zone,i+="%25"+l.zone),{host:f,escapedHost:i,isIPV6:!0}}}function o(g,l){let f="",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]===l||p+1===c)&&(f+=b,i=!1):(b===l?i=!0:i=!1,f+=b)}return f}function u(g,l){let f=0;for(let i=0;i<g.length;i++)g[i]===l&&f++;return f}const d=/^\.\.?\//u,y=/^\/\.(?:\/|$)/u,h=/^\/\.\.(?:\/|$)/u,v=/^\/?(?:.|\n)*?(?=\/|$)/u;function $(g){const l=[];for(;g.length;)if(g.match(d))g=g.replace(d,"");else if(g.match(y))g=g.replace(y,"/");else if(g.match(h))g=g.replace(h,"/"),l.pop();else if(g==="."||g==="..")g="";else{const f=g.match(v);if(f){const i=f[0];g=g.slice(i.length),l.push(i)}else throw new Error("Unexpected dot segment condition")}return l.join("")}function S(g,l){const f=l!==!0?escape:unescape;return g.scheme!==void 0&&(g.scheme=f(g.scheme)),g.userinfo!==void 0&&(g.userinfo=f(g.userinfo)),g.host!==void 0&&(g.host=f(g.host)),g.path!==void 0&&(g.path=f(g.path)),g.query!==void 0&&(g.query=f(g.query)),g.fragment!==void 0&&(g.fragment=f(g.fragment)),g}function w(g){const l=[];if(g.userinfo!==void 0&&(l.push(g.userinfo),l.push("@")),g.host!==void 0){let f=unescape(g.host);const i=r(f);if(i.isIPV4)f=i.host;else{const c=a(i.host);c.isIPV6===!0?f=`[${c.escapedHost}]`:f=g.host}l.push(f)}return(typeof g.port=="number"||typeof g.port=="string")&&(l.push(":"),l.push(String(g.port))),l.length?l.join(""):void 0}return rr={recomposeAuthority:w,normalizeComponentEncoding:S,removeDotSegments:$,normalizeIPv4:r,normalizeIPv6:a,stringArrayToHexStripped:n},rr}var nr,Hr;function ia(){if(Hr)return nr;Hr=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 s(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 a(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}`,P=f[_];i.path=void 0,P&&(i=P.parse(i,c))}else i.error=i.error||"URN can not be parsed.";return i}function d(i,c){const p=c.scheme||i.scheme||"urn",b=i.nid.toLowerCase(),_=`${p}:${c.nid||b}`,P=f[_];P&&(i=P.serialize(i,c));const I=i,V=i.nss;return I.path=`${b||c.nid}:${V}`,c.skipEscape=!0,I}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 h(i){const c=i;return c.nss=(i.uuid||"").toLowerCase(),c}const v={scheme:"http",domainHost:!0,parse:n,serialize:s},$={scheme:"https",domainHost:v.domainHost,parse:n,serialize:s},S={scheme:"ws",domainHost:!0,parse:a,serialize:o},w={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},f={http:v,https:$,ws:S,wss:w,urn:{scheme:"urn",parse:u,serialize:d,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:y,serialize:h,skipNormalize:!0}};return nr=f,nr}var Gr;function oa(){if(Gr)return Ve.exports;Gr=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:s}=aa(),a=ia();function o(l,f){return typeof l=="string"?l=h(w(l,f),f):typeof l=="object"&&(l=w(h(l,f),f)),l}function u(l,f,i){const c=Object.assign({scheme:"null"},i),p=d(w(l,c),w(f,c),c,!0);return h(p,{...c,skipEscape:!0})}function d(l,f,i,c){const p={};return c||(l=w(h(l,i),i),f=w(h(f,i),i)),i=i||{},!i.tolerant&&f.scheme?(p.scheme=f.scheme,p.userinfo=f.userinfo,p.host=f.host,p.port=f.port,p.path=r(f.path||""),p.query=f.query):(f.userinfo!==void 0||f.host!==void 0||f.port!==void 0?(p.userinfo=f.userinfo,p.host=f.host,p.port=f.port,p.path=r(f.path||""),p.query=f.query):(f.path?(f.path.charAt(0)==="/"?p.path=r(f.path):((l.userinfo!==void 0||l.host!==void 0||l.port!==void 0)&&!l.path?p.path="/"+f.path:l.path?p.path=l.path.slice(0,l.path.lastIndexOf("/")+1)+f.path:p.path=f.path,p.path=r(p.path)),p.query=f.query):(p.path=l.path,f.query!==void 0?p.query=f.query:p.query=l.query),p.userinfo=l.userinfo,p.host=l.host,p.port=l.port),p.scheme=l.scheme),p.fragment=f.fragment,p}function y(l,f,i){return typeof l=="string"?(l=unescape(l),l=h(s(w(l,i),!0),{...i,skipEscape:!0})):typeof l=="object"&&(l=h(s(l,!0),{...i,skipEscape:!0})),typeof f=="string"?(f=unescape(f),f=h(s(w(f,i),!0),{...i,skipEscape:!0})):typeof f=="object"&&(f=h(s(f,!0),{...i,skipEscape:!0})),l.toLowerCase()===f.toLowerCase()}function h(l,f){const i={host:l.host,scheme:l.scheme,userinfo:l.userinfo,port:l.port,path:l.path,query:l.query,nid:l.nid,nss:l.nss,uuid:l.uuid,fragment:l.fragment,reference:l.reference,resourceName:l.resourceName,secure:l.secure,error:""},c=Object.assign({},f),p=[],b=a[(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 P=i.path;!c.absolutePath&&(!b||!b.absolutePath)&&(P=r(P)),_===void 0&&(P=P.replace(/^\/\//u,"/%2F")),p.push(P)}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},(l,f)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(f)));function $(l){let f=0;for(let i=0,c=l.length;i<c;++i)if(f=l.charCodeAt(i),f>126||v[f])return!0;return!1}const S=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function w(l,f){const i=Object.assign({},f),c={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},p=l.indexOf("%")!==-1;let b=!1;i.reference==="suffix"&&(l=(i.scheme?i.scheme+":":"")+"//"+l);const _=l.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 I=t(c.host);if(I.isIPV4===!1){const V=e(I.host);c.host=V.host.toLowerCase(),b=V.isIPV6}else c.host=I.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 P=a[(i.scheme||c.scheme||"").toLowerCase()];if(!i.unicodeSupport&&(!P||!P.unicodeSupport)&&c.host&&(i.domainHost||P&&P.domainHost)&&b===!1&&$(c.host))try{c.host=URL.domainToASCII(c.host.toLowerCase())}catch(I){c.error=c.error||"Host's domain name can not be converted to ASCII: "+I}(!P||P&&!P.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)))),P&&P.parse&&P.parse(c,i)}else c.error=c.error||"URI can not be parsed.";return c}const g={SCHEMES:a,normalize:o,resolve:u,resolveComponents:d,equal:y,serialize:h,parse:w};return Ve.exports=g,Ve.exports.default=g,Ve.exports.fastUri=g,Ve.exports}var Xr;function ua(){if(Xr)return He;Xr=1,Object.defineProperty(He,"__esModule",{value:!0});const e=oa();return e.code='require("ajv/dist/runtime/uri").default',He.default=e,He}var Yr;function ns(){return Yr||(Yr=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=H();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(),s=Ue(),a=es(),o=Mt(),u=H(),d=qt(),y=Nt(),h=Q(),v=na,$=ua(),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"]),l={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."},f={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},i=200;function c(M){var k,T,C,m,E,R,K,W,Z,Y,j,N,q,L,x,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,$r=Wt===!0||Wt===void 0?1:Wt||0,wr=(C=(T=M.code)===null||T===void 0?void 0:T.regExp)!==null&&C!==void 0?C:S,Us=(m=M.uriResolver)!==null&&m!==void 0?m:$.default;return{strictSchema:(R=(E=M.strictSchema)!==null&&E!==void 0?E: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:$r,regExp:wr}:{optimize:$r,regExp:wr},loopRequired:(x=M.loopRequired)!==null&&x!==void 0?x: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:Us}}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:C}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:g,es5:T,lines:C}),this.logger=z(k.logger);const m=k.validateFormats;k.validateFormats=!1,this.RULES=(0,a.getRules)(),b.call(this,l,k,"NOT SUPPORTED"),b.call(this,f,k,"DEPRECATED","warn"),this._metaOpts=F.call(this),k.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),k.keywords&&V.call(this,k.keywords),typeof k.meta=="object"&&this.addMetaSchema(k.meta),P.call(this),k.validateFormats=m}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:k,meta:T,schemaId:C}=this.opts;let m=v;C==="id"&&(m={...v},m.id=m.$id,delete m.$id),T&&k&&this.addMetaSchema(m,m[C],!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 C;if(typeof k=="string"){if(C=this.getSchema(k),!C)throw new Error(`no schema with key or ref "${k}"`)}else C=this.compile(k);const m=C(T);return"$async"in C||(this.errors=C.errors),m}compile(k,T){const C=this._addSchema(k,T);return C.validate||this._compileSchemaEnv(C)}compileAsync(k,T){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:C}=this.opts;return m.call(this,k,T);async function m(Y,j){await E.call(this,Y.$schema);const N=this._addSchema(Y,j);return N.validate||R.call(this,N)}async function E(Y){Y&&!this.getSchema(Y)&&await m.call(this,{$ref:Y},!0)}async function R(Y){try{return this._compileSchemaEnv(Y)}catch(j){if(!(j instanceof s.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 E.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]=C(Y))}finally{delete this._loading[Y]}}}addSchema(k,T,C,m=this.opts.validateSchema){if(Array.isArray(k)){for(const R of k)this.addSchema(R,void 0,C,m);return this}let E;if(typeof k=="object"){const{schemaId:R}=this.opts;if(E=k[R],E!==void 0&&typeof E!="string")throw new Error(`schema ${R} must be string`)}return T=(0,d.normalizeId)(T||E),this._checkUnique(T),this.schemas[T]=this._addSchema(k,C,T,m,!0),this}addMetaSchema(k,T,C=this.opts.validateSchema){return this.addSchema(k,T,!0,C),this}validateSchema(k,T){if(typeof k=="boolean")return!0;let C;if(C=k.$schema,C!==void 0&&typeof C!="string")throw new Error("$schema must be a string");if(C=C||this.opts.defaultMeta||this.defaultMeta(),!C)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const m=this.validate(C,k);if(!m&&T){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return m}getSchema(k){let T;for(;typeof(T=_.call(this,k))=="string";)k=T;if(T===void 0){const{schemaId:C}=this.opts,m=new o.SchemaEnv({schema:{},schemaId:C});if(T=o.resolveSchema.call(this,m,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 C=k[this.opts.schemaId];return C&&(C=(0,d.normalizeId)(C),delete this.schemas[C],delete this.refs[C]),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 C;if(typeof k=="string")C=k,typeof T=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),T.keyword=C);else if(typeof k=="object"&&T===void 0){if(T=k,C=T.keyword,Array.isArray(C)&&!C.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(B.call(this,C,T),!T)return(0,h.eachItem)(C,E=>ee.call(this,E)),this;se.call(this,T);const m={...T,type:(0,y.getJSONTypes)(T.type),schemaType:(0,y.getJSONTypes)(T.schemaType)};return(0,h.eachItem)(C,m.type.length===0?E=>ee.call(this,E,m):E=>m.type.forEach(R=>ee.call(this,E,m,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 C of T.rules){const m=C.rules.findIndex(E=>E.keyword===k);m>=0&&C.rules.splice(m,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:C="data"}={}){return!k||k.length===0?"No errors":k.map(m=>`${C}${m.instancePath} ${m.message}`).reduce((m,E)=>m+T+E)}$dataMetaSchema(k,T){const C=this.RULES.all;k=JSON.parse(JSON.stringify(k));for(const m of T){const E=m.split("/").slice(1);let R=k;for(const K of E)R=R[K];for(const K in C){const W=C[K];if(typeof W!="object")continue;const{$data:Z}=W.definition,Y=R[K];Z&&Y&&(R[K]=me(Y))}}return k}_removeAllSchemas(k,T){for(const C in k){const m=k[C];(!T||T.test(C))&&(typeof m=="string"?delete k[C]:m&&!m.meta&&(this._cache.delete(m.schema),delete k[C]))}}_addSchema(k,T,C,m=this.opts.validateSchema,E=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;C=(0,d.normalizeId)(R||C);const Z=d.getSchemaRefs.call(this,k,C);return W=new o.SchemaEnv({schema:k,schemaId:K,meta:T,baseId:C,localRefs:Z}),this._cache.set(W.schema,W),E&&!C.startsWith("#")&&(C&&this._checkUnique(C),this.refs[C]=W),m&&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=s.default,e.default=p;function b(M,k,T,C="error"){for(const m in M){const E=m;E in k&&this.logger[C](`${T}: option ${m}. ${M[E]}`)}}function _(M){return M=(0,d.normalizeId)(M),this.schemas[M]||this.refs[M]}function P(){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 I(){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,h.eachItem)(M,C=>{if(T.keywords[C])throw new Error(`Keyword ${C} is already defined`);if(!U.test(C))throw new Error(`Keyword ${C} 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 C;const m=k?.post;if(T&&m)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let R=m?E.post:E.rules.find(({type:W})=>W===T);if(R||(R={type:T,rules:[]},E.rules.push(R)),E.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),E.all[M]=K,(C=k.implements)===null||C===void 0||C.forEach(W=>this.addKeyword(W))}function ae(M,k,T){const C=M.rules.findIndex(m=>m.keyword===T);C>=0?M.rules.splice(C,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=me(k)),M.validateSchema=this.compile(k,!0))}const te={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function me(M){return{anyOf:[M,te]}}}(Ht)),Ht}var Ge={},Xe={},Ye={},Zr;function ca(){if(Zr)return Ye;Zr=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 Ee={},Qr;function ss(){if(Qr)return Ee;Qr=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.callRef=Ee.getValidate=void 0;const e=Ue(),t=ve(),r=H(),n=Se(),s=Mt(),a=Q(),o={keyword:"$ref",schemaType:"string",code(y){const{gen:h,schema:v,it:$}=y,{baseId:S,schemaEnv:w,validateName:g,opts:l,self:f}=$,{root:i}=w;if((v==="#"||v==="#/")&&S===i.baseId)return p();const c=s.resolveRef.call(f,i,S,v);if(c===void 0)throw new e.default($.opts.uriResolver,S,v);if(c instanceof s.SchemaEnv)return b(c);return _(c);function p(){if(w===i)return d(y,g,w,w.$async);const P=h.scopeValue("root",{ref:i});return d(y,(0,r._)`${P}.validate`,i,i.$async)}function b(P){const I=u(y,P);d(y,I,P,P.$async)}function _(P){const I=h.scopeValue("schema",l.code.source===!0?{ref:P,code:(0,r.stringify)(P)}:{ref:P}),V=h.name("valid"),F=y.subschema({schema:P,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:v},V);y.mergeEvaluated(F),y.ok(V)}}};function u(y,h){const{gen:v}=y;return h.validate?v.scopeValue("validate",{ref:h.validate}):(0,r._)`${v.scopeValue("wrapper",{ref:h})}.validate`}Ee.getValidate=u;function d(y,h,v,$){const{gen:S,it:w}=y,{allErrors:g,schemaEnv:l,opts:f}=w,i=f.passContext?n.default.this:r.nil;$?c():p();function c(){if(!l.$async)throw new Error("async schema referenced by sync schema");const P=S.let("valid");S.try(()=>{S.code((0,r._)`await ${(0,t.callValidateCode)(y,h,i)}`),_(h),g||S.assign(P,!0)},I=>{S.if((0,r._)`!(${I} instanceof ${w.ValidationError})`,()=>S.throw(I)),b(I),g||S.assign(P,!1)}),y.ok(P)}function p(){y.result((0,t.callValidateCode)(y,h,i),()=>_(h),()=>b(h))}function b(P){const I=(0,r._)`${P}.errors`;S.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),S.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(P){var I;if(!w.opts.unevaluated)return;const V=(I=v?.validate)===null||I===void 0?void 0:I.evaluated;if(w.props!==!0)if(V&&!V.dynamicProps)V.props!==void 0&&(w.props=a.mergeEvaluated.props(S,V.props,w.props));else{const F=S.var("props",(0,r._)`${P}.evaluated.props`);w.props=a.mergeEvaluated.props(S,F,w.props,r.Name)}if(w.items!==!0)if(V&&!V.dynamicItems)V.items!==void 0&&(w.items=a.mergeEvaluated.items(S,V.items,w.items));else{const F=S.var("items",(0,r._)`${P}.evaluated.items`);w.items=a.mergeEvaluated.items(S,F,w.items,r.Name)}}}return Ee.callRef=d,Ee.default=o,Ee}var en;function as(){if(en)return Xe;en=1,Object.defineProperty(Xe,"__esModule",{value:!0});const e=ca(),t=ss(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return Xe.default=r,Xe}var Ze={},Qe={},tn;function la(){if(tn)return Qe;tn=1,Object.defineProperty(Qe,"__esModule",{value:!0});const e=H(),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:a,schemaCode:o})=>(0,e.str)`must be ${r[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>(0,e._)`{comparison: ${r[a].okStr}, limit: ${o}}`},s={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(a){const{keyword:o,data:u,schemaCode:d}=a;a.fail$data((0,e._)`${u} ${r[o].fail} ${d} || isNaN(${u})`)}};return Qe.default=s,Qe}var et={},rn;function fa(){if(rn)return et;rn=1,Object.defineProperty(et,"__esModule",{value:!0});const e=H(),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:s,data:a,schemaCode:o,it:u}=n,d=u.opts.multipleOfPrecision,y=s.let("res"),h=d?(0,e._)`Math.abs(Math.round(${y}) - ${y}) > 1e-${d}`:(0,e._)`${y} !== parseInt(${y})`;n.fail$data((0,e._)`(${o} === 0 || (${y} = ${a}/${o}, ${h}))`)}};return et.default=r,et}var tt={},rt={},nn;function da(){if(nn)return rt;nn=1,Object.defineProperty(rt,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,s=0,a;for(;s<r;)n++,a=t.charCodeAt(s++),a>=55296&&a<=56319&&s<r&&(a=t.charCodeAt(s),(a&64512)===56320&&s++);return n}return rt.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',rt}var sn;function ha(){if(sn)return tt;sn=1,Object.defineProperty(tt,"__esModule",{value:!0});const e=H(),t=Q(),r=da(),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:o}){const u=a==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${u} than ${o} characters`},params:({schemaCode:a})=>(0,e._)`{limit: ${a}}`},code(a){const{keyword:o,data:u,schemaCode:d,it:y}=a,h=o==="maxLength"?e.operators.GT:e.operators.LT,v=y.opts.unicode===!1?(0,e._)`${u}.length`:(0,e._)`${(0,t.useFunc)(a.gen,r.default)}(${u})`;a.fail$data((0,e._)`${v} ${h} ${d}`)}};return tt.default=s,tt}var nt={},an;function ma(){if(an)return nt;an=1,Object.defineProperty(nt,"__esModule",{value:!0});const e=ve(),t=H(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>(0,t.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0,t._)`{pattern: ${s}}`},code(s){const{data:a,$data:o,schema:u,schemaCode:d,it:y}=s,h=y.opts.unicodeRegExp?"u":"",v=o?(0,t._)`(new RegExp(${d}, ${h}))`:(0,e.usePattern)(s,u);s.fail$data((0,t._)`!${v}.test(${a})`)}};return nt.default=n,nt}var st={},on;function pa(){if(on)return st;on=1,Object.defineProperty(st,"__esModule",{value:!0});const e=H(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const a=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${s} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:a,schemaCode:o}=n,u=s==="maxProperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${a}).length ${u} ${o}`)}};return st.default=r,st}var at={},un;function ya(){if(un)return at;un=1,Object.defineProperty(at,"__esModule",{value:!0});const e=ve(),t=H(),r=Q(),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,t.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,t._)`{missingProperty: ${a}}`},code(a){const{gen:o,schema:u,schemaCode:d,data:y,$data:h,it:v}=a,{opts:$}=v;if(!h&&u.length===0)return;const S=u.length>=$.loopRequired;if(v.allErrors?w():g(),$.strictRequired){const i=a.parentSchema.properties,{definedProperties:c}=a.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||h)a.block$data(t.nil,l);else for(const i of u)(0,e.checkReportMissingProp)(a,i)}function g(){const i=o.let("missing");if(S||h){const c=o.let("valid",!0);a.block$data(c,()=>f(i,c)),a.ok(c)}else o.if((0,e.checkMissingProp)(a,u,i)),(0,e.reportMissingProp)(a,i),o.else()}function l(){o.forOf("prop",d,i=>{a.setParams({missingProperty:i}),o.if((0,e.noPropertyInData)(o,y,i,$.ownProperties),()=>a.error())})}function f(i,c){a.setParams({missingProperty:i}),o.forOf(i,d,()=>{o.assign(c,(0,e.propertyInData)(o,y,i,$.ownProperties)),o.if((0,t.not)(c),()=>{a.error(),o.break()})},t.nil)}}};return at.default=s,at}var it={},cn;function ga(){if(cn)return it;cn=1,Object.defineProperty(it,"__esModule",{value:!0});const e=H(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:s}){const a=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${s} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:s,data:a,schemaCode:o}=n,u=s==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`${a}.length ${u} ${o}`)}};return it.default=r,it}var ot={},ut={},ln;function fr(){if(ln)return ut;ln=1,Object.defineProperty(ut,"__esModule",{value:!0});const e=rs();return e.code='require("ajv/dist/runtime/equal").default',ut.default=e,ut}var fn;function va(){if(fn)return ot;fn=1,Object.defineProperty(ot,"__esModule",{value:!0});const e=Nt(),t=H(),r=Q(),n=fr(),a={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:d,$data:y,schema:h,parentSchema:v,schemaCode:$,it:S}=o;if(!y&&!h)return;const w=u.let("valid"),g=v.items?(0,e.getSchemaTypes)(v.items):[];o.block$data(w,l,(0,t._)`${$} === false`),o.ok(w);function l(){const p=u.let("i",(0,t._)`${d}.length`),b=u.let("j");o.setParams({i:p,j:b}),u.assign(w,!0),u.if((0,t._)`${p} > 1`,()=>(f()?i:c)(p,b))}function f(){return g.length>0&&!g.some(p=>p==="object"||p==="array")}function i(p,b){const _=u.name("item"),P=(0,e.checkDataTypes)(g,_,S.opts.strictNumbers,e.DataType.Wrong),I=u.const("indices",(0,t._)`{}`);u.for((0,t._)`;${p}--;`,()=>{u.let(_,(0,t._)`${d}[${p}]`),u.if(P,(0,t._)`continue`),g.length>1&&u.if((0,t._)`typeof ${_} == "string"`,(0,t._)`${_} += "_"`),u.if((0,t._)`typeof ${I}[${_}] == "number"`,()=>{u.assign(b,(0,t._)`${I}[${_}]`),o.error(),u.assign(w,!1).break()}).code((0,t._)`${I}[${_}] = ${p}`)})}function c(p,b){const _=(0,r.useFunc)(u,n.default),P=u.name("outer");u.label(P).for((0,t._)`;${p}--;`,()=>u.for((0,t._)`${b} = ${p}; ${b}--;`,()=>u.if((0,t._)`${_}(${d}[${p}], ${d}[${b}])`,()=>{o.error(),u.assign(w,!1).break(P)})))}}};return ot.default=a,ot}var ct={},dn;function ba(){if(dn)return ct;dn=1,Object.defineProperty(ct,"__esModule",{value:!0});const e=H(),t=Q(),r=fr(),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,e._)`{allowedValue: ${a}}`},code(a){const{gen:o,data:u,$data:d,schemaCode:y,schema:h}=a;d||h&&typeof h=="object"?a.fail$data((0,e._)`!${(0,t.useFunc)(o,r.default)}(${u}, ${y})`):a.fail((0,e._)`${h} !== ${u}`)}};return ct.default=s,ct}var lt={},hn;function _a(){if(hn)return lt;hn=1,Object.defineProperty(lt,"__esModule",{value:!0});const e=H(),t=Q(),r=fr(),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,e._)`{allowedValues: ${a}}`},code(a){const{gen:o,data:u,$data:d,schema:y,schemaCode:h,it:v}=a;if(!d&&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($||d)g=o.let("valid"),a.block$data(g,l);else{if(!Array.isArray(y))throw new Error("ajv implementation error");const i=o.const("vSchema",h);g=(0,e.or)(...y.map((c,p)=>f(i,p)))}a.pass(g);function l(){o.assign(g,!1),o.forOf("v",h,i=>o.if((0,e._)`${w()}(${u}, ${i})`,()=>o.assign(g,!0).break()))}function f(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=s,lt}var mn;function is(){if(mn)return Ze;mn=1,Object.defineProperty(Ze,"__esModule",{value:!0});const e=la(),t=fa(),r=ha(),n=ma(),s=pa(),a=ya(),o=ga(),u=va(),d=ba(),y=_a(),h=[e.default,t.default,r.default,n.default,s.default,a.default,o.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,y.default];return Ze.default=h,Ze}var ft={},Ce={},pn;function os(){if(pn)return Ce;pn=1,Object.defineProperty(Ce,"__esModule",{value:!0}),Ce.validateAdditionalItems=void 0;const e=H(),t=Q(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{parentSchema:o,it:u}=a,{items:d}=o;if(!Array.isArray(d)){(0,t.checkStrictMode)(u,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(a,d)}};function s(a,o){const{gen:u,schema:d,data:y,keyword:h,it:v}=a;v.items=!0;const $=u.const("len",(0,e._)`${y}.length`);if(d===!1)a.setParams({len:o.length}),a.pass((0,e._)`${$} <= ${o.length}`);else if(typeof d=="object"&&!(0,t.alwaysValidSchema)(v,d)){const w=u.var("valid",(0,e._)`${$} <= ${o.length}`);u.if((0,e.not)(w),()=>S(w)),a.ok(w)}function S(w){u.forRange("i",o.length,$,g=>{a.subschema({keyword:h,dataProp:g,dataPropType:t.Type.Num},w),v.allErrors||u.if((0,e.not)(w),()=>u.break())})}}return Ce.validateAdditionalItems=s,Ce.default=n,Ce}var dt={},Ie={},yn;function us(){if(yn)return Ie;yn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.validateTuple=void 0;const e=H(),t=Q(),r=ve(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:o,it:u}=a;if(Array.isArray(o))return s(a,"additionalItems",o);u.items=!0,!(0,t.alwaysValidSchema)(u,o)&&a.ok((0,r.validateArray)(a))}};function s(a,o,u=a.schema){const{gen:d,parentSchema:y,data:h,keyword:v,it:$}=a;g(y),$.opts.unevaluated&&u.length&&$.items!==!0&&($.items=t.mergeEvaluated.items(d,u.length,$.items));const S=d.name("valid"),w=d.const("len",(0,e._)`${h}.length`);u.forEach((l,f)=>{(0,t.alwaysValidSchema)($,l)||(d.if((0,e._)`${w} > ${f}`,()=>a.subschema({keyword:v,schemaProp:f,dataProp:f},S)),a.ok(S))});function g(l){const{opts:f,errSchemaPath:i}=$,c=u.length,p=c===l.minItems&&(c===l.maxItems||l[o]===!1);if(f.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,f.strictTuples)}}}return Ie.validateTuple=s,Ie.default=n,Ie}var gn;function $a(){if(gn)return dt;gn=1,Object.defineProperty(dt,"__esModule",{value:!0});const e=us(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return dt.default=t,dt}var ht={},vn;function wa(){if(vn)return ht;vn=1,Object.defineProperty(ht,"__esModule",{value:!0});const e=H(),t=Q(),r=ve(),n=os(),a={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:d,it:y}=o,{prefixItems:h}=d;y.items=!0,!(0,t.alwaysValidSchema)(y,u)&&(h?(0,n.validateAdditionalItems)(o,h):o.ok((0,r.validateArray)(o)))}};return ht.default=a,ht}var mt={},bn;function Sa(){if(bn)return mt;bn=1,Object.defineProperty(mt,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:s,max:a}})=>a===void 0?(0,e.str)`must contain at least ${s} valid item(s)`:(0,e.str)`must contain at least ${s} and no more than ${a} valid item(s)`,params:({params:{min:s,max:a}})=>a===void 0?(0,e._)`{minContains: ${s}}`:(0,e._)`{minContains: ${s}, maxContains: ${a}}`},code(s){const{gen:a,schema:o,parentSchema:u,data:d,it:y}=s;let h,v;const{minContains:$,maxContains:S}=u;y.opts.next?(h=$===void 0?1:$,v=S):h=1;const w=a.const("len",(0,e._)`${d}.length`);if(s.setParams({min:h,max:v}),v===void 0&&h===0){(0,t.checkStrictMode)(y,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(v!==void 0&&h>v){(0,t.checkStrictMode)(y,'"minContains" > "maxContains" is always invalid'),s.fail();return}if((0,t.alwaysValidSchema)(y,o)){let c=(0,e._)`${w} >= ${h}`;v!==void 0&&(c=(0,e._)`${c} && ${w} <= ${v}`),s.pass(c);return}y.items=!0;const g=a.name("valid");v===void 0&&h===1?f(g,()=>a.if(g,()=>a.break())):h===0?(a.let(g,!0),v!==void 0&&a.if((0,e._)`${d}.length > 0`,l)):(a.let(g,!1),l()),s.result(g,()=>s.reset());function l(){const c=a.name("_valid"),p=a.let("count",0);f(c,()=>a.if(c,()=>i(p)))}function f(c,p){a.forRange("i",0,w,b=>{s.subschema({keyword:"contains",dataProp:b,dataPropType:t.Type.Num,compositeRule:!0},c),p()})}function i(c){a.code((0,e._)`${c}++`),v===void 0?a.if((0,e._)`${c} >= ${h}`,()=>a.assign(g,!0).break()):(a.if((0,e._)`${c} > ${v}`,()=>a.assign(g,!1).break()),h===1?a.assign(g,!0):a.if((0,e._)`${c} >= ${h}`,()=>a.assign(g,!0)))}}};return mt.default=n,mt}var sr={},_n;function cs(){return _n||(_n=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=H(),r=Q(),n=ve();e.error={message:({params:{property:d,depsCount:y,deps:h}})=>{const v=y===1?"property":"properties";return(0,t.str)`must have ${v} ${h} when property ${d} is present`},params:({params:{property:d,depsCount:y,deps:h,missingProperty:v}})=>(0,t._)`{property: ${d},
|
|
6
6
|
missingProperty: ${v},
|
|
7
7
|
depsCount: ${y},
|
|
8
|
-
deps: ${h}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[y,h]=a(d);o(d,y),u(d,h)}};function a({schema:d}){const y={},h={};for(const v in d){if(v==="__proto__")continue;const $=Array.isArray(d[v])?y:h;$[v]=d[v]}return[y,h]}function o(d,y=d.schema){const{gen:h,data:v,it:$}=d;if(Object.keys(y).length===0)return;const S=h.let("missing");for(const w in y){const g=y[w];if(g.length===0)continue;const l=(0,n.propertyInData)(h,v,w,$.opts.ownProperties);d.setParams({property:w,depsCount:g.length,deps:g.join(", ")}),$.allErrors?h.if(l,()=>{for(const f of g)(0,n.checkReportMissingProp)(d,f)}):(h.if((0,t._)`${l} && (${(0,n.checkMissingProp)(d,g,S)})`),(0,n.reportMissingProp)(d,S),h.else())}}e.validatePropertyDeps=o;function u(d,y=d.schema){const{gen:h,data:v,keyword:$,it:S}=d,w=h.name("valid");for(const g in y)(0,r.alwaysValidSchema)(S,y[g])||(h.if((0,n.propertyInData)(h,v,g,S.opts.ownProperties),()=>{const l=d.subschema({keyword:$,schemaProp:g},w);d.mergeValidEvaluated(l,w)},()=>h.var(w,!0)),d.ok(w))}e.validateSchemaDeps=u,e.default=s}(sr)),sr}var pt={},$n;function Ea(){if($n)return pt;$n=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:a,schema:o,data:u,it:d}=s;if((0,t.alwaysValidSchema)(d,o))return;const y=a.name("valid");a.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},y),a.if((0,e.not)(y),()=>{s.error(!0),d.allErrors||a.break()})}),s.ok(y)}};return pt.default=n,pt}var yt={},wn;function ls(){if(wn)return yt;wn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=ve(),t=H(),r=Se(),n=Q(),a={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:d,parentSchema:y,data:h,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)($,d))return;const g=(0,e.allSchemaProperties)(y.properties),l=(0,e.allSchemaProperties)(y.patternProperties);f(),o.ok((0,t._)`${v} === ${r.default.errors}`);function f(){u.forIn("key",h,_=>{!g.length&&!l.length?p(_):u.if(i(_),()=>p(_))})}function i(_){let P;if(g.length>8){const I=(0,n.schemaRefOrVal)($,y.properties,"properties");P=(0,e.isOwnProperty)(u,I,_)}else g.length?P=(0,t.or)(...g.map(I=>(0,t._)`${_} === ${I}`)):P=t.nil;return l.length&&(P=(0,t.or)(P,...l.map(I=>(0,t._)`${(0,e.usePattern)(o,I)}.test(${_})`))),(0,t.not)(P)}function c(_){u.code((0,t._)`delete ${h}[${_}]`)}function p(_){if(w.removeAdditional==="all"||w.removeAdditional&&d===!1){c(_);return}if(d===!1){o.setParams({additionalProperty:_}),o.error(),S||u.break();return}if(typeof d=="object"&&!(0,n.alwaysValidSchema)($,d)){const P=u.name("valid");w.removeAdditional==="failing"?(b(_,P,!1),u.if((0,t.not)(P),()=>{o.reset(),c(_)})):(b(_,P),S||u.if((0,t.not)(P),()=>u.break()))}}function b(_,P,I){const V={keyword:"additionalProperties",dataProp:_,dataPropType:n.Type.Str};I===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(V,P)}}};return yt.default=a,yt}var gt={},Sn;function Pa(){if(Sn)return gt;Sn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Le(),t=ve(),r=Q(),n=ls(),s={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:u,parentSchema:d,data:y,it:h}=a;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(h,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(u);for(const l of v)h.definedProperties.add(l);h.opts.unevaluated&&v.length&&h.props!==!0&&(h.props=r.mergeEvaluated.props(o,(0,r.toHash)(v),h.props));const $=v.filter(l=>!(0,r.alwaysValidSchema)(h,u[l]));if($.length===0)return;const S=o.name("valid");for(const l of $)w(l)?g(l):(o.if((0,t.propertyInData)(o,y,l,h.opts.ownProperties)),g(l),h.allErrors||o.else().var(S,!0),o.endIf()),a.it.definedProperties.add(l),a.ok(S);function w(l){return h.opts.useDefaults&&!h.compositeRule&&u[l].default!==void 0}function g(l){a.subschema({keyword:"properties",schemaProp:l,dataProp:l},S)}}};return gt.default=s,gt}var vt={},En;function Oa(){if(En)return vt;En=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=ve(),t=H(),r=Q(),n=Q(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:u,data:d,parentSchema:y,it:h}=a,{opts:v}=h,$=(0,e.allSchemaProperties)(u),S=$.filter(p=>(0,r.alwaysValidSchema)(h,u[p]));if($.length===0||S.length===$.length&&(!h.opts.unevaluated||h.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&y.properties,g=o.name("valid");h.props!==!0&&!(h.props instanceof t.Name)&&(h.props=(0,n.evaluatedPropsToName)(o,h.props));const{props:l}=h;f();function f(){for(const p of $)w&&i(p),h.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)(h,`property ${b} matches pattern ${p} (use allowMatchingProperties)`)}function c(p){o.forIn("key",d,b=>{o.if((0,t._)`${(0,e.usePattern)(a,p)}.test(${b})`,()=>{const _=S.includes(p);_||a.subschema({keyword:"patternProperties",schemaProp:p,dataProp:b,dataPropType:n.Type.Str},g),h.opts.unevaluated&&l!==!0?o.assign((0,t._)`${l}[${b}]`,!0):!_&&!h.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return vt.default=s,vt}var bt={},Pn;function ja(){if(Pn)return bt;Pn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Q(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:a}=r;if((0,e.alwaysValidSchema)(a,s)){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={},On;function ka(){if(On)return _t;On=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={},jn;function Na(){if(jn)return $t;jn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:a,schema:o,parentSchema:u,it:d}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;const y=o,h=a.let("valid",!1),v=a.let("passing",null),$=a.name("_valid");s.setParams({passing:v}),a.block(S),s.result(h,()=>s.reset(),()=>s.error(!0));function S(){y.forEach((w,g)=>{let l;(0,t.alwaysValidSchema)(d,w)?a.var($,!0):l=s.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},$),g>0&&a.if((0,e._)`${$} && ${h}`).assign(h,!1).assign(v,(0,e._)`[${v}, ${g}]`).else(),a.if($,()=>{a.assign(h,!0),a.assign(v,g),l&&s.mergeEvaluated(l,e.Name)})})}}};return $t.default=n,$t}var wt={},kn;function Ra(){if(kn)return wt;kn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Q(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:a}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=n.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(a,u))return;const y=r.subschema({keyword:"allOf",schemaProp:d},o);r.ok(o),r.mergeEvaluated(y)})}};return wt.default=t,wt}var St={},Nn;function Ca(){if(Nn)return St;Nn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:u,it:d}=a;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const y=s(d,"then"),h=s(d,"else");if(!y&&!h)return;const v=o.let("valid",!0),$=o.name("_valid");if(S(),a.reset(),y&&h){const g=o.let("ifClause");a.setParams({ifClause:g}),o.if($,w("then",g),w("else",g))}else y?o.if($,w("then")):o.if((0,e.not)($),w("else"));a.pass(v,()=>a.error(!0));function S(){const g=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);a.mergeEvaluated(g)}function w(g,l){return()=>{const f=a.subschema({keyword:g},$);o.assign(v,$),a.mergeValidEvaluated(f,v),l?o.assign(l,(0,e._)`${g}`):a.setParams({ifClause:g})}}}};function s(a,o){const u=a.schema[o];return u!==void 0&&!(0,t.alwaysValidSchema)(a,u)}return St.default=n,St}var Et={},Rn;function Ia(){if(Rn)return Et;Rn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=Q(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Et.default=t,Et}var Cn;function fs(){if(Cn)return ft;Cn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=os(),t=$a(),r=us(),n=wa(),s=Sa(),a=cs(),o=Ea(),u=ls(),d=Pa(),y=Oa(),h=ja(),v=ka(),$=Na(),S=Ra(),w=Ca(),g=Ia();function l(f=!1){const i=[h.default,v.default,$.default,S.default,w.default,g.default,o.default,u.default,a.default,d.default,y.default];return f?i.push(t.default,n.default):i.push(e.default,r.default),i.push(s.default),i}return ft.default=l,ft}var Pt={},Ot={},In;function Aa(){if(In)return Ot;In=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=H(),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,s){const{gen:a,data:o,$data:u,schema:d,schemaCode:y,it:h}=n,{opts:v,errSchemaPath:$,schemaEnv:S,self:w}=h;if(!v.validateFormats)return;u?g():l();function g(){const f=a.scopeValue("formats",{ref:w.formats,code:v.code.formats}),i=a.const("fDef",(0,e._)`${f}[${y}]`),c=a.let("fType"),p=a.let("format");a.if((0,e._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>a.assign(c,(0,e._)`${i}.type || "string"`).assign(p,(0,e._)`${i}.validate`),()=>a.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 P=S.$async?(0,e._)`(${i}.async ? await ${p}(${o}) : ${p}(${o}))`:(0,e._)`${p}(${o})`,I=(0,e._)`(typeof ${p} == "function" ? ${P} : ${p}.test(${o}))`;return(0,e._)`${p} && ${p} !== true && ${c} === ${s} && !${I}`}}function l(){const f=w.formats[d];if(!f){b();return}if(f===!0)return;const[i,c,p]=_(f);i===s&&n.pass(P());function b(){if(v.strictSchema===!1){w.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${d}" ignored in schema at path "${$}"`}}function _(I){const V=I instanceof RegExp?(0,e.regexpCode)(I):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(d)}`:void 0,F=a.scopeValue("formats",{key:d,ref:I,code:V});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,e._)`${F}.validate`]:["string",I,F]}function P(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.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 An;function ds(){if(An)return Pt;An=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t=[Aa().default];return Pt.default=t,Pt}var ke={},Tn;function hs(){return Tn||(Tn=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 qn;function ms(){if(qn)return Ge;qn=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=as(),t=is(),r=fs(),n=ds(),s=hs(),a=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return Ge.default=a,Ge}var jt={},Me={},Vn;function Ta(){if(Vn)return Me;Vn=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 Mn;function ps(){if(Mn)return jt;Mn=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=H(),t=Ta(),r=Mt(),n=Ue(),s=Q(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:d}})=>u===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:u,tag:d,tagName:y}})=>(0,e._)`{error: ${u}, tag: ${y}, tagValue: ${d}}`},code(u){const{gen:d,data:y,schema:h,parentSchema:v,it:$}=u,{oneOf:S}=v;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=h.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!S)throw new Error("discriminator: requires oneOf keyword");const g=d.let("valid",!1),l=d.const("tag",(0,e._)`${y}${(0,e.getProperty)(w)}`);d.if((0,e._)`typeof ${l} == "string"`,()=>f(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:l,tagName:w})),u.ok(g);function f(){const p=c();d.if(!1);for(const b in p)d.elseIf((0,e._)`${l} === ${b}`),d.assign(g,i(p[b]));d.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:l,tagName:w}),d.endIf()}function i(p){const b=d.name("valid"),_=u.subschema({keyword:"oneOf",schemaProp:p},b);return u.mergeEvaluated(_,e.Name),b}function c(){var p;const b={},_=I(v);let P=!0;for(let A=0;A<S.length;A++){let z=S[A];if(z?.$ref&&!(0,s.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}"`);P=P&&(_||I(z)),V(U,A)}if(!P)throw new Error(`discriminator: "${w}" must be required`);return b;function I({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 qa="http://json-schema.org/draft-07/schema#",Va="http://json-schema.org/draft-07/schema#",Ma="Core schema meta-schema",Da={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:[]}},za=["object","boolean"],Fa={$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:"#"}},La={$schema:qa,$id:Va,title:Ma,definitions:Da,type:za,properties:Fa,default:!0};var Dn;function ys(){return Dn||(Dn=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=ns(),n=ms(),s=ps(),a=La,o=["/properties"],u="http://json-schema.org/draft-07/schema";class d extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(a,o):a;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=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var y=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var h=H();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.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 zn;function Ua(){return zn||(zn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=ys(),r=H(),n=r.operators,s={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}},a={message:({keyword:u,schemaCode:d})=>(0,r.str)`should be ${s[u].okStr} ${d}`,params:({keyword:u,schemaCode:d})=>(0,r._)`{comparison: ${s[u].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(u){const{gen:d,data:y,schemaCode:h,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?l():f();function l(){const c=d.scopeValue("formats",{ref:w.formats,code:S.code.formats}),p=d.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 f(){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=d.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}, ${h}) ${s[v].fail} 0`}},dependencies:["format"]};const o=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=o}(xt)),xt}var Fn;function Ka(){return Fn||(Fn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ws(),n=Ua(),s=H(),a=new s.Name("fullFormats"),o=new s.Name("fastFormats"),u=(y,h={keywords:!0})=>{if(Array.isArray(h))return d(y,h,r.fullFormats,a),y;const[v,$]=h.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,a],S=h.formats||r.formatNames;return d(y,S,v,$),h.keywords&&(0,n.default)(y),y};u.get=(y,h="full")=>{const $=(h==="fast"?r.fastFormats:r.fullFormats)[y];if(!$)throw new Error(`Unknown format "${y}"`);return $};function d(y,h,v,$){var S,w;(S=(w=y.opts.code).formats)!==null&&S!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${$}`);for(const g of h)y.addFormat(g,v[g])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u}(Ke,Ke.exports)),Ke.exports}var Ja=Ka();const Wa=lr(Ja);function dr(e){return e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function gs(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 vs(e){return e.message??`${e.keyword} validation failed`}function bs(e){return e.reduce((t,r)=>{const n=gs(r);if(n==null)return t;let s=t;for(const a of n){const o=a;s.dependencies==null&&(s.dependencies={}),s.dependencies[o]==null&&(s.dependencies[o]={}),s=s.dependencies[o]}return s.message=vs(r),t},{})}function Dt(e){const t=bs(e);return D.a.invalid(t)}function Ba(e){const t={keyword:"x:ui",schemaType:["string","object"],errors:!1,validate:()=>!0};e.addKeyword(t)}let Rt=new WeakMap;function xa(){Rt=new WeakMap}function Ha(e){Rt.delete(e)}function Ga(){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 s=e.compile(t);return r.set(t,s),s}async function Ln(e,t,r){const n=(await(()=>{switch(e){case"2020-12":return Promise.resolve().then(()=>require("./2020-BVrVGeh-.cjs")).then(a=>a._2020);case"2019-09":return Promise.resolve().then(()=>require("./2019-B4jrQ2Q8.cjs")).then(a=>a._2019);case"draft-07":return Promise.resolve().then(()=>so)}})()).default,s=new n({meta:r,strictSchema:!1,allErrors:!0,removeAdditional:t});switch(e){case"2020-12":s.opts.defaultMeta="https://json-schema.org/draft/2020-12/schema";break;case"2019-09":s.opts.defaultMeta="https://json-schema.org/draft/2019-09/schema";break;case"draft-07":s.opts.defaultMeta="http://json-schema.org/draft-07/schema#";break}return Wa(s),Ba(s),s}function Xa(e){return e==null||e.includes("draft/2020-12")?"2020-12":e.includes("draft/2019-09")?"2019-09":"draft-07"}function Ya(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[s,a]of Object.entries(r))!t&&(s==="$id"||s==="$schema"||s==="$dynamicAnchor")||(n[s]=or(a,!1));return n}return e}function Un(e){const t=new Set,r=n=>{if(n!=null){if(Array.isArray(n)){for(const s of n)r(s);return}if(typeof n=="object"){const s=n,a=s.$ref;typeof a=="string"&&a.length>0&&a[0]!=="#"&&t.add(Ya(a));for(const o of Object.values(s))r(o)}}};return r(e),[...t]}function _s(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 Za(e,t,r,n){if(r==null)return null;const s=new Set;if(n&&n.length>0)for(const u of n){const d=u.$id;typeof d=="string"&&d.length>0&&s.add(d)}const a=[],o=5;for(let u=0;u<o;u++){const d=Un(t),y=a.flatMap($=>Un($)),h=new Set([...d,...y]),v=[];for(const $ of h)if(!s.has($)){if(e.getSchema($)){s.add($);continue}v.push($)}if(v.length===0)return null;try{const $=await r(v);if(!Array.isArray($)||$.length===0)return null;_s(e,$);for(const S of $){const w=S.$id;typeof w=="string"&&w.length>0&&(s.add(w),a.push(S))}}catch($){return`refResolver failed: ${$ instanceof Error?$.message:String($)}`}}return"refResolver reached iteration limit while resolving external $refs"}async function $s(e,t){try{const r=Xa(e.$schema),n=t?.sanitizeAdditional===!1?!1:t?.sanitizeAdditional??!1,s=h=>typeof h=="string"&&h.endsWith("#")?h.slice(0,-1):h??"",a=e.$id,o=s(a);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 h=await Ln(r,n,!1),v=or(e);try{h.addMetaSchema(v)}catch{}const $=h.getSchema(a??o)??h.compile(v);return{ok:!0,value:{ajv:h,validate:$}}}const d=await Ln(r,n,!0);if(t?.externalSchemas&&t.externalSchemas.length>0&&_s(d,t.externalSchemas),t?.refResolver){const h=await Za(d,e,t.refResolver,t.externalSchemas);if(h!=null)return{ok:!1,error:h}}const y=d.compile(e);return{ok:!0,value:{ajv:d,validate:y}}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}function Qa(e,t){if(typeof e=="boolean"||typeof t=="boolean")return t;const r={...e};for(const[n,s]of Object.entries(t))n==="required"&&Array.isArray(e.required)&&Array.isArray(s)?r.required=[...new Set([...e.required,...s])]:n==="properties"&&e.properties&&typeof s=="object"&&s!=null?r.properties={...e.properties,...s}:r[n]=s;return r}function ei(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 ti(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 s=t.type,a=r.type;if(s!=null&&a!=null&&s!==a){const o=Array.isArray(s)?s:[s],u=Array.isArray(a)?a:[a];return{path:n,message:`Property "${e}" has conflicting types: ${o.join("|")} vs ${u.join("|")}`,conflictingValues:[t,r]}}if(s===a&&s==="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(s===a&&(s==="number"||s==="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 ei(t,r)?null:{path:n,message:`Property "${e}" has conflicting definitions in allOf branches`,conflictingValues:[t,r]}}function ri(e){const t=Array.isArray(e)?e:[e],r=new Set(t.map(n=>n));return r.has("number")&&r.add("integer"),r}function ni(e,t,r,n){for(const[s,a]of Object.entries(t)){if(e[s]!=null&&e[s]!==a){const o=e[s],u=ti(s,o,a,[...r,"properties",s]);u!=null&&n.push(u)}e[s]!=null?e[s]=Qa(e[s],a):e[s]=a}}function si(e,t,r,n){t!=null&&e.additionalProperties!=null&&e.additionalProperties!==t&&n.push({path:[...r,"additionalProperties"],message:`Conflicting additionalProperties values in allOf: ${e.additionalProperties} vs ${t}`,conflictingValues:[e.additionalProperties,t]})}function ai(e,t,r,n,s){t!=null&&e.maxProperties!=null&&t>e.maxProperties&&s.push({path:[...n,"minProperties"],message:`minProperties ${t} conflicts with existing maxProperties ${e.maxProperties}`,conflictingValues:[t,e.maxProperties]}),r!=null&&e.minProperties!=null&&r<e.minProperties&&s.push({path:[...n,"maxProperties"],message:`maxProperties ${r} conflicts with existing minProperties ${e.minProperties}`,conflictingValues:[r,e.minProperties]})}function ii(e,t,r){if(e.length===0)return;let n=null;for(const a of e)if(n==null)n=new Set(a);else{const o=new Set;for(const u of n)a.has(u)&&o.add(u);n=o}const s=Array.from(n??[]);if(s.length===0){const a=e.map(o=>Array.from(o));r.push({path:[...t,"type"],message:"Incompatible types in allOf (no common types)",conflictingValues:a});return}else return s.length===1?s[0]:s}function Ft(e,t=[]){const r=[],n={},s=[],a=[],o={};for(const d of e){d.type!=null&&s.push(ri(d.type)),Array.isArray(d.required)&&a.push(...d.required),d.properties!=null&&ni(o,d.properties,t,r);const{type:y,required:h,properties:v,allOf:$,additionalProperties:S,patternProperties:w,minProperties:g,maxProperties:l,...f}=d;si(n,S,t,r),ai(n,g,l,t,r),Object.assign(n,f),S!=null&&(n.additionalProperties=S),w!=null&&(n.patternProperties=w),g!=null&&(n.minProperties=g),l!=null&&(n.maxProperties=l)}const u=ii(s,t,r);return u!=null&&(n.type=u),a.length>0&&(n.required=[...new Set(a)]),Object.keys(o).length>0&&(n.properties=o),{mergedSchema:n,conflicts:r}}function ws(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 Ss(e,t,r,n=[]){const s=[],a=[],o=hr(e,t,r);o&&s.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,l]of Object.entries($))if(Object.prototype.hasOwnProperty.call(v,g))for(const f of l)u.push(f)}const S=e.dependencies;if(S){for(const[g,l]of Object.entries(S))if(Object.prototype.hasOwnProperty.call(v,g))if(Array.isArray(l))for(const f of l)u.push(f);else typeof l=="object"&&l&&s.push(l)}const w=e.dependentSchemas;if(w)for(const[g,l]of Object.entries(w))Object.prototype.hasOwnProperty.call(v,g)&&s.push(l)}const d=[e,...s],{mergedSchema:y,conflicts:h}=Ft(d,n);if(u.length>0){const v=new Set([...y.required??[],...u]);y.required=[...v]}return a.push(...h),{effective:y,conflicts:a}}function hr(e,t,r){if(!r||!e.if||typeof e.if!="object")return null;try{if(zt(r,e.if)(t)){const a=e.then;if(a&&typeof a=="object")return a}else{const a=e.else;if(a&&typeof a=="object")return a}}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(d=>{try{new RegExp(d).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(d=>n.add(d))});const s=hr(e,t,r);s&&Ae(s,t,r).forEach(u=>n.add(u));const a=e.dependentSchemas;return a&&Object.keys(a).forEach(o=>{if(o in t){const u=a[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}class Lt{schema;definition;horizontal;path;ajv;isPropertyRequired;suppressLabel;schemaConflicts;notViolations;constructor(t){const{schema:r,definition:n,horizontal:s,path:a,ajv:o,isPropertyRequired:u,suppressLabel:d,schemaConflicts:y,notViolations:h}=t;this.schema=r,this.definition=n,this.horizontal=s,this.path=a,this.ajv=o,this.isPropertyRequired=u??!1,this.suppressLabel=d??!1,this.schemaConflicts=y??[],this.notViolations=h??[]}with=t=>new Lt({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(s=>n.includes(s))}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 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 s=[];if(e.isDeprecated&&s.push("deprecated"),e.isReadOnly&&!e.shouldIgnoreReadOnly&&s.push("read-only"),e.isWriteOnly&&!e.shouldShowWriteOnly&&s.push("write-only"),s.length>0){const a=`(${s.join(", ")})`;n=n?`${n} ${a}`:a}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 Es(e){return e==null?1:Math.round(e)}function mr(e){return e.isWriteOnly&&!e.shouldShowWriteOnly}function pr(e){return e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated}function Ps(e){const{options:t,selected:r,onChange:n,mode:s="auto",size:a="sm",keyFor:o=h=>String(h),parseKey:u=h=>h}=e,d=t.length;if((s==="auto"?d<=3?"segmented":"select":s)==="segmented"){const h=Object.fromEntries(t.map(v=>[o(v.value),v.label]));return J.SegmentedInput({options:h,value:O.Value.map(r,v=>o(v)),onChange:v=>n(u(v)),size:a})}return J.NativeSelect({options:t.map(h=>({type:"value",value:h.value,label:h.label})),value:r,onChange:n})}function Os({ctx:e,showSelector:t,selector:r,inner:n}){return e.isRoot?t?D.Stack(O.attr.class("bc-stack--gap-2"),r,n):n:D.InputWrapper({...we({ctx:e}),content:t?D.Stack(O.attr.class("bc-stack--gap-2 bc-stack--align-start"),r,n):n})}function oi(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 ui(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 ci(e){switch(e){case"null":return null;case"array":return[];case"object":return{};default:return}}function li(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 fi(e){if(typeof e=="boolean")return ar;const t=e["x:ui"];return t&&Array.isArray(t.textAreaTriggers)?[...ar,...t.textAreaTriggers]:ar}function js(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 yr(e,t){if(typeof e=="boolean")return;const r=js(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(a=>a==="number"||a==="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 a=t.toLowerCase();if(a.includes("password")||a.includes("secret"))return{widget:"password",source:"heuristics"};if(a.includes("email"))return{widget:"email",source:"heuristics"};if(a.includes("url")||a.includes("link"))return{widget:"url",source:"heuristics"};if(a.includes("color"))return{widget:"color",source:"heuristics"};if(fi(e).some(u=>a.includes(u.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}function di(e){const{definition:t}=e;if(typeof t=="boolean")return;const r={pattern:t.pattern,minLength:t.minLength,maxLength:t.maxLength},n=yr(t,e.name),s=n?.widget;if(s!=null)switch(s){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 hi=e=>{const{value:t,onBlur:r,onChange:n,onInput:s,after:a,disabled:o,...u}=e,d=J.NullableResetAfter(t,o,n);return J.Base64Input({...u,value:O.Value.map(t,y=>y??void 0),onChange:n!=null?y=>n(y??null):void 0,onInput:s!=null?y=>s(y??null):void 0,onBlur:r,after:a!=null?O.Fragment(d,a):d})};function Kn({ctx:e,options:t,controller:r}){const n=di(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:s=>s==null?null:new Date(s),fromInput:s=>s?.toISOString().split("T")[0]??null});case"date-time":return D.MappedControl(J.NullableDateTimeInput,{...t,controller:J.transformNullToUndefined(r),toInput:s=>s==null?null:new Date(s),fromInput:s=>s?.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:s}=e,a=typeof s=="object"?s["x:ui"]:void 0;return n.mediaType&&(n.mediaType.startsWith("image/")||n.mediaType.startsWith("video/")||n.mediaType.startsWith("audio/")||n.mediaType==="application/pdf"||a?.preferFileUpload===!0)?D.Control(hi,{...t,controller:J.transformNullToUndefined(r),mode:"compact",accept:n.mediaType||"*/*",maxFileSize:(typeof a?.maxBytes=="number"?a.maxBytes:void 0)||(typeof a?.maxFileSize=="number"?a.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:s})=>D.MappedControl(J.NullableDurationInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:s.from(a),fromInput:a=>a?.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 Ct({ctx:e,controller:t}){if(mr(e))return O.Fragment();const r={...we({ctx:e}),placeholder:De(e.definition,String),disabled:pr(e)};if(e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle))return Kn({ctx:e,options:r,controller:t});const s=yr(e.definition,e.name)?.widget;if(s!=null&&["url","uri","uri-reference","hostname","ipv4","ipv6","regex","duration","binary","markdown","time","color"].includes(s))return Kn({ctx:e,options:r,controller:t});switch(s){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 mi(e){const t=yr(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(mr(e))return O.Fragment();const r=e.definition,n=mi(e),s={...we({ctx:e}),placeholder:De(e.definition,String),min:r.minimum,max:r.maximum,step:r.multipleOf,disabled:pr(e)},a=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 a?D.Control(J.NullableRatingInput,{...s,max:o,controller:t}):D.Control(J.RatingInput,{...s,max:o,controller:t});case"slider":return a?D.Control(J.NullableSliderInput,{...s,controller:t}):D.Control(J.SliderInput,{...s,controller:t});case"currency":const u=typeof n.options?.currency=="string"?n.options.currency:"USD";return a?D.Control(J.MaskInput,{...s,mask:Jn(u),controller:t}):D.Control(J.MaskInput,{...s,mask:Jn(u),controller:t});case"percent":return a?D.Control(J.MaskInput,{...s,mask:Wn(),controller:t}):D.Control(J.MaskInput,{...s,mask:Wn(),controller:t});default:return a?D.Control(J.NullableNumberInput,{...s,controller:t}):D.Control(J.NumberInput,{...s,controller:t})}}function Jn(e){return`${pi(e)} 000,000.00`}function Wn(){return"000.00%"}function pi(e){return{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$"}[e.toUpperCase()]||e}function It({ctx:e,controller:t}){return ze({ctx:e.with({definition:{...e.definition,multipleOf:Es(e.definition.multipleOf)}}),controller:t})}function At({ctx:e,controller:t}){if(mr(e))return O.Fragment();const r={...we({ctx:e}),disabled:pr(e)},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,s=>t.change(s))})}function gr({controller:e}){return O.WithElement(()=>{e.change(null)})}let ir=new WeakMap,Bn=new WeakMap;function ks(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 s=new Set;for(;Ns(n);){const a=n.$ref;if(!a.startsWith("#")){console.warn(`resolveRef: external $ref not supported here: ${a}`);break}if(s.has(a)){console.warn(`resolveRef: cycle detected while resolving in-document $ref chain: ${[...s,a].join(" -> ")}`);break}s.add(a);const o=Rs(t,a);if(!Ut(o)){console.warn(`resolveRef: could not resolve JSON Pointer ${a}`);break}const{$ref:u,...d}=n;n={...o,...d}}if(r!=null){let a=ir.get(r);a==null&&(a=new WeakMap,ir.set(r,a)),a.set(e,n)}return n}function Ns(e){return Ut(e)&&typeof e.$ref=="string"}function Ut(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function Rs(e,t){if(!t.startsWith("#"))return;if(t==="#")return e;if(typeof e!="object"||e==null)return;const r=e;let n=Bn.get(r);n==null&&(n=new Map,Bn.set(r,n));const s=n.get(t);if(s!==void 0)return s;const a=dr(t);let o=e;for(const u of a){if(!Ut(o)&&!Array.isArray(o)){n.set(t,void 0);return}o=o[u]}return n.set(t,o),o}function Cs(e,t,r){let n=e;const s=new Set,a=(o,u)=>{const{$ref:d,...y}=u;return{...o,...y}};for(;Ns(n);){const o=n.$ref;if(s.has(o)){console.warn(`resolveAnyRef: cycle detected while resolving $ref chain: ${[...s,o].join(" -> ")}`);break}if(s.add(o),o.startsWith("#")){const v=Rs(t,o);if(!Ut(v)){console.warn(`resolveAnyRef: could not resolve JSON Pointer ${o}`);break}n=a(v,n);continue}if(!r){console.warn(`resolveAnyRef: external $ref without AJV not resolved: ${o}`);break}const u=o.indexOf("#"),d=u>=0?o.slice(0,u):o;let y=r.getSchema(o)||r.getSchema(d);if(!y)try{y=r.compile({$ref:o})}catch{}const h=y?.schema;if(!h||typeof h!="object"){console.warn(`resolveAnyRef: AJV could not provide schema for ${o}`);break}n=a(h,n)}return n}function yi({conflicts:e}){return e.length===0?O.Empty:D.Notice({variant:"warning",tone:"prominent",title:"Schema Conflicts Detected",class:"bc-schema-conflicts-banner"},O.html.ul(O.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>O.html.li(O.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?O.html.code(O.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function gi({violations:e}){return e.length===0?O.Empty:D.Notice({variant:"danger",tone:"prominent",title:"Schema Violations Detected",class:"bc-not-violations-banner"},O.html.ul(O.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>O.html.li(O.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?O.html.code(O.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function vi({ctx:e,controller:t,content:r}){const n=O.Value.map(t.signal,o=>o!==void 0),s=e.widgetLabel??"Property",a=o=>{if(o){const u=e.default;if(u!==void 0)t.change(u);else{const d=e.definition;d.type==="string"?t.change(""):d.type==="number"||d.type==="integer"?t.change(0):d.type==="boolean"?t.change(!1):d.type==="array"?t.change([]):d.type==="object"?t.change({}):t.change(null)}}else t.change(void 0)};return D.Stack(O.html.div(O.attr.class("bc-presence-toggle"),D.InputWrapper({layout:"horizontal",label:`Include ${s}`,content:J.Switch({value:n,onChange:a,size:"xs"})})),O.When(n,()=>r))}function ne(e,t,r){const n=e.schemaConflicts.length>0,s=e.notViolations.length>0,a=e.shouldShowPresenceToggle&&r!=null;let o=t;return a&&r!=null&&(o=vi({ctx:e,controller:r,content:t})),!n&&!s?o:D.Stack(O.attr.class("bc-stack--gap-2"),s?gi({violations:e.notViolations}):null,n?yi({conflicts:e.schemaConflicts}):null,o)}function Is(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 bi(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:xn(r.trim())}}if(e.includes("=")){const[t,r]=e.split("=",2);return{field:t.trim(),operator:"equals",value:xn(r.trim())}}return{field:e.trim(),operator:"truthy"}}function xn(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 _i(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const s of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else n=n[s]}return n}function ur(e,t){const r=_i(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 As(e,t){const r=e.conditions.map(n=>"operator"in n&&["and","or","not"].includes(n.operator)?As(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 $i(e,t){try{if(typeof e=="string"){const r=bi(e);return ur(r,t)}return"operator"in e&&["and","or","not"].includes(e.operator)?As(e,t):ur(e,t)}catch(r){return console.warn("Error evaluating visibility condition:",r),!0}}function wi(e,t){return O.computedOf(t)(r=>$i(e,r))}const Hn={behavior:"hide",clearOnHide:!1};function Si({ctx:e,controller:t,children:r,options:n=Hn}){const s=Is(e.definition);if(!s)return r;const a={...Hn,...n},o=Ei(t),u=wi(s,o);switch(a.clearOnHide&&u.on(d=>{!d&&t.signal.value!==void 0&&t.change(void 0)}),a.behavior){case"unmount":return O.When(u,()=>r,()=>O.Fragment());case"hide":default:return O.When(u,()=>r,()=>O.Fragment(r))}}function Ei(e){return e.signal}function Ts({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 qs({ctx:e,controller:t}){const r=e.definition;return O.Fragment(O.WithElement(()=>{O.Value.get(t.signal)!==r.const&&t.change(r.const)}),J.Group(D.MutedLabel(e.widgetLabel,": "),D.Label(String(r.const))))}function Pi(e,t,r){const{controller:n,effCtx:s,patternProps:a,apSchema:o,canRemove:u,lockKeyAfterSet:d,validatePropertyName:y}=r,h=n.field(e),v=O.prop(e),$=O.prop(null);let S=o;if(t){const f=Object.keys(a).find(i=>{try{return new RegExp(i).test(e)}catch{return!1}});if(f){const i=a[f];i!==!1&&typeof i=="object"&&(S=i)}}const w=f=>{const i=(f??"").trim();if(!i||i===e||Object.prototype.hasOwnProperty.call(O.Value.get(n.signal)??{},i))return;const c=y(i);if(!c.ok){$.set(c.message);return}$.set(null);const p={...O.Value.get(n.signal)??{}},b=p[e];delete p[e],p[i]=b,n.change(p)},g=O.Use(Ne.BeatUII18n,f=>D.CloseButton({size:"xs",label:f.$.removeItem,disabled:!u(Object.keys(O.Value.get(n.signal)??{}).length),onClick:()=>{const i=Object.keys(O.Value.get(n.signal)??{}).length;if(!u(i))return;const c={...O.Value.get(n.signal)??{}};delete c[e],n.change(c)}})),l=O.Value.map(h.signal,f=>d&&f!=null);return O.html.div(O.attr.class("bc-object-helpers__row"),O.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:v,onChange:w,disabled:O.computedOf(n.disabled,l)((f,i)=>f||i)}),error:O.Ensure($,f=>O.html.div(O.attr.class("bc-object-helpers__error"),f)),description:Object.keys(a).length>0?O.html.div(O.attr.class("bc-object-helpers__description"),"Allowed patterns: ",Object.keys(a).join(", ")):null}),O.html.div(Pe({ctx:s.with({definition:S,suppressLabel:!0}).append(e),controller:h})),O.html.div(O.attr.class("bc-object-helpers__remove"),g))}function Oi(e,t,r){const{controller:n,effCtx:s,patternProps:a,apSchema:o,unevaluatedProps:u,canRemove:d,lockKeyAfterSet:y,validatePropertyName:h}=r,v=n.field(e),$=O.prop(e),S=O.prop(null);let w;if(u&&typeof u=="object")w=u;else if(t){const i=Object.keys(a).find(c=>{try{return new RegExp(c).test(e)}catch{return!1}});if(i){const c=a[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(O.Value.get(n.signal)??{},c))return;const p=h(c);if(!p.ok){S.set(p.message);return}S.set(null);const b={...O.Value.get(n.signal)??{}},_=b[e];delete b[e],b[c]=_,n.change(b)},l=O.Use(Ne.BeatUII18n,i=>D.CloseButton({size:"xs",label:i.$.removeItem,disabled:!d(Object.keys(O.Value.get(n.signal)??{}).length),onClick:()=>{const c=Object.keys(O.Value.get(n.signal)??{}).length;if(!d(c))return;const p={...O.Value.get(n.signal)??{}};delete p[e],n.change(p)}})),f=O.Value.map(v.signal,i=>y&&i!=null);return O.html.div(O.attr.class("bc-object-helpers__row"),O.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:$,onChange:g,disabled:O.computedOf(n.disabled,f)((i,c)=>i||c)}),error:O.Ensure(S,i=>O.html.div(O.attr.class("bc-object-helpers__error"),i)),description:O.html.div(O.attr.class("bc-object-helpers__description"),u===!1?"Unevaluated property (not allowed by schema)":"Unevaluated property",Object.keys(a).length>0?O.html.span(" • Allowed patterns: ",Object.keys(a).join(", ")):null)}),O.html.div(Pe({ctx:s.with({definition:w,suppressLabel:!0}).append(e),controller:v})),O.html.div(O.attr.class("bc-object-helpers__remove"),l))}function ji(e){if(typeof e.definition=="boolean")return;const t=js(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 ki({title:e,children:t}){return O.html.fieldset(O.attr.class("bc-fieldset"),e?O.html.legend(O.attr.class("bc-fieldset__legend"),e):null,O.html.div(O.attr.class("bc-fieldset__content"),D.Stack(O.attr.class("bc-stack--gap-1"),...t)))}function Ni({title:e,children:t}){return J.Card({variant:"outlined",size:"md"},D.Stack(O.attr.class("bc-stack--gap-1"),e?D.Label(e):null,...t))}function Ri({cols:e=1,children:t}){const r=typeof e=="number"?`bc-schema-grid bc-schema-grid--cols-${e}`:O.computedOf(e)(n=>{if(typeof n=="number")return`bc-schema-grid bc-schema-grid--cols-${n}`;if(n&&typeof n=="object"){const s=["bc-schema-grid"];return n.sm&&s.push(`bc-schema-grid--cols-sm-${n.sm}`),n.md&&s.push(`bc-schema-grid--cols-md-${n.md}`),n.lg&&s.push(`bc-schema-grid--cols-lg-${n.lg}`),n.xl&&s.push(`bc-schema-grid--cols-xl-${n.xl}`),n["2xl"]&&s.push(`bc-schema-grid--cols-2xl-${n["2xl"]}`),s.join(" ")}return"bc-schema-grid bc-schema-grid--cols-1"});return O.html.div(O.attr.class(r),O.attr.class("bc-schema-grid--gap-4"),...t)}function Ci({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ii({title:"Properties",children:t});const r=O.prop(Object.keys(e)[0]),n=Object.entries(e);return O.html.div(O.attr.class("bc-tabs"),O.html.div(O.attr.class("bc-tabs__header"),O.attr.role("tablist"),...n.map(([s],a)=>O.html.button(O.attr.type("button"),O.attr.class("bc-tabs__tab"),O.attr.class(O.computedOf(r)(o=>o===s?"bc-tabs__tab--active":"")),O.attr.role("tab"),O.attr.tabindex(r.map(o=>o===s?0:-1)),O.on.click(()=>r.set(s)),O.on.keydown(o=>{switch(o.key){case"ArrowLeft":o.preventDefault();const u=a>0?a-1:n.length-1;r.set(n[u][0]);break;case"ArrowRight":o.preventDefault();const d=a<n.length-1?a+1:0;r.set(n[d][0]);break;case"Home":o.preventDefault(),r.set(n[0][0]);break;case"End":o.preventDefault(),r.set(n[n.length-1][0]);break}}),s))),O.html.div(O.attr.class("bc-tabs__content"),...n.map(([s,a])=>O.html.div(O.attr.class("bc-tabs__panel"),O.attr.class(O.computedOf(r)(o=>o===s?"bc-tabs__panel--active":"bc-tabs__panel--hidden")),O.attr.role("tabpanel"),D.Stack(O.attr.class("bc-stack--gap-1"),...t.filter((o,u)=>a.length===0||u<a.length))))))}function Ii({title:e,children:t}){return O.html.div(O.attr.class("bc-tabs"),O.html.div(O.attr.class("bc-tabs__header"),O.html.div(O.attr.class("bc-tabs__tab bc-tabs__tab--active"),e)),O.html.div(O.attr.class("bc-tabs__content"),O.html.div(O.attr.class("bc-tabs__panel bc-tabs__panel--active"),D.Stack(O.attr.class("bc-stack--gap-1"),...t))))}function Ai({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ti({title:"Properties",children:t});const r=Object.entries(e),n=O.prop(new Set([r[0]?.[0]].filter(Boolean)));return O.html.div(O.attr.class("bc-accordion"),...r.map(([s,a])=>{const o=O.computedOf(n)(u=>u.has(s));return O.html.div(O.attr.class("bc-accordion__item"),O.html.button(O.attr.type("button"),O.attr.class("bc-accordion__header"),O.aria.expanded(o),O.on.click(()=>{const u=n.value,d=new Set(u);d.has(s)?d.delete(s):d.add(s),n.set(d)}),O.on.keydown(u=>{if(u.key==="Enter"||u.key===" "){u.preventDefault();const d=n.value,y=new Set(d);y.has(s)?y.delete(s):y.add(s),n.set(y)}}),O.html.span(s),Ne.Icon({icon:O.computedOf(o)(u=>u?"chevron-up":"chevron-down"),size:"sm"})),O.html.div(O.attr.class("bc-accordion__content"),O.attr.class(O.computedOf(o)(u=>u?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(O.attr.class("bc-stack--gap-1"),...t.filter((u,d)=>a.length===0||d<a.length))))}))}function Ti({title:e,children:t}){const r=O.prop(!0);return O.html.div(O.attr.class("bc-accordion"),O.html.div(O.attr.class("bc-accordion__item"),O.html.button(O.attr.type("button"),O.attr.class("bc-accordion__header"),O.on.click(()=>r.set(!r.value)),O.html.span(e),Ne.Icon({icon:O.computedOf(r)(n=>n?"chevron-up":"chevron-down"),size:"sm"})),O.html.div(O.attr.class("bc-accordion__content"),O.attr.class(O.computedOf(r)(n=>n?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(O.attr.class("bc-stack--gap-1"),...t))))}function Gn(e,t,r){const n=new Map;r.forEach((o,u)=>{e[u]&&n.set(o,e[u])});let s=e;if(t.order&&t.order.length>0){const o=new Map,u=[];t.order.forEach(d=>{const y=n.get(d);y&&o.set(d,y)}),r.forEach((d,y)=>{!t.order.includes(d)&&e[y]&&u.push(e[y])}),s=[...Array.from(o.values()),...u]}let a;if(t.groups&&Object.keys(t.groups).length>0){a={};const o=new Set;Object.entries(t.groups).forEach(([d,y])=>{a[d]=[],y.forEach(h=>{const v=n.get(h);v&&(a[d].push(v),o.add(v))})});const u=s.filter(d=>!o.has(d));u.length>0&&(a.Other=u)}return{orderedChildren:s,groupedChildren:a}}function qi(e,t,r,n=[]){if(!e||!e.format){if(e?.order){const{orderedChildren:u}=Gn(r,e,n);return D.Stack(O.attr.class("bc-stack--gap-1"),...u)}return D.Stack(O.attr.class("bc-stack--gap-1"),...r)}const s=t.widgetLabel||t.name,{orderedChildren:a,groupedChildren:o}=Gn(r,e,n);switch(e.format){case"fieldset":return ki({title:s,children:a});case"group":return Ni({title:s,children:a});case"grid":return Ri({cols:e.cols,children:a});case"tabs":return Ci({groups:o||e.groups,children:o?Object.values(o).flat():a});case"accordion":return Ai({groups:o||e.groups,children:o?Object.values(o).flat():a});default:return D.Stack(O.attr.class("bc-stack--gap-1"),...a)}}function vr({ctx:e,controller:t}){return O.MapSignal(t.signal,r=>{const n=e.definition,{effective:s,conflicts:a}=Ss(n,r,e.ajv,e.path),o=e.with({definition:s,schemaConflicts:[...e.schemaConflicts,...a]}),u=s.properties??{},d=new Set(Object.keys(u)),y=Object.keys(r??{}),h=y.filter(m=>!d.has(m)),v=s.unevaluatedProperties,$=Ae(s,r??{},e.ajv),S=h.filter(m=>!$.has(m)),w=h.filter(m=>$.has(m)),g=s.additionalProperties??!0,l=g!==!1,f=g===!0||g===void 0?{}:g,i=s.minProperties??0,c=s.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 _=l&&p&&y.length<c,P=m=>m>i,I=s.patternProperties??{},V=Object.keys(I).filter(Boolean).map(m=>{try{return new RegExp(m)}catch{return null}}).filter(m=>m!=null),F=s.propertyNames,A=m=>{const E=(m??"").trim();if(E==="")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(E))return{ok:!1,message:R.errors?.[0]?.message??"Invalid property name"}}catch{}if(!l&&!d.has(E)){if(V.length===0)return{ok:!1,message:"Only declared properties are allowed"};if(!V.some(K=>K.test(E)))return{ok:!1,message:`Key must match one of: ${Object.keys(I).join(", ")}`}}return{ok:!0}},z=s["x:ui"],U=!!(z&&typeof z=="object"&&z.lockKeyAfterSet),B=m=>{const E=De(m,K=>K);if(E!==void 0)return E;const R=m.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=(m,E)=>{const R=m,K=Z=>E.has(Z)?!1:A(Z).ok;if(K(R))return R;let W=1;for(;E.has(R+W)||!K(R+W);)W++;return R+W},ae=O.Use(Ne.BeatUII18n,m=>Ne.Button({variant:"outline",disabled:!_,onClick:()=>{if(!_)return;const E=new Set(Object.keys(O.Value.get(t.signal)??{})),R=ee("property",E);if(!A(R).ok)return;let W=f;v&&typeof v=="object"&&(W=v);const Z=B(W),Y={...O.Value.get(t.signal)??{},[R]:Z};t.change(Y)}},O.attr.title(b),m.$.addLabel)),se=ji(o),te=Ks.f(u).filter(([,m])=>m!==!1),M=[...te.map(([m])=>m),...w,...S],k=[...te.map(([m,E])=>{const R=m,K=t.field(R);return Pe({ctx:o.with({definition:E,isPropertyRequired:Array.isArray(s.required)?s.required.includes(R):o.hasRequiredProperty(R),suppressLabel:!1}).append(R),controller:K})}),...w.map(m=>{const E=V.some(R=>R.test(m));return Pi(m,E,{controller:t,effCtx:o,patternProps:I,apSchema:f,canRemove:P,lockKeyAfterSet:U,validatePropertyName:A})}),...S.map(m=>{const E=V.some(R=>R.test(m));return Oi(m,E,{controller:t,effCtx:o,patternProps:I,apSchema:f,unevaluatedProps:v,canRemove:P,lockKeyAfterSet:U,validatePropertyName:A})}),l?ae:null].filter(Boolean),T=qi(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 Vi(e,t,r){const s=e.definition.oneOf;if(!Array.isArray(s)||s.length===0)return{matchingBranch:-1,validBranches:[],isAmbiguous:!1,hasNoMatch:!0};const a=s.map(h=>{if(typeof h=="object"&&h!=null&&"$ref"in h){const v=h.$ref;if(typeof v=="string"&&v.startsWith("#"))return ks(h,e.schema)}return h}),o=[];for(let h=0;h<a.length;h++){const v=a[h];if(typeof v=="boolean"){v===!0&&o.push(h);continue}if(r)try{zt(r,v)(t)&&o.push(h)}catch($){console.warn(`Failed to compile oneOf branch ${h}:`,$),Xn(v,t)&&o.push(h)}else Xn(v,t)&&o.push(h)}const u=o.length>1,d=o.length===0;return{matchingBranch:o.length===1?o[0]:-1,validBranches:o,isAmbiguous:u,hasNoMatch:d}}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=Mi(t);if(n==="unknown"||!r.includes(n))return!1}if(e.properties&&typeof t=="object"&&t!=null){const r=t;for(const[n,s]of Object.entries(e.properties))if(typeof s=="object"&&s!=null&&"const"in s&&r[n]!==s.const)return!1}return!0}function Mi(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 Di(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,s]of Object.entries(e.properties))if(typeof s=="object"&&s!=null&&"const"in s){const a=s.const;if(typeof a=="string")return`${n}: ${a}`}}return"const"in e&&typeof e.const=="string"?e.const:e.type?(Array.isArray(e.type)?e.type:[e.type]).join(" | "):r}function Yn(e,t,r){const n=Vi(e,t,r);return n.matchingBranch!==-1?n.matchingBranch:-1}function zi(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 Fi(e,t,r){if(!t.discriminator||!r||typeof r!="object")return null;const{discriminator:n,type:s}=t;if(s==="openapi"){const a=n,o=r[a.propertyName];if(o==null)return null;if(a.mapping&&a.mapping[o]){const u=a.mapping[o];return Li(e,u)}return Zn(e,a.propertyName,o)}if(s==="beatui"){const a=n,o=r[a.key];if(o==null)return null;if(a.mapping&&a.mapping[o]!=null){const u=a.mapping[o];return u>=0&&u<e.length?u:null}return Zn(e,a.key,o)}return null}function Li(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 Zn(e,t,r){for(let n=0;n<e.length;n++){const s=e[n];if(typeof s!="object")continue;const a=s.properties;if(a&&a[t]){const o=a[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(s.const===r)return n}return null}function Vs({ctx:e,controller:t}){const r=e.definition.anyOf;return Ds({ctx:e,controller:t,kind:"anyOf",variants:r})}function Ms({ctx:e,controller:t}){const r=e.definition.oneOf;return Ds({ctx:e,controller:t,kind:"oneOf",variants:r})}function Ui({ctx:e,controller:t}){const n=e.definition.allOf.filter(u=>typeof u=="object").map(u=>Cs(u,e.schema,e.ajv)),{mergedSchema:s,conflicts:a}=Ft(n,e.path),o=e.with({definition:s,schemaConflicts:[...e.schemaConflicts,...a]});return Pe({ctx:o,controller:t})}function Ds({ctx:e,controller:t,kind:r,variants:n}){const s=n.map((g,l)=>Di(g,l,`${r} ${l+1}`)),a=typeof e.definition=="boolean"?{discriminator:null,type:null}:zi(e.definition),o=O.computedOf(t.signal,e.ajv)((g,l)=>{if(r==="oneOf"){if(a.discriminator){const f=Fi(n,a,g);if(f!==null)return f}return Yn(e,g,l)}return Yn(e,g,l)}),u=O.Value.get(o),d=O.prop(u>=0?u:0);t.onDispose(d.dispose);let y=!1;const h=o.on(g=>{!y&&g>=0&&d.set(g)});t.onDispose(h);const v=n.length,$=g=>{y=!0,d.set(g)},S=v>1?Ps({options:n.map((g,l)=>({value:l,label:s[l]})),selected:d,onChange:$}):"",w=O.MapSignal(d,g=>Pe({ctx:e.with({definition:n[O.Value.get(g)],suppressLabel:!e.isRoot}),controller:t}));return Os({ctx:e,showSelector:v>1,selector:S,inner:w})}function Pe({ctx:e,controller:t}){const r=typeof e.definition=="boolean"?{}:e.definition;let n=r?.$ref?ks(r,e.schema):r,s=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($=>Cs($,e.schema,e.ajv)),{mergedSchema:d,conflicts:y}=Ft(u,e.path),{allOf:h,...v}=n;n={...v,...d},s=e.with({definition:n,schemaConflicts:[...e.schemaConflicts,...y]})}}let a=[...s.notViolations];if(n?.not!=null&&typeof n.not=="object"){const o=O.Value.get(t.signal),u=ws(n.not,o,s.ajv,s.path);u&&(a=[...a,u],s=s.with({notViolations:a}))}if(n==null)return le(s,t,ne(s,Fe({ctx:s,controller:t}),t));if(n.enum!=null)return le(s,t,ne(s,Ts({ctx:s,controller:t}),t));if(n.const!=null)return le(s,t,ne(s,qs({ctx:s,controller:t}),t));if(n.anyOf!=null)return le(s,t,ne(s,Vs({ctx:s,controller:t}),t));if(n.oneOf!=null)return le(s,t,ne(s,Ms({ctx:s,controller:t}),t));if(n?.type==null)return ne(s,Fe({ctx:s,controller:t}),t);if(Array.isArray(n.type)){const u=n.type.filter(d=>d!=="null");if(u.length===1&&["string","number","integer","boolean"].includes(u[0]))switch(u[0]){case"number":return ne(s,ze({ctx:s,controller:t}),t);case"integer":return ne(s,It({ctx:s,controller:t}),t);case"string":return ne(s,Ct({ctx:s,controller:t}),t);case"boolean":return ne(s,At({ctx:s,controller:t}),t)}return le(s,t,ne(s,_r({ctx:s,controller:t}),t))}switch(n.type){case"number":return le(s,t,ne(s,ze({ctx:s,controller:t}),t));case"integer":return le(s,t,ne(s,It({ctx:s,controller:t}),t));case"string":return le(s,t,ne(s,Ct({ctx:s,controller:t}),t));case"boolean":return le(s,t,ne(s,At({ctx:s,controller:t}),t));case"array":return le(s,t,ne(s,br({ctx:s,controller:t instanceof D.ArrayController?t:t.array()}),t));case"object":{const o=vr({ctx:s,controller:t instanceof D.ObjectController?t:t.object()});return s.isRoot?le(s,t,ne(s,o,t)):le(s,t,ne(s,O.html.div(O.attr.class("bc-json-schema-object"),o),t))}case"null":return le(s,t,ne(s,gr({controller:t}),t));default:return console.warn("Unknown type",n.type),le(s,t,ne(s,O.html.div(O.attr.class("bc-json-schema-unknown"),"Unknown"),t))}}function zs({schema:e,controller:t,ajv:r}){const n=new Lt({schema:e,definition:e,horizontal:!1,isPropertyRequired:!1,path:[],ajv:r});return e===!0?Fe({ctx:n,controller:t}):e===!1?O.Fragment():Pe({ctx:n,controller:t})}function le(e,t,r){return Is(e.definition)?Si({ctx:e,controller:t,children:r,options:{behavior:"hide",clearOnHide:!1}}):r}function Ki(e){return e.prefixItems!=null?{isTuple:!0,prefixItems:e.prefixItems,additionalItemsSchema:Array.isArray(e.items)?!0:e.items??!0,tupleLabels:Qn(e)}:Array.isArray(e.items)?{isTuple:!0,prefixItems:e.items,additionalItemsSchema:e.additionalItems??!0,tupleLabels:Qn(e)}:{isTuple:!1,prefixItems:[],additionalItemsSchema:e.items??!0}}function Qn(e){if(typeof e=="boolean")return;const t=e["x:ui"];return Array.isArray(t?.tupleLabels)?t.tupleLabels:void 0}function br({ctx:e,controller:t}){const r=e.definition,n=Ki(r),s=O.computedOf(t.signal)(h=>{const v=h?.length??0;return!(r.maxItems!=null&&v>=r.maxItems||n.isTuple&&v>=n.prefixItems.length&&n.additionalItemsSchema===!1)}),a=O.computedOf(t.signal)(h=>{const v=h?.length??0;return r.minItems==null||v>r.minItems}),o=O.computedOf(t.signal)(h=>{if(!r.uniqueItems||!h)return new Set;const v=new Map,$=new Set;for(let S=0;S<h.length;S++){const w=JSON.stringify(h[S]);v.has(w)?($.add(v.get(w)),$.add(S)):v.set(w,S)}return $}),u=O.computedOf(t.signal)(h=>{if(!r.contains||!h)return{matchingIndices:new Set,count:0,isValid:!0};const v=new Set;let $=0;if(e.ajv)try{const l=e.ajv.compile(r.contains);for(let f=0;f<h.length;f++)l(h[f])&&(v.add(f),$++)}catch{}else{const l=r.contains,f=i=>{if(typeof l=="boolean")return l;if(typeof l!="object"||l==null)return!1;const c=l,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<h.length;i++)f(h[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}}),d=r.contains?u.map(h=>{const v=typeof r.contains=="object"&&r.contains.title?r.contains.title:"required pattern";if(!h.isValid){if(h.count<(h.minContains??0))return`Must contain at least ${h.minContains??0} item(s) matching ${v} (currently ${h.count})`;if(h.maxContains!=null&&h.count>h.maxContains)return`Must contain at most ${h.maxContains} item(s) matching ${v} (currently ${h.count})`}return`Contains ${h.count} item(s) matching ${v}`}):null,y=J.ListControl({...we({ctx:e}),createItem:()=>{const h=t.signal.value?.length??0;if(n.isTuple&&h<n.prefixItems.length){const v=n.prefixItems[h];return De(v,()=>{})}else return De(n.additionalItemsSchema,()=>{})},controller:t,showAdd:!0,addDisabled:O.computedOf(s)(h=>!h),showRemove:!0,removeDisabled:O.computedOf(a)(h=>!h),element:h=>{const v=h.item,$=h.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=Pe({ctx:e.with({definition:S}).append($),controller:v}),l=o.map(p=>p.has($)),f=u.map(p=>p.matchingIndices.has($));let i=g;w&&n.isTuple&&(i=D.Stack(O.attr.class("bc-stack--gap-1"),D.Label(O.attr.class("bc-array-control__item-label"),w),i));const c=[];return r.uniqueItems&&c.push(O.When(l,()=>D.Label(O.attr.class("bc-array-control__indicator bc-array-control__indicator--error"),"⚠️ Duplicate value"))),r.contains&&c.push(O.When(f,()=>D.Label(O.attr.class("bc-array-control__indicator bc-array-control__indicator--success"),"✓ Matches required pattern"))),c.length>0?D.Stack(O.attr.class("bc-stack--gap-1"),i,...c):i}});return r.contains&&d?D.Stack(O.attr.class("bc-stack--gap-2"),y,O.MapSignal(O.computedOf(u,d)((h,v)=>({info:h,summary:v})),({info:h,summary:v})=>D.Label(O.attr.class(h.isValid?"bc-array-control__summary bc-array-control__summary--success":"bc-array-control__summary bc-array-control__summary--error"),v))):y}function Ji(e){return e.map(t=>({key:t,label:J._t(t),detect:r=>oi(r,[t])===t,convert:r=>ui(r,t),defaultValue:()=>ci(t)}))}function _r({ctx:e,controller:t}){const r=e.definition;let n=r.type??[];const s=li(r),a=n.includes("null"),o=n.filter(S=>S!=="null"&&(S==="string"||S==="number"||S==="integer"||S==="boolean")),u=a&&o.length===n.length-1;u&&(n=o);const d=Ji(n),y=new J.UnionController(t.path,t.change,t.signal,t.status,{disabled:t.disabled},d);t.onDispose(()=>y.dispose());const h=S=>Ps({options:n.map(w=>({value:w,label:J._t(w)})),selected:y.activeBranch,onChange:S,mode:s.selector??"auto"}),v=S=>{y.switchToBranch(S,s.confirmBranchChange)},$=O.MapSignal(y.activeBranch,S=>{const w=O.Value.get(S),g=y.getBranchController(w);if(u&&(w==="number"||w==="integer")){const f=r;return D.Control(J.NullableNumberInput,{...we({ctx:e.with({suppressLabel:!e.isRoot})}),controller:g,min:f.minimum,max:f.maximum,step:w==="integer"?Es(f.multipleOf):f.multipleOf})}const l=e.with({definition:{...r,type:w},suppressLabel:!e.isRoot});switch(w){case"string":return Ct({ctx:l,controller:g});case"number":return ze({ctx:l,controller:g});case"integer":return It({ctx:l,controller:g});case"boolean":return At({ctx:l,controller:g});case"null":return gr({controller:g});case"array":{const f=g.array();return br({ctx:l,controller:f})}case"object":{const f=g.object();return vr({ctx:l,controller:f})}default:return D.Control(J.NullableNumberInput,{...we({ctx:l}),controller:g})}});return Os({ctx:e,showSelector:n.length>1,selector:h(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}):_r({ctx:e.with({definition:{...e.definition,type:["string","number","object","array","boolean","null"]}}),controller:t})}function Wi(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 Bi(e,t,r=!1){const n=[],s=[...t].sort((a,o)=>(o.priority||0)-(a.priority||0));for(const a of s)if(!(a.onSubmitOnly&&!r))try{const o={};for(const d of a.fields)o[d]=xi(e,d);const u=a.validate(o,e);if(!u.valid){const d=a.targets||a.fields;if(u.fieldErrors)for(const[y,h]of Object.entries(u.fieldErrors))n.push({instancePath:`/${y}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields,context:u.context},message:h});else{const y=u.message||a.message||"Cross-field validation failed";for(const h of d)n.push({instancePath:`/${h}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields,context:u.context},message:y})}}}catch(o){console.warn(`Error in cross-field validation rule ${a.id}:`,o);const u=a.targets?.[0]||a.fields[0];n.push({instancePath:`/${u}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields},message:"Cross-field validation error"})}return n.length>0?Dt(n):D.a.valid}function xi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const s of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else n=n[s]}return n}function Hi(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(s=>typeof s=="object"&&s!=null&&"watch"in s&&"condition"in s)),Array.isArray(t.crossField)&&(r.crossField=t.crossField.filter(s=>typeof s=="object"&&s!=null&&Array.isArray(s.fields)&&typeof s.validate=="function"));const n=Wi(e);return n.length>0&&(r.crossFieldRules=n),Array.isArray(t.async)&&(r.async=t.async.filter(s=>typeof s=="object"&&s!=null&&typeof s.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 s of r){if(n==null)return;if(typeof n=="object"&&!Array.isArray(n))n=n[s];else if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else return}return n}function Gi(e,t){try{if(typeof e.condition=="function"){const n=(Array.isArray(e.watch)?e.watch:[e.watch]).map(s=>cr(s,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 Xi(e,t,r,n){const s=[];if(n&&!n(e)&&n.errors&&s.push(...n.errors),r.when){for(const a of r.when)if(Gi(a,t)?a.then:a.else,a.validate)try{const u=a.validate(e,t);u&&s.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 a of r.crossField)try{const o={};for(const d of a.fields)o[d]=cr(`$.${d}`,t);const u=a.validate(o,t);if(u){const d=a.target||a.fields[0];s.push({instancePath:`/${d}`,schemaPath:"#/x:ui/crossField",keyword:"crossField",params:{fields:a.fields},message:a.message||u})}}catch(o){console.warn("Error in cross-field validation:",o)}if(r.crossFieldRules&&r.crossFieldRules.length>0){const a=Bi(t,r.crossFieldRules);if(a.type==="invalid"){const o=Yi(a);s.push(...o)}}return s.length>0?Dt(s):D.a.valid}function Yi(e){if(e.type==="valid")return[];const t=[];function r(n,s=""){if(n.message&&t.push({instancePath:s,schemaPath:"#/crossField",keyword:"crossField",params:{},message:n.message}),n.dependencies)for(const[a,o]of Object.entries(n.dependencies)){const u=s?`${s}/${a}`:`/${a}`;r(o,u)}}return r(e.error),t}function Zi(e,t){const r=new Set;if(e.when)for(const n of e.when)(Array.isArray(n.watch)?n.watch:[n.watch]).forEach(a=>r.add(a));if(e.crossField)for(const n of e.crossField)n.fields.forEach(s=>r.add(s));return{watchedPaths:Array.from(r),shouldRevalidate:n=>Array.from(r).some(s=>n.startsWith(s)||s.startsWith(n))}}function Qi(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 eo{timeouts=new Map;validationStates=new Map;abortControllers=new Map;getValidationState(t){return this.validationStates.has(t)||this.validationStates.set(t,O.prop({isValidating:!1,result:D.a.valid,lastValidatedValue:void 0,lastValidatedAt:0})),this.validationStates.get(t)}async validateField(t,r,n,s=!1){const a=`${t.field}_${t.id}`,o=this.getValidationState(a),u=this.timeouts.get(a);u!==void 0&&clearTimeout(u);const d=this.abortControllers.get(a);if(d&&d.abort(),!s&&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 h=new AbortController;this.abortControllers.set(a,h),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(h.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(h.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(a),this.timeouts.delete(a)}},s?0:t.debounce||300);this.timeouts.set(a,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 s=n.value;!s.isValidating&&s.result.type==="invalid"&&(t[r]=s.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 to(e){const t=globalThis.structuredClone;return typeof t=="function"?t(e):JSON.parse(JSON.stringify(e))}function ro(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}}function no({schema:e,initialValue:t,externalSchemas:r,refResolver:n,sanitizeAdditional:s,validationMode:a,validateDebounceMs:o},u){return O.Async($s(e,{externalSchemas:r,refResolver:n,sanitizeAdditional:s}),d=>{if(d.ok){const{ajv:y,validate:h}=d.value,v=Hi(e),$=Qi(e),S=$.length>0?new eo:null,w=a??"touchedOrSubmit",g=F=>{const A=h(F);let z;return A?z=D.a.valid:z=Dt(h.errors??[]),v?Xi(F,F,v,h):z},{controller:l,setStatus:f}=D.useController({initialValue:t,validationMode:w,validateDebounceMs:o,validate:w==="onSubmit"?void 0:g}),i=v?Zi(v):null,c=s!==!1;let p=!1;const b=c?l.signal.on(F=>{if(p)return;const A=to(F);h(A)&&!ro(A,F)&&(p=!0,l.change(A),p=!1)}):()=>{},_=i?l.signal.on((F,A)=>{A!=null&&JSON.stringify(F)!==JSON.stringify(A)&&setTimeout(()=>{const U=l.status.value;f(U)},10)}):()=>{},P=S&&$.length>0?l.signal.on(F=>{for(const A of $)S.validateField(A,F,F)}):()=>{},I=()=>{b(),_(),P(),S?.dispose(),l.dispose()},V=O.Fragment(O.OnDispose(I),zs({schema:e,controller:l,ajv:y}));return u({Form:V,controller:l,setStatus:f})}return O.html.div(O.attr.class("bc-json-schema-form__error"),d.error)})}var Fs=ys();const Ls=lr(Fs),so=Js({__proto__:null,default:Ls},[Fs]);function ao(e,t){const n=(t?.ajv??new Ls({allErrors:!0})).compile(e);return{"~standard":{version:1,vendor:"ajv",validate:s=>n(s)?{value:s}:{issues:io(n.errors??[])},types:void 0}}}function io(e){return e.map(t=>({message:oo(t),path:uo(t)}))}function oo(e){return e.message??`${e.keyword} validation failed`}function uo(e){const t=co(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 co(e){return e?e.split("/").slice(1).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~")).map(r=>lo(r)?Number(r):r):[]}function lo(e){return/^\d+$/.test(e)}exports.JSONSchemaAllOf=Ui;exports.JSONSchemaAny=Fe;exports.JSONSchemaAnyOf=Vs;exports.JSONSchemaArray=br;exports.JSONSchemaBoolean=At;exports.JSONSchemaConst=qs;exports.JSONSchemaControl=zs;exports.JSONSchemaEnum=Ts;exports.JSONSchemaForm=no;exports.JSONSchemaGenericControl=Pe;exports.JSONSchemaInteger=It;exports.JSONSchemaNull=gr;exports.JSONSchemaNumber=ze;exports.JSONSchemaObject=vr;exports.JSONSchemaOneOf=Ms;exports.JSONSchemaString=Ct;exports.JSONSchemaUnion=_r;exports.SchemaContext=Lt;exports.ajvErrorsToControllerValidation=Dt;exports.ajvErrorsToDependencies=bs;exports.buildMessage=vs;exports.buildPath=gs;exports.clearCaches=xa;exports.clearCachesForAjv=Ha;exports.compileWithCache=zt;exports.composeEffectiveObjectSchema=Ss;exports.createAJVStandardSchema=ao;exports.evaluateIfThenElseOverlay=hr;exports.evaluateNotViolation=ws;exports.getAjvForSchema=$s;exports.getCacheStats=Ga;exports.getDefaultExportFromCjs=lr;exports.getEvaluatedProperties=Ae;exports.jsonPointerToSegments=dr;exports.mergeAllOf=Ft;exports.requireApplicator=fs;exports.requireCodegen=H;exports.requireCompile=Mt;exports.requireCore=ns;exports.requireCore$1=as;exports.requireDependencies=cs;exports.requireDiscriminator=ps;exports.requireDraft7=ms;exports.requireFormat=ds;exports.requireMetadata=hs;exports.requireNames=Se;exports.requireRef=ss;exports.requireRef_error=Ue;exports.requireUtil=Q;exports.requireValidate=Le;exports.requireValidation=is;exports.requireValidation_error=Vt;
|
|
8
|
+
deps: ${h}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(d){const[y,h]=a(d);o(d,y),u(d,h)}};function a({schema:d}){const y={},h={};for(const v in d){if(v==="__proto__")continue;const $=Array.isArray(d[v])?y:h;$[v]=d[v]}return[y,h]}function o(d,y=d.schema){const{gen:h,data:v,it:$}=d;if(Object.keys(y).length===0)return;const S=h.let("missing");for(const w in y){const g=y[w];if(g.length===0)continue;const l=(0,n.propertyInData)(h,v,w,$.opts.ownProperties);d.setParams({property:w,depsCount:g.length,deps:g.join(", ")}),$.allErrors?h.if(l,()=>{for(const f of g)(0,n.checkReportMissingProp)(d,f)}):(h.if((0,t._)`${l} && (${(0,n.checkMissingProp)(d,g,S)})`),(0,n.reportMissingProp)(d,S),h.else())}}e.validatePropertyDeps=o;function u(d,y=d.schema){const{gen:h,data:v,keyword:$,it:S}=d,w=h.name("valid");for(const g in y)(0,r.alwaysValidSchema)(S,y[g])||(h.if((0,n.propertyInData)(h,v,g,S.opts.ownProperties),()=>{const l=d.subschema({keyword:$,schemaProp:g},w);d.mergeValidEvaluated(l,w)},()=>h.var(w,!0)),d.ok(w))}e.validateSchemaDeps=u,e.default=s}(sr)),sr}var pt={},$n;function Ea(){if($n)return pt;$n=1,Object.defineProperty(pt,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:s})=>(0,e._)`{propertyName: ${s.propertyName}}`},code(s){const{gen:a,schema:o,data:u,it:d}=s;if((0,t.alwaysValidSchema)(d,o))return;const y=a.name("valid");a.forIn("key",u,h=>{s.setParams({propertyName:h}),s.subschema({keyword:"propertyNames",data:h,dataTypes:["string"],propertyName:h,compositeRule:!0},y),a.if((0,e.not)(y),()=>{s.error(!0),d.allErrors||a.break()})}),s.ok(y)}};return pt.default=n,pt}var yt={},wn;function ls(){if(wn)return yt;wn=1,Object.defineProperty(yt,"__esModule",{value:!0});const e=ve(),t=H(),r=Se(),n=Q(),a={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:d,parentSchema:y,data:h,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)($,d))return;const g=(0,e.allSchemaProperties)(y.properties),l=(0,e.allSchemaProperties)(y.patternProperties);f(),o.ok((0,t._)`${v} === ${r.default.errors}`);function f(){u.forIn("key",h,_=>{!g.length&&!l.length?p(_):u.if(i(_),()=>p(_))})}function i(_){let P;if(g.length>8){const I=(0,n.schemaRefOrVal)($,y.properties,"properties");P=(0,e.isOwnProperty)(u,I,_)}else g.length?P=(0,t.or)(...g.map(I=>(0,t._)`${_} === ${I}`)):P=t.nil;return l.length&&(P=(0,t.or)(P,...l.map(I=>(0,t._)`${(0,e.usePattern)(o,I)}.test(${_})`))),(0,t.not)(P)}function c(_){u.code((0,t._)`delete ${h}[${_}]`)}function p(_){if(w.removeAdditional==="all"||w.removeAdditional&&d===!1){c(_);return}if(d===!1){o.setParams({additionalProperty:_}),o.error(),S||u.break();return}if(typeof d=="object"&&!(0,n.alwaysValidSchema)($,d)){const P=u.name("valid");w.removeAdditional==="failing"?(b(_,P,!1),u.if((0,t.not)(P),()=>{o.reset(),c(_)})):(b(_,P),S||u.if((0,t.not)(P),()=>u.break()))}}function b(_,P,I){const V={keyword:"additionalProperties",dataProp:_,dataPropType:n.Type.Str};I===!1&&Object.assign(V,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(V,P)}}};return yt.default=a,yt}var gt={},Sn;function Pa(){if(Sn)return gt;Sn=1,Object.defineProperty(gt,"__esModule",{value:!0});const e=Le(),t=ve(),r=Q(),n=ls(),s={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:u,parentSchema:d,data:y,it:h}=a;h.opts.removeAdditional==="all"&&d.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(h,n.default,"additionalProperties"));const v=(0,t.allSchemaProperties)(u);for(const l of v)h.definedProperties.add(l);h.opts.unevaluated&&v.length&&h.props!==!0&&(h.props=r.mergeEvaluated.props(o,(0,r.toHash)(v),h.props));const $=v.filter(l=>!(0,r.alwaysValidSchema)(h,u[l]));if($.length===0)return;const S=o.name("valid");for(const l of $)w(l)?g(l):(o.if((0,t.propertyInData)(o,y,l,h.opts.ownProperties)),g(l),h.allErrors||o.else().var(S,!0),o.endIf()),a.it.definedProperties.add(l),a.ok(S);function w(l){return h.opts.useDefaults&&!h.compositeRule&&u[l].default!==void 0}function g(l){a.subschema({keyword:"properties",schemaProp:l,dataProp:l},S)}}};return gt.default=s,gt}var vt={},En;function Oa(){if(En)return vt;En=1,Object.defineProperty(vt,"__esModule",{value:!0});const e=ve(),t=H(),r=Q(),n=Q(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:u,data:d,parentSchema:y,it:h}=a,{opts:v}=h,$=(0,e.allSchemaProperties)(u),S=$.filter(p=>(0,r.alwaysValidSchema)(h,u[p]));if($.length===0||S.length===$.length&&(!h.opts.unevaluated||h.props===!0))return;const w=v.strictSchema&&!v.allowMatchingProperties&&y.properties,g=o.name("valid");h.props!==!0&&!(h.props instanceof t.Name)&&(h.props=(0,n.evaluatedPropsToName)(o,h.props));const{props:l}=h;f();function f(){for(const p of $)w&&i(p),h.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)(h,`property ${b} matches pattern ${p} (use allowMatchingProperties)`)}function c(p){o.forIn("key",d,b=>{o.if((0,t._)`${(0,e.usePattern)(a,p)}.test(${b})`,()=>{const _=S.includes(p);_||a.subschema({keyword:"patternProperties",schemaProp:p,dataProp:b,dataPropType:n.Type.Str},g),h.opts.unevaluated&&l!==!0?o.assign((0,t._)`${l}[${b}]`,!0):!_&&!h.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return vt.default=s,vt}var bt={},Pn;function ja(){if(Pn)return bt;Pn=1,Object.defineProperty(bt,"__esModule",{value:!0});const e=Q(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:s,it:a}=r;if((0,e.alwaysValidSchema)(a,s)){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={},On;function ka(){if(On)return _t;On=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={},jn;function Na(){if(jn)return $t;jn=1,Object.defineProperty($t,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:s})=>(0,e._)`{passingSchemas: ${s.passing}}`},code(s){const{gen:a,schema:o,parentSchema:u,it:d}=s;if(!Array.isArray(o))throw new Error("ajv implementation error");if(d.opts.discriminator&&u.discriminator)return;const y=o,h=a.let("valid",!1),v=a.let("passing",null),$=a.name("_valid");s.setParams({passing:v}),a.block(S),s.result(h,()=>s.reset(),()=>s.error(!0));function S(){y.forEach((w,g)=>{let l;(0,t.alwaysValidSchema)(d,w)?a.var($,!0):l=s.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},$),g>0&&a.if((0,e._)`${$} && ${h}`).assign(h,!1).assign(v,(0,e._)`[${v}, ${g}]`).else(),a.if($,()=>{a.assign(h,!0),a.assign(v,g),l&&s.mergeEvaluated(l,e.Name)})})}}};return $t.default=n,$t}var wt={},kn;function Ra(){if(kn)return wt;kn=1,Object.defineProperty(wt,"__esModule",{value:!0});const e=Q(),t={keyword:"allOf",schemaType:"array",code(r){const{gen:n,schema:s,it:a}=r;if(!Array.isArray(s))throw new Error("ajv implementation error");const o=n.name("valid");s.forEach((u,d)=>{if((0,e.alwaysValidSchema)(a,u))return;const y=r.subschema({keyword:"allOf",schemaProp:d},o);r.ok(o),r.mergeEvaluated(y)})}};return wt.default=t,wt}var St={},Nn;function Ca(){if(Nn)return St;Nn=1,Object.defineProperty(St,"__esModule",{value:!0});const e=H(),t=Q(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:u,it:d}=a;u.then===void 0&&u.else===void 0&&(0,t.checkStrictMode)(d,'"if" without "then" and "else" is ignored');const y=s(d,"then"),h=s(d,"else");if(!y&&!h)return;const v=o.let("valid",!0),$=o.name("_valid");if(S(),a.reset(),y&&h){const g=o.let("ifClause");a.setParams({ifClause:g}),o.if($,w("then",g),w("else",g))}else y?o.if($,w("then")):o.if((0,e.not)($),w("else"));a.pass(v,()=>a.error(!0));function S(){const g=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},$);a.mergeEvaluated(g)}function w(g,l){return()=>{const f=a.subschema({keyword:g},$);o.assign(v,$),a.mergeValidEvaluated(f,v),l?o.assign(l,(0,e._)`${g}`):a.setParams({ifClause:g})}}}};function s(a,o){const u=a.schema[o];return u!==void 0&&!(0,t.alwaysValidSchema)(a,u)}return St.default=n,St}var Et={},Rn;function Ia(){if(Rn)return Et;Rn=1,Object.defineProperty(Et,"__esModule",{value:!0});const e=Q(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:s}){n.if===void 0&&(0,e.checkStrictMode)(s,`"${r}" without "if" is ignored`)}};return Et.default=t,Et}var Cn;function fs(){if(Cn)return ft;Cn=1,Object.defineProperty(ft,"__esModule",{value:!0});const e=os(),t=$a(),r=us(),n=wa(),s=Sa(),a=cs(),o=Ea(),u=ls(),d=Pa(),y=Oa(),h=ja(),v=ka(),$=Na(),S=Ra(),w=Ca(),g=Ia();function l(f=!1){const i=[h.default,v.default,$.default,S.default,w.default,g.default,o.default,u.default,a.default,d.default,y.default];return f?i.push(t.default,n.default):i.push(e.default,r.default),i.push(s.default),i}return ft.default=l,ft}var Pt={},Ot={},In;function Aa(){if(In)return Ot;In=1,Object.defineProperty(Ot,"__esModule",{value:!0});const e=H(),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,s){const{gen:a,data:o,$data:u,schema:d,schemaCode:y,it:h}=n,{opts:v,errSchemaPath:$,schemaEnv:S,self:w}=h;if(!v.validateFormats)return;u?g():l();function g(){const f=a.scopeValue("formats",{ref:w.formats,code:v.code.formats}),i=a.const("fDef",(0,e._)`${f}[${y}]`),c=a.let("fType"),p=a.let("format");a.if((0,e._)`typeof ${i} == "object" && !(${i} instanceof RegExp)`,()=>a.assign(c,(0,e._)`${i}.type || "string"`).assign(p,(0,e._)`${i}.validate`),()=>a.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 P=S.$async?(0,e._)`(${i}.async ? await ${p}(${o}) : ${p}(${o}))`:(0,e._)`${p}(${o})`,I=(0,e._)`(typeof ${p} == "function" ? ${P} : ${p}.test(${o}))`;return(0,e._)`${p} && ${p} !== true && ${c} === ${s} && !${I}`}}function l(){const f=w.formats[d];if(!f){b();return}if(f===!0)return;const[i,c,p]=_(f);i===s&&n.pass(P());function b(){if(v.strictSchema===!1){w.logger.warn(I());return}throw new Error(I());function I(){return`unknown format "${d}" ignored in schema at path "${$}"`}}function _(I){const V=I instanceof RegExp?(0,e.regexpCode)(I):v.code.formats?(0,e._)`${v.code.formats}${(0,e.getProperty)(d)}`:void 0,F=a.scopeValue("formats",{key:d,ref:I,code:V});return typeof I=="object"&&!(I instanceof RegExp)?[I.type||"string",I.validate,(0,e._)`${F}.validate`]:["string",I,F]}function P(){if(typeof f=="object"&&!(f instanceof RegExp)&&f.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 An;function ds(){if(An)return Pt;An=1,Object.defineProperty(Pt,"__esModule",{value:!0});const t=[Aa().default];return Pt.default=t,Pt}var ke={},Tn;function hs(){return Tn||(Tn=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 qn;function ms(){if(qn)return Ge;qn=1,Object.defineProperty(Ge,"__esModule",{value:!0});const e=as(),t=is(),r=fs(),n=ds(),s=hs(),a=[e.default,t.default,(0,r.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];return Ge.default=a,Ge}var jt={},Me={},Vn;function Ta(){if(Vn)return Me;Vn=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 Mn;function ps(){if(Mn)return jt;Mn=1,Object.defineProperty(jt,"__esModule",{value:!0});const e=H(),t=Ta(),r=Mt(),n=Ue(),s=Q(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:d}})=>u===t.DiscrError.Tag?`tag "${d}" must be string`:`value of tag "${d}" must be in oneOf`,params:({params:{discrError:u,tag:d,tagName:y}})=>(0,e._)`{error: ${u}, tag: ${y}, tagValue: ${d}}`},code(u){const{gen:d,data:y,schema:h,parentSchema:v,it:$}=u,{oneOf:S}=v;if(!$.opts.discriminator)throw new Error("discriminator: requires discriminator option");const w=h.propertyName;if(typeof w!="string")throw new Error("discriminator: requires propertyName");if(h.mapping)throw new Error("discriminator: mapping is not supported");if(!S)throw new Error("discriminator: requires oneOf keyword");const g=d.let("valid",!1),l=d.const("tag",(0,e._)`${y}${(0,e.getProperty)(w)}`);d.if((0,e._)`typeof ${l} == "string"`,()=>f(),()=>u.error(!1,{discrError:t.DiscrError.Tag,tag:l,tagName:w})),u.ok(g);function f(){const p=c();d.if(!1);for(const b in p)d.elseIf((0,e._)`${l} === ${b}`),d.assign(g,i(p[b]));d.else(),u.error(!1,{discrError:t.DiscrError.Mapping,tag:l,tagName:w}),d.endIf()}function i(p){const b=d.name("valid"),_=u.subschema({keyword:"oneOf",schemaProp:p},b);return u.mergeEvaluated(_,e.Name),b}function c(){var p;const b={},_=I(v);let P=!0;for(let A=0;A<S.length;A++){let z=S[A];if(z?.$ref&&!(0,s.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}"`);P=P&&(_||I(z)),V(U,A)}if(!P)throw new Error(`discriminator: "${w}" must be required`);return b;function I({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 qa="http://json-schema.org/draft-07/schema#",Va="http://json-schema.org/draft-07/schema#",Ma="Core schema meta-schema",Da={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:[]}},za=["object","boolean"],Fa={$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:"#"}},La={$schema:qa,$id:Va,title:Ma,definitions:Da,type:za,properties:Fa,default:!0};var Dn;function ys(){return Dn||(Dn=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=ns(),n=ms(),s=ps(),a=La,o=["/properties"],u="http://json-schema.org/draft-07/schema";class d extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(w=>this.addVocabulary(w)),this.opts.discriminator&&this.addKeyword(s.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const w=this.opts.$data?this.$dataMetaSchema(a,o):a;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=d,e.exports=t=d,e.exports.Ajv=d,Object.defineProperty(t,"__esModule",{value:!0}),t.default=d;var y=Le();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return y.KeywordCxt}});var h=H();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.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 zn;function Ua(){return zn||(zn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=ys(),r=H(),n=r.operators,s={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}},a={message:({keyword:u,schemaCode:d})=>(0,r.str)`should be ${s[u].okStr} ${d}`,params:({keyword:u,schemaCode:d})=>(0,r._)`{comparison: ${s[u].okStr}, limit: ${d}}`};e.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(u){const{gen:d,data:y,schemaCode:h,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?l():f();function l(){const c=d.scopeValue("formats",{ref:w.formats,code:S.code.formats}),p=d.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 f(){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=d.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}, ${h}) ${s[v].fail} 0`}},dependencies:["format"]};const o=u=>(u.addKeyword(e.formatLimitDefinition),u);e.default=o}(xt)),xt}var Fn;function Ka(){return Fn||(Fn=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Ws(),n=Ua(),s=H(),a=new s.Name("fullFormats"),o=new s.Name("fastFormats"),u=(y,h={keywords:!0})=>{if(Array.isArray(h))return d(y,h,r.fullFormats,a),y;const[v,$]=h.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,a],S=h.formats||r.formatNames;return d(y,S,v,$),h.keywords&&(0,n.default)(y),y};u.get=(y,h="full")=>{const $=(h==="fast"?r.fastFormats:r.fullFormats)[y];if(!$)throw new Error(`Unknown format "${y}"`);return $};function d(y,h,v,$){var S,w;(S=(w=y.opts.code).formats)!==null&&S!==void 0||(w.formats=(0,s._)`require("ajv-formats/dist/formats").${$}`);for(const g of h)y.addFormat(g,v[g])}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u}(Ke,Ke.exports)),Ke.exports}var Ja=Ka();const Wa=lr(Ja);function dr(e){return e.split("/").slice(1).map(t=>t.replace(/~1/g,"/").replace(/~0/g,"~"))}function gs(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 vs(e){return e.message??`${e.keyword} validation failed`}function bs(e){return e.reduce((t,r)=>{const n=gs(r);if(n==null)return t;let s=t;for(const a of n){const o=a;s.dependencies==null&&(s.dependencies={}),s.dependencies[o]==null&&(s.dependencies[o]={}),s=s.dependencies[o]}return s.message=vs(r),t},{})}function Dt(e){const t=bs(e);return D.a.invalid(t)}function Ba(e){const t={keyword:"x:ui",schemaType:["string","object"],errors:!1,validate:()=>!0};e.addKeyword(t)}let Rt=new WeakMap;function xa(){Rt=new WeakMap}function Ha(e){Rt.delete(e)}function Ga(){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 s=e.compile(t);return r.set(t,s),s}async function Ln(e,t,r){const n=(await(()=>{switch(e){case"2020-12":return Promise.resolve().then(()=>require("./2020-C8VDmyg1.cjs")).then(a=>a._2020);case"2019-09":return Promise.resolve().then(()=>require("./2019-Dks2DDHw.cjs")).then(a=>a._2019);case"draft-07":return Promise.resolve().then(()=>so)}})()).default,s=new n({meta:r,strictSchema:!1,allErrors:!0,removeAdditional:t});switch(e){case"2020-12":s.opts.defaultMeta="https://json-schema.org/draft/2020-12/schema";break;case"2019-09":s.opts.defaultMeta="https://json-schema.org/draft/2019-09/schema";break;case"draft-07":s.opts.defaultMeta="http://json-schema.org/draft-07/schema#";break}return Wa(s),Ba(s),s}function Xa(e){return e==null||e.includes("draft/2020-12")?"2020-12":e.includes("draft/2019-09")?"2019-09":"draft-07"}function Ya(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[s,a]of Object.entries(r))!t&&(s==="$id"||s==="$schema"||s==="$dynamicAnchor")||(n[s]=or(a,!1));return n}return e}function Un(e){const t=new Set,r=n=>{if(n!=null){if(Array.isArray(n)){for(const s of n)r(s);return}if(typeof n=="object"){const s=n,a=s.$ref;typeof a=="string"&&a.length>0&&a[0]!=="#"&&t.add(Ya(a));for(const o of Object.values(s))r(o)}}};return r(e),[...t]}function _s(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 Za(e,t,r,n){if(r==null)return null;const s=new Set;if(n&&n.length>0)for(const u of n){const d=u.$id;typeof d=="string"&&d.length>0&&s.add(d)}const a=[],o=5;for(let u=0;u<o;u++){const d=Un(t),y=a.flatMap($=>Un($)),h=new Set([...d,...y]),v=[];for(const $ of h)if(!s.has($)){if(e.getSchema($)){s.add($);continue}v.push($)}if(v.length===0)return null;try{const $=await r(v);if(!Array.isArray($)||$.length===0)return null;_s(e,$);for(const S of $){const w=S.$id;typeof w=="string"&&w.length>0&&(s.add(w),a.push(S))}}catch($){return`refResolver failed: ${$ instanceof Error?$.message:String($)}`}}return"refResolver reached iteration limit while resolving external $refs"}async function $s(e,t){try{const r=Xa(e.$schema),n=t?.sanitizeAdditional===!1?!1:t?.sanitizeAdditional??!1,s=h=>typeof h=="string"&&h.endsWith("#")?h.slice(0,-1):h??"",a=e.$id,o=s(a);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 h=await Ln(r,n,!1),v=or(e);try{h.addMetaSchema(v)}catch{}const $=h.getSchema(a??o)??h.compile(v);return{ok:!0,value:{ajv:h,validate:$}}}const d=await Ln(r,n,!0);if(t?.externalSchemas&&t.externalSchemas.length>0&&_s(d,t.externalSchemas),t?.refResolver){const h=await Za(d,e,t.refResolver,t.externalSchemas);if(h!=null)return{ok:!1,error:h}}const y=d.compile(e);return{ok:!0,value:{ajv:d,validate:y}}}catch(r){return{ok:!1,error:r instanceof Error?r.message:String(r)}}}function Qa(e,t){if(typeof e=="boolean"||typeof t=="boolean")return t;const r={...e};for(const[n,s]of Object.entries(t))n==="required"&&Array.isArray(e.required)&&Array.isArray(s)?r.required=[...new Set([...e.required,...s])]:n==="properties"&&e.properties&&typeof s=="object"&&s!=null?r.properties={...e.properties,...s}:r[n]=s;return r}function ei(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 ti(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 s=t.type,a=r.type;if(s!=null&&a!=null&&s!==a){const o=Array.isArray(s)?s:[s],u=Array.isArray(a)?a:[a];return{path:n,message:`Property "${e}" has conflicting types: ${o.join("|")} vs ${u.join("|")}`,conflictingValues:[t,r]}}if(s===a&&s==="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(s===a&&(s==="number"||s==="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 ei(t,r)?null:{path:n,message:`Property "${e}" has conflicting definitions in allOf branches`,conflictingValues:[t,r]}}function ri(e){const t=Array.isArray(e)?e:[e],r=new Set(t.map(n=>n));return r.has("number")&&r.add("integer"),r}function ni(e,t,r,n){for(const[s,a]of Object.entries(t)){if(e[s]!=null&&e[s]!==a){const o=e[s],u=ti(s,o,a,[...r,"properties",s]);u!=null&&n.push(u)}e[s]!=null?e[s]=Qa(e[s],a):e[s]=a}}function si(e,t,r,n){t!=null&&e.additionalProperties!=null&&e.additionalProperties!==t&&n.push({path:[...r,"additionalProperties"],message:`Conflicting additionalProperties values in allOf: ${e.additionalProperties} vs ${t}`,conflictingValues:[e.additionalProperties,t]})}function ai(e,t,r,n,s){t!=null&&e.maxProperties!=null&&t>e.maxProperties&&s.push({path:[...n,"minProperties"],message:`minProperties ${t} conflicts with existing maxProperties ${e.maxProperties}`,conflictingValues:[t,e.maxProperties]}),r!=null&&e.minProperties!=null&&r<e.minProperties&&s.push({path:[...n,"maxProperties"],message:`maxProperties ${r} conflicts with existing minProperties ${e.minProperties}`,conflictingValues:[r,e.minProperties]})}function ii(e,t,r){if(e.length===0)return;let n=null;for(const a of e)if(n==null)n=new Set(a);else{const o=new Set;for(const u of n)a.has(u)&&o.add(u);n=o}const s=Array.from(n??[]);if(s.length===0){const a=e.map(o=>Array.from(o));r.push({path:[...t,"type"],message:"Incompatible types in allOf (no common types)",conflictingValues:a});return}else return s.length===1?s[0]:s}function Ft(e,t=[]){const r=[],n={},s=[],a=[],o={};for(const d of e){d.type!=null&&s.push(ri(d.type)),Array.isArray(d.required)&&a.push(...d.required),d.properties!=null&&ni(o,d.properties,t,r);const{type:y,required:h,properties:v,allOf:$,additionalProperties:S,patternProperties:w,minProperties:g,maxProperties:l,...f}=d;si(n,S,t,r),ai(n,g,l,t,r),Object.assign(n,f),S!=null&&(n.additionalProperties=S),w!=null&&(n.patternProperties=w),g!=null&&(n.minProperties=g),l!=null&&(n.maxProperties=l)}const u=ii(s,t,r);return u!=null&&(n.type=u),a.length>0&&(n.required=[...new Set(a)]),Object.keys(o).length>0&&(n.properties=o),{mergedSchema:n,conflicts:r}}function ws(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 Ss(e,t,r,n=[]){const s=[],a=[],o=hr(e,t,r);o&&s.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,l]of Object.entries($))if(Object.prototype.hasOwnProperty.call(v,g))for(const f of l)u.push(f)}const S=e.dependencies;if(S){for(const[g,l]of Object.entries(S))if(Object.prototype.hasOwnProperty.call(v,g))if(Array.isArray(l))for(const f of l)u.push(f);else typeof l=="object"&&l&&s.push(l)}const w=e.dependentSchemas;if(w)for(const[g,l]of Object.entries(w))Object.prototype.hasOwnProperty.call(v,g)&&s.push(l)}const d=[e,...s],{mergedSchema:y,conflicts:h}=Ft(d,n);if(u.length>0){const v=new Set([...y.required??[],...u]);y.required=[...v]}return a.push(...h),{effective:y,conflicts:a}}function hr(e,t,r){if(!r||!e.if||typeof e.if!="object")return null;try{if(zt(r,e.if)(t)){const a=e.then;if(a&&typeof a=="object")return a}else{const a=e.else;if(a&&typeof a=="object")return a}}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(d=>{try{new RegExp(d).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(d=>n.add(d))});const s=hr(e,t,r);s&&Ae(s,t,r).forEach(u=>n.add(u));const a=e.dependentSchemas;return a&&Object.keys(a).forEach(o=>{if(o in t){const u=a[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}class Lt{schema;definition;horizontal;path;ajv;isPropertyRequired;suppressLabel;schemaConflicts;notViolations;constructor(t){const{schema:r,definition:n,horizontal:s,path:a,ajv:o,isPropertyRequired:u,suppressLabel:d,schemaConflicts:y,notViolations:h}=t;this.schema=r,this.definition=n,this.horizontal=s,this.path=a,this.ajv=o,this.isPropertyRequired=u??!1,this.suppressLabel=d??!1,this.schemaConflicts=y??[],this.notViolations=h??[]}with=t=>new Lt({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(s=>n.includes(s))}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 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 s=[];if(e.isDeprecated&&s.push("deprecated"),e.isReadOnly&&!e.shouldIgnoreReadOnly&&s.push("read-only"),e.isWriteOnly&&!e.shouldShowWriteOnly&&s.push("write-only"),s.length>0){const a=`(${s.join(", ")})`;n=n?`${n} ${a}`:a}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 Es(e){return e==null?1:Math.round(e)}function mr(e){return e.isWriteOnly&&!e.shouldShowWriteOnly}function pr(e){return e.isReadOnly&&!e.shouldIgnoreReadOnly||e.isDeprecated}function Ps(e){const{options:t,selected:r,onChange:n,mode:s="auto",size:a="sm",keyFor:o=h=>String(h),parseKey:u=h=>h}=e,d=t.length;if((s==="auto"?d<=3?"segmented":"select":s)==="segmented"){const h=Object.fromEntries(t.map(v=>[o(v.value),v.label]));return J.SegmentedInput({options:h,value:O.Value.map(r,v=>o(v)),onChange:v=>n(u(v)),size:a})}return J.NativeSelect({options:t.map(h=>({type:"value",value:h.value,label:h.label})),value:r,onChange:n})}function Os({ctx:e,showSelector:t,selector:r,inner:n}){return e.isRoot?t?D.Stack(O.attr.class("bc-stack--gap-2"),r,n):n:D.InputWrapper({...we({ctx:e}),content:t?D.Stack(O.attr.class("bc-stack--gap-2 bc-stack--align-start"),r,n):n})}function oi(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 ui(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 ci(e){switch(e){case"null":return null;case"array":return[];case"object":return{};default:return}}function li(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 fi(e){if(typeof e=="boolean")return ar;const t=e["x:ui"];return t&&Array.isArray(t.textAreaTriggers)?[...ar,...t.textAreaTriggers]:ar}function js(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 yr(e,t){if(typeof e=="boolean")return;const r=js(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(a=>a==="number"||a==="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 a=t.toLowerCase();if(a.includes("password")||a.includes("secret"))return{widget:"password",source:"heuristics"};if(a.includes("email"))return{widget:"email",source:"heuristics"};if(a.includes("url")||a.includes("link"))return{widget:"url",source:"heuristics"};if(a.includes("color"))return{widget:"color",source:"heuristics"};if(fi(e).some(u=>a.includes(u.toLowerCase())))return{widget:"textarea",source:"heuristics"}}}}function di(e){const{definition:t}=e;if(typeof t=="boolean")return;const r={pattern:t.pattern,minLength:t.minLength,maxLength:t.maxLength},n=yr(t,e.name),s=n?.widget;if(s!=null)switch(s){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 hi=e=>{const{value:t,onBlur:r,onChange:n,onInput:s,after:a,disabled:o,...u}=e,d=J.NullableResetAfter(t,o,n);return J.Base64Input({...u,value:O.Value.map(t,y=>y??void 0),onChange:n!=null?y=>n(y??null):void 0,onInput:s!=null?y=>s(y??null):void 0,onBlur:r,after:a!=null?O.Fragment(d,a):d})};function Kn({ctx:e,options:t,controller:r}){const n=di(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:s=>s==null?null:new Date(s),fromInput:s=>s?.toISOString().split("T")[0]??null});case"date-time":return D.MappedControl(J.NullableDateTimeInput,{...t,controller:J.transformNullToUndefined(r),toInput:s=>s==null?null:new Date(s),fromInput:s=>s?.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:s}=e,a=typeof s=="object"?s["x:ui"]:void 0;return n.mediaType&&(n.mediaType.startsWith("image/")||n.mediaType.startsWith("video/")||n.mediaType.startsWith("audio/")||n.mediaType==="application/pdf"||a?.preferFileUpload===!0)?D.Control(hi,{...t,controller:J.transformNullToUndefined(r),mode:"compact",accept:n.mediaType||"*/*",maxFileSize:(typeof a?.maxBytes=="number"?a.maxBytes:void 0)||(typeof a?.maxFileSize=="number"?a.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:s})=>D.MappedControl(J.NullableDurationInput,{...t,controller:J.transformNullToUndefined(r),toInput:a=>a==null?null:s.from(a),fromInput:a=>a?.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 Ct({ctx:e,controller:t}){if(mr(e))return O.Fragment();const r={...we({ctx:e}),placeholder:De(e.definition,String),disabled:pr(e)};if(e.isNullable&&(e.isOptional||!e.shouldShowPresenceToggle))return Kn({ctx:e,options:r,controller:t});const s=yr(e.definition,e.name)?.widget;if(s!=null&&["url","uri","uri-reference","hostname","ipv4","ipv6","regex","duration","binary","markdown","time","color"].includes(s))return Kn({ctx:e,options:r,controller:t});switch(s){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 mi(e){const t=yr(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(mr(e))return O.Fragment();const r=e.definition,n=mi(e),s={...we({ctx:e}),placeholder:De(e.definition,String),min:r.minimum,max:r.maximum,step:r.multipleOf,disabled:pr(e)},a=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 a?D.Control(J.NullableRatingInput,{...s,max:o,controller:t}):D.Control(J.RatingInput,{...s,max:o,controller:t});case"slider":return a?D.Control(J.NullableSliderInput,{...s,controller:t}):D.Control(J.SliderInput,{...s,controller:t});case"currency":const u=typeof n.options?.currency=="string"?n.options.currency:"USD";return a?D.Control(J.MaskInput,{...s,mask:Jn(u),controller:t}):D.Control(J.MaskInput,{...s,mask:Jn(u),controller:t});case"percent":return a?D.Control(J.MaskInput,{...s,mask:Wn(),controller:t}):D.Control(J.MaskInput,{...s,mask:Wn(),controller:t});default:return a?D.Control(J.NullableNumberInput,{...s,controller:t}):D.Control(J.NumberInput,{...s,controller:t})}}function Jn(e){return`${pi(e)} 000,000.00`}function Wn(){return"000.00%"}function pi(e){return{USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"C$",AUD:"A$"}[e.toUpperCase()]||e}function It({ctx:e,controller:t}){return ze({ctx:e.with({definition:{...e.definition,multipleOf:Es(e.definition.multipleOf)}}),controller:t})}function At({ctx:e,controller:t}){if(mr(e))return O.Fragment();const r={...we({ctx:e}),disabled:pr(e)},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,s=>t.change(s))})}function gr({controller:e}){return O.WithElement(()=>{e.change(null)})}let ir=new WeakMap,Bn=new WeakMap;function ks(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 s=new Set;for(;Ns(n);){const a=n.$ref;if(!a.startsWith("#")){console.warn(`resolveRef: external $ref not supported here: ${a}`);break}if(s.has(a)){console.warn(`resolveRef: cycle detected while resolving in-document $ref chain: ${[...s,a].join(" -> ")}`);break}s.add(a);const o=Rs(t,a);if(!Ut(o)){console.warn(`resolveRef: could not resolve JSON Pointer ${a}`);break}const{$ref:u,...d}=n;n={...o,...d}}if(r!=null){let a=ir.get(r);a==null&&(a=new WeakMap,ir.set(r,a)),a.set(e,n)}return n}function Ns(e){return Ut(e)&&typeof e.$ref=="string"}function Ut(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)}function Rs(e,t){if(!t.startsWith("#"))return;if(t==="#")return e;if(typeof e!="object"||e==null)return;const r=e;let n=Bn.get(r);n==null&&(n=new Map,Bn.set(r,n));const s=n.get(t);if(s!==void 0)return s;const a=dr(t);let o=e;for(const u of a){if(!Ut(o)&&!Array.isArray(o)){n.set(t,void 0);return}o=o[u]}return n.set(t,o),o}function Cs(e,t,r){let n=e;const s=new Set,a=(o,u)=>{const{$ref:d,...y}=u;return{...o,...y}};for(;Ns(n);){const o=n.$ref;if(s.has(o)){console.warn(`resolveAnyRef: cycle detected while resolving $ref chain: ${[...s,o].join(" -> ")}`);break}if(s.add(o),o.startsWith("#")){const v=Rs(t,o);if(!Ut(v)){console.warn(`resolveAnyRef: could not resolve JSON Pointer ${o}`);break}n=a(v,n);continue}if(!r){console.warn(`resolveAnyRef: external $ref without AJV not resolved: ${o}`);break}const u=o.indexOf("#"),d=u>=0?o.slice(0,u):o;let y=r.getSchema(o)||r.getSchema(d);if(!y)try{y=r.compile({$ref:o})}catch{}const h=y?.schema;if(!h||typeof h!="object"){console.warn(`resolveAnyRef: AJV could not provide schema for ${o}`);break}n=a(h,n)}return n}function yi({conflicts:e}){return e.length===0?O.Empty:D.Notice({variant:"warning",tone:"prominent",title:"Schema Conflicts Detected",class:"bc-schema-conflicts-banner"},O.html.ul(O.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>O.html.li(O.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?O.html.code(O.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function gi({violations:e}){return e.length===0?O.Empty:D.Notice({variant:"danger",tone:"prominent",title:"Schema Violations Detected",class:"bc-not-violations-banner"},O.html.ul(O.attr.style("margin: 0; padding-left: 1.25rem; list-style-type: disc;"),...e.map(t=>O.html.li(O.attr.style("margin-bottom: 0.25rem;"),t.message,t.path.length>0?O.html.code(O.attr.style("margin-left: 0.5rem; font-size: 0.75rem; opacity: 0.7;"),` (${t.path.join(".")})`):null))))}function vi({ctx:e,controller:t,content:r}){const n=O.Value.map(t.signal,o=>o!==void 0),s=e.widgetLabel??"Property",a=o=>{if(o){const u=e.default;if(u!==void 0)t.change(u);else{const d=e.definition;d.type==="string"?t.change(""):d.type==="number"||d.type==="integer"?t.change(0):d.type==="boolean"?t.change(!1):d.type==="array"?t.change([]):d.type==="object"?t.change({}):t.change(null)}}else t.change(void 0)};return D.Stack(O.html.div(O.attr.class("bc-presence-toggle"),D.InputWrapper({layout:"horizontal",label:`Include ${s}`,content:J.Switch({value:n,onChange:a,size:"xs"})})),O.When(n,()=>r))}function ne(e,t,r){const n=e.schemaConflicts.length>0,s=e.notViolations.length>0,a=e.shouldShowPresenceToggle&&r!=null;let o=t;return a&&r!=null&&(o=vi({ctx:e,controller:r,content:t})),!n&&!s?o:D.Stack(O.attr.class("bc-stack--gap-2"),s?gi({violations:e.notViolations}):null,n?yi({conflicts:e.schemaConflicts}):null,o)}function Is(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 bi(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:xn(r.trim())}}if(e.includes("=")){const[t,r]=e.split("=",2);return{field:t.trim(),operator:"equals",value:xn(r.trim())}}return{field:e.trim(),operator:"truthy"}}function xn(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 _i(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const s of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else n=n[s]}return n}function ur(e,t){const r=_i(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 As(e,t){const r=e.conditions.map(n=>"operator"in n&&["and","or","not"].includes(n.operator)?As(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 $i(e,t){try{if(typeof e=="string"){const r=bi(e);return ur(r,t)}return"operator"in e&&["and","or","not"].includes(e.operator)?As(e,t):ur(e,t)}catch(r){return console.warn("Error evaluating visibility condition:",r),!0}}function wi(e,t){return O.computedOf(t)(r=>$i(e,r))}const Hn={behavior:"hide",clearOnHide:!1};function Si({ctx:e,controller:t,children:r,options:n=Hn}){const s=Is(e.definition);if(!s)return r;const a={...Hn,...n},o=Ei(t),u=wi(s,o);switch(a.clearOnHide&&u.on(d=>{!d&&t.signal.value!==void 0&&t.change(void 0)}),a.behavior){case"unmount":return O.When(u,()=>r,()=>O.Fragment());case"hide":default:return O.When(u,()=>r,()=>O.Fragment(r))}}function Ei(e){return e.signal}function Ts({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 qs({ctx:e,controller:t}){const r=e.definition;return O.Fragment(O.WithElement(()=>{O.Value.get(t.signal)!==r.const&&t.change(r.const)}),J.Group(D.MutedLabel(e.widgetLabel,": "),D.Label(String(r.const))))}function Pi(e,t,r){const{controller:n,effCtx:s,patternProps:a,apSchema:o,canRemove:u,lockKeyAfterSet:d,validatePropertyName:y}=r,h=n.field(e),v=O.prop(e),$=O.prop(null);let S=o;if(t){const f=Object.keys(a).find(i=>{try{return new RegExp(i).test(e)}catch{return!1}});if(f){const i=a[f];i!==!1&&typeof i=="object"&&(S=i)}}const w=f=>{const i=(f??"").trim();if(!i||i===e||Object.prototype.hasOwnProperty.call(O.Value.get(n.signal)??{},i))return;const c=y(i);if(!c.ok){$.set(c.message);return}$.set(null);const p={...O.Value.get(n.signal)??{}},b=p[e];delete p[e],p[i]=b,n.change(p)},g=O.Use(Ne.BeatUII18n,f=>D.CloseButton({size:"xs",label:f.$.removeItem,disabled:!u(Object.keys(O.Value.get(n.signal)??{}).length),onClick:()=>{const i=Object.keys(O.Value.get(n.signal)??{}).length;if(!u(i))return;const c={...O.Value.get(n.signal)??{}};delete c[e],n.change(c)}})),l=O.Value.map(h.signal,f=>d&&f!=null);return O.html.div(O.attr.class("bc-object-helpers__row"),O.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:v,onChange:w,disabled:O.computedOf(n.disabled,l)((f,i)=>f||i)}),error:O.Ensure($,f=>O.html.div(O.attr.class("bc-object-helpers__error"),f)),description:Object.keys(a).length>0?O.html.div(O.attr.class("bc-object-helpers__description"),"Allowed patterns: ",Object.keys(a).join(", ")):null}),O.html.div(Pe({ctx:s.with({definition:S,suppressLabel:!0}).append(e),controller:h})),O.html.div(O.attr.class("bc-object-helpers__remove"),g))}function Oi(e,t,r){const{controller:n,effCtx:s,patternProps:a,apSchema:o,unevaluatedProps:u,canRemove:d,lockKeyAfterSet:y,validatePropertyName:h}=r,v=n.field(e),$=O.prop(e),S=O.prop(null);let w;if(u&&typeof u=="object")w=u;else if(t){const i=Object.keys(a).find(c=>{try{return new RegExp(c).test(e)}catch{return!1}});if(i){const c=a[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(O.Value.get(n.signal)??{},c))return;const p=h(c);if(!p.ok){S.set(p.message);return}S.set(null);const b={...O.Value.get(n.signal)??{}},_=b[e];delete b[e],b[c]=_,n.change(b)},l=O.Use(Ne.BeatUII18n,i=>D.CloseButton({size:"xs",label:i.$.removeItem,disabled:!d(Object.keys(O.Value.get(n.signal)??{}).length),onClick:()=>{const c=Object.keys(O.Value.get(n.signal)??{}).length;if(!d(c))return;const p={...O.Value.get(n.signal)??{}};delete p[e],n.change(p)}})),f=O.Value.map(v.signal,i=>y&&i!=null);return O.html.div(O.attr.class("bc-object-helpers__row"),O.style.gridTemplateColumns("2fr 3fr min-content"),D.InputWrapper({content:J.EditableText({value:$,onChange:g,disabled:O.computedOf(n.disabled,f)((i,c)=>i||c)}),error:O.Ensure(S,i=>O.html.div(O.attr.class("bc-object-helpers__error"),i)),description:O.html.div(O.attr.class("bc-object-helpers__description"),u===!1?"Unevaluated property (not allowed by schema)":"Unevaluated property",Object.keys(a).length>0?O.html.span(" • Allowed patterns: ",Object.keys(a).join(", ")):null)}),O.html.div(Pe({ctx:s.with({definition:w,suppressLabel:!0}).append(e),controller:v})),O.html.div(O.attr.class("bc-object-helpers__remove"),l))}function ji(e){if(typeof e.definition=="boolean")return;const t=js(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 ki({title:e,children:t}){return O.html.fieldset(O.attr.class("bc-fieldset"),e?O.html.legend(O.attr.class("bc-fieldset__legend"),e):null,O.html.div(O.attr.class("bc-fieldset__content"),D.Stack(O.attr.class("bc-stack--gap-1"),...t)))}function Ni({title:e,children:t}){return J.Card({variant:"outlined",size:"md"},D.Stack(O.attr.class("bc-stack--gap-1"),e?D.Label(e):null,...t))}function Ri({cols:e=1,children:t}){const r=typeof e=="number"?`bc-schema-grid bc-schema-grid--cols-${e}`:O.computedOf(e)(n=>{if(typeof n=="number")return`bc-schema-grid bc-schema-grid--cols-${n}`;if(n&&typeof n=="object"){const s=["bc-schema-grid"];return n.sm&&s.push(`bc-schema-grid--cols-sm-${n.sm}`),n.md&&s.push(`bc-schema-grid--cols-md-${n.md}`),n.lg&&s.push(`bc-schema-grid--cols-lg-${n.lg}`),n.xl&&s.push(`bc-schema-grid--cols-xl-${n.xl}`),n["2xl"]&&s.push(`bc-schema-grid--cols-2xl-${n["2xl"]}`),s.join(" ")}return"bc-schema-grid bc-schema-grid--cols-1"});return O.html.div(O.attr.class(r),O.attr.class("bc-schema-grid--gap-4"),...t)}function Ci({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ii({title:"Properties",children:t});const r=O.prop(Object.keys(e)[0]),n=Object.entries(e);return O.html.div(O.attr.class("bc-tabs"),O.html.div(O.attr.class("bc-tabs__header"),O.attr.role("tablist"),...n.map(([s],a)=>O.html.button(O.attr.type("button"),O.attr.class("bc-tabs__tab"),O.attr.class(O.computedOf(r)(o=>o===s?"bc-tabs__tab--active":"")),O.attr.role("tab"),O.attr.tabindex(r.map(o=>o===s?0:-1)),O.on.click(()=>r.set(s)),O.on.keydown(o=>{switch(o.key){case"ArrowLeft":o.preventDefault();const u=a>0?a-1:n.length-1;r.set(n[u][0]);break;case"ArrowRight":o.preventDefault();const d=a<n.length-1?a+1:0;r.set(n[d][0]);break;case"Home":o.preventDefault(),r.set(n[0][0]);break;case"End":o.preventDefault(),r.set(n[n.length-1][0]);break}}),s))),O.html.div(O.attr.class("bc-tabs__content"),...n.map(([s,a])=>O.html.div(O.attr.class("bc-tabs__panel"),O.attr.class(O.computedOf(r)(o=>o===s?"bc-tabs__panel--active":"bc-tabs__panel--hidden")),O.attr.role("tabpanel"),D.Stack(O.attr.class("bc-stack--gap-1"),...t.filter((o,u)=>a.length===0||u<a.length))))))}function Ii({title:e,children:t}){return O.html.div(O.attr.class("bc-tabs"),O.html.div(O.attr.class("bc-tabs__header"),O.html.div(O.attr.class("bc-tabs__tab bc-tabs__tab--active"),e)),O.html.div(O.attr.class("bc-tabs__content"),O.html.div(O.attr.class("bc-tabs__panel bc-tabs__panel--active"),D.Stack(O.attr.class("bc-stack--gap-1"),...t))))}function Ai({groups:e,children:t}){if(!e||Object.keys(e).length===0)return Ti({title:"Properties",children:t});const r=Object.entries(e),n=O.prop(new Set([r[0]?.[0]].filter(Boolean)));return O.html.div(O.attr.class("bc-accordion"),...r.map(([s,a])=>{const o=O.computedOf(n)(u=>u.has(s));return O.html.div(O.attr.class("bc-accordion__item"),O.html.button(O.attr.type("button"),O.attr.class("bc-accordion__header"),O.aria.expanded(o),O.on.click(()=>{const u=n.value,d=new Set(u);d.has(s)?d.delete(s):d.add(s),n.set(d)}),O.on.keydown(u=>{if(u.key==="Enter"||u.key===" "){u.preventDefault();const d=n.value,y=new Set(d);y.has(s)?y.delete(s):y.add(s),n.set(y)}}),O.html.span(s),Ne.Icon({icon:O.computedOf(o)(u=>u?"chevron-up":"chevron-down"),size:"sm"})),O.html.div(O.attr.class("bc-accordion__content"),O.attr.class(O.computedOf(o)(u=>u?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(O.attr.class("bc-stack--gap-1"),...t.filter((u,d)=>a.length===0||d<a.length))))}))}function Ti({title:e,children:t}){const r=O.prop(!0);return O.html.div(O.attr.class("bc-accordion"),O.html.div(O.attr.class("bc-accordion__item"),O.html.button(O.attr.type("button"),O.attr.class("bc-accordion__header"),O.on.click(()=>r.set(!r.value)),O.html.span(e),Ne.Icon({icon:O.computedOf(r)(n=>n?"chevron-up":"chevron-down"),size:"sm"})),O.html.div(O.attr.class("bc-accordion__content"),O.attr.class(O.computedOf(r)(n=>n?"bc-accordion__content--open":"bc-accordion__content--closed")),D.Stack(O.attr.class("bc-stack--gap-1"),...t))))}function Gn(e,t,r){const n=new Map;r.forEach((o,u)=>{e[u]&&n.set(o,e[u])});let s=e;if(t.order&&t.order.length>0){const o=new Map,u=[];t.order.forEach(d=>{const y=n.get(d);y&&o.set(d,y)}),r.forEach((d,y)=>{!t.order.includes(d)&&e[y]&&u.push(e[y])}),s=[...Array.from(o.values()),...u]}let a;if(t.groups&&Object.keys(t.groups).length>0){a={};const o=new Set;Object.entries(t.groups).forEach(([d,y])=>{a[d]=[],y.forEach(h=>{const v=n.get(h);v&&(a[d].push(v),o.add(v))})});const u=s.filter(d=>!o.has(d));u.length>0&&(a.Other=u)}return{orderedChildren:s,groupedChildren:a}}function qi(e,t,r,n=[]){if(!e||!e.format){if(e?.order){const{orderedChildren:u}=Gn(r,e,n);return D.Stack(O.attr.class("bc-stack--gap-1"),...u)}return D.Stack(O.attr.class("bc-stack--gap-1"),...r)}const s=t.widgetLabel||t.name,{orderedChildren:a,groupedChildren:o}=Gn(r,e,n);switch(e.format){case"fieldset":return ki({title:s,children:a});case"group":return Ni({title:s,children:a});case"grid":return Ri({cols:e.cols,children:a});case"tabs":return Ci({groups:o||e.groups,children:o?Object.values(o).flat():a});case"accordion":return Ai({groups:o||e.groups,children:o?Object.values(o).flat():a});default:return D.Stack(O.attr.class("bc-stack--gap-1"),...a)}}function vr({ctx:e,controller:t}){return O.MapSignal(t.signal,r=>{const n=e.definition,{effective:s,conflicts:a}=Ss(n,r,e.ajv,e.path),o=e.with({definition:s,schemaConflicts:[...e.schemaConflicts,...a]}),u=s.properties??{},d=new Set(Object.keys(u)),y=Object.keys(r??{}),h=y.filter(m=>!d.has(m)),v=s.unevaluatedProperties,$=Ae(s,r??{},e.ajv),S=h.filter(m=>!$.has(m)),w=h.filter(m=>$.has(m)),g=s.additionalProperties??!0,l=g!==!1,f=g===!0||g===void 0?{}:g,i=s.minProperties??0,c=s.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 _=l&&p&&y.length<c,P=m=>m>i,I=s.patternProperties??{},V=Object.keys(I).filter(Boolean).map(m=>{try{return new RegExp(m)}catch{return null}}).filter(m=>m!=null),F=s.propertyNames,A=m=>{const E=(m??"").trim();if(E==="")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(E))return{ok:!1,message:R.errors?.[0]?.message??"Invalid property name"}}catch{}if(!l&&!d.has(E)){if(V.length===0)return{ok:!1,message:"Only declared properties are allowed"};if(!V.some(K=>K.test(E)))return{ok:!1,message:`Key must match one of: ${Object.keys(I).join(", ")}`}}return{ok:!0}},z=s["x:ui"],U=!!(z&&typeof z=="object"&&z.lockKeyAfterSet),B=m=>{const E=De(m,K=>K);if(E!==void 0)return E;const R=m.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=(m,E)=>{const R=m,K=Z=>E.has(Z)?!1:A(Z).ok;if(K(R))return R;let W=1;for(;E.has(R+W)||!K(R+W);)W++;return R+W},ae=O.Use(Ne.BeatUII18n,m=>Ne.Button({variant:"outline",disabled:!_,onClick:()=>{if(!_)return;const E=new Set(Object.keys(O.Value.get(t.signal)??{})),R=ee("property",E);if(!A(R).ok)return;let W=f;v&&typeof v=="object"&&(W=v);const Z=B(W),Y={...O.Value.get(t.signal)??{},[R]:Z};t.change(Y)}},O.attr.title(b),m.$.addLabel)),se=ji(o),te=Ks.f(u).filter(([,m])=>m!==!1),M=[...te.map(([m])=>m),...w,...S],k=[...te.map(([m,E])=>{const R=m,K=t.field(R);return Pe({ctx:o.with({definition:E,isPropertyRequired:Array.isArray(s.required)?s.required.includes(R):o.hasRequiredProperty(R),suppressLabel:!1}).append(R),controller:K})}),...w.map(m=>{const E=V.some(R=>R.test(m));return Pi(m,E,{controller:t,effCtx:o,patternProps:I,apSchema:f,canRemove:P,lockKeyAfterSet:U,validatePropertyName:A})}),...S.map(m=>{const E=V.some(R=>R.test(m));return Oi(m,E,{controller:t,effCtx:o,patternProps:I,apSchema:f,unevaluatedProps:v,canRemove:P,lockKeyAfterSet:U,validatePropertyName:A})}),l?ae:null].filter(Boolean),T=qi(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 Vi(e,t,r){const s=e.definition.oneOf;if(!Array.isArray(s)||s.length===0)return{matchingBranch:-1,validBranches:[],isAmbiguous:!1,hasNoMatch:!0};const a=s.map(h=>{if(typeof h=="object"&&h!=null&&"$ref"in h){const v=h.$ref;if(typeof v=="string"&&v.startsWith("#"))return ks(h,e.schema)}return h}),o=[];for(let h=0;h<a.length;h++){const v=a[h];if(typeof v=="boolean"){v===!0&&o.push(h);continue}if(r)try{zt(r,v)(t)&&o.push(h)}catch($){console.warn(`Failed to compile oneOf branch ${h}:`,$),Xn(v,t)&&o.push(h)}else Xn(v,t)&&o.push(h)}const u=o.length>1,d=o.length===0;return{matchingBranch:o.length===1?o[0]:-1,validBranches:o,isAmbiguous:u,hasNoMatch:d}}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=Mi(t);if(n==="unknown"||!r.includes(n))return!1}if(e.properties&&typeof t=="object"&&t!=null){const r=t;for(const[n,s]of Object.entries(e.properties))if(typeof s=="object"&&s!=null&&"const"in s&&r[n]!==s.const)return!1}return!0}function Mi(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 Di(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,s]of Object.entries(e.properties))if(typeof s=="object"&&s!=null&&"const"in s){const a=s.const;if(typeof a=="string")return`${n}: ${a}`}}return"const"in e&&typeof e.const=="string"?e.const:e.type?(Array.isArray(e.type)?e.type:[e.type]).join(" | "):r}function Yn(e,t,r){const n=Vi(e,t,r);return n.matchingBranch!==-1?n.matchingBranch:-1}function zi(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 Fi(e,t,r){if(!t.discriminator||!r||typeof r!="object")return null;const{discriminator:n,type:s}=t;if(s==="openapi"){const a=n,o=r[a.propertyName];if(o==null)return null;if(a.mapping&&a.mapping[o]){const u=a.mapping[o];return Li(e,u)}return Zn(e,a.propertyName,o)}if(s==="beatui"){const a=n,o=r[a.key];if(o==null)return null;if(a.mapping&&a.mapping[o]!=null){const u=a.mapping[o];return u>=0&&u<e.length?u:null}return Zn(e,a.key,o)}return null}function Li(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 Zn(e,t,r){for(let n=0;n<e.length;n++){const s=e[n];if(typeof s!="object")continue;const a=s.properties;if(a&&a[t]){const o=a[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(s.const===r)return n}return null}function Vs({ctx:e,controller:t}){const r=e.definition.anyOf;return Ds({ctx:e,controller:t,kind:"anyOf",variants:r})}function Ms({ctx:e,controller:t}){const r=e.definition.oneOf;return Ds({ctx:e,controller:t,kind:"oneOf",variants:r})}function Ui({ctx:e,controller:t}){const n=e.definition.allOf.filter(u=>typeof u=="object").map(u=>Cs(u,e.schema,e.ajv)),{mergedSchema:s,conflicts:a}=Ft(n,e.path),o=e.with({definition:s,schemaConflicts:[...e.schemaConflicts,...a]});return Pe({ctx:o,controller:t})}function Ds({ctx:e,controller:t,kind:r,variants:n}){const s=n.map((g,l)=>Di(g,l,`${r} ${l+1}`)),a=typeof e.definition=="boolean"?{discriminator:null,type:null}:zi(e.definition),o=O.computedOf(t.signal,e.ajv)((g,l)=>{if(r==="oneOf"){if(a.discriminator){const f=Fi(n,a,g);if(f!==null)return f}return Yn(e,g,l)}return Yn(e,g,l)}),u=O.Value.get(o),d=O.prop(u>=0?u:0);t.onDispose(d.dispose);let y=!1;const h=o.on(g=>{!y&&g>=0&&d.set(g)});t.onDispose(h);const v=n.length,$=g=>{y=!0,d.set(g)},S=v>1?Ps({options:n.map((g,l)=>({value:l,label:s[l]})),selected:d,onChange:$}):"",w=O.MapSignal(d,g=>Pe({ctx:e.with({definition:n[O.Value.get(g)],suppressLabel:!e.isRoot}),controller:t}));return Os({ctx:e,showSelector:v>1,selector:S,inner:w})}function Pe({ctx:e,controller:t}){const r=typeof e.definition=="boolean"?{}:e.definition;let n=r?.$ref?ks(r,e.schema):r,s=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($=>Cs($,e.schema,e.ajv)),{mergedSchema:d,conflicts:y}=Ft(u,e.path),{allOf:h,...v}=n;n={...v,...d},s=e.with({definition:n,schemaConflicts:[...e.schemaConflicts,...y]})}}let a=[...s.notViolations];if(n?.not!=null&&typeof n.not=="object"){const o=O.Value.get(t.signal),u=ws(n.not,o,s.ajv,s.path);u&&(a=[...a,u],s=s.with({notViolations:a}))}if(n==null)return le(s,t,ne(s,Fe({ctx:s,controller:t}),t));if(n.enum!=null)return le(s,t,ne(s,Ts({ctx:s,controller:t}),t));if(n.const!=null)return le(s,t,ne(s,qs({ctx:s,controller:t}),t));if(n.anyOf!=null)return le(s,t,ne(s,Vs({ctx:s,controller:t}),t));if(n.oneOf!=null)return le(s,t,ne(s,Ms({ctx:s,controller:t}),t));if(n?.type==null)return ne(s,Fe({ctx:s,controller:t}),t);if(Array.isArray(n.type)){const u=n.type.filter(d=>d!=="null");if(u.length===1&&["string","number","integer","boolean"].includes(u[0]))switch(u[0]){case"number":return ne(s,ze({ctx:s,controller:t}),t);case"integer":return ne(s,It({ctx:s,controller:t}),t);case"string":return ne(s,Ct({ctx:s,controller:t}),t);case"boolean":return ne(s,At({ctx:s,controller:t}),t)}return le(s,t,ne(s,_r({ctx:s,controller:t}),t))}switch(n.type){case"number":return le(s,t,ne(s,ze({ctx:s,controller:t}),t));case"integer":return le(s,t,ne(s,It({ctx:s,controller:t}),t));case"string":return le(s,t,ne(s,Ct({ctx:s,controller:t}),t));case"boolean":return le(s,t,ne(s,At({ctx:s,controller:t}),t));case"array":return le(s,t,ne(s,br({ctx:s,controller:t instanceof D.ArrayController?t:t.array()}),t));case"object":{const o=vr({ctx:s,controller:t instanceof D.ObjectController?t:t.object()});return s.isRoot?le(s,t,ne(s,o,t)):le(s,t,ne(s,O.html.div(O.attr.class("bc-json-schema-object"),o),t))}case"null":return le(s,t,ne(s,gr({controller:t}),t));default:return console.warn("Unknown type",n.type),le(s,t,ne(s,O.html.div(O.attr.class("bc-json-schema-unknown"),"Unknown"),t))}}function zs({schema:e,controller:t,ajv:r}){const n=new Lt({schema:e,definition:e,horizontal:!1,isPropertyRequired:!1,path:[],ajv:r});return e===!0?Fe({ctx:n,controller:t}):e===!1?O.Fragment():Pe({ctx:n,controller:t})}function le(e,t,r){return Is(e.definition)?Si({ctx:e,controller:t,children:r,options:{behavior:"hide",clearOnHide:!1}}):r}function Ki(e){return e.prefixItems!=null?{isTuple:!0,prefixItems:e.prefixItems,additionalItemsSchema:Array.isArray(e.items)?!0:e.items??!0,tupleLabels:Qn(e)}:Array.isArray(e.items)?{isTuple:!0,prefixItems:e.items,additionalItemsSchema:e.additionalItems??!0,tupleLabels:Qn(e)}:{isTuple:!1,prefixItems:[],additionalItemsSchema:e.items??!0}}function Qn(e){if(typeof e=="boolean")return;const t=e["x:ui"];return Array.isArray(t?.tupleLabels)?t.tupleLabels:void 0}function br({ctx:e,controller:t}){const r=e.definition,n=Ki(r),s=O.computedOf(t.signal)(h=>{const v=h?.length??0;return!(r.maxItems!=null&&v>=r.maxItems||n.isTuple&&v>=n.prefixItems.length&&n.additionalItemsSchema===!1)}),a=O.computedOf(t.signal)(h=>{const v=h?.length??0;return r.minItems==null||v>r.minItems}),o=O.computedOf(t.signal)(h=>{if(!r.uniqueItems||!h)return new Set;const v=new Map,$=new Set;for(let S=0;S<h.length;S++){const w=JSON.stringify(h[S]);v.has(w)?($.add(v.get(w)),$.add(S)):v.set(w,S)}return $}),u=O.computedOf(t.signal)(h=>{if(!r.contains||!h)return{matchingIndices:new Set,count:0,isValid:!0};const v=new Set;let $=0;if(e.ajv)try{const l=e.ajv.compile(r.contains);for(let f=0;f<h.length;f++)l(h[f])&&(v.add(f),$++)}catch{}else{const l=r.contains,f=i=>{if(typeof l=="boolean")return l;if(typeof l!="object"||l==null)return!1;const c=l,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<h.length;i++)f(h[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}}),d=r.contains?u.map(h=>{const v=typeof r.contains=="object"&&r.contains.title?r.contains.title:"required pattern";if(!h.isValid){if(h.count<(h.minContains??0))return`Must contain at least ${h.minContains??0} item(s) matching ${v} (currently ${h.count})`;if(h.maxContains!=null&&h.count>h.maxContains)return`Must contain at most ${h.maxContains} item(s) matching ${v} (currently ${h.count})`}return`Contains ${h.count} item(s) matching ${v}`}):null,y=J.ListControl({...we({ctx:e}),createItem:()=>{const h=t.signal.value?.length??0;if(n.isTuple&&h<n.prefixItems.length){const v=n.prefixItems[h];return De(v,()=>{})}else return De(n.additionalItemsSchema,()=>{})},controller:t,showAdd:!0,addDisabled:O.computedOf(s)(h=>!h),showRemove:!0,removeDisabled:O.computedOf(a)(h=>!h),element:h=>{const v=h.item,$=h.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=Pe({ctx:e.with({definition:S}).append($),controller:v}),l=o.map(p=>p.has($)),f=u.map(p=>p.matchingIndices.has($));let i=g;w&&n.isTuple&&(i=D.Stack(O.attr.class("bc-stack--gap-1"),D.Label(O.attr.class("bc-array-control__item-label"),w),i));const c=[];return r.uniqueItems&&c.push(O.When(l,()=>D.Label(O.attr.class("bc-array-control__indicator bc-array-control__indicator--error"),"⚠️ Duplicate value"))),r.contains&&c.push(O.When(f,()=>D.Label(O.attr.class("bc-array-control__indicator bc-array-control__indicator--success"),"✓ Matches required pattern"))),c.length>0?D.Stack(O.attr.class("bc-stack--gap-1"),i,...c):i}});return r.contains&&d?D.Stack(O.attr.class("bc-stack--gap-2"),y,O.MapSignal(O.computedOf(u,d)((h,v)=>({info:h,summary:v})),({info:h,summary:v})=>D.Label(O.attr.class(h.isValid?"bc-array-control__summary bc-array-control__summary--success":"bc-array-control__summary bc-array-control__summary--error"),v))):y}function Ji(e){return e.map(t=>({key:t,label:J._t(t),detect:r=>oi(r,[t])===t,convert:r=>ui(r,t),defaultValue:()=>ci(t)}))}function _r({ctx:e,controller:t}){const r=e.definition;let n=r.type??[];const s=li(r),a=n.includes("null"),o=n.filter(S=>S!=="null"&&(S==="string"||S==="number"||S==="integer"||S==="boolean")),u=a&&o.length===n.length-1;u&&(n=o);const d=Ji(n),y=new J.UnionController(t.path,t.change,t.signal,t.status,{disabled:t.disabled},d);t.onDispose(()=>y.dispose());const h=S=>Ps({options:n.map(w=>({value:w,label:J._t(w)})),selected:y.activeBranch,onChange:S,mode:s.selector??"auto"}),v=S=>{y.switchToBranch(S,s.confirmBranchChange)},$=O.MapSignal(y.activeBranch,S=>{const w=O.Value.get(S),g=y.getBranchController(w);if(u&&(w==="number"||w==="integer")){const f=r;return D.Control(J.NullableNumberInput,{...we({ctx:e.with({suppressLabel:!e.isRoot})}),controller:g,min:f.minimum,max:f.maximum,step:w==="integer"?Es(f.multipleOf):f.multipleOf})}const l=e.with({definition:{...r,type:w},suppressLabel:!e.isRoot});switch(w){case"string":return Ct({ctx:l,controller:g});case"number":return ze({ctx:l,controller:g});case"integer":return It({ctx:l,controller:g});case"boolean":return At({ctx:l,controller:g});case"null":return gr({controller:g});case"array":{const f=g.array();return br({ctx:l,controller:f})}case"object":{const f=g.object();return vr({ctx:l,controller:f})}default:return D.Control(J.NullableNumberInput,{...we({ctx:l}),controller:g})}});return Os({ctx:e,showSelector:n.length>1,selector:h(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}):_r({ctx:e.with({definition:{...e.definition,type:["string","number","object","array","boolean","null"]}}),controller:t})}function Wi(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 Bi(e,t,r=!1){const n=[],s=[...t].sort((a,o)=>(o.priority||0)-(a.priority||0));for(const a of s)if(!(a.onSubmitOnly&&!r))try{const o={};for(const d of a.fields)o[d]=xi(e,d);const u=a.validate(o,e);if(!u.valid){const d=a.targets||a.fields;if(u.fieldErrors)for(const[y,h]of Object.entries(u.fieldErrors))n.push({instancePath:`/${y}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields,context:u.context},message:h});else{const y=u.message||a.message||"Cross-field validation failed";for(const h of d)n.push({instancePath:`/${h}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields,context:u.context},message:y})}}}catch(o){console.warn(`Error in cross-field validation rule ${a.id}:`,o);const u=a.targets?.[0]||a.fields[0];n.push({instancePath:`/${u}`,schemaPath:`#/x:ui/crossField/${a.id}`,keyword:"crossField",params:{ruleId:a.id,fields:a.fields},message:"Cross-field validation error"})}return n.length>0?Dt(n):D.a.valid}function xi(e,t){if(e==null||typeof e!="object")return;const r=t.split(".");let n=e;for(const s of r){if(n==null||typeof n!="object")return;if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else n=n[s]}return n}function Hi(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(s=>typeof s=="object"&&s!=null&&"watch"in s&&"condition"in s)),Array.isArray(t.crossField)&&(r.crossField=t.crossField.filter(s=>typeof s=="object"&&s!=null&&Array.isArray(s.fields)&&typeof s.validate=="function"));const n=Wi(e);return n.length>0&&(r.crossFieldRules=n),Array.isArray(t.async)&&(r.async=t.async.filter(s=>typeof s=="object"&&s!=null&&typeof s.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 s of r){if(n==null)return;if(typeof n=="object"&&!Array.isArray(n))n=n[s];else if(Array.isArray(n)){const a=parseInt(s,10);if(!isNaN(a))n=n[a];else return}else return}return n}function Gi(e,t){try{if(typeof e.condition=="function"){const n=(Array.isArray(e.watch)?e.watch:[e.watch]).map(s=>cr(s,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 Xi(e,t,r,n){const s=[];if(n&&!n(e)&&n.errors&&s.push(...n.errors),r.when){for(const a of r.when)if(Gi(a,t)?a.then:a.else,a.validate)try{const u=a.validate(e,t);u&&s.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 a of r.crossField)try{const o={};for(const d of a.fields)o[d]=cr(`$.${d}`,t);const u=a.validate(o,t);if(u){const d=a.target||a.fields[0];s.push({instancePath:`/${d}`,schemaPath:"#/x:ui/crossField",keyword:"crossField",params:{fields:a.fields},message:a.message||u})}}catch(o){console.warn("Error in cross-field validation:",o)}if(r.crossFieldRules&&r.crossFieldRules.length>0){const a=Bi(t,r.crossFieldRules);if(a.type==="invalid"){const o=Yi(a);s.push(...o)}}return s.length>0?Dt(s):D.a.valid}function Yi(e){if(e.type==="valid")return[];const t=[];function r(n,s=""){if(n.message&&t.push({instancePath:s,schemaPath:"#/crossField",keyword:"crossField",params:{},message:n.message}),n.dependencies)for(const[a,o]of Object.entries(n.dependencies)){const u=s?`${s}/${a}`:`/${a}`;r(o,u)}}return r(e.error),t}function Zi(e,t){const r=new Set;if(e.when)for(const n of e.when)(Array.isArray(n.watch)?n.watch:[n.watch]).forEach(a=>r.add(a));if(e.crossField)for(const n of e.crossField)n.fields.forEach(s=>r.add(s));return{watchedPaths:Array.from(r),shouldRevalidate:n=>Array.from(r).some(s=>n.startsWith(s)||s.startsWith(n))}}function Qi(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 eo{timeouts=new Map;validationStates=new Map;abortControllers=new Map;getValidationState(t){return this.validationStates.has(t)||this.validationStates.set(t,O.prop({isValidating:!1,result:D.a.valid,lastValidatedValue:void 0,lastValidatedAt:0})),this.validationStates.get(t)}async validateField(t,r,n,s=!1){const a=`${t.field}_${t.id}`,o=this.getValidationState(a),u=this.timeouts.get(a);u!==void 0&&clearTimeout(u);const d=this.abortControllers.get(a);if(d&&d.abort(),!s&&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 h=new AbortController;this.abortControllers.set(a,h),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(h.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(h.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(a),this.timeouts.delete(a)}},s?0:t.debounce||300);this.timeouts.set(a,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 s=n.value;!s.isValidating&&s.result.type==="invalid"&&(t[r]=s.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 to(e){const t=globalThis.structuredClone;return typeof t=="function"?t(e):JSON.parse(JSON.stringify(e))}function ro(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return e===t}}function no({schema:e,initialValue:t,externalSchemas:r,refResolver:n,sanitizeAdditional:s,validationMode:a,validateDebounceMs:o},u){return O.Async($s(e,{externalSchemas:r,refResolver:n,sanitizeAdditional:s}),d=>{if(d.ok){const{ajv:y,validate:h}=d.value,v=Hi(e),$=Qi(e),S=$.length>0?new eo:null,w=a??"touchedOrSubmit",g=F=>{const A=h(F);let z;return A?z=D.a.valid:z=Dt(h.errors??[]),v?Xi(F,F,v,h):z},{controller:l,setStatus:f}=D.useController({initialValue:t,validationMode:w,validateDebounceMs:o,validate:w==="onSubmit"?void 0:g}),i=v?Zi(v):null,c=s!==!1;let p=!1;const b=c?l.signal.on(F=>{if(p)return;const A=to(F);h(A)&&!ro(A,F)&&(p=!0,l.change(A),p=!1)}):()=>{},_=i?l.signal.on((F,A)=>{A!=null&&JSON.stringify(F)!==JSON.stringify(A)&&setTimeout(()=>{const U=l.status.value;f(U)},10)}):()=>{},P=S&&$.length>0?l.signal.on(F=>{for(const A of $)S.validateField(A,F,F)}):()=>{},I=()=>{b(),_(),P(),S?.dispose(),l.dispose()},V=O.Fragment(O.OnDispose(I),zs({schema:e,controller:l,ajv:y}));return u({Form:V,controller:l,setStatus:f})}return O.html.div(O.attr.class("bc-json-schema-form__error"),d.error)})}var Fs=ys();const Ls=lr(Fs),so=Js({__proto__:null,default:Ls},[Fs]);function ao(e,t){const n=(t?.ajv??new Ls({allErrors:!0})).compile(e);return{"~standard":{version:1,vendor:"ajv",validate:s=>n(s)?{value:s}:{issues:io(n.errors??[])},types:void 0}}}function io(e){return e.map(t=>({message:oo(t),path:uo(t)}))}function oo(e){return e.message??`${e.keyword} validation failed`}function uo(e){const t=co(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 co(e){return e?e.split("/").slice(1).map(r=>r.replace(/~1/g,"/").replace(/~0/g,"~")).map(r=>lo(r)?Number(r):r):[]}function lo(e){return/^\d+$/.test(e)}exports.JSONSchemaAllOf=Ui;exports.JSONSchemaAny=Fe;exports.JSONSchemaAnyOf=Vs;exports.JSONSchemaArray=br;exports.JSONSchemaBoolean=At;exports.JSONSchemaConst=qs;exports.JSONSchemaControl=zs;exports.JSONSchemaEnum=Ts;exports.JSONSchemaForm=no;exports.JSONSchemaGenericControl=Pe;exports.JSONSchemaInteger=It;exports.JSONSchemaNull=gr;exports.JSONSchemaNumber=ze;exports.JSONSchemaObject=vr;exports.JSONSchemaOneOf=Ms;exports.JSONSchemaString=Ct;exports.JSONSchemaUnion=_r;exports.SchemaContext=Lt;exports.ajvErrorsToControllerValidation=Dt;exports.ajvErrorsToDependencies=bs;exports.buildMessage=vs;exports.buildPath=gs;exports.clearCaches=xa;exports.clearCachesForAjv=Ha;exports.compileWithCache=zt;exports.composeEffectiveObjectSchema=Ss;exports.createAJVStandardSchema=ao;exports.evaluateIfThenElseOverlay=hr;exports.evaluateNotViolation=ws;exports.getAjvForSchema=$s;exports.getCacheStats=Ga;exports.getDefaultExportFromCjs=lr;exports.getEvaluatedProperties=Ae;exports.jsonPointerToSegments=dr;exports.mergeAllOf=Ft;exports.requireApplicator=fs;exports.requireCodegen=H;exports.requireCompile=Mt;exports.requireCore=ns;exports.requireCore$1=as;exports.requireDependencies=cs;exports.requireDiscriminator=ps;exports.requireDraft7=ms;exports.requireFormat=ds;exports.requireMetadata=hs;exports.requireNames=Se;exports.requireRef=ss;exports.requireRef_error=Ue;exports.requireUtil=Q;exports.requireValidate=Le;exports.requireValidation=is;exports.requireValidation_error=Vt;
|