@umijs/bundler-webpack
Version:
@umijs/bundler-webpack
1 lines • 428 kB
JavaScript
(function(){var e={3471:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.formatNames=t.fastFormats=t.fullFormats=void 0;function fmtDef(e,t){return{validate:e,compare:t}}t.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(time,compareTime),"date-time":fmtDef(date_time,compareDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:uri,"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|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\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:regex,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:byte,int32:{type:"number",validate:validateInt32},int64:{type:"number",validate:validateInt64},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:true,binary:true};t.fastFormats={...t.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareTime),"date-time":fmtDef(/^\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,compareDateTime),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};t.formatNames=Object.keys(t.fullFormats);function isLeapYear(e){return e%4===0&&(e%100!==0||e%400===0)}const a=/^(\d\d\d\d)-(\d\d)-(\d\d)$/;const n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(e){const t=a.exec(e);if(!t)return false;const i=+t[1];const o=+t[2];const s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&isLeapYear(i)?29:n[o])}function compareDate(e,t){if(!(e&&t))return undefined;if(e>t)return 1;if(e<t)return-1;return 0}const i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function time(e,t){const a=i.exec(e);if(!a)return false;const n=+a[1];const o=+a[2];const s=+a[3];const r=a[5];return(n<=23&&o<=59&&s<=59||n===23&&o===59&&s===60)&&(!t||r!=="")}function compareTime(e,t){if(!(e&&t))return undefined;const a=i.exec(e);const n=i.exec(t);if(!(a&&n))return undefined;e=a[1]+a[2]+a[3]+(a[4]||"");t=n[1]+n[2]+n[3]+(n[4]||"");if(e>t)return 1;if(e<t)return-1;return 0}const o=/t|\s/i;function date_time(e){const t=e.split(o);return t.length===2&&date(t[0])&&time(t[1],true)}function compareDateTime(e,t){if(!(e&&t))return undefined;const[a,n]=e.split(o);const[i,s]=t.split(o);const r=compareDate(a,i);if(r===undefined)return undefined;return r||compareTime(n,s)}const s=/\/|:/;const r=/^(?:[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 uri(e){return s.test(e)&&r.test(e)}const c=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function byte(e){c.lastIndex=0;return c.test(e)}const p=-(2**31);const u=2**31-1;function validateInt32(e){return Number.isInteger(e)&&e<=u&&e>=p}function validateInt64(e){return Number.isInteger(e)}function validateNumber(){return true}const l=/[^\\]\\Z/;function regex(e){if(l.test(e))return false;try{new RegExp(e);return true}catch(e){return false}}},5679:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(3471);const i=a(6541);const o=a(4109);const s=new o.Name("fullFormats");const r=new o.Name("fastFormats");const formatsPlugin=(e,t={keywords:true})=>{if(Array.isArray(t)){addFormats(e,t,n.fullFormats,s);return e}const[a,o]=t.mode==="fast"?[n.fastFormats,r]:[n.fullFormats,s];const c=t.formats||n.formatNames;addFormats(e,c,a,o);if(t.keywords)i.default(e);return e};formatsPlugin.get=(e,t="full")=>{const a=t==="fast"?n.fastFormats:n.fullFormats;const i=a[e];if(!i)throw new Error(`Unknown format "${e}"`);return i};function addFormats(e,t,a,n){var i;var s;(i=(s=e.opts.code).formats)!==null&&i!==void 0?i:s.formats=o._`require("ajv-formats/dist/formats").${n}`;for(const n of t)e.addFormat(n,a[n])}e.exports=t=formatsPlugin;Object.defineProperty(t,"__esModule",{value:true});t["default"]=formatsPlugin},6541:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.formatLimitDefinition=void 0;const n=a(4711);const i=a(4109);const o=i.operators;const s={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}};const r={message:({keyword:e,schemaCode:t})=>i.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:true,error:r,code(e){const{gen:t,data:a,schemaCode:o,keyword:r,it:c}=e;const{opts:p,self:u}=c;if(!p.validateFormats)return;const l=new n.KeywordCxt(c,u.RULES.all.format.definition,"format");if(l.$data)validate$DataFormat();else validateFormat();function validate$DataFormat(){const a=t.scopeValue("formats",{ref:u.formats,code:p.code.formats});const n=t.const("fmt",i._`${a}[${l.schemaCode}]`);e.fail$data(i.or(i._`typeof ${n} != "object"`,i._`${n} instanceof RegExp`,i._`typeof ${n}.compare != "function"`,compareCode(n)))}function validateFormat(){const a=l.schema;const n=u.formats[a];if(!n||n===true)return;if(typeof n!="object"||n instanceof RegExp||typeof n.compare!="function"){throw new Error(`"${r}": format "${a}" does not define "compare" function`)}const o=t.scopeValue("formats",{key:a,ref:n,code:p.code.formats?i._`${p.code.formats}${i.getProperty(a)}`:undefined});e.fail$data(compareCode(o))}function compareCode(e){return i._`${e}.compare(${a}, ${o}) ${s[r].fail} 0`}},dependencies:["format"]};const formatLimitPlugin=e=>{e.addKeyword(t.formatLimitDefinition);return e};t["default"]=formatLimitPlugin},408:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function getRangeDef(e){return()=>({keyword:e,type:"number",schemaType:"array",macro:function([t,a]){validateRangeSchema(t,a);return e==="range"?{minimum:t,maximum:a}:{exclusiveMinimum:t,exclusiveMaximum:a}},metaSchema:{type:"array",minItems:2,maxItems:2,items:{type:"number"}}});function validateRangeSchema(t,a){if(t>a||e==="exclusiveRange"&&t===a){throw new Error("There are no numbers in range")}}}t["default"]=getRangeDef},1085:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function getRequiredDef(e){return()=>({keyword:e,type:"object",schemaType:"array",macro(t){if(t.length===0)return true;if(t.length===1)return{required:t};const a=e==="anyRequired"?"anyOf":"oneOf";return{[a]:t.map((e=>({required:[e]})))}},metaSchema:{type:"array",items:{type:"string"}}})}t["default"]=getRequiredDef},9503:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.usePattern=t.metaSchemaRef=void 0;const n=a(4109);const i="http://json-schema.org/schema";function metaSchemaRef({defaultMeta:e}={}){return e===false?{}:{$ref:e||i}}t.metaSchemaRef=metaSchemaRef;function usePattern({gen:e,it:{opts:t}},a,i=(t.unicodeRegExp?"u":"")){const o=new RegExp(a,i);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,n._)`new RegExp(${a}, ${i})`})}t.usePattern=usePattern},9160:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"allRequired",type:"object",schemaType:"boolean",macro(e,t){if(!e)return true;const a=Object.keys(t.properties);if(a.length===0)return true;return{required:a}},dependencies:["properties"]}}t["default"]=getDef;e.exports=getDef},5817:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(1085));const o=(0,i.default)("anyRequired");t["default"]=o;e.exports=o},6165:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(9503);function getDef(e){return{keyword:"deepProperties",type:"object",schemaType:"object",macro:function(e){const t=[];for(const a in e)t.push(getSchema(a,e[a]));return{allOf:t}},metaSchema:{type:"object",propertyNames:{type:"string",format:"json-pointer"},additionalProperties:(0,n.metaSchemaRef)(e)}}}t["default"]=getDef;function getSchema(e,t){const a=e.split("/");const n={};let i=n;for(let e=1;e<a.length;e++){let n=a[e];const o=e===a.length-1;n=unescapeJsonPointer(n);const s=i.properties={};let r;if(/[0-9]+/.test(n)){let e=+n;r=i.items=[];i.type=["object","array"];while(e--)r.push({})}else{i.type="object"}i=o?t:{};s[n]=i;if(r)r.push(i)}return n}function unescapeJsonPointer(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports=getDef},2592:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);function getDef(){return{keyword:"deepRequired",type:"object",schemaType:"array",code(e){const{schema:t,data:a}=e;const i=t.map((e=>(0,n._)`(${getData(e)}) === undefined`));e.fail((0,n.or)(...i));function getData(e){if(e==="")throw new Error("empty JSON pointer not allowed");const t=e.split("/");let i=a;const o=t.map(((e,t)=>t?i=(0,n._)`${i}${(0,n.getProperty)(unescapeJPSegment(e))}`:i));return(0,n.and)(...o)}},metaSchema:{type:"array",items:{type:"string",format:"json-pointer"}}}}t["default"]=getDef;function unescapeJPSegment(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}e.exports=getDef},3220:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={};const n={timestamp:()=>()=>Date.now(),datetime:()=>()=>(new Date).toISOString(),date:()=>()=>(new Date).toISOString().slice(0,10),time:()=>()=>(new Date).toISOString().slice(11),random:()=>()=>Math.random(),randomint:e=>{var t;const a=(t=e===null||e===void 0?void 0:e.max)!==null&&t!==void 0?t:2;return()=>Math.floor(Math.random()*a)},seq:e=>{var t;const n=(t=e===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:"";a[n]||(a[n]=0);return()=>a[n]++}};const i=Object.assign(_getDef,{DEFAULTS:n});function _getDef(){return{keyword:"dynamicDefaults",type:"object",schemaType:["string","object"],modifying:true,valid:true,compile(e,t,a){if(!a.opts.useDefaults||a.compositeRule)return()=>true;const n={};for(const t in e)n[t]=getDefault(e[t]);const i=a.opts.useDefaults==="empty";return t=>{for(const a in e){if(t[a]===undefined||i&&(t[a]===null||t[a]==="")){t[a]=n[a]()}}return true}},metaSchema:{type:"object",additionalProperties:{anyOf:[{type:"string"},{type:"object",additionalProperties:false,required:["func","args"],properties:{func:{type:"string"},args:{type:"object"}}}]}}}}function getDefault(e){return typeof e=="object"?getObjDefault(e):getStrDefault(e)}function getObjDefault({func:e,args:t}){const a=n[e];assertDefined(e,a);return a(t)}function getStrDefault(e=""){const t=n[e];assertDefined(e,t);return t()}function assertDefined(e,t){if(!t)throw new Error(`invalid "dynamicDefaults" keyword property value: ${e}`)}t["default"]=i;e.exports=i},541:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(408));const o=(0,i.default)("exclusiveRange");t["default"]=o;e.exports=o},4785:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});const a={Object:Object,Array:Array,Function:Function,Number:Number,String:String,Date:Date,RegExp:RegExp};if(typeof Buffer!="undefined")a.Buffer=Buffer;if(typeof Promise!="undefined")a.Promise=Promise;const n=Object.assign(_getDef,{CONSTRUCTORS:a});function _getDef(){return{keyword:"instanceof",schemaType:["string","array"],compile(e){if(typeof e=="string"){const t=getConstructor(e);return e=>e instanceof t}if(Array.isArray(e)){const t=e.map(getConstructor);return e=>{for(const a of t){if(e instanceof a)return true}return false}}throw new Error("ajv implementation error")},metaSchema:{anyOf:[{type:"string"},{type:"array",items:{type:"string"}}]}}}function getConstructor(e){const t=a[e];if(t)return t;throw new Error(`invalid "instanceof" keyword value ${e}`)}t["default"]=n;e.exports=n},4656:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(1085));const o=(0,i.default)("oneRequired");t["default"]=o;e.exports=o},1818:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);const i=a(9503);const o={message:({params:{missingPattern:e}})=>(0,n.str)`should have property matching pattern '${e}'`,params:({params:{missingPattern:e}})=>(0,n._)`{missingPattern: ${e}}`};function getDef(){return{keyword:"patternRequired",type:"object",schemaType:"array",error:o,code(e){const{gen:t,schema:a,data:o}=e;if(a.length===0)return;const s=t.let("valid",true);for(const e of a)validateProperties(e);function validateProperties(a){const r=t.let("matched",false);t.forIn("key",o,(o=>{t.assign(r,(0,n._)`${(0,i.usePattern)(e,a)}.test(${o})`);t.if(r,(()=>t.break()))}));e.setParams({missingPattern:a});t.assign(s,(0,n.and)(s,r));e.pass(s)}},metaSchema:{type:"array",items:{type:"string",format:"regex"},uniqueItems:true}}}t["default"]=getDef;e.exports=getDef},7506:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});function getDef(){return{keyword:"prohibited",type:"object",schemaType:"array",macro:function(e){if(e.length===0)return true;if(e.length===1)return{not:{required:e}};return{not:{anyOf:e.map((e=>({required:[e]})))}}},metaSchema:{type:"array",items:{type:"string"}}}}t["default"]=getDef;e.exports=getDef},2669:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(408));const o=(0,i.default)("range");t["default"]=o;e.exports=o},3163:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);const i=a(9503);const o={type:"object",properties:{pattern:{type:"string"},flags:{type:"string",nullable:true}},required:["pattern"],additionalProperties:false};const s=/^\/(.*)\/([gimuy]*)$/;function getDef(){return{keyword:"regexp",type:"string",schemaType:["string","object"],code(e){const{data:t,schema:a}=e;const o=getRegExp(a);e.pass((0,n._)`${o}.test(${t})`);function getRegExp(t){if(typeof t=="object")return(0,i.usePattern)(e,t.pattern,t.flags);const a=s.exec(t);if(a)return(0,i.usePattern)(e,a[1],a[2]);throw new Error("cannot parse string into RegExp")}},metaSchema:{anyOf:[{type:"string"},o]}}}t["default"]=getDef;e.exports=getDef},2730:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);const i=a(9503);const o={message:({params:{schemaProp:e}})=>e?(0,n.str)`should match case "${e}" schema`:(0,n.str)`should match default case schema`,params:({params:{schemaProp:e}})=>e?(0,n._)`{failingCase: ${e}}`:(0,n._)`{failingDefault: true}`};function getDef(e){const t=(0,i.metaSchemaRef)(e);return[{keyword:"select",schemaType:["string","number","boolean","null"],$data:true,error:o,dependencies:["selectCases"],code(e){const{gen:t,schemaCode:a,parentSchema:i}=e;e.block$data(n.nil,(()=>{const o=t.let("valid",true);const s=t.name("_valid");const r=t.const("value",(0,n._)`${a} === null ? "null" : ${a}`);t.if(false);for(const a in i.selectCases){e.setParams({schemaProp:a});t.elseIf((0,n._)`"" + ${r} == ${a}`);const i=e.subschema({keyword:"selectCases",schemaProp:a},s);e.mergeEvaluated(i,n.Name);t.assign(o,s)}t.else();if(i.selectDefault!==undefined){e.setParams({schemaProp:undefined});const a=e.subschema({keyword:"selectDefault"},s);e.mergeEvaluated(a,n.Name);t.assign(o,s)}t.endIf();e.pass(o)}))}},{keyword:"selectCases",dependencies:["select"],metaSchema:{type:"object",additionalProperties:t}},{keyword:"selectDefault",dependencies:["select","selectCases"],metaSchema:t}]}t["default"]=getDef;e.exports=getDef},6678:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);const i={trimStart:e=>e.trimStart(),trimEnd:e=>e.trimEnd(),trimLeft:e=>e.trimStart(),trimRight:e=>e.trimEnd(),trim:e=>e.trim(),toLowerCase:e=>e.toLowerCase(),toUpperCase:e=>e.toUpperCase(),toEnumCase:(e,t)=>(t===null||t===void 0?void 0:t.hash[configKey(e)])||e};const o=Object.assign(_getDef,{transform:i});function _getDef(){return{keyword:"transform",schemaType:"array",before:"enum",code(e){const{gen:t,data:a,schema:o,parentSchema:s,it:r}=e;const{parentData:c,parentDataProperty:p}=r;const u=o;if(!u.length)return;let l;if(u.includes("toEnumCase")){const e=getEnumCaseCfg(s);l=t.scopeValue("obj",{ref:e,code:(0,n.stringify)(e)})}t.if((0,n._)`typeof ${a} == "string" && ${c} !== undefined`,(()=>{t.assign(a,transformExpr(u.slice()));t.assign((0,n._)`${c}[${p}]`,a)}));function transformExpr(e){if(!e.length)return a;const o=e.pop();if(!(o in i))throw new Error(`transform: unknown transformation ${o}`);const s=t.scopeValue("func",{ref:i[o],code:(0,n._)`require("ajv-keywords/dist/definitions/transform").transform${(0,n.getProperty)(o)}`});const r=transformExpr(e);return l&&o==="toEnumCase"?(0,n._)`${s}(${r}, ${l})`:(0,n._)`${s}(${r})`}},metaSchema:{type:"array",items:{type:"string",enum:Object.keys(i)}}}}function getEnumCaseCfg(e){const t={hash:{}};if(!e.enum)throw new Error('transform: "toEnumCase" requires "enum"');for(const a of e.enum){if(typeof a!=="string")continue;const e=configKey(a);if(t.hash[e]){throw new Error('transform: "toEnumCase" requires all lowercased "enum" values to be unique')}t.hash[e]=a}return t}function configKey(e){return e.toLowerCase()}t["default"]=o;e.exports=o},2518:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(4109);const i=["undefined","string","number","object","function","boolean","symbol"];function getDef(){return{keyword:"typeof",schemaType:["string","array"],code(e){const{data:t,schema:a,schemaValue:i}=e;e.fail(typeof a=="string"?(0,n._)`typeof ${t} != ${a}`:(0,n._)`${i}.indexOf(typeof ${t}) < 0`)},metaSchema:{anyOf:[{type:"string",enum:i},{type:"array",items:{type:"string",enum:i}}]}}}t["default"]=getDef;e.exports=getDef},3530:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=a(7447);const i=["number","integer","string","boolean","null"];function getDef(){return{keyword:"uniqueItemProperties",type:"array",schemaType:"array",compile(e,t){const a=getScalarKeys(e,t);return t=>{if(t.length<=1)return true;for(let i=0;i<e.length;i++){const o=e[i];if(a[i]){const e={};for(const a of t){if(!a||typeof a!="object")continue;let t=a[o];if(t&&typeof t=="object")continue;if(typeof t=="string")t='"'+t;if(e[t])return false;e[t]=true}}else{for(let e=t.length;e--;){const a=t[e];if(!a||typeof a!="object")continue;for(let i=e;i--;){const e=t[i];if(e&&typeof e=="object"&&n(a[o],e[o]))return false}}}}return true}},metaSchema:{type:"array",items:{type:"string"}}}}t["default"]=getDef;function getScalarKeys(e,t){return e.map((e=>{var a,n,o;const s=(o=(n=(a=t.items)===null||a===void 0?void 0:a.properties)===null||n===void 0?void 0:n[e])===null||o===void 0?void 0:o.type;return Array.isArray(s)?!s.includes("object")&&!s.includes("array"):i.includes(s)}))}e.exports=getDef},4563:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(4959));const ajvKeywords=(e,t)=>{if(Array.isArray(t)){for(const a of t)get(a)(e);return e}if(t){get(t)(e);return e}for(t in i.default)get(t)(e);return e};ajvKeywords.get=get;function get(e){const t=i.default[e];if(!t)throw new Error("Unknown keyword "+e);return t}t["default"]=ajvKeywords;e.exports=ajvKeywords;e.exports["default"]=ajvKeywords},237:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(9160));const allRequired=e=>e.addKeyword((0,i.default)());t["default"]=allRequired;e.exports=allRequired},484:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(5817));const anyRequired=e=>e.addKeyword((0,i.default)());t["default"]=anyRequired;e.exports=anyRequired},4739:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(6165));const deepProperties=(e,t)=>e.addKeyword((0,i.default)(t));t["default"]=deepProperties;e.exports=deepProperties},8360:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(2592));const deepRequired=e=>e.addKeyword((0,i.default)());t["default"]=deepRequired;e.exports=deepRequired},4515:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(3220));const dynamicDefaults=e=>e.addKeyword((0,i.default)());t["default"]=dynamicDefaults;e.exports=dynamicDefaults},5304:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(541));const exclusiveRange=e=>e.addKeyword((0,i.default)());t["default"]=exclusiveRange;e.exports=exclusiveRange},4959:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(6401));const o=n(a(7499));const s=n(a(7119));const r=n(a(5304));const c=n(a(9033));const p=n(a(4573));const u=n(a(2857));const l=n(a(237));const d=n(a(484));const m=n(a(3207));const f=n(a(9417));const h=n(a(9832));const v=n(a(4739));const x=n(a(8360));const g=n(a(4515));const y=n(a(2520));const b={typeof:i.default,instanceof:o.default,range:s.default,exclusiveRange:r.default,regexp:c.default,transform:p.default,uniqueItemProperties:u.default,allRequired:l.default,anyRequired:d.default,oneRequired:m.default,patternRequired:f.default,prohibited:h.default,deepProperties:v.default,deepRequired:x.default,dynamicDefaults:g.default,select:y.default};t["default"]=b;e.exports=b},7499:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(4785));const instanceofPlugin=e=>e.addKeyword((0,i.default)());t["default"]=instanceofPlugin;e.exports=instanceofPlugin},3207:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(4656));const oneRequired=e=>e.addKeyword((0,i.default)());t["default"]=oneRequired;e.exports=oneRequired},9417:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(1818));const patternRequired=e=>e.addKeyword((0,i.default)());t["default"]=patternRequired;e.exports=patternRequired},9832:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(7506));const prohibited=e=>e.addKeyword((0,i.default)());t["default"]=prohibited;e.exports=prohibited},7119:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(2669));const range=e=>e.addKeyword((0,i.default)());t["default"]=range;e.exports=range},9033:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(3163));const regexp=e=>e.addKeyword((0,i.default)());t["default"]=regexp;e.exports=regexp},2520:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(2730));const select=(e,t)=>{(0,i.default)(t).forEach((t=>e.addKeyword(t)));return e};t["default"]=select;e.exports=select},4573:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(6678));const transform=e=>e.addKeyword((0,i.default)());t["default"]=transform;e.exports=transform},6401:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(2518));const typeofPlugin=e=>e.addKeyword((0,i.default)());t["default"]=typeofPlugin;e.exports=typeofPlugin},2857:function(e,t,a){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const i=n(a(3530));const uniqueItemProperties=e=>e.addKeyword((0,i.default)());t["default"]=uniqueItemProperties;e.exports=uniqueItemProperties},4711:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;const n=a(3834);const i=a(8056);const o=a(8222);const s=a(9520);const r=["/properties"];const c="http://json-schema.org/draft-07/schema";class Ajv extends n.default{_addVocabularies(){super._addVocabularies();i.default.forEach((e=>this.addVocabulary(e)));if(this.opts.discriminator)this.addKeyword(o.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();if(!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,r):s;this.addMetaSchema(e,c,false);this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:undefined)}}e.exports=t=Ajv;Object.defineProperty(t,"__esModule",{value:true});t["default"]=Ajv;var p=a(7357);Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return p.KeywordCxt}});var u=a(4109);Object.defineProperty(t,"_",{enumerable:true,get:function(){return u._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return u.str}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return u.stringify}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return u.nil}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return u.Name}});Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return u.CodeGen}})},3456:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class _CodeOrName{}t._CodeOrName=_CodeOrName;t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(e){super();if(!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return false}get names(){return{[this.str]:1}}}t.Name=Name;class _Code extends _CodeOrName{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;const e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce(((e,t)=>`${e}${t}`),"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce(((e,t)=>{if(t instanceof Name)e[t.str]=(e[t.str]||0)+1;return e}),{})}}t._Code=_Code;t.nil=new _Code("");function _(e,...t){const a=[e[0]];let n=0;while(n<t.length){addCodeArg(a,t[n]);a.push(e[++n])}return new _Code(a)}t._=_;const a=new _Code("+");function str(e,...t){const n=[safeStringify(e[0])];let i=0;while(i<t.length){n.push(a);addCodeArg(n,t[i]);n.push(a,safeStringify(e[++i]))}optimize(n);return new _Code(n)}t.str=str;function addCodeArg(e,t){if(t instanceof _Code)e.push(...t._items);else if(t instanceof Name)e.push(t);else e.push(interpolate(t))}t.addCodeArg=addCodeArg;function optimize(e){let t=1;while(t<e.length-1){if(e[t]===a){const a=mergeExprItems(e[t-1],e[t+1]);if(a!==undefined){e.splice(t-1,3,a);continue}e[t++]="+"}t++}}function mergeExprItems(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Name||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Name))return`"${e}${t.slice(1)}`;return}function strConcat(e,t){return t.emptyStr()?e:e.emptyStr()?t:str`${e}${t}`}t.strConcat=strConcat;function interpolate(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:safeStringify(Array.isArray(e)?e.join(","):e)}function stringify(e){return new _Code(safeStringify(e))}t.stringify=stringify;function safeStringify(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=safeStringify;function getProperty(e){return typeof e=="string"&&t.IDENTIFIER.test(e)?new _Code(`.${e}`):_`[${e}]`}t.getProperty=getProperty;function getEsmExportName(e){if(typeof e=="string"&&t.IDENTIFIER.test(e)){return new _Code(`${e}`)}throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}t.getEsmExportName=getEsmExportName;function regexpCode(e){return new _Code(e.toString())}t.regexpCode=regexpCode},4109:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=a(3456);const i=a(3078);var o=a(3456);Object.defineProperty(t,"_",{enumerable:true,get:function(){return o._}});Object.defineProperty(t,"str",{enumerable:true,get:function(){return o.str}});Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return o.strConcat}});Object.defineProperty(t,"nil",{enumerable:true,get:function(){return o.nil}});Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return o.getProperty}});Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return o.stringify}});Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return o.regexpCode}});Object.defineProperty(t,"Name",{enumerable:true,get:function(){return o.Name}});var s=a(3078);Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return s.Scope}});Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return s.ValueScope}});Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return s.ValueScopeName}});Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return s.varKinds}});t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(e,t){return this}}class Def extends Node{constructor(e,t,a){super();this.varKind=e;this.name=t;this.rhs=a}render({es5:e,_n:t}){const a=e?i.varKinds.var:this.varKind;const n=this.rhs===undefined?"":` = ${this.rhs}`;return`${a} ${this.name}${n};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(e,t,a){super();this.lhs=e;this.rhs=t;this.sideEffects=a}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof n.Name&&!e[this.lhs.str]&&!this.sideEffects)return;this.rhs=optimizeExpr(this.rhs,e,t);return this}get names(){const e=this.lhs instanceof n.Name?{}:{...this.lhs.names};return addExprNames(e,this.rhs)}}class AssignOp extends Assign{constructor(e,t,a,n){super(e,a,n);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class Label extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){return`${this.label}:`+e}}class Break extends Node{constructor(e){super();this.label=e;this.names={}}render({_n:e}){const t=this.label?` ${this.label}`:"";return`break${t};`+e}}class Throw extends Node{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class AnyCode extends Node{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:undefined}optimizeNames(e,t){this.code=optimizeExpr(this.code,e,t);return this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce(((t,a)=>t+a.render(e)),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;while(t--){const a=e[t].optimizeNodes();if(Array.isArray(a))e.splice(t,1,...a);else if(a)e[t]=a;else e.splice(t,1)}return e.length>0?this:undefined}optimizeNames(e,t){const{nodes:a}=this;let n=a.length;while(n--){const i=a[n];if(i.optimizeNames(e,t))continue;subtractNames(e,i.names);a.splice(n,1)}return a.length>0?this:undefined}get names(){return this.nodes.reduce(((e,t)=>addNames(e,t.names)),{})}}class BlockNode extends ParentNode{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(e===true)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new Else(e):e}if(t){if(e===false)return t instanceof If?t:t.nodes;if(this.nodes.length)return this;return new If(not(e),t instanceof If?[t]:t.nodes)}if(e===false||!this.nodes.length)return undefined;return this}optimizeNames(e,t){var a;this.else=(a=this.else)===null||a===void 0?void 0:a.optimizeNames(e,t);if(!(super.optimizeNames(e,t)||this.else))return;this.condition=optimizeExpr(this.condition,e,t);return this}get names(){const e=super.names;addExprNames(e,this.condition);if(this.else)addNames(e,this.else.names);return e}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iteration=optimizeExpr(this.iteration,e,t);return this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(e,t,a,n){super();this.varKind=e;this.name=t;this.from=a;this.to=n}render(e){const t=e.es5?i.varKinds.var:this.varKind;const{name:a,from:n,to:o}=this;return`for(${t} ${a}=${n}; ${a}<${o}; ${a}++)`+super.render(e)}get names(){const e=addExprNames(super.names,this.from);return addExprNames(e,this.to)}}class ForIter extends For{constructor(e,t,a,n){super();this.loop=e;this.varKind=t;this.name=a;this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;this.iterable=optimizeExpr(this.iterable,e,t);return this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(e,t,a){super();this.name=e;this.args=t;this.async=a}render(e){const t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}Func.kind="func";class Return extends ParentNode{render(e){return"return "+super.render(e)}}Return.kind="return";class Try extends BlockNode{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;super.optimizeNodes();(e=this.catch)===null||e===void 0?void 0:e.optimizeNodes();(t=this.finally)===null||t===void 0?void 0:t.optimizeNodes();return this}optimizeNames(e,t){var a,n;super.optimizeNames(e,t);(a=this.catch)===null||a===void 0?void 0:a.optimizeNames(e,t);(n=this.finally)===null||n===void 0?void 0:n.optimizeNames(e,t);return this}get names(){const e=super.names;if(this.catch)addNames(e,this.catch.names);if(this.finally)addNames(e,this.finally.names);return e}}class Catch extends BlockNode{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Catch.kind="catch";class Finally extends BlockNode{render(e){return"finally"+super.render(e)}}Finally.kind="finally";class CodeGen{constructor(e,t={}){this._values={};this._blockStarts=[];this._constants={};this.opts={...t,_n:t.lines?"\n":""};this._extScope=e;this._scope=new i.Scope({parent:e});this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const a=this._extScope.value(e,t);const n=this._values[a.prefix]||(this._values[a.prefix]=new Set);n.add(a);return a}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,a,n){const i=this._scope.toName(t);if(a!==undefined&&n)this._constants[i.str]=a;this._leafNode(new Def(e,i,a));return i}const(e,t,a){return this._def(i.varKinds.const,e,t,a)}let(e,t,a){return this._def(i.varKinds.let,e,t,a)}var(e,t,a){return this._def(i.varKinds.var,e,t,a)}assign(e,t,a){return this._leafNode(new Assign(e,t,a))}add(e,a){return this._leafNode(new AssignOp(e,t.operators.ADD,a))}code(e){if(typeof e=="function")e();else if(e!==n.nil)this._leafNode(new AnyCode(e));return this}object(...e){const t=["{"];for(const[a,i]of e){if(t.length>1)t.push(",");t.push(a);if(a!==i||this.opts.es5){t.push(":");(0,n.addCodeArg)(t,i)}}t.push("}");return new n._Code(t)}if(e,t,a){this._blockNode(new If(e));if(t&&a){this.code(t).else().code(a).endIf()}else if(t){this.code(t).endIf()}else if(a){throw new Error('CodeGen: "else" body without "then" body')}return this}elseIf(e){return this._elseNode(new If(e))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(e,t){this._blockNode(e);if(t)this.code(t).endFor();return this}for(e,t){return this._for(new ForLoop(e),t)}forRange(e,t,a,n,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const s=this._scope.toName(e);return this._for(new ForRange(o,s,t,a),(()=>n(s)))}forOf(e,t,a,o=i.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,(t=>{this.var(s,(0,n._)`${e}[${t}]`);a(s)}))}return this._for(new ForIter("of",o,s,t),(()=>a(s)))}forIn(e,t,a,o=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties){return this.forOf(e,(0,n._)`Object.keys(${t})`,a)}const s=this._scope.toName(e);return this._for(new ForIter("in",o,s,t),(()=>a(s)))}endFor(){return this._endBlockNode(For)}label(e){return this._leafNode(new Label(e))}break(e){return this._leafNode(new Break(e))}return(e){const t=new Return;this._blockNode(t);this.code(e);if(t.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(e,t,a){if(!t&&!a)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new Try;this._blockNode(n);this.code(e);if(t){const e=this.name("e");this._currNode=n.catch=new Catch(e);t(e)}if(a){this._currNode=n.finally=new Finally;this.code(a)}return this._endBlockNode(Catch,Finally)}throw(e){return this._leafNode(new Throw(e))}block(e,t){this._blockStarts.push(this._nodes.length);if(e)this.code(e).endBlock(t);return this}endBlock(e){const t=this._blockStarts.pop();if(t===undefined)throw new Error("CodeGen: not in self-balancing block");const a=this._nodes.length-t;if(a<0||e!==undefined&&a!==e){throw new Error(`CodeGen: wrong number of nodes: ${a} vs ${e} expected`)}this._nodes.length=t;return this}func(e,t=n.nil,a,i){this._blockNode(new Func(e,t,a));if(i)this.code(i).endFunc();return this}endFunc(){return this._endBlockNode(Func)}optimize(e=1){while(e-- >0){this._root.optimizeNodes();this._root.optimizeNames(this._root.names,this._constants)}}_leafNode(e){this._currNode.nodes.push(e);return this}_blockNode(e){this._currNode.nodes.push(e);this._nodes.push(e)}_endBlockNode(e,t){const a=this._currNode;if(a instanceof e||t&&a instanceof t){this._nodes.pop();return this}throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof If)){throw new Error('CodeGen: "else" without "if"')}this._currNode=t.else=e;return this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}}t.CodeGen=CodeGen;function addNames(e,t){for(const a in t)e[a]=(e[a]||0)+(t[a]||0);return e}function addExprNames(e,t){return t instanceof n._CodeOrName?addNames(e,t.names):e}function optimizeExpr(e,t,a){if(e instanceof n.Name)return replaceName(e);if(!canOptimize(e))return e;return new n._Code(e._items.reduce(((e,t)=>{if(t instanceof n.Name)t=replaceName(t);if(t instanceof n._Code)e.push(...t._items);else e.push(t);return e}),[]));function replaceName(e){const n=a[e.str];if(n===undefined||t[e.str]!==1)return e;delete t[e.str];return n}function canOptimize(e){return e instanceof n._Code&&e._items.some((e=>e instanceof n.Name&&t[e.str]===1&&a[e.str]!==undefined))}}function subtractNames(e,t){for(const a in t)e[a]=(e[a]||0)-(t[a]||0)}function not(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,n._)`!${par(e)}`}t.not=not;const r=mappend(t.operators.AND);function and(...e){return e.reduce(r)}t.and=and;const c=mappend(t.operators.OR);function or(...e){return e.reduce(c)}t.or=or;function mappend(e){return(t,a)=>t===n.nil?a:a===n.nil?t:(0,n._)`${par(t)} ${e} ${par(a)}`}function par(e){return e instanceof n.Name?e:(0,n._)`(${e})`}},3078:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=a(3456);class ValueError extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var i;(function(e){e[e["Started"]=0]="Started";e[e["Completed"]=1]="Completed"})(i=t.UsedValueState||(t.UsedValueState={}));t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class Scope{constructor({prefixes:e,parent:t}={}){this._names={};this._prefixes=e;this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){const t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,a;if(((a=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||a===void 0?void 0:a.has(e))||this._prefixes&&!this._prefixes.has(e)){throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`)}return this._names[e]={prefix:e,index:0}}}t.Scope=Scope;class ValueScopeName extends n.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:a}){this.value=e;this.scopePath=(0,n._)`.${new n.Name(t)}[${a}]`}}t.ValueScopeName=ValueScopeName;const o=(0,n._)`\n`;class ValueScope extends Scope{constructor(e){super(e);this._values={};this._scope=e.scope;this.opts={...e,_n:e.lines?o:n.nil}}get(){return this._scope}name(e){return new ValueScopeName(e,this._newName(e))}value(e,t){var a;if(t.ref===undefined)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e);const{prefix:i}=n;const o=(a=t.key)!==null&&a!==void 0?a:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else{s=this._values[i]=new Map}s.set(o,n);const r=this._scope[i]||(this._scope[i]=[]);const c=r.length;r[c]=t.ref;n.setValue(t,{property:i,itemIndex:c});return n}getValue(e,t){const a=this._values[e];if(!a)return;return a.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(t=>{if(t.scopePath===undefined)throw new Error(`CodeGen: name "${t}" has no value`);return(0,n._)`${e}${t.scopePath}`}))}scopeCode(e=this._values,t,a){return this._reduceValues(e,(e=>{if(e.value===undefined)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code}),t,a)}_reduceValues(e,a,o={},s){let r=n.nil;for(const c in e){const p=e[c];if(!p)continue;const u=o[c]=o[c]||new Map;p.forEach((e=>{if(u.has(e))return;u.set(e,i.Started);let o=a(e);if(o){const a=this.opts.es5?t.varKinds.var:t.varKinds.const;r=(0,n._)`${r}${a} ${e} = ${o};${this.opts._n}`}else if(o=s===null||s===void 0?void 0:s(e)){r=(0,n._)`${r}${o}${this.opts._n}`}else{throw new ValueError(e)}u.set(e,i.Completed)}))}return r}}t.ValueScope=ValueScope},1069:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=a(4109);const i=a(7545);const o=a(4492);t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`};t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`};function reportError(e,a=t.keywordError,i,o){const{it:s}=e;const{gen:r,compositeRule:c,allErrors:p}=s;const u=errorObjectCode(e,a,