var Mt,En;function bt(){if(En)return Mt;En=1;class i extends String{}const L=new Set(["","="]),J=e=>`\\u${e.toString(16).padStart(4,"0")}`,f=e=>{if([1/0,-1/0,NaN,void 0,null].includes(e))return`${e}`;if(!["string","boolean","number"].includes(typeof e)){if(typeof e!="object")throw new Error("Unexpected value type");const s=Object.getPrototypeOf(e);if(!(s===Array.prototype&&Array.isArray(e)||s===Object.prototype))throw new Error("Unexpected object given as value")}return JSON.stringify(e).replace(/([{,])"__proto__":/g,'$1["__proto__"]:').replace(/[^\\]"__proto__":/g,()=>{throw new Error("Unreachable")}).replace(/[\u2028\u2029]/g,s=>J(s.charCodeAt(0)))},b=(e,...c)=>{const s=e.replace(/%[%drscjw]/g,a=>{if(a==="%%")return"%";if(c.length===0)throw new Error("Unexpected arguments count");const d=c.shift();switch(a){case"%d":if(typeof d=="number")return d;throw new Error("Expected a number");case"%r":if(d instanceof RegExp)return b("new RegExp(%j, %j)",d.source,d.flags);throw new Error("Expected a RegExp instance");case"%s":if(d instanceof i)return d;throw new Error("Expected a safe string");case"%c":if(L.has(d))return d;throw new Error("Expected a compare op");case"%j":return f(d);case"%w":if(Number.isInteger(d)&&d>=0)return" ".repeat(d);throw new Error("Expected a non-negative integer for indentation")}throw new Error("Unreachable")});if(c.length!==0)throw new Error("Unexpected arguments count");return new i(s)},w=e=>{if(!/^[a-z][a-z0-9_]*$/i.test(e))throw new Error("Does not look like a safe id");return new i(e)},g=e=>(...c)=>{if(!c.every(s=>s instanceof i))throw new Error("Unsafe arguments");return new i(e(...c))},M=e=>/^[a-z][a-z0-9_().]*$/i.test(e)||/^\([^()]+\)$/i.test(e)?e:b("(%s)",e),X=g((...e)=>e.some(c=>`${c}`=="true")?"true":e.join(" || ")||"false"),re=g((...e)=>e.some(c=>`${c}`=="false")?"false":e.join(" && ")||"true"),H=e=>`${e}`=="true"?w("false"):`${e}`=="false"?w("true"):b("!%s",M(e));return Mt={format:b,safe:w,safeand:re,safenot:H,safenotor:(...e)=>H(X(...e))},Mt}var Dt,xn;function Nn(){if(xn)return Dt;xn=1;const{safe:i}=bt(),L=new WeakMap;return Dt={scopeMethods:f=>{L.has(f)||L.set(f,{sym:new Map,ref:new Map,format:new Map,pattern:new Map});const b=L.get(f),w=h=>{b.sym.get(h)||b.sym.set(h,0);const e=b.sym.get(h);return b.sym.set(h,e+1),i(`${h}${e}`)},g=h=>{if(b.pattern.has(h))return b.pattern.get(h);const e=w("pattern");return f[e]=new RegExp(h,"u"),b.pattern.set(h,e),e};return b.loop||(b.loop="ijklmnopqrstuvxyz".split("")),{gensym:w,genpattern:g,genloop:()=>{const h=b.loop.shift();return b.loop.push(`${h}${h[0]}`),i(h)},getref:h=>b.ref.get(h),genref:h=>{const e=w("ref");return b.ref.set(h,e),e},genformat:h=>{let e=b.format.get(h);return e||(e=w("format"),f[e]=h,b.format.set(h,e)),e}}}},Dt}var Tt,Sn;function Jt(){if(Sn)return Tt;Sn=1;const i=e=>/[\uD800-\uDFFF]/.test(e)?[...e].length:e.length,L=(e,c,s,a)=>{if(e%c===0)return!0;let d=e*s;if((d===1/0||d===-1/0)&&(d=e),d%a===0)return!0;const y=Math.floor(d+.5);return y/s===e&&y%a===0},J=(e,c)=>{if(e===c)return!0;if(!e||!c||typeof e!=typeof c||e!==c&&typeof e!="object")return!1;const s=Object.getPrototypeOf(e);if(s!==Object.getPrototypeOf(c))return!1;if(s===Array.prototype)return!Array.isArray(e)||!Array.isArray(c)||e.length!==c.length?!1:e.every((a,d)=>J(a,c[d]));if(s===Object.prototype){const[a,d]=[Object.keys(e),Object.keys(c)];return a.length!==d.length?!1:new Set([...a,...d]).size===a.length&&a.every(A=>J(e[A],c[A]))}return!1},f=e=>{if(e.length20?new Set:null;let a=0,d=0;for(const y of e){if(typeof y=="object")c.push(y);else if(s){if(s.add(y),s.size!==++a)return!1}else if(e.indexOf(y,d+1)!==-1)return!1;d++}for(let y=1;y{if(typeof Bufferc.charCodeAt(a)))},w=Function.prototype.call.bind(Object.prototype.hasOwnProperty);w[Symbol.for("toJayString")]="Function.prototype.call.bind(Object.prototype.hasOwnProperty)";const g=e=>/~\//.test(e)?`${e}`.replace(/~/g,"~0").replace(/\//g,"~1"):e;return Tt={stringLength:i,isMultipleOf:L,deepEqual:J,unique:f,deBase64:b,hasOwn:w,...{toPointer:e=>e.length===0?"#":`#/${e.map(g).join("/")}`,pointerPart:g,errorMerge:({keywordLocation:e,instanceLocation:c},s,a)=>({keywordLocation:`${s}${e.slice(1)}`,instanceLocation:`${a}${c.slice(1)}`}),propertyIn:(e,[c,s])=>c.includes(!0)||c.some(a=>a===e)||s.some(a=>new RegExp(a,"u").test(e)),dynamicResolve:(e,c)=>(e.filter(s=>s[c])[0]||{})[c]}},Tt}var zt,qn;function Cn(){if(qn)return zt;qn=1;const{format:i,safe:L}=bt(),{scopeMethods:J}=Nn(),f=Jt(),b=new Map(Object.entries({null:e=>i("%s === null",e),boolean:e=>i('typeof %s === "boolean"',e),array:e=>i("Array.isArray(%s)",e),object:e=>i('typeof %s === "object" && %s && !Array.isArray(%s)',e,e,e),number:e=>i('typeof %s === "number"',e),integer:e=>i("Number.isInteger(%s)",e),string:e=>i('typeof %s === "string"',e)})),w=({name:e,parent:c,keyval:s,keyname:a})=>{if(e){if(c||s||a)throw new Error("name can be used only stand-alone");return e}if(!c)throw new Error("Can not use property of undefined parent!");const d=w(c);if(s!==void 0){if(a)throw new Error("Can not use key value and name together");if(!["string","number"].includes(typeof s))throw new Error("Invalid property path");return/^[a-z][a-z0-9_]*$/i.test(s)?i("%s.%s",d,L(s)):i("%s[%j]",d,s)}else if(a)return i("%s[%s]",d,a);throw new Error("Unreachable")},g=new Set([].concat(...[Object,Array,String,Number,Boolean].map(e=>Object.getOwnPropertyNames(e.prototype)))),M=(e,c,s,{unmodifiedPrototypes:a,isJSON:d},y)=>{const{gensym:A,genpattern:D,genloop:C}=J(c,s);return{present:j=>{const P=w(j),{parent:S,keyval:F,keyname:Q,inKeys:B,checked:te}=j;if(te||B&&d)throw new Error("Unreachable: useless check for undefined");if(B)return i("%s !== undefined",P);if(S&&Q){c.hasOwn=f.hasOwn;const ne=w(S);return d?i("%s !== undefined && hasOwn(%s, %s)",P,ne,Q):i("%s in %s && hasOwn(%s, %s)",Q,ne,ne,Q)}else if(S&&F!==void 0){if(a&&d&&!g.has(`${F}`))return i("%s !== undefined",P);c.hasOwn=f.hasOwn;const ne=w(S);return d?i("%s !== undefined && hasOwn(%s, %j)",P,ne,F):i("%j in %s && hasOwn(%s, %j)",F,ne,ne,F)}throw new Error("Unreachable: present() check without parent")},forObjectKeys:(j,P)=>{const S=A("key");e.block(i("for (const %s of Object.keys(%s))",S,w(j)),()=>{P(s(j,S,!0),S)})},forArray:(j,P,S)=>{const F=C(),Q=w(j);e.block(i("for (let %s = %s; %s {S(s(j,F,a,!0),F)})},patternTest:(j,P)=>{const S=j.replace(/[.^$|*+?(){}[\]\\]/gu,"");if(j===`^${S}$`)return i("(%s === %j)",P,j.slice(1,-1));if(y.has(j))return i("true");if([S,`${S}+`,`${S}.*`,`.*${S}.*`].includes(j))return i("%s.includes(%j)",P,S);if([`^${S}`,`^${S}+`,`^${S}.*`].includes(j))return i("%s.startsWith(%j)",P,S);if([`${S}$`,`.*${S}$`].includes(j))return i("%s.endsWith(%j)",P,S);const F=[...S].slice(0,-1).join("");return[`${S}*`,`${S}?`].includes(j)?F.length===0?i("true"):i("%s.includes(%j)",P,F):[`^${S}*`,`^${S}?`].includes(j)?F.length===0?i("true"):i("%s.startsWith(%j)",P,F):i("%s.test(%s)",D(j),P)},compare:(j,P)=>{if(!P||typeof P!="object")return i("%s === %j",j,P);let S;const F=Q=>Q.length!B||typeof B!="object");if(Array.isArray(P)){if(S=b.get("array")(j),F(P)){let Q=i("%s.length === %d",j,P.length);for(let B=0;B0&&(c.hasOwn=f.hasOwn);for(const ne of Q)te=i("%s && hasOwn(%s, %j)",te,j,ne);for(const ne of Q)te=i("%s && %s[%j] === %j",te,j,ne,P[ne]);return i("%s && %s",S,te)}}return c.deepEqual=f.deepEqual,i("%s && deepEqual(%s, %j)",S,j,P)},propvar:s}},X=/^\([^)]*\) *=>/,re=/^[^=]*=>/,H=Symbol.for("toJayString");function h(e){if(typeof e=="function"){if(e[H])return e[H];if(Object.getPrototypeOf(e)!==Function.prototype)throw new Error("Can not stringify: a function with unexpected prototype");const c=`${e}`;if(e.prototype){if(!/^function[ (]/.test(c))throw new Error("Unexpected function");return c}if(X.test(c)||re.test(c))return c;throw new Error("Can not stringify: only either normal or arrow functions are supported")}else if(typeof e=="object"){const c=Object.getPrototypeOf(e);if(e instanceof RegExp&&c===RegExp.prototype)return i("%r",e);throw new Error("Can not stringify: an object with unexpected prototype")}throw new Error(`Can not stringify: unknown type ${typeof e}`)}return zt={types:b,buildName:w,jsHelpers:M,jaystring:h},zt}var Nt,Pn;function Fn(){if(Pn)return Nt;Pn=1;const{format:i,safe:L,safenot:J}=bt(),{jaystring:f}=Cn(),b=/[{[]/,w=/[}\]]/;return Nt=()=>{const g=[];let M=0;const X=h=>{w.test(h.trim()[0])&&M--,g.push({indent:M,code:h}),b.test(h[h.length-1])&&M++},re=()=>{if(M!==0)throw new Error("Unexpected indent at build()");const h=g.map(e=>i("%w%s",e.indent*2,e.code)).join(`
`);return/^[a-z][a-z0-9]*$/i.test(h)?`return ${h}`:`return (${h})`},H=h=>{const e=Object.entries(h);for(const[c,s]of e){if(!/^[a-z][a-z0-9]*$/i.test(c))throw new Error("Unexpected scope key!");if(!(typeof s=="function"||s instanceof RegExp))throw new Error("Unexpected scope value!")}return e};return{optimizedOut:!1,size:()=>g.length,write(h,...e){if(typeof h!="string")throw new Error("Format must be a string!");if(h.includes(`
`))throw new Error("Only single lines are supported");return X(i(h,...e)),!0},block(h,e,c=!1){const s=M;this.write("%s {",h);const a=g.length;if(e(),a===g.length)return g.pop(),M=s,!1;if(a===g.length-1&&!c){const{code:d}=g[g.length-1];if(!/^(if|for) /.test(d))return g.length-=2,M=s,this.write("%s %s",h,d)}return this.write("}")},if(h,e,c){`${h}`=="false"?(c&&c(),e&&(this.optimizedOut=!0)):`${h}`=="true"?(e&&e(),c&&(this.optimizedOut=!0)):e&&this.block(i("if (%s)",h),e,!!c)?c&&this.block(i("else"),c):c&&this.if(J(h),c)},makeModule(h={}){return`(function() {
'use strict'
${H(h).map(([c,s])=>`const ${L(c)} = ${f(s)};`).join(`
`)}
${re()}})()`},makeFunction(h={}){const e=H(h),c=e.map(a=>a[0]),s=e.map(a=>a[1]);return Function(...c,`'use strict'
${re()}`)(...s)}}},Nt}var Ct,Rn;function Un(){if(Rn)return Ct;Rn=1;const i=["$schema","$vocabulary","id","$id","$anchor","$ref","definitions","$defs","$recursiveRef","$recursiveAnchor","$dynamicAnchor","$dynamicRef","type","required","default","enum","const","not","allOf","anyOf","oneOf","if","then","else","maximum","minimum","exclusiveMaximum","exclusiveMinimum","multipleOf","divisibleBy","items","maxItems","minItems","additionalItems","prefixItems","contains","minContains","maxContains","uniqueItems","maxLength","minLength","format","pattern","contentEncoding","contentMediaType","contentSchema","properties","maxProperties","minProperties","additionalProperties","patternProperties","propertyNames","dependencies","dependentRequired","dependentSchemas","propertyDependencies","unevaluatedProperties","unevaluatedItems","title","description","deprecated","readOnly","writeOnly","examples","$comment","example","discriminator","removeAdditional"],J=["draft/next","draft/2020-12","draft/2019-09","draft-07","draft-06","draft-04","draft-03"].map(g=>`https://json-schema.org/${g}/schema`),f=["core","applicator","validation","meta-data","format","content"],b=["core","applicator","unevaluated","validation","meta-data","format-annotation","format-assertion","content"],w=[...f.map(g=>`https://json-schema.org/draft/2019-09/vocab/${g}`),...b.map(g=>`https://json-schema.org/draft/2020-12/vocab/${g}`)];return Ct={knownKeywords:i,schemaVersions:J,knownVocabularies:w},Ct}var Ft,In;function Ln(){if(In)return Ft;In=1;const{knownKeywords:i}=Un();function L(d,y,A,D="keys"){if(!d.has(y))return d.set(y,A);if(d.get(y)!==A)throw new Error(`Conflicting duplicate ${D}: ${y}`)}function J(d){return d.includes("~")?d.replace(/~[01]/g,y=>{switch(y){case"~1":return"/";case"~0":return"~"}throw new Error("Unreachable")}):d}function f(d,y,A){if(typeof d!="object")throw new Error("Invalid input object");if(typeof y!="string")throw new Error("Invalid JSON pointer");const D=y.split("/");if(!["","#"].includes(D.shift()))throw new Error("Invalid JSON pointer");if(D.length===0)return d;let C=d;for(const Z of D){if(typeof Z!="string")throw new Error("Invalid JSON pointer");A&&A.push(C);const O=J(Z);if(typeof C!="object"||!Object.prototype.hasOwnProperty.call(C,O))return;C=C[O]}return C}const b=/^https?:\/\//;function w(d,y){if(typeof d!="string"||typeof y!="string")throw new Error("Unexpected path!");if(y.length===0)return d;const A=d.replace(/#.*/,"");return y.startsWith("#")?`${A}${y}`:!A.includes("/")||b.test(y)?y:b.test(A)?`${new URL(y,A)}`:y.startsWith("/")?y:[...A.split("/").slice(0,-1),y].join("/")}function g(d){return d.map(A=>A&&(A.$id||A.id)||"").filter(A=>A&&typeof A=="string").reduce(w,"")}const M=["properties","patternProperties","$defs","definitions"],X=["const","enum","examples","example","comment"],re=Symbol("skip");function H(d,y){const A=(D,C=!1)=>{if(!D||typeof D!="object")return;const Z=y(D);if(Z!==void 0)return Z===re?void 0:Z;for(const O of Object.keys(D)){if(!C&&!Array.isArray(D)&&!i.includes(O)||!C&&X.includes(O))continue;const se=A(D[O],!C&&M.includes(O));if(se!==void 0)return se}};return A(d)}function h(d,y,A,D=""){const C=w(D,A),Z=[],[O,se=""]=C.split("#"),V=decodeURI(se),be=(j,P,S=!1,F=!1)=>{if(!j||typeof j!="object")return;const Q=j.$id||j.id;let B=P;if(Q&&typeof Q=="string"){if(B=w(B,Q),B===C||B===O&&V==="")Z.push([j,d,P]);else if(B===O&&V[0]==="/"){const ne=[],ot=f(j,V,ne);ot!==void 0&&Z.push([ot,d,w(P,g(ne))])}}const te=F?j.$dynamicAnchor:j.$anchor;if(te&&typeof te=="string"){if(te.includes("#"))throw new Error("$anchor can't include '#'");if(te.startsWith("/"))throw new Error("$anchor can't start with '/'");B=w(B,`#${te}`),B===C&&Z.push([j,d,P])}for(const ne of Object.keys(j))!S&&!Array.isArray(j)&&!i.includes(ne)||!S&&X.includes(ne)||be(j[ne],B,!S&&M.includes(ne));!F&&j.$dynamicAnchor&&be(j,P,S,!0)};if(be(d,O),O===D.replace(/#$/,"")&&(V[0]==="/"||V==="")){const j=[],P=f(d,V,j);P!==void 0&&Z.push([P,d,g(j)])}if(y.has(O)&&y.get(O)!==d){const j=h(y.get(O),y,`#${se}`,O);Z.push(...j.map(([P,S,F])=>[P,S,w(O,F)]))}return y.has(C)&&Z.push([y.get(C),y.get(C),C]),Z}function e(d){const y=new Map;return H(d,A=>{if(A!==d&&(A.$id||A.id))return re;const D=A.$dynamicAnchor;if(D&&typeof D=="string"){if(D.includes("#"))throw new Error("$dynamicAnchor can't include '#'");if(!/^[a-zA-Z0-9_-]+$/.test(D))throw new Error(`Unsupported $dynamicAnchor: ${D}`);L(y,D,A,"$dynamicAnchor")}}),y}const c=(d,y)=>H(d,A=>Object.keys(A).some(D=>y.includes(D))||void 0)||!1,s=(d,y,A=!1)=>{if(!Array.isArray(y))throw new Error("Expected an array of schemas");for(const D of y)H(D,C=>{const Z=C.$id||C.id,O=Z&&typeof Z=="string"?Z.replace(/#$/,""):null;if(O&&O.includes("://")&&!O.includes("#"))L(d,O,C,"schema $id in 'schemas'");else if(C===D&&!A)throw new Error("Schema with missing or invalid $id in 'schemas'")});return d},a=(d,y)=>{if(y)return s(a(d),y,!0);if(d)switch(Object.getPrototypeOf(d)){case Object.prototype:return new Map(Object.entries(d));case Map.prototype:return new Map(d);case Array.prototype:return s(new Map,d)}throw new Error("Unexpected value for 'schemas' option")};return Ft={get:f,joinPath:w,resolveReference:h,getDynamicAnchors:e,hasKeywords:c,buildSchemas:a},Ft}var Ut,Mn;function jr(){if(Mn)return Ut;Mn=1;const i={email:f=>{if(f.length>318)return!1;if(/^[a-z0-9!#$%&'*+/=?^_`{|}~-]{1,20}(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]{1,21}){0,2}@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,60}[a-z0-9])?){0,3}$/i.test(f))return!0;if(!f.includes("@")||/(^\.|^"|\.@|\.\.)/.test(f))return!1;const[w,g,...M]=f.split("@");return!w||!g||M.length!==0||w.length>64||g.length>253||!/^[a-z0-9.-]+$/i.test(g)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(w)?!1:g.split(".").every(X=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(X))},hostname:f=>f.length>(f.endsWith(".")?254:253)?!1:/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*\.?$/i.test(f),date:f=>{if(f.length!==10)return!1;if(f[5]==="0"&&f[6]==="2"){if(/^\d\d\d\d-02-(?:[012][1-8]|[12]0|[01]9)$/.test(f))return!0;const b=f.match(/^(\d\d\d\d)-02-29$/);if(!b)return!1;const w=b[1]|0;return w%16===0||w%4===0&&w%25!==0}return f.endsWith("31")?/^\d\d\d\d-(?:0[13578]|1[02])-31$/.test(f):/^\d\d\d\d-(?:0[13-9]|1[012])-(?:[012][1-9]|[123]0)$/.test(f)},time:f=>{if(f.length>27||!/^(?:2[0-3]|[0-1]\d):[0-5]\d:(?:[0-5]\d|60)(?:\.\d+)?(?:z|[+-](?:2[0-3]|[0-1]\d)(?::?[0-5]\d)?)?$/i.test(f))return!1;if(!/:60/.test(f))return!0;const w=f.match(/([0-9.]+|[^0-9.])/g);let g=Number(w[0])*60+Number(w[2]);return w[5]==="+"?g+=1440-Number(w[6]||0)*60-Number(w[8]||0):w[5]==="-"&&(g+=Number(w[6]||0)*60+Number(w[8]||0)),g%1440===1439},"date-time":f=>{if(f.length>38)return!1;const b=/^\d\d\d\d-(?:0[1-9]|1[0-2])-(?:[0-2]\d|3[01])[t\s](?:2[0-3]|[0-1]\d):[0-5]\d:(?:[0-5]\d|60)(?:\.\d+)?(?:z|[+-](?:2[0-3]|[0-1]\d)(?::?[0-5]\d)?)$/i,w=f[5]==="0"&&f[6]==="2";if(w&&f[8]==="3"||!b.test(f))return!1;if(f[17]==="6"){const g=f.slice(11).match(/([0-9.]+|[^0-9.])/g);let M=Number(g[0])*60+Number(g[2]);if(g[5]==="+"?M+=1440-Number(g[6]||0)*60-Number(g[8]||0):g[5]==="-"&&(M+=Number(g[6]||0)*60+Number(g[8]||0)),M%1440!==1439)return!1}if(w){if(/^\d\d\d\d-02-(?:[012][1-8]|[12]0|[01]9)/.test(f))return!0;const g=f.match(/^(\d\d\d\d)-02-29/);if(!g)return!1;const M=g[1]|0;return M%16===0||M%4===0&&M%25!==0}return f[8]==="3"&&f[9]==="1"?/^\d\d\d\d-(?:0[13578]|1[02])-31/.test(f):/^\d\d\d\d-(?:0[13-9]|1[012])-(?:[012][1-9]|[123]0)/.test(f)},ipv4:f=>f.length{if(f.length>45||f.length=48&&c4)return!1}else if(c===46){if(b>6||w>=3||g===0||X)return!1;w++,g=0}else if(c===58){if(w>0||b>=7)return!1;if(re===58){if(M)return!1;M=!0}else e===0&&(H=!1);b++,g=0,X=!1}else if(c>=97&&c=65&&c0||++g>4)return!1;X=!0}else return!1;re=c}if(b0&&(w!==3||g===0))return!1;if(M&&f.length===2)return!0;if(w>0&&!/(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}$/.test(f))return!1;const h=w>0?6:7;return M?(H||g>0)&&b0},uri:/^[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|1\d\d|[1-9]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})?::)|v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})*)?$/i,"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|1\d\d|[1-9]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})?::)|v[0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\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})*)?$/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,"json-pointer":/^(?:|\/(?:[^~]|~0|~1)*)$/,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:|#|\/(?:[^~]|~0|~1)*)$/,uuid:/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,duration:f=>f.length>1&&f.lengthf.length%4===0&&/^[a-z0-9+/]*={0,3}$/i.test(f),"json-pointer-uri-fragment":/^#(|\/(\/|[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)$/i,"host-name":i.hostname,"ip-address":i.ipv4,color:/^(#[0-9A-Fa-f]{3,6}|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|rgb\(\s*([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\s*,\s*([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\s*\)|rgb\(\s*(\d?\d%|100%)\s*,\s*(\d?\d%|100%)\s*,\s*(\d?\d%|100%)\s*\))$/};return Ut={core:i,extra:L,weak:{regex:f=>{if(f.length>1e5||/[^\\]\\Z/.test(f))return!1;try{return new RegExp(f,"u"),!0}catch{return!1}}}},Ut}var Lt,Dn;function $r(){if(Dn)return Lt;Dn=1;const i=(s,a)=>[...new Set([...s,...a])].sort(),L=(s,a)=>s.filter(d=>a.includes(d)),J=s=>(...a)=>s(...a.map(w)),f=s=>(...a)=>w(s(...a.map(w))),b=(s,a)=>s&&!s.includes(a),w=({type:s=null,dyn:a={},...d})=>({type:s&&[...s].sort(),items:b(s,"array")?1/0:d.items||0,properties:b(s,"object")?[!0]:[...d.properties||[]].sort(),patterns:b(s,"object")?[]:[...d.patterns||[]].sort(),required:b(s,"object")?[]:[...d.required||[]].sort(),fullstring:b(s,"string")||d.fullstring||!1,dyn:{item:b(s,"array")?!1:a.item||!1,items:b(s,"array")?0:Math.max(d.items||0,a.items||0),properties:b(s,"object")?[]:i(d.properties||[],a.properties||[]),patterns:b(s,"object")?[]:i(d.patterns||[],a.patterns||[])},unknown:d.unknown&&!(b(s,"object")&&b(s,"array"))||!1}),g=()=>w({}),M=f((s,a)=>({type:s.type&&a.type?L(s.type,a.type):s.type||a.type||null,items:Math.max(s.items,a.items),properties:i(s.properties,a.properties),patterns:i(s.patterns,a.patterns),required:i(s.required,a.required),fullstring:s.fullstring||a.fullstring,dyn:{item:s.dyn.item||a.dyn.item,items:Math.max(s.dyn.items,a.dyn.items),properties:i(s.dyn.properties,a.dyn.properties),patterns:i(s.dyn.patterns,a.dyn.patterns)},unknown:s.unknown||a.unknown})),X=(s,a)=>a!==!0&&new RegExp(s,"u").test(a),re=({properties:s,patterns:a},{properties:d,patterns:y})=>{const A=s.filter(O=>d.includes(O)||d.includes(!0)||y.some(se=>X(se,O))),D=d.filter(O=>s.includes(O)||s.includes(!0)||a.some(se=>X(se,O))),C=a.filter(O=>y.includes(O)||d.includes(!0)),Z=y.filter(O=>a.includes(O)||s.includes(!0));return{properties:i(A,D),patterns:i(C,Z)}},H=({properties:s,patterns:a},{properties:d,patterns:y})=>d.every(A=>s.includes(A)||s.includes(!0)||a.some(D=>X(D,A)))&&y.every(A=>a.includes(A)||s.includes(!0)),h=f((s,a)=>({type:s.type&&a.type?i(s.type,a.type):null,items:Math.min(s.items,a.items),...re(s,a),required:b(s.type,"object")&&a.required||b(a.type,"object")&&s.required||L(s.required,a.required),fullstring:s.fullstring&&a.fullstring,dyn:{item:s.dyn.item||a.dyn.item,items:Math.max(s.dyn.items,a.dyn.items),properties:i(s.dyn.properties,a.dyn.properties),patterns:i(s.dyn.patterns,a.dyn.patterns)},unknown:s.unknown||a.unknown})),e=(s,a)=>Object.assign(s,M(s,a)),c=J(({unknown:s,items:a,dyn:d,...y})=>({items:a!==1/0&&(s||d.items>a||d.item),properties:!y.properties.includes(!0)&&(s||!H(y,d))}));return Lt={initTracing:g,andDelta:M,orDelta:h,applyDelta:e,isDynamic:c,inProperties:H},Lt}var _t,Tn;function Ar(){if(Tn)return _t;Tn=1;const{format:i,safe:L,safeand:J,safenot:f,safenotor:b}=bt(),w=Fn(),{resolveReference:g,joinPath:M,getDynamicAnchors:X,hasKeywords:re}=Ln(),H=jr(),{toPointer:h,...e}=Jt(),{scopeMethods:c}=Nn(),{buildName:s,types:a,jsHelpers:d}=Cn(),{knownKeywords:y,schemaVersions:A,knownVocabularies:D}=Un(),{initTracing:C,andDelta:Z,orDelta:O,applyDelta:se,isDynamic:V,inProperties:be}=$r(),j=new Set(["^[\\s\\S]*$","^[\\S\\s]*$","^[^]*$","",".*","^","$"]),P=["null","boolean","number","integer","string"],S=new Map(Object.entries({boolean:k=>typeof k=="boolean",array:k=>Array.isArray(k)&&Object.getPrototypeOf(k)===Array.prototype,object:k=>k&&Object.getPrototypeOf(k)===Object.prototype,finite:k=>Number.isFinite(k),natural:k=>Number.isInteger(k)&&k>=0,string:k=>typeof k=="string",jsonval:k=>e.deepEqual(k,JSON.parse(JSON.stringify(k)))})),F=S.get("object"),Q=k=>F(k)||typeof k=="boolean",B=k=>e.deepEqual(k,{type:[]}),te=(k,U)=>A.indexOf(k)>A.indexOf(`https://json-schema.org/${U}/schema`),ne=(k,U)=>{const q=`${k}`.replace(/^http:\/\//,"https://").replace(/#$/,"");return A.includes(q)?te(q,U):!0},ot=(k,U,q=!1,_=!1)=>Object.freeze({parent:k,keyname:U,inKeys:q,number:_}),_n=(k,U,q=!1)=>Object.freeze({parent:k,keyval:U,checked:q}),wt=Symbol("evaluatedStatic"),Ee=Symbol("optDynamic"),Fe=Symbol("optDynAnchors"),Xe=Symbol("optRecAnchors"),Wn=k=>{if(typeof k=="boolean")return k;if(F(k)&&Object.keys(k).length===0)return!0},xe=new Set,Be=new Map,Jn=(k,U,q,_)=>{if(U){const ae=U.replace(/^http:\/\//,"https://").replace(/#$/,"");q(A.includes(ae),"Unexpected schema version:",ae),Be.set(k,{exclusiveRefs:te(ae,"draft/2019-09"),contentValidation:te(ae,"draft/2019-09"),dependentUnsupported:te(ae,"draft/2019-09"),newItemsSyntax:!te(ae,"draft/2020-12"),containsEvaluates:!te(ae,"draft/2020-12"),objectContains:!te(ae,"draft/next"),bookending:te(ae,"draft/next")})}else q(!_,"[requireSchema] $schema is required"),Be.set(k,{})},Vt=(k,U,q,_,ae="")=>{const{mode:je="default",useDefaults:Kt=!1,removeAdditional:Ue=!1,includeErrors:ye=!1,allErrors:ue=!1,contentValidation:Ht,dryRun:Dr,lint:et=!1,allowUnusedKeywords:De=q.mode==="lax"||q.mode==="spec",allowUnreachable:Vn=q.mode==="lax"||q.mode==="spec",requireSchema:vt=q.mode==="strong",requireValidation:ct=q.mode==="strong",requireStringValidation:dt=q.mode==="strong",forbidNoopValues:Kn=q.mode==="strong",complexityChecks:Gt=q.mode==="strong",unmodifiedPrototypes:Hn=!1,isJSON:Zt=!1,$schemaDefault:Yt=null,formatAssertion:Qt=q.mode!=="spec"||ne(U.$schema,"draft/2019-09"),formats:Xt={},weakFormats:Bt=q.mode!=="strong",extraFormats:Gn=!1,schemas:Le,...en}=q,Zn={...H.core,...Bt?H.weak:{},...Gn?H.extra:{},...Xt};if(Object.keys(en).length!==0)throw new Error(`Unknown options: ${Object.keys(en).join(", ")}`);if(!["strong","lax","default","spec"].includes(je))throw new Error(`Invalid mode: ${je}`);if(!ye&&ue)throw new Error("allErrors requires includeErrors to be enabled");if(vt&&Yt)throw new Error("requireSchema forbids $schemaDefault");if(je==="strong"){const le={...{requireValidation:ct,requireStringValidation:dt},formatAssertion:Qt,complexityChecks:Gt,requireSchema:vt},E={weakFormats:Bt,allowUnusedKeywords:De};for(const[l,oe]of Object.entries(le))if(!oe)throw new Error(`Strong mode demands ${l}`);for(const[l,oe]of Object.entries(E))if(oe)throw new Error(`Strong mode forbids ${l}`)}const{gensym:he,getref:Yn,genref:Qn,genformat:tn}=c(_),Xn=de=>{const le=[];let E=de;for(;E;)E.name||le.unshift(E),E=E.parent||E.errorParent;if(le.every(ge=>ge.keyval!==void 0))return i("%j",h(le.map(ge=>ge.keyval)));const l=["#"],oe=()=>{const ge=l.map(e.pointerPart).join("/");return l.length=0,ge};let we=null;for(const{keyname:ge,keyval:pt,number:ze}of le)if(ge){ze||(_.pointerPart=e.pointerPart);const We=ze?ge:i("pointerPart(%s)",ge),z=`${oe()}/`;we=we?i("%s+%j+%s",we,z,We):i("%j+%s",z,We)}else pt&&l.push(pt);return l.length>0?i("%s+%j",we,`/${oe()}`):we},$e=Qn(k);let lt=null;const nn=(...de)=>{const le=lt(...de);return nn.errors=lt.errors,le};_[$e]=nn;const Bn=re(k,["$ref","$recursiveRef","$dynamicRef"]),kt=q[Fe]&&Bn&&re(k,["$dynamicAnchor"]),er=()=>q[Fe]?i(kt?", dynAnchors = []":", dynAnchors"):i(""),tr=q[Xe]?i(", recursive"):i(""),p=w();p.write("function validate(data%s%s) {",tr,er()),ye&&p.write("validate.errors = null"),ue&&p.write("let errorCount = 0"),q[Ee]&&p.write("validate.evaluatedDynamic = null");let rn=q[Fe]?i(", dynAnchors"):i("");kt&&(p.write("const dynLocal = [{}]"),rn=i(", [...dynAnchors, dynLocal[0] || []]"));const nr=d(p,_,ot,{unmodifiedPrototypes:Hn,isJSON:Zt},j),{present:Ae,forObjectKeys:ft,forArray:jt,patternTest:rr,compare:$t}=nr,Te=[],ce=()=>Be.get(U),_e=ae?[ae]:[],At=(de,le,E,l,oe,we={},{constProp:ge}={})=>{const pt=le.length>0&&le[le.length-1].prop===E,ze=()=>le.filter(t=>t.prop===E),We=!E.parent||E.checked||E.inKeys&&Zt||ze().length>0,z=s(E),Ne=(...t)=>_n(E,...t),Se=({path:t=[],prop:r=E,source:o,suberr:u})=>{const n=h([...oe,...t]),m=ye?Xn(r):null;if(ye===!0&&de&&o){_.errorMerge=e.errorMerge;const v=[o,n,m];ue?(p.write("if (validate.errors === null) validate.errors = []"),p.write("validate.errors.push(...%s.map(e => errorMerge(e, %j, %s)))",...v)):p.write("validate.errors = [errorMerge(%s[0], %j, %s)]",...v)}else if(ye===!0&&de){const v=i("{ keywordLocation: %j, instanceLocation: %s }",n,m);ue?(p.write("if (%s === null) %s = []",de,de),p.write("%s.push(%s)",de,v)):p.write("%s = [%s]",de,v)}u&&gn(u),ue?p.write("errorCount++"):p.write("return false")},pe=(t,r)=>p.if(t,()=>Se(r));et&&!_.lintErrors&&(_.lintErrors=[]);const Oe=(t,r)=>{const o=r!==void 0?` ${JSON.stringify(r)}`:"",u=M(ae,h(oe)),n=`${t}${o} at ${u}`;if(et)return _.lintErrors.push({message:n,keywordLocation:u,schema:k});throw new Error(n)},Et=(t,r)=>{try{return rr(t,r)}catch(o){return Oe(o.message),i("false")}},R=(t,...r)=>t||Oe(...r),tt=(t,...r)=>R(je==="lax"||je==="spec"||t,...r),qe=(t,r)=>tt(!(l[r]R(!ct,`[requireValidation] ${t} ${r}`),ie=(...t)=>[...oe,...t],Je=t=>R(!Ue&&!Kt,`[removeAdditional/useDefaults] uncertain: ${t}`),sn=(t,r)=>R(!Gt,`[complexityChecks] ${t}`,r),on=t=>Jn(U,t||Yt,R,vt),I=C(),W=t=>se(I,t);if(typeof l=="boolean")return l===!0?(Pe("schema = true","is not allowed"),{stat:I}):(pe(We||E.inKeys?!0:Ae(E),{}),W({type:[]}),{stat:I});R(F(l),"Schema is not an object");for(const t of Object.keys(l))R(y.includes(t)||De,"Keyword not supported:",t);if(Object.keys(l).length===0)return Pe("empty rules node","is not allowed"),{stat:I};const Re=new Set(Object.keys(l)),an=new Set,Ie=(t,...r)=>{R(an.has(t)||Re.has(t),"Unexpected double consumption:",t),R(e.hasOwn(l,t),"Is not an own property:",t),R(r.every(o=>S.has(o)),"Invalid type used in consume"),R(r.some(o=>S.get(o)(l[t])),"Unexpected type for",t),Re.delete(t)},cn=(t,...r)=>(l[t]!==void 0&&Ie(t,...r),l[t]),$=(t,r,o,u={})=>{if(l[t]===void 0)return!1;if(Ie(t,...r),o!==null)try{const n=o(l[t]);n!==null&&pe(n,{path:[t],...u})}catch(n){if(et&&!n.message.startsWith("[opt] "))Oe(n.message);else throw n}return!0};if(l===U?(on(cn("$schema","string")),$("$vocabulary",["object"],t=>{for(const[r,o]of Object.entries(t))o!==!1&&R(o===!0&&D.includes(r),"Unknown vocabulary:",r);return null})):ce()||on(U.$schema),ce().objectContains)for(const t of["contains","minContains","maxContains"])an.add(t);$("examples",["array"],null),$("example",["jsonval"],null);for(const t of["title","description","$comment"])$(t,["string"],null);for(const t of["deprecated","readOnly","writeOnly"])$(t,["boolean"],null);$("$defs",["object"],null)||$("definitions",["object"],null);const nt=(t,r,o)=>t===k?L("validate"):Yn(t)||Vt(t,r,q,_,o),Me=()=>_e.length>0?_e[_e.length-1]:"",ir=_e.length,dn=t=>(_e.push(M(Me(),t)),null);(!ce().exclusiveRefs||!l.$ref)&&($("$id",["string"],dn)||$("id",["string"],dn),$("$anchor",["string"],null),$("$dynamicAnchor",["string"],null),(l.$recursiveAnchor||!Kn)&&$("$recursiveAnchor",["boolean"],t=>(t&&Te.push([l,U,Me()]),null)));const ln=kt&&(l===k||l.id||l.$id);if(ln){const t=X(l);l!==k&&p.write("dynLocal.unshift({})");for(const[r,o]of t){const u=g(U,Le,`#${r}`,Me()),[n,m,v]=u[0]||[];R(n===o,`Unexpected $dynamicAnchor resolution: ${r}`);const x=nt(n,m,v);p.write("dynLocal[0][%j] = %s",`#${r}`,x)}}const xt=t=>q[Ee]&&(l[t]||l[t]===!1||l===k),me=Object.freeze({item:xt("unevaluatedItems")?he("evaluatedItem"):null,items:xt("unevaluatedItems")?he("evaluatedItems"):null,props:xt("unevaluatedProperties")?he("evaluatedProps"):null}),Y=Object.freeze({item:me.item||we.item,items:me.items||we.items,props:me.props||we.props}),fn=()=>(!Y.items||I.items===1/0)&&(!Y.props||I.properties.includes(!0)),ve=t=>{if(Y.item&&t.item&&I.items!==1/0&&p.write("%s.push(%s)",Y.item,t.item),Y.items&&t.items>I.items&&p.write("%s.push(%d)",Y.items,t.items),Y.props&&(t.properties||[]).includes(!0)&&!I.properties.includes(!0))p.write("%s[0].push(true)",Y.props);else if(Y.props){const r=(n,m)=>be(I,{properties:n,patterns:m}),o=(t.properties||[]).filter(n=>!r([n],[])),u=(t.patterns||[]).filter(n=>!r([],[n]));o.length>0&&p.write("%s[0].push(...%j)",Y.props,o),u.length>0&&p.write("%s[1].push(...%j)",Y.props,u);for(const n of t.propertiesVars||[])p.write("%s[0].push(%s)",Y.props,n)}},un=(t,r,o,u)=>{V(I).items&&t.item&&r&&p.write("%s.push(...%s)",t.item,r),V(I).items&&t.items&&o&&p.write("%s.push(...%s)",t.items,o),V(I).properties&&t.props&&u&&(p.write("%s[0].push(...%s[0])",t.props,u),p.write("%s[1].push(...%s[1])",t.props,u))},sr=()=>q[Xe]?Te.length===0?i(", recursive"):i(", recursive || %s",nt(...Te[0])):i(""),mt=(t,r)=>{const o=_[t]&&_[t][wt]||{unknown:!0};W(o);const u=i("%s(%s%s%s)",t,z,sr(),rn);if(!ye&&fn())return i("!%s",u);const n=he("res"),m=he("err"),v=he("suberr");return ye&&p.write("const %s = validate.errors",m),p.write("const %s = %s",n,u),ye&&p.write("const %s = %s.errors",v,t),ye&&p.write("validate.errors = %s",m),pe(f(n),{...r,source:v}),p.if(n,()=>{const x=V(o).items?i("%s.evaluatedDynamic[0]",t):null,T=V(o).items?i("%s.evaluatedDynamic[1]",t):null,N=V(o).properties?i("%s.evaluatedDynamic[2]",t):null;un(Y,x,T,N)}),null},pn=(t,r)=>t&&t.every(o=>r.includes(o)),mn=(t,r)=>r.some(o=>t===null||t.includes(o)),hn=(...t)=>ze().some(r=>pn(r.stat.type,t)),or=(...t)=>pn(I.type,t)||hn(...t),Ve=(...t)=>mn(I.type,t)&&ze().every(r=>mn(r.stat.type,t)),St=(t,r=l)=>{R(typeof t=="string","Invalid pattern:",t),(ct||dt)&&R(/^\^.*\$$/.test(t),"Should start with ^ and end with $:",t),/([{+*].*[{+*]|\)[{+*]|^[^^].*[{+*].)/.test(t)&&r.maxLength===void 0&&sn("maxLength should be specified for pattern:",t)},ar=l.pattern&&!j.has(l.pattern),cr=l.uniqueItems||ar||l.patternProperties||l.format,ht=ue&&cr?he("prev"):null,yt=(t,r)=>p.if(t&&ht!==null?i("errorCount === %s",ht):!0,r),yn=()=>[...le,{stat:I,prop:E}],fe=(...t)=>At(de,yn(),...t).stat,Ce=(t,...r)=>{if(r[0]===E){const n=Wn(r[1]);if(n===!0)return{sub:i("true"),delta:{}};if(n===!1)return{sub:i("false"),delta:{type:[]}}}const o=he("sub");p.write("const %s = (() => {",o),ue&&p.write("let errorCount = 0");const{stat:u}=At(t,yn(),...r);return ue?p.write("return errorCount === 0"):p.write("return true"),p.write("})()"),{sub:o,delta:u}},qt=()=>{const t=ye&&ue?he("suberr"):null;return t&&p.write("let %s = null",t),t},gn=t=>{de===null||t===null||p.if(t,()=>p.write("%s.push(...%s)",de,t))},bn=()=>{if(!Ue)return!1;if(Ue===!0)return!0;if(Ue==="keyword")return l.removeAdditional?(Ie("removeAdditional","boolean"),!0):!1;throw new Error(`Invalid removeAdditional: ${Ue}`)},gt=(t,r,o)=>{$(t,["object","boolean"],n=>n===!1&&bn()?(p.write("if (%s.length > %s) %s.length = %s",z,r,z,r),null):n===!1&&!o?i("%s.length > %s",z,r):(jt(E,r,(m,v)=>(o&&p.write("if (%s) continue",o(v)),fe(m,n,ie(t)))),null))&&W({items:1/0})},Pt=(t,r)=>{$(t,["object","boolean"],u=>(ft(E,(n,m)=>{p.if(r(m),()=>{u===!1&&bn()?p.write("delete %s[%s]",z,m):fe(n,u,ie(t))})}),null))&&W({properties:[!0]})},wn=(t,r,o)=>J(...r.map(u=>i("%s !== %j",t,u)),...o.map(u=>f(Et(u,t)))),vn=(t,r)=>{const o=r.map(n=>new RegExp(n,"u")),u=n=>t.includes(n)||o.some(m=>m.test(n));for(const n of I.required)R(u(n),"Unknown required property:",n)},kn=[],dr=()=>{const t=(o,u)=>i("!(%d %c %s)",o,u,z);Number.isFinite(l.exclusiveMinimum)?$("exclusiveMinimum",["finite"],o=>t(o,"t(o,l.exclusiveMinimum?"t(o,">")),qe("minimum","exclusiveMaximum"),qe("exclusiveMinimum","exclusiveMaximum")):l.maximum!==void 0&&($("maximum",["finite"],o=>t(o,l.exclusiveMaximum?">":">=")),$("exclusiveMaximum",["boolean"],null),qe("minimum","maximum"),qe("exclusiveMinimum","maximum"));const r=l.multipleOf===void 0?"divisibleBy":"multipleOf";$(r,["finite"],o=>{R(o>0,`Invalid ${r}:`,o);const[u,n]=`${o}`.split("e-"),v=`${u}.`.split(".")[1].length+(n?Number(n):0);if(Number.isInteger(o*2**v))return i("%s %% %d !== 0",z,o);_.isMultipleOf=e.isMultipleOf;const x=[z,o,v,Math.round(o*Math.pow(10,v))];return i("!isMultipleOf(%s, %d, 1e%d, %d)",...x)})},lr=()=>{$("maxLength",["natural"],t=>(_.stringLength=e.stringLength,i("%s.length > %d && stringLength(%s) > %d",z,t,z,t))),$("minLength",["natural"],t=>(_.stringLength=e.stringLength,i("%s.length {const t=(n,m,v=Zn)=>{const x=typeof n=="string"&&e.hasOwn(v,n);R(x,"Unrecognized format used:",n);const T=v[n],N=T instanceof RegExp||typeof T=="function";return R(N,"Invalid format used:",n),Qt?T instanceof RegExp?(e.hasOwn(Xt,n)&&St(T.source),i("!%s.test(%s)",tn(T),m)):i("!%s(%s)",tn(T),m):null};$("format",["string"],n=>(W({fullstring:!0}),t(n,z))),$("pattern",["string"],n=>(St(n),W({fullstring:!0}),j.has(n)?null:f(Et(n,z)))),R(l.contentSchema!==!1,"contentSchema cannot be set to false");const r=Ht===void 0?ce().contentValidation:Ht,o=l.contentEncoding||l.contentMediaType||l.contentSchema;if(R(!o||r||De,'"content*" keywords are disabled by default per spec, enable with { contentValidation = true } option (see doc/Options.md for more info)'),o&&r){const n=he("dec");l.contentMediaType&&p.write("let %s = %s",n,z),l.contentEncoding==="base64"?(pe(t("base64",z,H.extra),{path:["contentEncoding"]}),l.contentMediaType&&(_.deBase64=e.deBase64,p.write("try {"),p.write("%s = deBase64(%s)",n,n)),Ie("contentEncoding","string")):R(!l.contentEncoding,"Unknown contentEncoding:",l.contentEncoding);let m=!1;if(l.contentMediaType==="application/json"?(p.write("try {"),p.write("%s = JSON.parse(%s)",n,n),m=!0,Ie("contentMediaType","string")):R(!l.contentMediaType,"Unknown contentMediaType:",l.contentMediaType),l.contentSchema){R(m,"contentSchema requires contentMediaType application/json");const v=Object.freeze({name:n,errorParent:E});fe(v,l.contentSchema,ie("contentSchema")),Ie("contentSchema","object","array"),W({fullstring:!0})}l.contentMediaType&&(p.write("} catch (e) {"),Se({path:["contentMediaType"]}),p.write("}"),l.contentEncoding&&(p.write("} catch (e) {"),Se({path:["contentEncoding"]}),p.write("}")))}})},fr=()=>{$("maxItems",["natural"],n=>{const m=ce().newItemsSyntax?"prefixItems":"items";return Array.isArray(l[m])&&l[m].length>n&&Oe(`Invalid maxItems: ${n} is less than ${m} array length`),i("%s.length > %d",z,n)}),$("minItems",["natural"],n=>i("%s.length {for(let m=0;m(jt(E,i("0"),m=>fe(m,n,ie("items"))),W({items:1/0}),null)),jn(n=>{jt(E,i("0"),(m,v)=>{n(m,()=>{W({dyn:{item:!0}}),ve({item:v})})})});const r=n=>{if(!F(n))return!1;if(n.enum||e.hasOwn(n,"const")||n.type&&(Array.isArray(n.type)?n.type:[n.type]).every(v=>P.includes(v)))return!0;if(n.$ref){const[m]=g(U,Le,n.$ref,Me())[0]||[];if(r(m))return!0}return!1},o=n=>n===!1||r(n),u=()=>!!(l.maxItems!==void 0||o(l.items)||Array.isArray(l.items)&&o(l.additionalItems));yt(!0,()=>{$("uniqueItems",["boolean"],n=>n===!1?null:(u()||sn("maxItems should be specified for non-primitive uniqueItems"),Object.assign(_,{unique:e.unique,deepEqual:e.deepEqual}),i("!unique(%s)",z)))})},Ke=t=>!ue&&(I.required.includes(t)||ze().some(r=>r.stat.required.includes(t))),ur=()=>{const t=i("Object.keys(%s).length",z);$("maxProperties",["natural"],r=>i("%s > %d",t,r)),$("minProperties",["natural"],r=>i("%s (ft(E,(o,u)=>{const n=typeof r=="object"&&!r.$ref?{type:"string",...r}:r,m=Object.freeze({name:u,errorParent:o,type:"string"});fe(m,n,ie("propertyNames"))}),null)),$("required",["array"],r=>{for(const o of r){if(Ke(o))continue;const u=Ne(o);pe(f(Ae(u)),{path:["required"],prop:u})}return W({required:r}),null});for(const r of["dependencies","dependentRequired","dependentSchemas"])r!=="dependencies"&&ce().dependentUnsupported||$(r,["object"],o=>{for(const u of Object.keys(o)){const n=typeof o[u]=="string"?[o[u]]:o[u],m=Ne(u,Ke(u));if(Array.isArray(n)&&r!=="dependentSchemas"){const v=n.filter(N=>!Ke(N)).map(N=>Ae(Ne(N))),x=f(J(...v)),T={path:[r,u]};v.length===0||(m.checked?(pe(x,T),W({required:n})):pe(J(Ae(m),x),T))}else Q(n)&&r!=="dependentRequired"?(Je(r),p.if(m.checked?!0:Ae(m),()=>{const v=fe(E,n,ie(r,u),Y);W(O({},v)),ve(v)})):Oe(`Unexpected ${r} entry`)}return null});$("propertyDependencies",["object"],r=>{for(const[o,u]of Object.entries(r)){R(F(u),"propertyDependencies must be an object"),Je("propertyDependencies");const n=Ne(o,Ke(o));p.if(n.checked?!0:Ae(n),()=>{for(const[m,v]of Object.entries(u))R(Q(v),"propertyDependencies must contain schemas"),p.if($t(s(n),m),()=>{const x=fe(E,v,ie("propertyDependencies",o,m),Y);W(O({},x)),ve(x)})})}return null}),$("properties",["object"],r=>{for(const o of Object.keys(r))ge!==o&&fe(Ne(o,Ke(o)),r[o],ie("properties",o));return W({properties:Object.keys(r)}),null}),yt(l.patternProperties,()=>{if($("patternProperties",["object"],r=>(ft(E,(o,u)=>{for(const n of Object.keys(r))St(n,l.propertyNames||{}),p.if(Et(n,u),()=>{fe(o,r[n],ie("patternProperties",n))})}),W({patterns:Object.keys(r)}),null)),l.additionalProperties||l.additionalProperties===!1){const r=Object.keys(l.properties||{}),o=Object.keys(l.patternProperties||{});l.additionalProperties===!1&&kn.push(()=>vn(r,o)),Pt("additionalProperties",n=>wn(n,r,o))}}),ce().objectContains&&jn(r=>{ft(E,(o,u)=>{r(o,()=>{W({dyn:{properties:[!0]}}),ve({propertiesVars:[u]})})})})},pr=()=>{const t=$("const",["jsonval"],o=>f($t(z,o)));if(t&&!De)return!0;const r=$("enum",["array"],o=>{const u=o.filter(m=>m&&typeof m=="object"),n=o.filter(m=>!(m&&typeof m=="object"));return b(...[...n,...u].map(m=>$t(z,m)))});return t||r},jn=t=>{$("contains",["object","boolean"],()=>{Je("contains"),ce().objectContains&&Ve("array")&&Ve("object")&&Pe("possible type confusion in 'contains',","forbid 'object' or 'array'");const r=he("passes");p.write("let %s = 0",r);const o=qt();return t((u,n)=>{const{sub:m}=Ce(o,u,l.contains,ie("contains"));p.if(m,()=>{p.write("%s++",r),ce().containsEvaluates&&(R(!Ue,`Can't use removeAdditional with draft2020+ "contains"`),n())})}),$("minContains",["natural"],u=>i("%s i("%s > %d",r,u)),qe("minContains","maxContains"),null})},mr=()=>{$("not",["object","boolean"],n=>Ce(null,E,n,ie("not")).sub),l.not&&Je("not"),(l.then||l.then===!1||l.else||l.else===!1||De)&&$("if",["object","boolean"],n=>{Je("if/then/else");const{sub:m,delta:v}=Ce(null,E,n,ie("if"),Y);let x,T,N,K;return $("else",["object","boolean"],G=>(x=()=>{N=fe(E,G,ie("else"),Y),ve(N)},null)),$("then",["object","boolean"],G=>(T=()=>{K=fe(E,G,ie("then"),Y),ve(Z(v,K))},null)),!T&&!B(v)&&(T=()=>ve(v)),p.if(m,T,x),W(O(N||{},Z(v,K||{}))),null});const r=(n,m="allOf")=>{R(n.length>0,`${m} cannot be empty`);for(const[v,x]of Object.entries(n))W(fe(E,x,ie(m,v),Y));return null};$("allOf",["array"],n=>r(n));let o=null;$("discriminator",["object"],n=>{const m=new Set,v=(ee,Ge,Ze)=>R(ee,`[discriminator]: ${Ge}`,Ze),{propertyName:x,mapping:T,...N}=n,K=Ne(x);v(x&&!l.oneOf!=!l.anyOf,"need propertyName, oneOf OR anyOf"),v(Object.keys(N).length===0,'only "propertyName" and "mapping" are supported');const G=ee=>F(ee)?Object.keys(ee).length:null;return o=(ee,Ge)=>{const Ze=()=>{p.write("switch (%s) {",s(K));let Ye;for(const[gr,Qe]of Object.entries(ee)){const{const:Rt,enum:On,...br}=(Qe.properties||{})[x]||{};let it=Rt!==void 0?[Rt]:On;if(!it&&Qe.$ref){const[ke]=g(U,Le,Qe.$ref,Me())[0]||[];R(F(ke),"failed to resolve $ref:",Qe.$ref);const st=(ke.properties||{})[x]||{};it=st.const!==void 0?[st.const]:st.enum}const wr=Array.isArray(it)&&it.length>0;v(wr,"branches should have unique string const or enum values for [propertyName]");const vr=Object.keys(br).length===0&&(!Rt||!On);v(vr,"only const OR enum rules are allowed on [propertyName] in branches");for(const ke of it){const st=!T||e.hasOwn(T,ke)&&T[ke]===Qe.$ref;v(st,"mismatching mapping for",ke);const kr=typeof ke=="string"&&!m.has(ke);v(kr,"const/enum values for [propertyName] should be unique strings"),m.add(ke),p.write("case %j:",ke)}const It=fe(E,Qe,ie(Ge,gr),Y,{constProp:x});ve(It),Ye=Ye?O(Ye,It):It,p.write("break")}v(T===void 0||G(T)===m.size,"mismatching mapping size"),W(Ye),p.write("default:"),Se({path:[Ge]}),p.write("}")},rt=()=>{if(Ke(x))Ze();else{const Ye=["discriminator","propertyName"];p.if(Ae(K),Ze,()=>Se({path:Ye,prop:K}))}};return ue||!e.deepEqual(I.type,["object"])?p.if(a.get("object")(z),rt,()=>Se({path:["discriminator"]})):rt(),v(e.deepEqual(I.type,["object"]),"has to be checked for type:","object"),v(I.required.includes(x),"propertyName should be placed in required:",x),null},null});const u=(n,m)=>{const v=m.map(N=>N.type||(Array.isArray(N.const)?"array":typeof N.const)),x=v.filter(N=>!P.includes(N)&&N!=="array").length,T=v.filter(N=>!P.includes(N)&&N!=="object").length;(x>1||T>1)&&Je(`${n}, use discriminator to make it certain`)};$("anyOf",["array"],n=>{if(R(n.length>0,"anyOf cannot be empty"),n.length===1)return r(n);if(o)return o(n,"anyOf");const m=qt();if(!fn()){u("anyOf",n);const K=Object.entries(n).map(([G,ee])=>Ce(m,E,ee,ie("anyOf",G),Y));W(K.map(G=>G.delta).reduce((G,ee)=>O(G,ee))),pe(b(...K.map(({sub:G})=>G)),{path:["anyOf"],suberr:m});for(const{delta:G,sub:ee}of K)p.if(ee,()=>ve(G));return null}const v=n.filter(K=>e.hasOwn(K,"const")),x=n.filter(K=>!e.hasOwn(K,"const"));u("anyOf",x);const T=[...v,...x];let N;if(ce().exclusiveRefs){let K=()=>Se({path:["anyOf"],suberr:m});for(const[G,ee]of Object.entries(T).reverse()){const Ge=K;K=()=>{const{sub:Ze,delta:rt}=Ce(m,E,ee,ie("anyOf",G));p.if(f(Ze),Ge),N=N?O(N,rt):rt}}K()}else{const K=Object.entries(n).map(([G,ee])=>Ce(m,E,ee,ie("anyOf",G),Y));N=K.map(G=>G.delta).reduce((G,ee)=>O(G,ee)),pe(b(...K.map(({sub:G})=>G)),{path:["anyOf"],suberr:m})}return W(N),null}),$("oneOf",["array"],n=>{if(R(n.length>0,"oneOf cannot be empty"),n.length===1)return r(n);if(o)return o(n,"oneOf");u("oneOf",n);const m=he("passes");p.write("let %s = 0",m);const v=qt();let x,T=0;const N=Object.entries(n).map(([K,G])=>{!ye&&T++>1&&pe(i("%s > 1",m),{path:["oneOf"]});const ee=Ce(v,E,G,ie("oneOf",K),Y);return p.if(ee.sub,()=>p.write("%s++",m)),x=x?O(x,ee.delta):ee.delta,ee});W(x),pe(i("%s !== 1",m),{path:["oneOf"]}),p.if(i("%s === 0",m),()=>gn(v));for(const K of N)p.if(K.sub,()=>ve(K.delta));return null})},He=(t,r,o)=>{const[u,n]=[p.size(),Re.size];p.if(or(...r)?!0:o,t),(u!==p.size()||n!==Re.size)&&R(Ve(...r),"Unexpected rules in type",l.type)},hr=()=>{if(I.items===1/0)l.unevaluatedItems===!1&&Ie("unevaluatedItems","boolean");else if(l.unevaluatedItems||l.unevaluatedItems===!1)if(V(I).items){if(!q[Ee])throw new Error("[opt] Dynamic unevaluated tracing not enabled");const t=i("Math.max(%d, ...%s)",I.items,Y.items),r=o=>i("%s.includes(%s)",Y.item,o);gt("unevaluatedItems",t,ce().containsEvaluates?r:null)}else gt("unevaluatedItems",i("%d",I.items))},yr=()=>{yt(I.patterns.length>0||I.dyn.patterns.length>0||I.unknown,()=>{if(I.properties.includes(!0))l.unevaluatedProperties===!1&&Ie("unevaluatedProperties","boolean");else if(l.unevaluatedProperties||l.unevaluatedProperties===!1){const t=r=>wn(r,I.properties,I.patterns);if(V(I).properties){if(!q[Ee])throw new Error("[opt] Dynamic unevaluated tracing not enabled");_.propertyIn=e.propertyIn;const r=u=>i("!propertyIn(%s, %s)",u,Y.props);Pt("unevaluatedProperties",u=>J(t(u),r(u)))}else l.unevaluatedProperties===!1&&vn(I.properties,I.patterns),Pt("unevaluatedProperties",t)}})},$n=()=>{if(ht!==null&&p.write("const %s = errorCount",ht),pr()){const t=[...a.keys()];if(W({properties:[!0],items:1/0,type:t,fullstring:!0}),!De){R(Re.size===0,"Unexpected keywords mixed with const or enum:",[...Re]);return}}He(dr,["number","integer"],a.get("number")(z)),He(lr,["string"],a.get("string")(z)),He(fr,["array"],a.get("array")(z)),He(ur,["object"],a.get("object")(z)),mr(),He(hr,["array"],a.get("array")(z)),He(yr,["object"],a.get("object")(z));for(const t of kn)t();un(we,me.item,me.items,me.props)},An=()=>{if(me.item&&p.write("const %s = []",me.item),me.items&&p.write("const %s = [0]",me.items),me.props&&p.write("const %s = [[], []]",me.props),$("$ref",["string"],r=>{const o=g(U,Le,r,Me()),[u,n,m]=o[0]||[];if(!u&&u!==!1&&(Oe("failed to resolve $ref:",r),et))return null;const v=nt(u,n,m),x=u===k?$e:v;if(!_[x])throw new Error("Unexpected: coherence check failed");if(!_[x][wt]&&u.type){const T=Array.isArray(u.type)?u.type:[u.type];W({type:T}),ct&&(xe.add(x),T.includes("array")&&W({items:1/0}),T.includes("object")&&W({properties:[!0]})),dt&&T.includes("string")&&(xe.add(x),W({fullstring:!0}))}return mt(v,{path:["$ref"]})}),ce().exclusiveRefs&&(R(!q[Ee],"unevaluated* is supported only on draft2019-09 and above"),l.$ref))return;$("$recursiveRef",["string"],r=>{if(!q[Xe])throw new Error("[opt] Recursive anchors are not enabled");R(r==="#",'Behavior of $recursiveRef is defined only for "#"');const o=g(U,Le,"#",Me()),[u,n,m]=o[0];tt(u.$recursiveAnchor,"$recursiveRef without $recursiveAnchor");const v=nt(u,n,m),x=u.$recursiveAnchor?i("(recursive || %s)",v):v;return mt(x,{path:["$recursiveRef"]})}),$("$dynamicRef",["string"],r=>{if(!q[Fe])throw new Error("[opt] Dynamic anchors are not enabled");tt(/^[^#]*#[a-zA-Z0-9_-]+$/.test(r),"Unsupported $dynamicRef format");const o=r.replace(/^[^#]+/,""),u=g(U,Le,r,Me());if(!u[0]&&!ce().bookending){tt(!1,"$dynamicRef bookending resolution failed (even though not required)"),_.dynamicResolve=e.dynamicResolve;const K=i("dynamicResolve(dynAnchors || [], %j)",o);return mt(K,{path:["$dynamicRef"]})}R(u[0],"$dynamicRef bookending resolution failed",r);const[n,m,v]=u[0],x=n.$dynamicAnchor&&`#${n.$dynamicAnchor}`===o;tt(x,"$dynamicRef without $dynamicAnchor in the same scope");const T=nt(n,m,v);_.dynamicResolve=e.dynamicResolve;const N=x?i("(dynamicResolve(dynAnchors || [], %j) || %s)",o,T):T;return mt(N,{path:["$dynamicRef"]})});let t=null;$("type",["string","array"],r=>{const o=Array.isArray(r)?r:[r];for(const n of o)R(typeof n=="string"&&a.has(n),"Unknown type:",n);if(E.type)return R(e.deepEqual(o,[E.type]),"One type allowed:",E.type),W({type:[E.type]}),null;if(hn(...o))return null;const u=o.filter(n=>Ve(n));return u.length===0&&Oe("No valid types possible"),W({type:o}),t=b(...u.map(n=>a.get(n)(z))),null}),t&&ue?p.if(t,()=>Se({path:["type"]}),$n):(t&&pe(t,{path:["type"]}),$n()),I.itemsp.write("%s = %j",z,t))}else $("default",["jsonval"],null),p.if(We?!0:Ae(E),An);if(_e.length=ir,Te[0]&&Te[Te.length-1][0]===l&&Te.pop(),ln&&l!==k&&p.write("dynLocal.shift()"),Vn||R(!p.optimizedOut,"some checks are never reachable"),pt){const t=["not","if","then","else"].includes(oe[oe.length-1]),r=["oneOf","anyOf","allOf"].includes(oe[oe.length-2]),o=["dependencies","dependentSchemas"].includes(oe[oe.length-2]),u=["propertyDependencies"].includes(oe[oe.length-3]);R(t||r||o||u,"Unexpected logical path")}else if(!oe.includes("not")&&((!(k!==U&&l===k)||xe.has($e))&&(xe.delete($e),I.type||Pe("type"),Ve("array")&&I.items!==1/0&&Pe(l.items?"additionalItems or unevaluatedItems":"items rule"),Ve("object")&&!I.properties.includes(!0)&&Pe("additionalProperties or unevaluatedProperties"),!I.fullstring&&dt&&Oe("[requireStringValidation] pattern, format or contentSchema should be specified for strings, use pattern: ^[\\s\\S]*$ to opt-out")),typeof l.propertyNames!="object"))for(const r of["additionalProperties","unevaluatedProperties"])l[r]&&Pe(`wild-card ${r}`,"requires propertyNames");return l.properties&&!l.required&&Pe("if properties is used, required"),R(Re.size===0||De,"Unprocessed keywords:",[...Re]),{stat:I,local:me}},{stat:Ot,local:ut}=At(i("validate.errors"),[],{name:L("data")},k,[]);if(xe.has($e))throw new Error("Unexpected: unvalidated cyclic ref");if(q[Ee]&&(V(Ot).items||V(Ot).properties)){if(!ut)throw new Error("Failed to trace dynamic properties");p.write("validate.evaluatedDynamic = [%s, %s, %s]",ut.item,ut.items,ut.props)}return ue?p.write("return errorCount === 0"):p.write("return true"),p.write("}"),et||(lt=p.makeFunction(_),delete _[$e],_[$e]=lt),_[$e][wt]=Ot,$e},at=(k,U)=>{if(!Array.isArray(k))throw new Error("Expected an array of schemas");try{const q=Object.create(null),{getref:_}=c(q);xe.clear(),Be.clear();const ae=k.map(je=>_(je)||Vt(je,je,U,q));if(xe.size!==0)throw new Error("Unexpected: not all refs are validated");return{scope:q,refs:ae}}catch(q){if(!U[Ee]&&q.message==="[opt] Dynamic unevaluated tracing not enabled")return at(k,{...U,[Ee]:!0});if(!U[Fe]&&q.message==="[opt] Dynamic anchors are not enabled")return at(k,{...U,[Fe]:!0});if(!U[Xe]&&q.message==="[opt] Recursive anchors are not enabled")return at(k,{...U,[Xe]:!0});throw q}finally{xe.clear(),Be.clear()}};return _t={compile:at},_t}var Wt,zn;function Or(){if(zn)return Wt;zn=1;const i=Fn(),{buildSchemas:L}=Ln(),{compile:J}=Ar(),{deepEqual:f}=Jt(),b=h=>function e(c){if(!f(c,JSON.parse(JSON.stringify(c))))return e.errors=[{instanceLocation:"#",error:"not JSON compatible"}],!1;const s=h(c);return e.errors=h.errors,s},w=h=>e=>f(e,JSON.parse(JSON.stringify(e)))&&h(e),g=(h,{parse:e=!1,multi:c=!1,jsonCheck:s=!1,isJSON:a=!1,schemas:d=[],...y}={})=>{if(s&&a)throw new Error("Can not specify both isJSON and jsonCheck options");if(e&&(s||a))throw new Error("jsonCheck and isJSON options are not applicable in parser mode");const A=e?"strong":"default",D=a||s||e,C=c?h:[h],Z={mode:A,...y,schemas:L(d,C),isJSON:D},{scope:O,refs:se}=J(C,Z);if(y.dryRun)return;if(y.lint)return O.lintErrors;const V=i();if(e?O.parseWrap=y.includeErrors?M:X:s&&(O.deepEqual=f,O.jsonCheckWrap=y.includeErrors?b:w),c){V.write("[");for(const j of se.slice(0,-1))V.write("%s,",j);se.length>0&&V.write("%s",se[se.length-1]),V.write("]"),e?V.write(".map(parseWrap)"):s&&V.write(".map(jsonCheckWrap)")}else e?V.write("parseWrap(%s)",se[0]):s?V.write("jsonCheckWrap(%s)",se[0]):V.write("%s",se[0]);const be=V.makeFunction(O);return be.toModule=({semi:j=!0}={})=>V.makeModule(O)+(j?";":""),be.toJSON=()=>h,be},M=h=>e=>{if(typeof e!="string")return{valid:!1,error:"Input is not a string"};try{const c=JSON.parse(e);if(!h(c)){const{keywordLocation:s,instanceLocation:a}=h.errors[0];return{valid:!1,error:`JSON validation failed for ${s.slice(s.lastIndexOf("/")+1)} at ${a}`,errors:h.errors}}return{valid:!0,value:c}}catch({message:c}){return{valid:!1,error:c}}},X=h=>e=>{if(typeof e!="string")return{valid:!1};try{const c=JSON.parse(e);return h(c)?{valid:!0,value:c}:{valid:!1}}catch{return{valid:!1}}};return Wt={validator:g,parser:function(h,{parse:e=!0,...c}={}){if(!e)throw new Error("can not disable parse in parser");return g(h,{parse:e,...c})},lint:function(h,{lint:e=!0,...c}={}){if(!e)throw new Error("can not disable lint option in lint()");return g(h,{lint:e,...c})}},Wt}var Er=Or();const xr="http://json-schema.org/draft-04/schema#",Sr="object",qr={version:{type:"string"},isReadonly:{type:"boolean"},isDrawerOpen:{type:"boolean"},showLegend:{type:"boolean"},techniqueMappingMode:{type:"string"},selectedProfile:{type:"integer"},selectedStore:{type:"string"},containerSize:{type:"number"},matrixSize:{type:"integer"},associationMode:{type:"boolean"},matrixCommentMode:{type:"boolean"},localStorageWarning:{type:"boolean"},profiles:{type:"array",items:[{type:"object",properties:{id:{type:"integer"},description:{type:"string"},name:{type:"string"},includedLayers:{type:"array",items:[{type:"string"}]}},additionalProperties:!1,required:["id","description","name","includedLayers"]}]},layers:{type:"object",patternProperties:{".*":{type:"object",properties:{id:{type:"string"},description:{type:"string"},name:{type:"string"},techniques:{type:"array",items:[{type:"object",properties:{id:{type:"string"},comment:{type:"string"}},required:["id","comment"]}]},color:{type:"string"},children:{type:"array",items:[{type:"string"}]},checked:{type:"boolean"}},additionalProperties:!1,required:["id","description","name","techniques","color","children","checked"]}}},attack:{type:"object",patternProperties:{".*":{type:"object",patternProperties:{".*":{type:"array",items:[{type:"object",properties:{id:{type:"string"},justification:{type:"string"},tactic:{type:"string"},includedLayers:{type:"array",items:[{type:"string"}]}},additionalProperties:!1,required:["id","justification","tactic"]}]}}}}},rootTemplates:{type:"array",items:[{type:"string"}]},templates:{type:"object",patternProperties:{".*":{type:"object",properties:{id:{type:"string"},description:{type:"string"},name:{type:"string"},techniques:{type:"array",items:[{type:"object",properties:{id:{type:"string"},comment:{type:"string"}},required:["id","comment"]}]},checked:{type:"boolean"},color:{type:"string"},children:{type:"array",items:{}}},additionalProperties:!1,required:["id","description","name","techniques","checked","color","children"]}}},shownTactics:{type:"object",properties:{"d3f:Model":{type:"boolean"},"d3f:Harden":{type:"boolean"},"d3f:Detect":{type:"boolean"},"d3f:Isolate":{type:"boolean"},"d3f:Deceive":{type:"boolean"},"d3f:Evict":{type:"boolean"}},required:["d3f:Model","d3f:Harden","d3f:Detect","d3f:Isolate","d3f:Deceive","d3f:Evict"]}},Pr=!1,Rr=["version","isReadonly","isDrawerOpen","showLegend","techniqueMappingMode","selectedProfile","selectedStore","containerSize","matrixSize","associationMode","matrixCommentMode","localStorageWarning","profiles","layers","attack","rootTemplates","templates","shownTactics"],Ir={$schema:xr,type:Sr,properties:qr,additionalProperties:Pr,required:Rr},Tr={layers:"layers",templates:"templates"},zr={rootColor:"multiColor",heatMap:"heatMap",childrenMultiColor:"childrenMultiColor","ATT&CK":"ATT&CK"},Nr={attack:"attack"},Mr={version:"1",isReadonly:!1,isDrawerOpen:!0,showLegend:!0,techniqueMappingMode:"multiColor",selectedProfile:0,selectedStore:"layers",containerSize:.8,matrixSize:1,associationMode:!1,matrixCommentMode:!1,localStorageWarning:!1,profiles:[{name:"Example Profile",description:"Example D3FEND Profile",id:0,includedLayers:["endpoint-detection-response-b5e1b37fe803","network-detection-response-bd0a1550c68f","web-application-firewall-e2b69b0e42e7","network-intrusion-detection-system-53345eadd88f","idam-analytics-suite-05a3693fb7f6","network-vulnerability-scanner-5bdfd415a60c","security-orchestration-automation-and-response-861f9e04e823","operational-test-status-3e2e05ea8e07"]}],layers:{"zero-trust-kdjj2mvnvjkkd":{id:"zero-trust-kdjj2mvnvjkkd",description:"Testing the description",name:"Zero-Trust",techniques:[],color:"#ef0b0b",children:["role-based-access-hdjkfkkbvgn","continuous-verification-jkqwwer","geo-location-ie83909"],checked:!0},"role-based-access-hdjkfkkbvgn":{id:"role-based-access-hdjkfkkbvgn",description:"Testing the description",name:"Role-Based Access",techniques:[{id:"d3f:DataInventory",comment:""},{id:"d3f:ServiceDependencyMapping",comment:""},{id:"d3f:AccessModeling",comment:""},{id:"d3f:AssetInventory",comment:""}],children:[],color:"#ef0b0b",checked:!0},"least-priviledge-27kdjkdfkj":{id:"least-priviledge-27kdjkdfkj",description:"Testing the description",name:"Least Priviledge",techniques:[{id:"d3f:DNSAllowlisting",comment:""},{id:"d3f:DNSDenylisting",comment:""},{id:"d3f:ForwardResolutionDomainDenylisting",comment:""},{id:"d3f:HierarchicalDomainDenylisting",comment:""},{id:"d3f:HomoglyphDenylisting",comment:""},{id:"d3f:ForwardResolutionIPDenylisting",comment:""},{id:"d3f:ReverseResolutionIPDenylisting",comment:""},{id:"d3f:InboundTrafficFiltering",comment:""},{id:"d3f:OutboundTrafficFiltering",comment:""},{id:"d3f:AccountLocking",comment:""},{id:"d3f:ProcessTermination",comment:""}],color:"#bbc171",checked:!0,children:[]},"continuous-verification-jkqwwer":{id:"continuous-verification-jkqwwer",description:"Testing the description",name:"Continuous Verification",techniques:[],color:"#ef0b0b",children:[],checked:!1},"geo-location-ie83909":{id:"geo-location-ie83909",description:"Testing the description",name:"Geo Location",techniques:[{id:"d3f:TransferAgentAuthentication",comment:""},{id:"d3f:ServiceDependencyMapping",comment:""},{id:"d3f:AccessModeling",comment:""}],color:"#ef0b0b",children:[],checked:!0},"bandwidth-control-and-monitoring-837fdrkdm":{id:"bandwidth-control-and-monitoring-837fdrkdm",description:"Testing the description",name:"Bandwidth Control and Monitoring",techniques:[],children:[],color:"#ef0b0b",checked:!0},"web-filtering-3iejkdfmv":{id:"web-filtering-3iejkdfmv",description:"Testing the description",name:"Web Filtering",techniques:[],color:"#ef0b0b",children:["web-filtering-rule-1-e639d37443c9"],checked:!0},"sandboxing-kdnvmvmmv":{id:"sandboxing-kdnvmvmmv",description:"Testing the description",name:"Sandboxing",techniques:[],color:"#ef0b0b",children:[],checked:!0},"threat-prevention-kdkvsaka":{id:"threat-prevention-kdkvsaka",description:"Testing the description",name:"Threat Prevention",techniques:[],color:"#ef0b0b",children:[],checked:!0},"application-and-identiy-based-inspection-dkvn":{id:"application-and-identiy-based-inspection-dkvn",description:"Testing the description",name:"Application and Identiy-based Inspection",techniques:[{id:"d3f:HomoglyphDetection",comment:""},{id:"d3f:URLAnalysis",comment:""},{id:"d3f:CertificateAnalysis",comment:""},{id:"d3f:PassiveCertificateAnalysis",comment:""},{id:"d3f:IPCTrafficAnalysis",comment:""},{id:"d3f:AuthenticationEventThresholding",comment:""},{id:"d3f:AuthorizationEventThresholding",comment:""},{id:"d3f:DomainAccountMonitoring",comment:""},{id:"d3f:JobFunctionAccessPatternAnalysis",comment:""},{id:"d3f:LocalAccountMonitoring",comment:""},{id:"d3f:ResourceAccessPatternAnalysis",comment:""},{id:"d3f:SessionDurationAnalysis",comment:""},{id:"d3f:UserDataTransferAnalysis",comment:""},{id:"d3f:UserGeolocationLogonPatternAnalysis",comment:""},{id:"d3f:AdministrativeNetworkActivityAnalysis",comment:""},{id:"d3f:Client-serverPayloadProfiling",comment:""},{id:"d3f:ConnectionAttemptAnalysis",comment:""},{id:"d3f:DNSTrafficAnalysis",comment:""},{id:"d3f:NetworkTrafficCommunityDeviation",comment:""},{id:"d3f:PerHostDownload-UploadRatioAnalysis",comment:""},{id:"d3f:ProtocolMetadataAnomalyDetection",comment:""},{id:"d3f:RelayPatternAnalysis",comment:""},{id:"d3f:RemoteTerminalSessionDetection",comment:""},{id:"d3f:RPCTrafficAnalysis",comment:""},{id:"d3f:FirmwareBehaviorAnalysis",comment:""},{id:"d3f:FirmwareEmbeddedMonitoringCode",comment:""},{id:"d3f:PeripheralFirmwareVerification",comment:""},{id:"d3f:SystemFirmwareVerification",comment:""},{id:"d3f:FileIntegrityMonitoring",comment:""}],color:"#817fcc",checked:!0,children:[]},"scalability-kdnvmv":{id:"scalability-kdnvmv",description:"Testing the description",name:"Scalability",techniques:[],color:"#ef0b0b",children:[],checked:!0},"next-generation-firewall-kjlknlkn":{id:"next-generation-firewall-kjlknlkn",description:"Testing the description",name:"Next-Generation Firewall",techniques:[],color:"#ef0b0b",children:["web-filtering-3iejkdfmv","sandboxing-kdnvmvmmv","threat-prevention-kdkvsaka"],checked:!0},"claimed-dkjndlkdj":{id:"claimed-dkjndlkdj",description:"Testing the description",name:"Claimed",checked:!0,techniques:[],color:"#98d0A9",children:["scalability-kdnvmv","application-and-identiy-based-inspection-dkvn"]},"tested-dnkljlkldjs":{id:"tested-dnkljlkldjs",description:"Testing the description",name:"Tested",checked:!0,techniques:[{id:"d3f:AdministrativeNetworkActivityAnalysis",comment:""},{id:"d3f:Client-serverPayloadProfiling",comment:""},{id:"d3f:ConnectionAttemptAnalysis",comment:""},{id:"d3f:DNSTrafficAnalysis",comment:""},{id:"d3f:NetworkTrafficCommunityDeviation",comment:""},{id:"d3f:PerHostDownload-UploadRatioAnalysis",comment:""},{id:"d3f:ProtocolMetadataAnomalyDetection",comment:""},{id:"d3f:RelayPatternAnalysis",comment:""},{id:"d3f:RemoteTerminalSessionDetection",comment:""},{id:"d3f:RPCTrafficAnalysis",comment:""}],children:[],color:"#ec4327"},"integration-jksieufnvdkd":{id:"integration-jksieufnvdkd",description:"Testing the description",name:"Integration",techniques:[],children:["least-priviledge-27kdjkdfkj"],checked:!0,color:"#ffcc80"},"web-filtering-rule-1-e639d37443c9":{id:"web-filtering-rule-1-e639d37443c9",name:"Web Filtering Rule 1 ",description:"",techniques:[{id:"d3f:OutboundTrafficFiltering",comment:""}],children:[],checked:!0,color:"#ef0b0b"},"endpoint-detection-response-b5e1b37fe803":{id:"endpoint-detection-response-b5e1b37fe803",name:"Endpoint Detection & Response",description:"",techniques:[],children:["process-analysis-module-03228699d908","file-analysis-module-53b1557a8c3f","inventory-module-cd27dd8b9898"],checked:!0,color:"#12f576"},"network-detection-response-bd0a1550c68f":{id:"network-detection-response-bd0a1550c68f",name:"Network Detection & Response",description:"",techniques:[],children:["ueba-module-45cfb57fb917","anomaly-analytics-f62110fc7f8d"],checked:!0,color:"#9ff604"},"web-application-firewall-e2b69b0e42e7":{id:"web-application-firewall-e2b69b0e42e7",name:"Web Application Firewall",description:"",techniques:[{id:"d3f:AuthenticationEventThresholding",comment:""},{id:"d3f:AuthorizationEventThresholding",comment:""},{id:"d3f:ResourceAccessPatternAnalysis",comment:""}],children:[],checked:!0,color:"#e6f62a"},"network-intrusion-detection-system-53345eadd88f":{id:"network-intrusion-detection-system-53345eadd88f",name:"Network Intrusion Detection System",description:"",techniques:[],children:["ids-vendor-signatures-99c3ce856ebe"],checked:!0,color:"#f6bf37"},"idam-analytics-suite-05a3693fb7f6":{id:"idam-analytics-suite-05a3693fb7f6",name:"IDAM Analytics Suite",description:"",techniques:[{id:"d3f:AuthenticationEventThresholding",comment:""},{id:"d3f:AuthorizationEventThresholding",comment:""},{id:"d3f:UserGeolocationLogonPatternAnalysis",comment:""}],children:[],checked:!0,color:"#f67518"},"network-vulnerability-scanner-5bdfd415a60c":{id:"network-vulnerability-scanner-5bdfd415a60c",name:"Network Vulnerability Scanner",description:"",techniques:[{id:"d3f:AssetVulnerabilityEnumeration",comment:""},{id:"d3f:ContainerImageAnalysis",comment:""},{id:"d3f:NetworkNodeInventory",comment:""},{id:"d3f:PassiveLogicalLinkMapping",comment:""},{id:"d3f:ServiceDependencyMapping",comment:""}],children:[],checked:!0,color:"#0075ff"},"process-analysis-module-03228699d908":{id:"process-analysis-module-03228699d908",name:"Process Analysis Module",description:"",techniques:[{id:"d3f:ProcessSelf-ModificationDetection",comment:""},{id:"d3f:ProcessSpawnAnalysis",comment:""},{id:"d3f:ProcessLineageAnalysis",comment:""},{id:"d3f:ScriptExecutionAnalysis",comment:""},{id:"d3f:SystemCallAnalysis",comment:""},{id:"d3f:FileCreationAnalysis",comment:""},{id:"d3f:JobFunctionAccessPatternAnalysis",comment:""}],children:[],checked:!0,color:"#12f576"},"file-analysis-module-53b1557a8c3f":{id:"file-analysis-module-53b1557a8c3f",name:"File Analysis Module",description:"",techniques:[{id:"d3f:DynamicAnalysis",comment:""},{id:"d3f:FileHashing",comment:""},{id:"d3f:FileContentAnalysis",comment:""},{id:"d3f:FileContentRules",comment:""}],children:["custom-rules-9bcb48770338","vendor-supplied-rules-7efac2058dcb"],checked:!0,color:"#4cfe4b"},"inventory-module-cd27dd8b9898":{id:"inventory-module-cd27dd8b9898",name:"Inventory Module",description:"",techniques:[{id:"d3f:SoftwareInventory",comment:""},{id:"d3f:AssetVulnerabilityEnumeration",comment:""}],children:[],checked:!0,color:"#55fe38"},"custom-rules-9bcb48770338":{id:"custom-rules-9bcb48770338",name:"Custom Rules",description:"",techniques:[],children:["rule-1-fc6354ccbfc9","rule-2-11e6773a42cb"],checked:!0,color:"#37ff2a"},"rule-1-fc6354ccbfc9":{id:"rule-1-fc6354ccbfc9",name:"Rule 1",description:"",techniques:[{id:"d3f:FileContentRules",comment:""}],children:[],checked:!0,color:"#12f576"},"rule-2-11e6773a42cb":{id:"rule-2-11e6773a42cb",name:"Rule 2",description:"",techniques:[],children:[],checked:!0,color:"#36fe3b"},"vendor-supplied-rules-7efac2058dcb":{id:"vendor-supplied-rules-7efac2058dcb",name:"Vendor Supplied Rules",description:"",techniques:[{id:"d3f:AuthenticationEventThresholding",comment:""},{id:"d3f:AuthorizationEventThresholding",comment:""},{id:"d3f:ResourceAccessPatternAnalysis",comment:""}],children:[],checked:!0,color:"#23fe36"},"ueba-module-45cfb57fb917":{id:"ueba-module-45cfb57fb917",name:"UEBA Module",description:"",techniques:[{id:"d3f:AuthorizationEventThresholding",comment:""},{id:"d3f:JobFunctionAccessPatternAnalysis",comment:""},{id:"d3f:ResourceAccessPatternAnalysis",comment:""},{id:"d3f:SessionDurationAnalysis",comment:""},{id:"d3f:UserDataTransferAnalysis",comment:""},{id:"d3f:UserGeolocationLogonPatternAnalysis",comment:""},{id:"d3f:WebSessionActivityAnalysis",comment:""},{id:"d3f:AuthenticationEventThresholding",comment:""}],children:[],checked:!0,color:"#9ff604"},"anomaly-analytics-f62110fc7f8d":{id:"anomaly-analytics-f62110fc7f8d",name:"Anomaly Analytics",description:"",techniques:[{id:"d3f:AdministrativeNetworkActivityAnalysis",comment:""},{id:"d3f:Client-serverPayloadProfiling",comment:""},{id:"d3f:ConnectionAttemptAnalysis",comment:""},{id:"d3f:InboundSessionVolumeAnalysis",comment:""},{id:"d3f:NetworkTrafficCommunityDeviation",comment:""},{id:"d3f:PerHostDownload-UploadRatioAnalysis",comment:""},{id:"d3f:ProtocolMetadataAnomalyDetection",comment:""},{id:"d3f:RelayPatternAnalysis",comment:""},{id:"d3f:RemoteTerminalSessionDetection",comment:""},{id:"d3f:RPCTrafficAnalysis",comment:""}],children:[],checked:!0,color:"#9ff604"},"ids-vendor-signatures-99c3ce856ebe":{id:"ids-vendor-signatures-99c3ce856ebe",name:"IDS Vendor Signatures",description:"",techniques:[{id:"d3f:AdministrativeNetworkActivityAnalysis",comment:""},{id:"d3f:ConnectionAttemptAnalysis",comment:""}],children:[],checked:!0,color:"#f6bf37"},"security-orchestration-automation-and-response-861f9e04e823":{id:"security-orchestration-automation-and-response-861f9e04e823",name:"Security Orchestration Automation and Response",description:"",techniques:[{id:"d3f:EmailRemoval",comment:""},{id:"d3f:AccountLocking",comment:""},{id:"d3f:AuthenticationCacheInvalidation",comment:""},{id:"d3f:CredentialRevocation",comment:""},{id:"d3f:ProcessTermination",comment:""},{id:"d3f:ProcessSuspension",comment:""},{id:"d3f:RestoreNetworkAccess",comment:""},{id:"d3f:RestoreUserAccountAccess",comment:""},{id:"d3f:UnlockAccount",comment:""},{id:"d3f:RestoreFile",comment:""}],children:[],checked:!0,color:"#7ecdf5"},"operational-test-status-3e2e05ea8e07":{id:"operational-test-status-3e2e05ea8e07",name:"Operational Test Status",description:"",techniques:[{id:"d3f:DynamicAnalysis",comment:""},{id:"d3f:ConnectionAttemptAnalysis",comment:""},{id:"d3f:PerHostDownload-UploadRatioAnalysis",comment:""},{id:"d3f:RelayPatternAnalysis",comment:""},{id:"d3f:ProcessSpawnAnalysis",comment:""},{id:"d3f:ScriptExecutionAnalysis",comment:""},{id:"d3f:JobFunctionAccessPatternAnalysis",comment:""},{id:"d3f:ResourceAccessPatternAnalysis",comment:""},{id:"d3f:AuthenticationCacheInvalidation",comment:""}],children:[],checked:!0,color:"#ff260c"}},attack:{},rootTemplates:["firewall-kdjenyeurhg","threat-prevention-kdkvsaka"],templates:{"firewall-kdjenyeurhg":{id:"firewall-kdjenyeurhg",description:"Testing the description",name:"Firewall",techniques:[],checked:!0,color:"#7078A4",children:["bandwidth-control-and-monitoring-837fdrkdm"]},"bandwidth-control-and-monitoring-837fdrkdm":{id:"bandwidth-control-and-monitoring-837fdrkdm",description:"Testing the description",name:"Bandwidth Control and Monitoring",techniques:[{id:"d3f:SoftwareUpdate",comment:""},{id:"d3f:ByteSequenceEmulation",comment:""},{id:"d3f:JobFunctionAccessPatternAnalysis",comment:""},{id:"d3f:NetworkTrafficFiltering",comment:""}],children:[],color:"#7078A4",checked:!0},"web-filtering-3iejkdfmv":{id:"web-filtering-3iejkdfmv",name:"Web Filtering",description:"Testing the description",techniques:[],children:[],color:"#7078A4",checked:!0},"sandboxing-kdnvmvmmv":{id:"sandboxing-kdnvmvmmv",description:"Testing the description",name:"Sandboxing",techniques:[],children:[],checked:!0,color:"#BB5883"},"threat-prevention-kdkvsaka":{id:"threat-prevention-kdkvsaka",name:"Threat Prevention",description:"Testing the description",techniques:[],children:[],color:"#BB5883",checked:!0}},shownTactics:{"d3f:Model":!1,"d3f:Harden":!1,"d3f:Detect":!1,"d3f:Isolate":!1,"d3f:Deceive":!1,"d3f:Evict":!1}},Cr={selected:"selected",editing:"editing",parent:"parent",root:"root",noop:"noop"};try{const i=Er.parser(Ir,{requireStringValidation:!1,mode:"lax",includeErrors:!0,allErrors:!0}),{valid:L,error:J,errors:f}=i(JSON.stringify(Mr));if(!L)throw new AggregateError(f,`Error Parsing Initial Profile Layer: ${J}`)}catch(i){if(console.error(i.message),Array.isArray(i.errors))for(let L=0;L