likec4 1.44.0 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/src/likec4.js +14290 -13881
- package/__app__/src/main.js +16 -18
- package/__app__/src/style.css +1 -1
- package/__app__/src/vendors.js +531 -445
- package/__app__/src/webcomponent.js +1 -1
- package/config/schema.json +3 -5
- package/dist/cli/index.mjs +549 -548
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.H8IcXBiE.mjs → likec4.CuC6o09-.mjs} +125 -124
- package/dist/shared/{likec4.CXaeDwoC.mjs → likec4.DH1Cjktk.mjs} +1 -1
- package/dist/shared/{likec4.CyRRoRaV.d.mts → likec4.DVpfjKrU.d.mts} +18 -2
- package/dist/shared/{likec4.BSr9pG1Z.mjs → likec4.Do3Hp_xd.mjs} +1883 -1872
- package/dist/shared/{likec4.97TpL3Hf.d.mts → likec4.YFH8qb4R.d.mts} +57 -37
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/index.mjs +1 -1
- package/dist/vite-plugin/internal.mjs +6 -6
- package/package.json +32 -31
- package/react/index.d.ts +1904 -6174
- package/react/index.js +10346 -9859
package/dist/cli/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{h as Te,r as Tf,k as tt,l as mn,m as wt,u as
|
|
3
|
-
import{b as Uo,t as Fo,a as Bf,d as bt}from"../shared/likec4.CB2-Uaub.mjs";import{env as Vo,isMinimal as Kf,nodeENV as Wf,isDevelopment as Xf}from"std-env";import Jf from"yargs";import{hideBin as Yf}from"yargs/helpers";import ie,{resolve as oe,dirname as qe,join as Et,relative as Ue,sep as zo,extname as St,isAbsolute as _n,basename as
|
|
4
|
-
import{fileURLToPath as Bo}from"node:url";import bn from"@vitejs/plugin-react";import Ko from"util";import En,{resolve as ct}from"path";import{j as Wo,e as Xo,C as ed,t as Jo,N as ut,L as Sn,g as td,a as rd,b as nd}from"../shared/likec4.
|
|
5
|
-
isDeepStrictEqual as ud}from"node:util";import Pt from"node:crypto";import ld from"node:assert";import{
|
|
6
|
-
try{return se.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wd(){return Pn===void 0&&(Pn=$d()||_d()),Pn}let Cn;const bd=()=>{try{return se.statSync("/run/.containerenv"),!0}catch{return!1}};function
|
|
7
|
-
le by --no-use-dot":'use graphviz binaries ("dot" should be on PATH)',default:
|
|
8
|
-
ring",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4",nargs:1},ta={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},Ed={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Sd={alias:"l",type:"string"
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import{h as Te,r as Tf,k as tt,l as mn,m as wt,u as N,w as Oo,o as Of,p as Nf,q as Ae,s as No,v as Ht,x as Ke,y as If,d as Io,z as jo,A as jf,c as Lf,L as Pe,B as Df,j as Lo,C as qf,D as Do,E as De,F as xf,G as Mf,e as Hf,H as at,U as yn,I as it,J as gn,K as vn,M as qo,Q as xo}from"../shared/likec4.Do3Hp_xd.mjs";import se,{existsSync as He,copyFileSync as Mo,readdirSync as Uf,rmSync as $n,statSync as Ff}from"node:fs";import me,{hrtime as Vf,cwd as Ut,exit as Ho,argv as zf,stdout as Gf}from"node:process";
|
|
3
|
+
import{b as Uo,t as Fo,a as Bf,d as bt}from"../shared/likec4.CB2-Uaub.mjs";import{env as Vo,isMinimal as Kf,nodeENV as Wf,isDevelopment as Xf}from"std-env";import Jf from"yargs";import{hideBin as Yf}from"yargs/helpers";import ie,{resolve as oe,dirname as qe,join as Et,relative as Ue,sep as zo,extname as St,isAbsolute as _n,basename as Ft}from"node:path";import Go,{mkdtemp as Vt,writeFile as We,mkdir as xe,stat as wn,copyFile as Qf,rm as Zf}from"node:fs/promises";import Rt,{tmpdir as zt}from"node:os";
|
|
4
|
+
import{fileURLToPath as Bo}from"node:url";import bn from"@vitejs/plugin-react";import Ko from"util";import En,{resolve as ct}from"path";import{j as Wo,e as Xo,C as ed,t as Jo,N as ut,L as Sn,g as td,a as rd,b as nd}from"../shared/likec4.DH1Cjktk.mjs";import{build as At,createServer as sd,preview as od}from"vite";import ad from"node:module";import id from"node:net";import{setTimeout as cd}from"node:timers/promises";import{invariant as Rn,nonexhaustive as An}from"@likec4/core";import{promisify as ve,
|
|
5
|
+
isDeepStrictEqual as ud}from"node:util";import Pt from"node:crypto";import ld from"node:assert";import{l as lt}from"../shared/likec4.CuC6o09-.mjs";import{isDeploymentRelationModel as fd,isRelationModel as dd,isDeploymentElementModel as pd,isLikeC4ViewModel as hd,isElementModel as md}from"@likec4/core/model";import{compareNatural as yd,sortNaturalByFqn as gd,invariant as vd,delay as Yo}from"@likec4/core/utils";let Pn;function $d(){try{return se.statSync("/.dockerenv"),!0}catch{return!1}}function _d(){
|
|
6
|
+
try{return se.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function wd(){return Pn===void 0&&(Pn=$d()||_d()),Pn}let Cn;const bd=()=>{try{return se.statSync("/run/.containerenv"),!0}catch{return!1}};function Xe(){return Cn===void 0&&(Cn=bd()||wd()),Cn}const be={type:"string",desc:"<directory> with LikeC4 sources (default is current directory)",normalize:!0,default:".",coerce:oe},Re={alias:"use-dot-bin",boolean:!0,type:"boolean",desc:Xe()?"enabled in container, disab\
|
|
7
|
+
le by --no-use-dot":'use graphviz binaries ("dot" should be on PATH)',default:Xe()},Qo={boolean:!0,type:"boolean",desc:"use `@likec4/core` package in types",default:!1},Zo={boolean:!0,type:"boolean",desc:'use hash history for navigation, e.g. "/#/view" instead of "/view"'},Gt={alias:"o",type:"string",desc:"output directory",normalize:!0,nargs:1,coerce:oe},kn={alias:"w",type:"string",desc:'prefix for Webcomponents, e.g "c4" generates <c4-view ../>',default:"likec4",nargs:1},ea={alias:"t",type:"st\
|
|
8
|
+
ring",desc:'base title of the app pages (default is "LikeC4")',default:"LikeC4",nargs:1},ta={alias:["base-url"],type:"string",desc:'base url the app is being served from, e.g. "/" or "/pages/"',nargs:1},Ed={boolean:!0,type:"boolean",desc:"outputs a single self-contained HTML file with all required resources inlined"},Sd={alias:"l",type:"string",...Xe()?{desc:"listen 0.0.0.0 by default in container",default:"0.0.0.0"}:{desc:"ip address of the network interface to listen on"},nargs:1},Rd={type:"nu\
|
|
9
|
+
mber",desc:"port number for the dev server (default is 5173, or PORT environment variable)",nargs:1},Ct={alias:"p",type:"string",desc:'LikeC4 project, name eg. "my-project" or path to the project folder',nargs:1},ra=e=>e instanceof URL?Bo(e):e;function Ad(e,{cwd:t=me.cwd(),type:r="file",stopAt:n}={}){let i=ie.resolve(ra(t)??"");const{root:a}=ie.parse(i);for(n=ie.resolve(i,ra(n)??a);i&&i!==n&&i!==a;){const o=ie.isAbsolute(e)?e:ie.join(i,e);try{const s=se.statSync(o,{throwIfNoEntry:!1});if(r==="fi\
|
|
10
|
+
le"&&s?.isFile()||r==="directory"&&s?.isDirectory())return o}catch{}i=ie.dirname(i)}}function Pd({cwd:e=me.cwd()}={}){return Ad("package.json",{cwd:e})}const Cd=Te("vite"),Bt=qe(Bo(import.meta.url)),kd=`
|
|
11
11
|
/* prettier-ignore-start */
|
|
12
12
|
/* eslint-disable */
|
|
13
13
|
|
|
@@ -19,89 +19,89 @@ file"&&s?.isFile()||r==="directory"&&s?.isDirectory())return a}catch{}i=ie.dirna
|
|
|
19
19
|
`.trimStart(),Td=`
|
|
20
20
|
|
|
21
21
|
/* prettier-ignore-end */
|
|
22
|
-
`,Tn={banner:kd,footer:Td};function na(){const e=Pd({cwd:Bt});if(!e)throw new Error("likec4 package folder not found");return qe(e)}function
|
|
22
|
+
`,Tn={banner:kd,footer:Td};function na(){const e=Pd({cwd:Bt});if(!e)throw new Error("likec4 package folder not found");return qe(e)}function On(){const e=na(),t=[oe(e,"__app__"),oe(Bt,"../__app__"),oe(Bt,"../../__app__"),oe(Bt,"../../dist/__app__")],r=Tf(t,He);if(!r)throw tt.error(`likec4 app root does not exist, tried:
|
|
23
23
|
${t.join(`
|
|
24
|
-
`)}`),new Error("likec4 app root does not exist");return r}async function
|
|
24
|
+
`)}`),new Error("likec4 app root does not exist");return r}async function Nn(){const e=await Vt(Et(zt(),".likec4-public-"));return await We(Et(e,"likec4-views.js"),`// generated by likec4
|
|
25
25
|
`),e}const In=1e4;function jn(){const e=na();return{"likec4/icons":oe(e,"icons"),"likec4/react":oe(e,"react/index.js"),"likec4/model":oe(e,"dist/model/index.mjs"),"likec4/vite-plugin/internal":oe(e,"dist/vite-plugin/internal.mjs")}}var Ln={},sa;function Dn(){return sa||(sa=1,(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,r)=>t.nodes.find(n=>n.type===r),e.exceedsLimit=(t,r,n=1,i)=>i===!1||!e.isInteger(t)||
|
|
26
26
|
!e.isInteger(r)?!1:(Number(r)-Number(t))/Number(n)>=i,e.escapeNode=(t,r=0,n)=>{const i=t.nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===
|
|
27
|
-
!0||t.close===!0,e.reduce=t=>t.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),e.flatten=(...t)=>{const r=[],n=i=>{for(let
|
|
28
|
-
s)&&e.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const c of i.nodes)u+=n(c);return u};return n(t)},qn}var Mn,aa;function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
v=l(
|
|
32
|
-
|
|
33
|
-
return
|
|
34
|
-
`0{0,${d}}`:`0{${d}}`}}return t.cache={},t.clearCache=()=>t.cache={},Hn=t,Hn}var Un,ca;function ua(){if(ca)return Un;ca=1;const e=Ko,t=
|
|
35
|
-
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?v-1:v,"0")}return $===!1?String(d):d},c=(d,v)=>{let $=d[0]==="-"?"-":"";for($&&(d=d.slice(1),v--);d.length<v;)d="0"+d;return $?"-"+d:d},l=(d,v,$)=>{d.negatives.sort((
|
|
36
|
-
`(${w}${
|
|
37
|
-
be a number`);return[]},
|
|
38
|
-
abs(A)),Q=[],q=0;for(;
|
|
39
|
-
wrap:!1,options:w}):
|
|
40
|
-
i.escapeInvalid===!0,l=u===!0||c===!0,m=i.escapeInvalid===!0?"\\":"";let y="";if(
|
|
41
|
-
length>1?`(${S})`:S}if(
|
|
42
|
-
(o
|
|
43
|
-
or disable the limit.");let
|
|
44
|
-
flatten(u(
|
|
27
|
+
!0||t.close===!0,e.reduce=t=>t.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),e.flatten=(...t)=>{const r=[],n=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(t),r}})(Ln)),Ln}var qn,oa;function xn(){if(oa)return qn;oa=1;const e=Dn();return qn=(t,r={})=>{const n=(i,a={})=>{const o=r.escapeInvalid&&e.isInvalidBrace(a),s=i.invalid===!0&&r.escapeInvalid===!0;let u="";if(i.value)return(o||
|
|
28
|
+
s)&&e.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const c of i.nodes)u+=n(c);return u};return n(t)},qn}var Mn,aa;function Od(){return aa||(aa=1,Mn=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}),Mn}var Hn,ia;function Nd(){if(ia)return Hn;ia=1;const e=Od(),t=(h,p,f)=>{if(e(h)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(p===void 0||h===
|
|
29
|
+
p)return String(h);if(e(p)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let d={relaxZeros:!0,...f};typeof d.strictZeros=="boolean"&&(d.relaxZeros=d.strictZeros===!1);let v=String(d.relaxZeros),$=String(d.shorthand),w=String(d.capture),b=String(d.wrap),P=h+":"+p+"="+v+$+w+b;if(t.cache.hasOwnProperty(P))return t.cache[P].result;let I=Math.min(h,p),H=Math.max(h,p);if(Math.abs(I-H)===1){let M=h+"|"+p;return d.capture?`(${M})`:d.wrap===!1?M:`(?:${M})`}let x=S(
|
|
30
|
+
h)||S(p),U={min:h,max:p,a:I,b:H},L=[],j=[];if(x&&(U.isPadded=x,U.maxLen=String(U.max).length),I<0){let M=H<0?Math.abs(H):1;j=a(M,Math.abs(I),U,d),I=U.a=0}return H>=0&&(L=a(I,H,U,d)),U.negatives=j,U.positives=L,U.result=r(j,L),d.capture===!0?U.result=`(${U.result})`:d.wrap!==!1&&L.length+j.length>1&&(U.result=`(?:${U.result})`),t.cache[P]=U,U.result};function r(h,p,f){let d=o(h,p,"-",!1)||[],v=o(p,h,"",!1)||[],$=o(h,p,"-?",!0)||[];return d.concat($).concat(v).join("|")}function n(h,p){let f=1,d=1,
|
|
31
|
+
v=l(h,f),$=new Set([p]);for(;h<=v&&v<=p;)$.add(v),f+=1,v=l(h,f);for(v=m(p+1,d)-1;h<v&&v<=p;)$.add(v),d+=1,v=m(p+1,d)-1;return $=[...$],$.sort(u),$}function i(h,p,f){if(h===p)return{pattern:h,count:[],digits:0};let d=s(h,p),v=d.length,$="",w=0;for(let b=0;b<v;b++){let[P,I]=d[b];P===I?$+=P:P!=="0"||I!=="9"?$+=_(P,I):w++}return w&&($+=f.shorthand===!0?"\\d":"[0-9]"),{pattern:$,count:[w],digits:v}}function a(h,p,f,d){let v=n(h,p),$=[],w=h,b;for(let P=0;P<v.length;P++){let I=v[P],H=i(String(w),String(
|
|
32
|
+
I),d),x="";if(!f.isPadded&&b&&b.pattern===H.pattern){b.count.length>1&&b.count.pop(),b.count.push(H.count[0]),b.string=b.pattern+y(b.count),w=I+1;continue}f.isPadded&&(x=g(I,f,d)),H.string=x+H.pattern+y(H.count),$.push(H),w=I+1,b=H}return $}function o(h,p,f,d,v){let $=[];for(let w of h){let{string:b}=w;!d&&!c(p,"string",b)&&$.push(f+b),d&&c(p,"string",b)&&$.push(f+b)}return $}function s(h,p){let f=[];for(let d=0;d<h.length;d++)f.push([h[d],p[d]]);return f}function u(h,p){return h>p?1:p>h?-1:0}function c(h,p,f){
|
|
33
|
+
return h.some(d=>d[p]===f)}function l(h,p){return Number(String(h).slice(0,-p)+"9".repeat(p))}function m(h,p){return h-h%Math.pow(10,p)}function y(h){let[p=0,f=""]=h;return f||p>1?`{${p+(f?","+f:"")}}`:""}function _(h,p,f){return`[${h}${p-h===1?"":"-"}${p}]`}function S(h){return/^-?(0+)\d/.test(h)}function g(h,p,f){if(!p.isPadded)return h;let d=Math.abs(p.maxLen-String(h).length),v=f.relaxZeros!==!1;switch(d){case 0:return"";case 1:return v?"0?":"0";case 2:return v?"0{0,2}":"00";default:return v?
|
|
34
|
+
`0{0,${d}}`:`0{${d}}`}}return t.cache={},t.clearCache=()=>t.cache={},Hn=t,Hn}var Un,ca;function ua(){if(ca)return Un;ca=1;const e=Ko,t=Nd(),r=d=>d!==null&&typeof d=="object"&&!Array.isArray(d),n=d=>v=>d===!0?Number(v):String(v),i=d=>typeof d=="number"||typeof d=="string"&&d!=="",a=d=>Number.isInteger(+d),o=d=>{let v=`${d}`,$=-1;if(v[0]==="-"&&(v=v.slice(1)),v==="0")return!1;for(;v[++$]==="0";);return $>0},s=(d,v,$)=>typeof d=="string"||typeof v=="string"?!0:$.stringify===!0,u=(d,v,$)=>{if(v>0){let w=d[0]===
|
|
35
|
+
"-"?"-":"";w&&(d=d.slice(1)),d=w+d.padStart(w?v-1:v,"0")}return $===!1?String(d):d},c=(d,v)=>{let $=d[0]==="-"?"-":"";for($&&(d=d.slice(1),v--);d.length<v;)d="0"+d;return $?"-"+d:d},l=(d,v,$)=>{d.negatives.sort((H,x)=>H<x?-1:H>x?1:0),d.positives.sort((H,x)=>H<x?-1:H>x?1:0);let w=v.capture?"":"?:",b="",P="",I;return d.positives.length&&(b=d.positives.map(H=>c(String(H),$)).join("|")),d.negatives.length&&(P=`-(${w}${d.negatives.map(H=>c(String(H),$)).join("|")})`),b&&P?I=`${b}|${P}`:I=b||P,v.wrap?
|
|
36
|
+
`(${w}${I})`:I},m=(d,v,$,w)=>{if($)return t(d,v,{wrap:!1,...w});let b=String.fromCharCode(d);if(d===v)return b;let P=String.fromCharCode(v);return`[${b}-${P}]`},y=(d,v,$)=>{if(Array.isArray(d)){let w=$.wrap===!0,b=$.capture?"":"?:";return w?`(${b}${d.join("|")})`:d.join("|")}return t(d,v,$)},_=(...d)=>new RangeError("Invalid range arguments: "+e.inspect(...d)),S=(d,v,$)=>{if($.strictRanges===!0)throw _([d,v]);return[]},g=(d,v)=>{if(v.strictRanges===!0)throw new TypeError(`Expected step "${d}" to\
|
|
37
|
+
be a number`);return[]},h=(d,v,$=1,w={})=>{let b=Number(d),P=Number(v);if(!Number.isInteger(b)||!Number.isInteger(P)){if(w.strictRanges===!0)throw _([d,v]);return[]}b===0&&(b=0),P===0&&(P=0);let I=b>P,H=String(d),x=String(v),U=String($);$=Math.max(Math.abs($),1);let L=o(H)||o(x)||o(U),j=L?Math.max(H.length,x.length,U.length):0,M=L===!1&&s(d,v,w)===!1,z=w.transform||n(M);if(w.toRegex&&$===1)return m(c(d,j),c(v,j),!0,w);let F={negatives:[],positives:[]},G=A=>F[A<0?"negatives":"positives"].push(Math.
|
|
38
|
+
abs(A)),Q=[],q=0;for(;I?b>=P:b<=P;)w.toRegex===!0&&$>1?G(b):Q.push(u(z(b,q),j,M)),b=I?b-$:b+$,q++;return w.toRegex===!0?$>1?l(F,w,j):y(Q,null,{wrap:!1,...w}):Q},p=(d,v,$=1,w={})=>{if(!a(d)&&d.length>1||!a(v)&&v.length>1)return S(d,v,w);let b=w.transform||(M=>String.fromCharCode(M)),P=`${d}`.charCodeAt(0),I=`${v}`.charCodeAt(0),H=P>I,x=Math.min(P,I),U=Math.max(P,I);if(w.toRegex&&$===1)return m(x,U,!1,w);let L=[],j=0;for(;H?P>=I:P<=I;)L.push(b(P,j)),P=H?P-$:P+$,j++;return w.toRegex===!0?y(L,null,{
|
|
39
|
+
wrap:!1,options:w}):L},f=(d,v,$,w={})=>{if(v==null&&i(d))return[d];if(!i(d)||!i(v))return S(d,v,w);if(typeof $=="function")return f(d,v,1,{transform:$});if(r($))return f(d,v,0,$);let b={...w};return b.capture===!0&&(b.wrap=!0),$=$||b.step||1,a($)?a(d)&&a(v)?h(d,v,$,b):p(d,v,Math.max(Math.abs($),1),b):$!=null&&!r($)?g($,b):f(d,v,1,$)};return Un=f,Un}var Fn,la;function Id(){if(la)return Fn;la=1;const e=ua(),t=Dn();return Fn=(n,i={})=>{const a=(o,s={})=>{const u=t.isInvalidBrace(s),c=o.invalid===!0&&
|
|
40
|
+
i.escapeInvalid===!0,l=u===!0||c===!0,m=i.escapeInvalid===!0?"\\":"";let y="";if(o.isOpen===!0)return m+o.value;if(o.isClose===!0)return console.log("node.isClose",m,o.value),m+o.value;if(o.type==="open")return l?m+o.value:"(";if(o.type==="close")return l?m+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":l?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const _=t.reduce(o.nodes),S=e(..._,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if(S.length!==0)return _.length>1&&S.
|
|
41
|
+
length>1?`(${S})`:S}if(o.nodes)for(const _ of o.nodes)y+=a(_,o);return y};return a(n)},Fn}var Vn,fa;function jd(){if(fa)return Vn;fa=1;const e=ua(),t=xn(),r=Dn(),n=(a="",o="",s=!1)=>{const u=[];if(a=[].concat(a),o=[].concat(o),!o.length)return a;if(!a.length)return s?r.flatten(o).map(c=>`{${c}}`):o;for(const c of a)if(Array.isArray(c))for(const l of c)u.push(n(l,o,s));else for(let l of o)s===!0&&typeof l=="string"&&(l=`{${l}}`),u.push(Array.isArray(l)?n(c,l,s):c+l);return r.flatten(u)};return Vn=
|
|
42
|
+
(a,o={})=>{const s=o.rangeLimit===void 0?1e3:o.rangeLimit,u=(c,l={})=>{c.queue=[];let m=l,y=l.queue;for(;m.type!=="brace"&&m.type!=="root"&&m.parent;)m=m.parent,y=m.queue;if(c.invalid||c.dollar){y.push(n(y.pop(),t(c,o)));return}if(c.type==="brace"&&c.invalid!==!0&&c.nodes.length===2){y.push(n(y.pop(),["{}"]));return}if(c.nodes&&c.ranges>0){const h=r.reduce(c.nodes);if(r.exceedsLimit(...h,o.step,s))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase\
|
|
43
|
+
or disable the limit.");let p=e(...h,o);p.length===0&&(p=t(c,o)),y.push(n(y.pop(),p)),c.nodes=[];return}const _=r.encloseBrace(c);let S=c.queue,g=c;for(;g.type!=="brace"&&g.type!=="root"&&g.parent;)g=g.parent,S=g.queue;for(let h=0;h<c.nodes.length;h++){const p=c.nodes[h];if(p.type==="comma"&&c.type==="brace"){h===1&&S.push(""),S.push("");continue}if(p.type==="close"){y.push(n(y.pop(),S,_));continue}if(p.value&&p.type!=="open"){S.push(n(S.pop(),p.value));continue}p.nodes&&u(p,c)}return S};return r.
|
|
44
|
+
flatten(u(a))},Vn}var zn,da;function Ld(){return da||(da=1,zn={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\
|
|
45
45
|
\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
46
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),zn}var Gn,pa;function Dd(){if(pa)return Gn;pa=1;const e=xn(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:
|
|
47
|
-
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:m,CHAR_DOUBLE_QUOTE:y,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:S,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=Ld();return Gn=(
|
|
48
|
-
let
|
|
49
|
-
|
|
50
|
-
type:"brace",open:!0,close:!1,dollar:P.value&&P.value.slice(-1)==="$"||
|
|
51
|
-
const z=
|
|
52
|
-
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(
|
|
53
|
-
o
|
|
54
|
-
=.)",u="[^/]",c=`(?:${
|
|
46
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}),zn}var Gn,pa;function Dd(){if(pa)return Gn;pa=1;const e=xn(),{MAX_LENGTH:t,CHAR_BACKSLASH:r,CHAR_BACKTICK:n,CHAR_COMMA:i,CHAR_DOT:a,CHAR_LEFT_PARENTHESES:o,CHAR_RIGHT_PARENTHESES:s,
|
|
47
|
+
CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_RIGHT_SQUARE_BRACKET:m,CHAR_DOUBLE_QUOTE:y,CHAR_SINGLE_QUOTE:_,CHAR_NO_BREAK_SPACE:S,CHAR_ZERO_WIDTH_NOBREAK_SPACE:g}=Ld();return Gn=(p,f={})=>{if(typeof p!="string")throw new TypeError("Expected a string");const d=f||{},v=typeof d.maxLength=="number"?Math.min(t,d.maxLength):t;if(p.length>v)throw new SyntaxError(`Input length (${p.length}), exceeds max characters (${v})`);const $={type:"root",input:p,nodes:[]},w=[$];
|
|
48
|
+
let b=$,P=$,I=0;const H=p.length;let x=0,U=0,L;const j=()=>p[x++],M=z=>{if(z.type==="text"&&P.type==="dot"&&(P.type="text"),P&&P.type==="text"&&z.type==="text"){P.value+=z.value;return}return b.nodes.push(z),z.parent=b,z.prev=P,P=z,z};for(M({type:"bos"});x<H;)if(b=w[w.length-1],L=j(),!(L===g||L===S)){if(L===r){M({type:"text",value:(f.keepEscaping?L:"")+j()});continue}if(L===m){M({type:"text",value:"\\"+L});continue}if(L===l){I++;let z;for(;x<H&&(z=j());){if(L+=z,z===l){I++;continue}if(z===r){L+=
|
|
49
|
+
j();continue}if(z===m&&(I--,I===0))break}M({type:"text",value:L});continue}if(L===o){b=M({type:"paren",nodes:[]}),w.push(b),M({type:"text",value:L});continue}if(L===s){if(b.type!=="paren"){M({type:"text",value:L});continue}b=w.pop(),M({type:"text",value:L}),b=w[w.length-1];continue}if(L===y||L===_||L===n){const z=L;let F;for(f.keepQuotes!==!0&&(L="");x<H&&(F=j());){if(F===r){L+=F+j();continue}if(F===z){f.keepQuotes===!0&&(L+=F);break}L+=F}M({type:"text",value:L});continue}if(L===u){U++;const F={
|
|
50
|
+
type:"brace",open:!0,close:!1,dollar:P.value&&P.value.slice(-1)==="$"||b.dollar===!0,depth:U,commas:0,ranges:0,nodes:[]};b=M(F),w.push(b),M({type:"open",value:L});continue}if(L===c){if(b.type!=="brace"){M({type:"text",value:L});continue}const z="close";b=w.pop(),b.close=!0,M({type:z,value:L}),U--,b=w[w.length-1];continue}if(L===i&&U>0){if(b.ranges>0){b.ranges=0;const z=b.nodes.shift();b.nodes=[z,{type:"text",value:e(b)}]}M({type:"comma",value:L}),b.commas++;continue}if(L===a&&U>0&&b.commas===0){
|
|
51
|
+
const z=b.nodes;if(U===0||z.length===0){M({type:"text",value:L});continue}if(P.type==="dot"){if(b.range=[],P.value+=L,P.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,P.type="text";continue}b.ranges++,b.args=[];continue}if(P.type==="range"){z.pop();const F=z[z.length-1];F.value+=P.value+L,P=F,b.ranges--;continue}M({type:"dot",value:L});continue}M({type:"text",value:L})}do if(b=w.pop(),b.type!=="root"){b.nodes.forEach(G=>{G.nodes||(G.type==="open"&&(G.isOpen=!0),G.type===
|
|
52
|
+
"close"&&(G.isClose=!0),G.nodes||(G.type="text"),G.invalid=!0)});const z=w[w.length-1],F=z.nodes.indexOf(b);z.nodes.splice(F,1,...b.nodes)}while(w.length>0);return M({type:"eos"}),$},Gn}var Bn,ha;function qd(){if(ha)return Bn;ha=1;const e=xn(),t=Id(),r=jd(),n=Dd(),i=(a,o={})=>{let s=[];if(Array.isArray(a))for(const u of a){const c=i.create(u,o);Array.isArray(c)?s.push(...c):s.push(c)}else s=[].concat(i.create(a,o));return o&&o.expand===!0&&o.nodupes===!0&&(s=[...new Set(s)]),s};return i.parse=(a,o={})=>n(
|
|
53
|
+
a,o),i.stringify=(a,o={})=>e(typeof a=="string"?i.parse(a,o):a,o),i.compile=(a,o={})=>(typeof a=="string"&&(a=i.parse(a,o)),t(a,o)),i.expand=(a,o={})=>{typeof a=="string"&&(a=i.parse(a,o));let s=r(a,o);return o.noempty===!0&&(s=s.filter(Boolean)),o.nodupes===!0&&(s=[...new Set(s)]),s},i.create=(a,o={})=>a===""||a.length<3?[a]:o.expand!==!0?i.compile(a,o):i.expand(a,o),Bn=i,Bn}var Kn={},Wn,ma;function Kt(){if(ma)return Wn;ma=1;const e=En,t="\\\\/",r=`[^${t}]`,n="\\.",i="\\+",a="\\?",o="\\/",s="(?\
|
|
54
|
+
=.)",u="[^/]",c=`(?:${o}|$)`,l=`(?:^|${o})`,m=`${n}{1,2}${c}`,y=`(?!${n})`,_=`(?!${l}${m})`,S=`(?!${n}{0,1}${c})`,g=`(?!${m})`,h=`[^.${o}]`,p=`${u}*?`,f={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:a,SLASH_LITERAL:o,ONE_CHAR:s,QMARK:u,END_ANCHOR:c,DOTS_SLASH:m,NO_DOT:y,NO_DOTS:_,NO_DOT_SLASH:S,NO_DOTS_SLASH:g,QMARK_NO_DOT:h,STAR:p,START_ANCHOR:l},d={...f,SLASH_LITERAL:`[${t}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,
|
|
55
55
|
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`},v={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Wn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:v,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
56
56
|
REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,
|
|
57
57
|
CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,
|
|
58
58
|
CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:e.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?d:f}},Wn}var ya;function Wt(){return ya||(ya=1,(function(e){const t=En,r=process.
|
|
59
|
-
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:
|
|
59
|
+
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Kt();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>a.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(n,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||
|
|
60
60
|
s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:r===!0||t.sep==="\\",e.escapeLast=(s,u,c)=>{const l=s.lastIndexOf(u,c);return l===-1?s:s[l-1]==="\\"?e.escapeLast(s,u,l-1):`${s.slice(0,l)}\\${s.slice(l)}`},e.removePrefix=(s,u={})=>{let c=s;return c.startsWith("./")&&(c=c.slice(2),u.prefix="./"),c},e.wrapOutput=(s,u={},c={})=>{const l=c.contains?"":"^",m=c.contains?"":"$";let y=`${l}(?:${s})${m}`;return u.negated===!0&&(y=`(?:^(?!${y}).*$)`),y}})(Kn)),Kn}var Xn,ga;function xd(){
|
|
61
|
-
if(ga)return Xn;ga=1;const e=Wt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:
|
|
62
|
-
|
|
63
|
-
!0,F=K.isGlob=!0,R=!0,
|
|
64
|
-
break}if(B===t){if(C===t&&(Q=K.isGlobstar=!0),F=K.isGlob=!0,R=!0,
|
|
65
|
-
continue}break}if(F===!0){if(R=!0,
|
|
66
|
-
if($.tokens===!0&&(Z.maxDepth=0,
|
|
67
|
-
if(va)return Jn;va=1;const e=Kt(),t=Wt(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:
|
|
68
|
-
const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r;let S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);const g={type:"bos",value:"",output:y.prepend||""},
|
|
69
|
-
)*?)`,G=y.dot?"":
|
|
70
|
-
Y,A.index+=ne},
|
|
71
|
-
|
|
72
|
-
let ne=Y.close+(y.capture?")":""),W;if(Y.type==="negate"){let te=q;if(Y.inner&&Y.inner.length>1&&Y.inner.includes("/")&&(te=F(y)),(te!==q||B()||/^\)+$/.test(re()))&&(ne=Y.close=`)$))${te}`),Y.inner.includes("*")&&(W=re())&&/^\.[^\\/.]+$/.test(W)){const le=c(W,{...m,fastpaths:!1}).output;ne=Y.close=`)${le})${te})`}Y.prev.type==="bos"&&(A.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:C,output:ne}),Z("parens")};if(y.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let Y=!1,ne=l.replace(
|
|
73
|
-
"\\"?(Y=!0,W):ye==="?"?te?te+ye+(he?
|
|
74
|
-
C+="\\",J({type:"text",value:C});continue}const te=/^\\+/.exec(re());let le=0;if(te&&te[0].length>2&&(le=te[0].length,A.index+=le,le%2!==0&&(C+="\\")),y.unescape===!0?C=ee():C+=ee(),A.brackets===0){J({type:"text",value:C});continue}}if(A.brackets>0&&(C!=="]"||
|
|
75
|
-
he,A.backtrack=!0,ee(),!g.output&&
|
|
76
|
-
")"){if(A.parens===0&&y.strictBrackets===!0)throw new SyntaxError(u("opening","("));const W=
|
|
77
|
-
1){J({type:"text",value:C,output:`\\${C}`});continue}if(A.brackets===0){if(y.strictBrackets===!0)throw new SyntaxError(u("opening","["));J({type:"text",value:C,output:`\\${C}`});continue}Z("brackets");const W=
|
|
78
|
-
`(${
|
|
79
|
-
!0}if(W.comma!==!0&&W.dots!==!0){const le=A.output.slice(0,W.outputIndex),ye=A.tokens.slice(W.tokensIndex);W.value=W.output="\\{",C=te="\\}",A.output=le;for(const he of ye)A.output+=he.output||he.value}J({type:"brace",value:C,output:te}),Z("braces"),T.pop();continue}if(C==="|"){
|
|
80
|
-
if(
|
|
81
|
-
"("&&K(2)!=="?"){ue("qmark",C);continue}if(
|
|
82
|
-
!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ue("negate",C);continue}if(y.nonegate!==!0&&A.index===0){V();continue}}if(C==="+"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){ue("plus",C);continue}if(
|
|
83
|
-
value:C,output:""});continue}J({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const W=i.exec(re());W&&(C+=W[0],A.index+=W[0].length),J({type:"text",value:C});continue}if(
|
|
84
|
-
W.type==="bos",ye=te&&(te.type==="star"||te.type==="globstar");if(y.bash===!0&&(!le||Y[0]&&Y[0]!=="/")){J({type:"star",value:C,output:""});continue}const he=A.braces>0&&(W.type==="comma"||W.type==="brace"),Me=
|
|
85
|
-
output=
|
|
86
|
-
y)}${
|
|
87
|
-
ne.output=".*?",(
|
|
88
|
-
Z("brackets")}for(;A.parens>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing",")"));A.output=t.escapeLast(A.output,"("),Z("parens")}for(;A.braces>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","}"));A.output=t.escapeLast(A.output,"{"),Z("braces")}if(y.strictSlashes!==!0&&(
|
|
89
|
-
Y.suffix)}return A};return c.fastpaths=(l,m)=>{const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r,S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);l=
|
|
90
|
-
noglobstar===!0?
|
|
91
|
-
z=t.removePrefix(l,
|
|
92
|
-
u),_=l?
|
|
93
|
-
on"&&m.onMatch(w),f?w:!0)};return c&&(
|
|
94
|
-
RegExp?u:
|
|
95
|
-
mpty string");let m={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(m.output=r.fastpaths(s,u)),m.output||(m=r(s,u)),
|
|
96
|
-
{");return u>-1&&s.indexOf("}",u)>-1},
|
|
97
|
-
`No matches found for "${u.join(", ")}"`);if(c.nonull===!0||c.nullglob===!0)return c.unescape?u.map(
|
|
98
|
-
ng: "${e.inspect(s)}"`);if(Array.isArray(u))return u.some(l=>
|
|
99
|
-
some(_=>y(_)))return!0}return!1},
|
|
100
|
-
scan(...s),
|
|
101
|
-
function Gd(e,t,r,n=!1){const i=t.replaceAll(".","\\."),
|
|
102
|
-
</style>`)}const Kd=/\.[mc]?js$/,Wd=/\.css$/,Xd=/\.html?$/;function Jd({useRecommendedBuildConfig:e=!0,removeViteModuleLoader:t=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0}=zd){return{name:"vite:singlefile",config:e?Qd:void 0,enforce:"post",generateBundle(i,
|
|
103
|
-
`);const s={html:[],css:[],js:[],other:[]};for(const c of Object.keys(
|
|
104
|
-
y),m=Bd(m,_.fileName,_.source)}l.source=m}if(n)for(const c of u)delete
|
|
61
|
+
if(ga)return Xn;ga=1;const e=Wt(),{CHAR_ASTERISK:t,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:a,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:s,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:m,CHAR_QUESTION_MARK:y,CHAR_RIGHT_CURLY_BRACE:_,CHAR_RIGHT_PARENTHESES:S,CHAR_RIGHT_SQUARE_BRACKET:g}=Kt(),h=d=>d===s||d===n,p=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return Xn=(d,v)=>{const $=v||{},w=d.length-1,b=$.parts===!0||$.scanToEnd===!0,P=[],I=[],
|
|
62
|
+
H=[];let x=d,U=-1,L=0,j=0,M=!1,z=!1,F=!1,G=!1,Q=!1,q=!1,A=!1,D=!1,T=!1,R=!1,E=0,C,B,K={value:"",depth:0,isGlob:!1};const ee=()=>U>=w,re=()=>x.charCodeAt(U+1),k=()=>(C=B,x.charCodeAt(++U));for(;U<w;){B=k();let J;if(B===n){A=K.backslashes=!0,B=k(),B===u&&(q=!0);continue}if(q===!0||B===u){for(E++;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,k();continue}if(B===u){E++;continue}if(q!==!0&&B===a&&(B=k())===a){if(M=K.isBrace=!0,F=K.isGlob=!0,R=!0,b===!0)continue;break}if(q!==!0&&B===i){if(M=K.isBrace=
|
|
63
|
+
!0,F=K.isGlob=!0,R=!0,b===!0)continue;break}if(B===_&&(E--,E===0)){q=!1,M=K.isBrace=!0,R=!0;break}}if(b===!0)continue;break}if(B===s){if(P.push(U),I.push(K),K={value:"",depth:0,isGlob:!1},R===!0)continue;if(C===a&&U===L+1){L+=2;continue}j=U+1;continue}if($.noext!==!0&&(B===m||B===r||B===t||B===y||B===o)===!0&&re()===c){if(F=K.isGlob=!0,G=K.isExtglob=!0,R=!0,B===o&&U===L&&(T=!0),b===!0){for(;ee()!==!0&&(B=k());){if(B===n){A=K.backslashes=!0,B=k();continue}if(B===S){F=K.isGlob=!0,R=!0;break}}continue}
|
|
64
|
+
break}if(B===t){if(C===t&&(Q=K.isGlobstar=!0),F=K.isGlob=!0,R=!0,b===!0)continue;break}if(B===y){if(F=K.isGlob=!0,R=!0,b===!0)continue;break}if(B===l){for(;ee()!==!0&&(J=k());){if(J===n){A=K.backslashes=!0,k();continue}if(J===g){z=K.isBracket=!0,F=K.isGlob=!0,R=!0;break}}if(b===!0)continue;break}if($.nonegate!==!0&&B===o&&U===L){D=K.negated=!0,L++;continue}if($.noparen!==!0&&B===c){if(F=K.isGlob=!0,b===!0){for(;ee()!==!0&&(B=k());){if(B===c){A=K.backslashes=!0,B=k();continue}if(B===S){R=!0;break}}
|
|
65
|
+
continue}break}if(F===!0){if(R=!0,b===!0)continue;break}}$.noext===!0&&(G=!1,F=!1);let O=x,V="",X="";L>0&&(V=x.slice(0,L),x=x.slice(L),j-=L),O&&F===!0&&j>0?(O=x.slice(0,j),X=x.slice(j)):F===!0?(O="",X=x):O=x,O&&O!==""&&O!=="/"&&O!==x&&h(O.charCodeAt(O.length-1))&&(O=O.slice(0,-1)),$.unescape===!0&&(X&&(X=e.removeBackslashes(X)),O&&A===!0&&(O=e.removeBackslashes(O)));const Z={prefix:V,input:d,start:L,base:O,glob:X,isBrace:M,isBracket:z,isGlob:F,isExtglob:G,isGlobstar:Q,negated:D,negatedExtglob:T};
|
|
66
|
+
if($.tokens===!0&&(Z.maxDepth=0,h(B)||I.push(K),Z.tokens=I),$.parts===!0||$.tokens===!0){let J;for(let ue=0;ue<P.length;ue++){const we=J?J+1:L,Y=P[ue],ne=d.slice(we,Y);$.tokens&&(ue===0&&L!==0?(I[ue].isPrefix=!0,I[ue].value=V):I[ue].value=ne,p(I[ue]),Z.maxDepth+=I[ue].depth),(ue!==0||ne!=="")&&H.push(ne),J=Y}if(J&&J+1<d.length){const ue=d.slice(J+1);H.push(ue),$.tokens&&(I[I.length-1].value=ue,p(I[I.length-1]),Z.maxDepth+=I[I.length-1].depth)}Z.slashes=P,Z.parts=H}return Z},Xn}var Jn,va;function Md(){
|
|
67
|
+
if(va)return Jn;va=1;const e=Kt(),t=Wt(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:a,REPLACEMENTS:o}=e,s=(l,m)=>{if(typeof m.expandRange=="function")return m.expandRange(...l,m);l.sort();const y=`[${l.join("-")}]`;try{new RegExp(y)}catch{return l.map(S=>t.escapeRegex(S)).join("..")}return y},u=(l,m)=>`Missing ${l}: "${m}" - use "\\\\${m}" to match literal characters`,c=(l,m)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;
|
|
68
|
+
const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r;let S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);const g={type:"bos",value:"",output:y.prepend||""},h=[g],p=y.capture?"":"?:",f=t.isWindows(m),d=e.globChars(f),v=e.extglobChars(d),{DOT_LITERAL:$,PLUS_LITERAL:w,SLASH_LITERAL:b,ONE_CHAR:P,DOTS_SLASH:I,NO_DOT:H,NO_DOT_SLASH:x,NO_DOTS_SLASH:U,QMARK:L,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:z}=d,F=Y=>`(${p}(?:(?!${z}${Y.dot?I:$}).\
|
|
69
|
+
)*?)`,G=y.dot?"":H,Q=y.dot?L:j;let q=y.bash===!0?F(y):M;y.capture&&(q=`(${q})`),typeof y.noext=="boolean"&&(y.noextglob=y.noext);const A={input:l,index:-1,start:0,dot:y.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:h};l=t.removePrefix(l,A),S=l.length;const D=[],T=[],R=[];let E=g,C;const B=()=>A.index===S-1,K=A.peek=(Y=1)=>l[A.index+Y],ee=A.advance=()=>l[++A.index]||"",re=()=>l.slice(A.index+1),k=(Y="",ne=0)=>{A.consumed+=
|
|
70
|
+
Y,A.index+=ne},O=Y=>{A.output+=Y.output!=null?Y.output:Y.value,k(Y.value)},V=()=>{let Y=1;for(;K()==="!"&&(K(2)!=="("||K(3)==="?");)ee(),A.start++,Y++;return Y%2===0?!1:(A.negated=!0,A.start++,!0)},X=Y=>{A[Y]++,R.push(Y)},Z=Y=>{A[Y]--,R.pop()},J=Y=>{if(E.type==="globstar"){const ne=A.braces>0&&(Y.type==="comma"||Y.type==="brace"),W=Y.extglob===!0||D.length&&(Y.type==="pipe"||Y.type==="paren");Y.type!=="slash"&&Y.type!=="paren"&&!ne&&!W&&(A.output=A.output.slice(0,-E.output.length),E.type="star",
|
|
71
|
+
E.value="*",E.output=q,A.output+=E.output)}if(D.length&&Y.type!=="paren"&&(D[D.length-1].inner+=Y.value),(Y.value||Y.output)&&O(Y),E&&E.type==="text"&&Y.type==="text"){E.value+=Y.value,E.output=(E.output||"")+Y.value;return}Y.prev=E,h.push(Y),E=Y},ue=(Y,ne)=>{const W={...v[ne],conditions:1,inner:""};W.prev=E,W.parens=A.parens,W.output=A.output;const te=(y.capture?"(":"")+W.open;X("parens"),J({type:Y,value:ne,output:A.output?"":P}),J({type:"paren",extglob:!0,value:ee(),output:te}),D.push(W)},we=Y=>{
|
|
72
|
+
let ne=Y.close+(y.capture?")":""),W;if(Y.type==="negate"){let te=q;if(Y.inner&&Y.inner.length>1&&Y.inner.includes("/")&&(te=F(y)),(te!==q||B()||/^\)+$/.test(re()))&&(ne=Y.close=`)$))${te}`),Y.inner.includes("*")&&(W=re())&&/^\.[^\\/.]+$/.test(W)){const le=c(W,{...m,fastpaths:!1}).output;ne=Y.close=`)${le})${te})`}Y.prev.type==="bos"&&(A.negatedExtglob=!0)}J({type:"paren",extglob:!0,value:C,output:ne}),Z("parens")};if(y.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let Y=!1,ne=l.replace(a,(W,te,le,ye,he,Me)=>ye===
|
|
73
|
+
"\\"?(Y=!0,W):ye==="?"?te?te+ye+(he?L.repeat(he.length):""):Me===0?Q+(he?L.repeat(he.length):""):L.repeat(le.length):ye==="."?$.repeat(le.length):ye==="*"?te?te+ye+(he?q:""):q:te?W:`\\${W}`);return Y===!0&&(y.unescape===!0?ne=ne.replace(/\\/g,""):ne=ne.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),ne===l&&y.contains===!0?(A.output=l,A):(A.output=t.wrapOutput(ne,A,m),A)}for(;!B();){if(C=ee(),C==="\0")continue;if(C==="\\"){const W=K();if(W==="/"&&y.bash!==!0||W==="."||W===";")continue;if(!W){
|
|
74
|
+
C+="\\",J({type:"text",value:C});continue}const te=/^\\+/.exec(re());let le=0;if(te&&te[0].length>2&&(le=te[0].length,A.index+=le,le%2!==0&&(C+="\\")),y.unescape===!0?C=ee():C+=ee(),A.brackets===0){J({type:"text",value:C});continue}}if(A.brackets>0&&(C!=="]"||E.value==="["||E.value==="[^")){if(y.posix!==!1&&C===":"){const W=E.value.slice(1);if(W.includes("[")&&(E.posix=!0,W.includes(":"))){const te=E.value.lastIndexOf("["),le=E.value.slice(0,te),ye=E.value.slice(te+2),he=n[ye];if(he){E.value=le+
|
|
75
|
+
he,A.backtrack=!0,ee(),!g.output&&h.indexOf(E)===1&&(g.output=P);continue}}}(C==="["&&K()!==":"||C==="-"&&K()==="]")&&(C=`\\${C}`),C==="]"&&(E.value==="["||E.value==="[^")&&(C=`\\${C}`),y.posix===!0&&C==="!"&&E.value==="["&&(C="^"),E.value+=C,O({value:C});continue}if(A.quotes===1&&C!=='"'){C=t.escapeRegex(C),E.value+=C,O({value:C});continue}if(C==='"'){A.quotes=A.quotes===1?0:1,y.keepQuotes===!0&&J({type:"text",value:C});continue}if(C==="("){X("parens"),J({type:"paren",value:C});continue}if(C===
|
|
76
|
+
")"){if(A.parens===0&&y.strictBrackets===!0)throw new SyntaxError(u("opening","("));const W=D[D.length-1];if(W&&A.parens===W.parens+1){we(D.pop());continue}J({type:"paren",value:C,output:A.parens?")":"\\)"}),Z("parens");continue}if(C==="["){if(y.nobracket===!0||!re().includes("]")){if(y.nobracket!==!0&&y.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C=`\\${C}`}else X("brackets");J({type:"bracket",value:C});continue}if(C==="]"){if(y.nobracket===!0||E&&E.type==="bracket"&&E.value.length===
|
|
77
|
+
1){J({type:"text",value:C,output:`\\${C}`});continue}if(A.brackets===0){if(y.strictBrackets===!0)throw new SyntaxError(u("opening","["));J({type:"text",value:C,output:`\\${C}`});continue}Z("brackets");const W=E.value.slice(1);if(E.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(C=`/${C}`),E.value+=C,O({value:C}),y.literalBrackets===!1||t.hasRegexChars(W))continue;const te=t.escapeRegex(E.value);if(A.output=A.output.slice(0,-E.value.length),y.literalBrackets===!0){A.output+=te,E.value=te;continue}E.value=
|
|
78
|
+
`(${p}${te}|${E.value})`,A.output+=E.value;continue}if(C==="{"&&y.nobrace!==!0){X("braces");const W={type:"brace",value:C,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};T.push(W),J(W);continue}if(C==="}"){const W=T[T.length-1];if(y.nobrace===!0||!W){J({type:"text",value:C,output:C});continue}let te=")";if(W.dots===!0){const le=h.slice(),ye=[];for(let he=le.length-1;he>=0&&(h.pop(),le[he].type!=="brace");he--)le[he].type!=="dots"&&ye.unshift(le[he].value);te=s(ye,y),A.backtrack=
|
|
79
|
+
!0}if(W.comma!==!0&&W.dots!==!0){const le=A.output.slice(0,W.outputIndex),ye=A.tokens.slice(W.tokensIndex);W.value=W.output="\\{",C=te="\\}",A.output=le;for(const he of ye)A.output+=he.output||he.value}J({type:"brace",value:C,output:te}),Z("braces"),T.pop();continue}if(C==="|"){D.length>0&&D[D.length-1].conditions++,J({type:"text",value:C});continue}if(C===","){let W=C;const te=T[T.length-1];te&&R[R.length-1]==="braces"&&(te.comma=!0,W="|"),J({type:"comma",value:C,output:W});continue}if(C==="/"){
|
|
80
|
+
if(E.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",h.pop(),E=g;continue}J({type:"slash",value:C,output:b});continue}if(C==="."){if(A.braces>0&&E.type==="dot"){E.value==="."&&(E.output=$);const W=T[T.length-1];E.type="dots",E.output+=C,E.value+=C,W.dots=!0;continue}if(A.braces+A.parens===0&&E.type!=="bos"&&E.type!=="slash"){J({type:"text",value:C,output:$});continue}J({type:"dot",value:C,output:$});continue}if(C==="?"){if(!(E&&E.value==="(")&&y.noextglob!==!0&&K()===
|
|
81
|
+
"("&&K(2)!=="?"){ue("qmark",C);continue}if(E&&E.type==="paren"){const te=K();let le=C;if(te==="<"&&!t.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(E.value==="("&&!/[!=<:]/.test(te)||te==="<"&&!/<([!=]|\w+>)/.test(re()))&&(le=`\\${C}`),J({type:"text",value:C,output:le});continue}if(y.dot!==!0&&(E.type==="slash"||E.type==="bos")){J({type:"qmark",value:C,output:j});continue}J({type:"qmark",value:C,output:L});continue}if(C==="!"){if(y.noextglob!==
|
|
82
|
+
!0&&K()==="("&&(K(2)!=="?"||!/[!=<:]/.test(K(3)))){ue("negate",C);continue}if(y.nonegate!==!0&&A.index===0){V();continue}}if(C==="+"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){ue("plus",C);continue}if(E&&E.value==="("||y.regex===!1){J({type:"plus",value:C,output:w});continue}if(E&&(E.type==="bracket"||E.type==="paren"||E.type==="brace")||A.parens>0){J({type:"plus",value:C});continue}J({type:"plus",value:w});continue}if(C==="@"){if(y.noextglob!==!0&&K()==="("&&K(2)!=="?"){J({type:"at",extglob:!0,
|
|
83
|
+
value:C,output:""});continue}J({type:"text",value:C});continue}if(C!=="*"){(C==="$"||C==="^")&&(C=`\\${C}`);const W=i.exec(re());W&&(C+=W[0],A.index+=W[0].length),J({type:"text",value:C});continue}if(E&&(E.type==="globstar"||E.star===!0)){E.type="star",E.star=!0,E.value+=C,E.output=q,A.backtrack=!0,A.globstar=!0,k(C);continue}let Y=re();if(y.noextglob!==!0&&/^\([^?]/.test(Y)){ue("star",C);continue}if(E.type==="star"){if(y.noglobstar===!0){k(C);continue}const W=E.prev,te=W.prev,le=W.type==="slash"||
|
|
84
|
+
W.type==="bos",ye=te&&(te.type==="star"||te.type==="globstar");if(y.bash===!0&&(!le||Y[0]&&Y[0]!=="/")){J({type:"star",value:C,output:""});continue}const he=A.braces>0&&(W.type==="comma"||W.type==="brace"),Me=D.length&&(W.type==="pipe"||W.type==="paren");if(!le&&W.type!=="paren"&&!he&&!Me){J({type:"star",value:C,output:""});continue}for(;Y.slice(0,3)==="/**";){const Be=l[A.index+4];if(Be&&Be!=="/")break;Y=Y.slice(3),k("/**",3)}if(W.type==="bos"&&B()){E.type="globstar",E.value+=C,E.output=F(y),A.
|
|
85
|
+
output=E.output,A.globstar=!0,k(C);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!ye&&B()){A.output=A.output.slice(0,-(W.output+E.output).length),W.output=`(?:${W.output}`,E.type="globstar",E.output=F(y)+(y.strictSlashes?")":"|$)"),E.value+=C,A.globstar=!0,A.output+=W.output+E.output,k(C);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&Y[0]==="/"){const Be=Y[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(W.output+E.output).length),W.output=`(?:${W.output}`,E.type="globstar",E.output=`${F(
|
|
86
|
+
y)}${b}|${b}${Be})`,E.value+=C,A.output+=W.output+E.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Y[0]==="/"){E.type="globstar",E.value+=C,E.output=`(?:^|${b}|${F(y)}${b})`,A.output=E.output,A.globstar=!0,k(C+ee()),J({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-E.output.length),E.type="globstar",E.output=F(y),E.value+=C,A.output+=E.output,A.globstar=!0,k(C);continue}const ne={type:"star",value:C,output:q};if(y.bash===!0){
|
|
87
|
+
ne.output=".*?",(E.type==="bos"||E.type==="slash")&&(ne.output=G+ne.output),J(ne);continue}if(E&&(E.type==="bracket"||E.type==="paren")&&y.regex===!0){ne.output=C,J(ne);continue}(A.index===A.start||E.type==="slash"||E.type==="dot")&&(E.type==="dot"?(A.output+=x,E.output+=x):y.dot===!0?(A.output+=U,E.output+=U):(A.output+=G,E.output+=G),K()!=="*"&&(A.output+=P,E.output+=P)),J(ne)}for(;A.brackets>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","]"));A.output=t.escapeLast(A.output,"["),
|
|
88
|
+
Z("brackets")}for(;A.parens>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing",")"));A.output=t.escapeLast(A.output,"("),Z("parens")}for(;A.braces>0;){if(y.strictBrackets===!0)throw new SyntaxError(u("closing","}"));A.output=t.escapeLast(A.output,"{"),Z("braces")}if(y.strictSlashes!==!0&&(E.type==="star"||E.type==="bracket")&&J({type:"maybe_slash",value:"",output:`${b}?`}),A.backtrack===!0){A.output="";for(const Y of A.tokens)A.output+=Y.output!=null?Y.output:Y.value,Y.suffix&&(A.output+=
|
|
89
|
+
Y.suffix)}return A};return c.fastpaths=(l,m)=>{const y={...m},_=typeof y.maxLength=="number"?Math.min(r,y.maxLength):r,S=l.length;if(S>_)throw new SyntaxError(`Input length: ${S}, exceeds maximum allowed length: ${_}`);l=o[l]||l;const g=t.isWindows(m),{DOT_LITERAL:h,SLASH_LITERAL:p,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:v,NO_DOTS:$,NO_DOTS_SLASH:w,STAR:b,START_ANCHOR:P}=e.globChars(g),I=y.dot?$:v,H=y.dot?w:v,x=y.capture?"":"?:",U={negated:!1,prefix:""};let L=y.bash===!0?".*?":b;y.capture&&(L=`(${L})`);const j=G=>G.
|
|
90
|
+
noglobstar===!0?L:`(${x}(?:(?!${P}${G.dot?d:h}).)*?)`,M=G=>{switch(G){case"*":return`${I}${f}${L}`;case".*":return`${h}${f}${L}`;case"*.*":return`${I}${L}${h}${f}${L}`;case"*/*":return`${I}${L}${p}${f}${H}${L}`;case"**":return I+j(y);case"**/*":return`(?:${I}${j(y)}${p})?${H}${f}${L}`;case"**/*.*":return`(?:${I}${j(y)}${p})?${H}${L}${h}${f}${L}`;case"**/.*":return`(?:${I}${j(y)}${p})?${h}${f}${L}`;default:{const Q=/^(.*?)\.(\w+)$/.exec(G);if(!Q)return;const q=M(Q[1]);return q?q+h+Q[2]:void 0}}},
|
|
91
|
+
z=t.removePrefix(l,U);let F=M(z);return F&&y.strictSlashes!==!0&&(F+=`${p}?`),F},Jn=c,Jn}var Yn,$a;function Hd(){if($a)return Yn;$a=1;const e=En,t=xd(),r=Md(),n=Wt(),i=Kt(),a=s=>s&&typeof s=="object"&&!Array.isArray(s),o=(s,u,c=!1)=>{if(Array.isArray(s)){const p=s.map(d=>o(d,u,c));return d=>{for(const v of p){const $=v(d);if($)return $}return!1}}const l=a(s)&&s.tokens&&s.input;if(s===""||typeof s!="string"&&!l)throw new TypeError("Expected pattern to be a non-empty string");const m=u||{},y=n.isWindows(
|
|
92
|
+
u),_=l?o.compileRe(s,u):o.makeRe(s,u,!1,!0),S=_.state;delete _.state;let g=()=>!1;if(m.ignore){const p={...u,ignore:null,onMatch:null,onResult:null};g=o(m.ignore,p,c)}const h=(p,f=!1)=>{const{isMatch:d,match:v,output:$}=o.test(p,_,u,{glob:s,posix:y}),w={glob:s,state:S,regex:_,posix:y,input:p,output:$,match:v,isMatch:d};return typeof m.onResult=="function"&&m.onResult(w),d===!1?(w.isMatch=!1,f?w:!1):g(p)?(typeof m.onIgnore=="function"&&m.onIgnore(w),w.isMatch=!1,f?w:!1):(typeof m.onMatch=="functi\
|
|
93
|
+
on"&&m.onMatch(w),f?w:!0)};return c&&(h.state=S),h};return o.test=(s,u,c,{glob:l,posix:m}={})=>{if(typeof s!="string")throw new TypeError("Expected input to be a string");if(s==="")return{isMatch:!1,output:""};const y=c||{},_=y.format||(m?n.toPosixSlashes:null);let S=s===l,g=S&&_?_(s):s;return S===!1&&(g=_?_(s):s,S=g===l),(S===!1||y.capture===!0)&&(y.matchBase===!0||y.basename===!0?S=o.matchBase(s,u,c,m):S=u.exec(g)),{isMatch:!!S,match:S,output:g}},o.matchBase=(s,u,c,l=n.isWindows(c))=>(u instanceof
|
|
94
|
+
RegExp?u:o.makeRe(u,c)).test(e.basename(s)),o.isMatch=(s,u,c)=>o(u,c)(s),o.parse=(s,u)=>Array.isArray(s)?s.map(c=>o.parse(c,u)):r(s,{...u,fastpaths:!1}),o.scan=(s,u)=>t(s,u),o.compileRe=(s,u,c=!1,l=!1)=>{if(c===!0)return s.output;const m=u||{},y=m.contains?"":"^",_=m.contains?"":"$";let S=`${y}(?:${s.output})${_}`;s&&s.negated===!0&&(S=`^(?!${S}).*$`);const g=o.toRegex(S,u);return l===!0&&(g.state=s),g},o.makeRe=(s,u={},c=!1,l=!1)=>{if(!s||typeof s!="string")throw new TypeError("Expected a non-e\
|
|
95
|
+
mpty string");let m={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(s[0]==="."||s[0]==="*")&&(m.output=r.fastpaths(s,u)),m.output||(m=r(s,u)),o.compileRe(m,u,c,l)},o.toRegex=(s,u)=>{try{const c=u||{};return new RegExp(s,c.flags||(c.nocase?"i":""))}catch(c){if(u&&u.debug===!0)throw c;return/$^/}},o.constants=i,Yn=o,Yn}var Qn,_a;function Ud(){return _a||(_a=1,Qn=Hd()),Qn}var Zn,wa;function Fd(){if(wa)return Zn;wa=1;const e=Ko,t=qd(),r=Ud(),n=Wt(),i=s=>s===""||s==="./",a=s=>{const u=s.indexOf("\
|
|
96
|
+
{");return u>-1&&s.indexOf("}",u)>-1},o=(s,u,c)=>{u=[].concat(u),s=[].concat(s);let l=new Set,m=new Set,y=new Set,_=0,S=p=>{y.add(p.output),c&&c.onResult&&c.onResult(p)};for(let p=0;p<u.length;p++){let f=r(String(u[p]),{...c,onResult:S},!0),d=f.state.negated||f.state.negatedExtglob;d&&_++;for(let v of s){let $=f(v,!0);(d?!$.isMatch:$.isMatch)&&(d?l.add($.output):(l.delete($.output),m.add($.output)))}}let h=(_===u.length?[...y]:[...m]).filter(p=>!l.has(p));if(c&&h.length===0){if(c.failglob===!0)throw new Error(
|
|
97
|
+
`No matches found for "${u.join(", ")}"`);if(c.nonull===!0||c.nullglob===!0)return c.unescape?u.map(p=>p.replace(/\\/g,"")):u}return h};return o.match=o,o.matcher=(s,u)=>r(s,u),o.isMatch=(s,u,c)=>r(u,c)(s),o.any=o.isMatch,o.not=(s,u,c={})=>{u=[].concat(u).map(String);let l=new Set,m=[],y=S=>{c.onResult&&c.onResult(S),m.push(S.output)},_=new Set(o(s,u,{...c,onResult:y}));for(let S of m)_.has(S)||l.add(S);return[...l]},o.contains=(s,u,c)=>{if(typeof s!="string")throw new TypeError(`Expected a stri\
|
|
98
|
+
ng: "${e.inspect(s)}"`);if(Array.isArray(u))return u.some(l=>o.contains(s,l,c));if(typeof u=="string"){if(i(s)||i(u))return!1;if(s.includes(u)||s.startsWith("./")&&s.slice(2).includes(u))return!0}return o.isMatch(s,u,{...c,contains:!0})},o.matchKeys=(s,u,c)=>{if(!n.isObject(s))throw new TypeError("Expected the first argument to be an object");let l=o(Object.keys(s),u,c),m={};for(let y of l)m[y]=s[y];return m},o.some=(s,u,c)=>{let l=[].concat(s);for(let m of[].concat(u)){let y=r(String(m),c);if(l.
|
|
99
|
+
some(_=>y(_)))return!0}return!1},o.every=(s,u,c)=>{let l=[].concat(s);for(let m of[].concat(u)){let y=r(String(m),c);if(!l.every(_=>y(_)))return!1}return!0},o.all=(s,u,c)=>{if(typeof s!="string")throw new TypeError(`Expected a string: "${e.inspect(s)}"`);return[].concat(u).every(l=>r(l,c)(s))},o.capture=(s,u,c)=>{let l=n.isWindows(c),y=r.makeRe(String(s),{...c,capture:!0}).exec(l?n.toPosixSlashes(u):u);if(y)return y.slice(1).map(_=>_===void 0?"":_)},o.makeRe=(...s)=>r.makeRe(...s),o.scan=(...s)=>r.
|
|
100
|
+
scan(...s),o.parse=(s,u)=>{let c=[];for(let l of[].concat(s||[]))for(let m of t(String(l),u))c.push(r.parse(m,u));return c},o.braces=(s,u)=>{if(typeof s!="string")throw new TypeError("Expected a string");return u&&u.nobrace===!0||!a(s)?[s]:t(s,u)},o.braceExpand=(s,u)=>{if(typeof s!="string")throw new TypeError("Expected a string");return o.braces(s,{...u,expand:!0})},o.hasBraces=a,Zn=o,Zn}var Vd=Fd();const ba=mn(Vd),zd={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
|
|
101
|
+
function Gd(e,t,r,n=!1){const i=t.replaceAll(".","\\."),a=new RegExp(`<script([^>]*?) src="(?:[^"]*?/)?${i}"([^>]*)></script>`),o=/"?__VITE_PRELOAD__"?/g,s=r.replace(o,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),u=e.replace(a,(c,l,m)=>`<script${l}${m}>${s.trim()}</script>`);return n?Yd(u):u}function Bd(e,t,r){const n=t.replaceAll(".","\\."),i=new RegExp(`<link([^>]*?) href="(?:[^"]*?/)?${n}"([^>]*)>`),a=r.replace('@charset "UTF-8";',"");return e.replace(i,(s,u,c)=>`<style${u}${c}>${a.trim()}\
|
|
102
|
+
</style>`)}const Kd=/\.[mc]?js$/,Wd=/\.css$/,Xd=/\.html?$/;function Jd({useRecommendedBuildConfig:e=!0,removeViteModuleLoader:t=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0}=zd){return{name:"vite:singlefile",config:e?Qd:void 0,enforce:"post",generateBundle(i,a){const o=c=>this.info(`NOTE: asset not inlined: ${c}`);this.info(`
|
|
103
|
+
`);const s={html:[],css:[],js:[],other:[]};for(const c of Object.keys(a))Xd.test(c)?s.html.push(c):Wd.test(c)?s.css.push(c):Kd.test(c)?s.js.push(c):s.other.push(c);const u=[];for(const c of s.html){const l=a[c];let m=l.source;for(const y of s.js){if(r.length&&!ba.isMatch(y,r)){o(y);continue}const _=a[y];_.code!=null&&(this.info(`Inlining: ${y}`),u.push(y),m=Gd(m,_.fileName,_.code,t))}for(const y of s.css){if(r.length&&!ba.isMatch(y,r)){o(y);continue}const _=a[y];this.info(`Inlining: ${y}`),u.push(
|
|
104
|
+
y),m=Bd(m,_.fileName,_.source)}l.source=m}if(n)for(const c of u)delete a[c];for(const c of s.other)o(c)}}}const Yd=e=>e.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),Qd=e=>{e.build||(e.build={}),e.build.assetsInlineLimit=()=>!0,e.build.chunkSizeWarningLimit=1e8,e.build.cssCodeSplit=!1,e.base="./",e.build.assetsDir="",e.build.rollupOptions||(e.build.rollupOptions={}),e.build.rollupOptions.output||(e.build.rollupOptions.
|
|
105
105
|
output={});const t=r=>{r.inlineDynamicImports=!0};if(Array.isArray(e.build.rollupOptions.output))for(const r of e.build.rollupOptions.output)t(r);else t(e.build.rollupOptions.output)};function ft(e){return e.length===0?"never":e.sort(yd).map(t=>` | ${JSON.stringify(t)}`).join(`
|
|
106
106
|
`).trimStart()}function Ea(e){const t=Uo(e);return t.length===0?"never":Fo(t,gd,Bf(r=>` | ${JSON.stringify(r.id)}`)).join(`
|
|
107
107
|
`).trimStart()}function Sa(e,t={}){const{useCorePackage:r=!1}=t;return`
|
|
@@ -240,309 +240,310 @@ export {
|
|
|
240
240
|
ReactLikeC4
|
|
241
241
|
}
|
|
242
242
|
/* prettier-ignore-end */
|
|
243
|
-
`.trimStart()}const es=async({languageServices:e,likec4AssetsDir:t,...r})=>{const n=r.customLogger??Cd,i=
|
|
244
|
-
webcomponentPrefix:u,title:c,root:i,languageServices:e,clearScreen:!1,base:s,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...jn(),"likec4/previews":t}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/
|
|
245
|
-
likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:
|
|
246
|
-
recommended"},...!l&&{input:[oe(i,"index.html"),oe(i,"src","main.js"),oe(i,"src","fonts.css"),oe(i,"src","style.css")],output:{manualChunks:m=>{if(!(m.endsWith(".css")||m.endsWith(".html")||m.includes("likec4/icons"))){if(m.includes("__app__")){let y=m.match(/__app__\/src\/([\w]+)\.js/)?.[1];return y?y[1]:void 0}if(m.includes("node_modules/likec4")||m.includes("node_modules/@likec4"))return"likec4";if(m.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[bn(),
|
|
247
|
-
languageServices,useOverviewGraph:
|
|
248
|
-
stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:In,lib:{entry:"src/webcomponent.js",fileName(s,u){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:
|
|
249
|
-
useOverviewGraph:!1})]}}const np=["favicon.ico","robots.txt"],sp=async({buildWebcomponent:e=!0,webcomponentPrefix:t="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:o
|
|
250
|
-
computedViews(),m=await n.diagrams();if(m.length===0)throw process.exitCode=1,new Error("no views found");m.length===l.length?s.customLogger.info(`${
|
|
251
|
-
viewsService.computedViews(l.id);m.length===0?s.customLogger.warn(`${
|
|
252
|
-
"index.html");He(l)&&Mo(l,oe(s.build.outDir,"404.html"))}};function rs(e,t){return r=>r.length>1?[e,t,r[0],"--",...r.slice(1)]:[e,t,r[0]]}function op(){return e=>["deno","run",`npm:${e[0]}`,...e.slice(1)]}const ap={agent:["npm",0],run:rs("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,
|
|
253
|
-
|
|
254
|
-
yarn","up","-i",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},Aa={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:["pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-
|
|
255
|
-
|
|
256
|
-
install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],execute:op(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:["deno","uninstall","-g",0]},lp={npm:ap,yarn:Ra,"yarn@berry":ip,
|
|
257
|
-
"number"?t:[n]);return{command:r[0],args:r.slice(1)}}const pp=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Pa={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap
|
|
258
|
-
".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function ns(e,t){try{const r=await Go.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}function*hp(e=me.cwd()){let t=ie.resolve(e);const{root:r}=ie.parse(t);for(;t&&t!==r;)yield t,t=ie.dirname(t)}async function ka(e,t){
|
|
259
|
-
resolve(e.stopDir);i=
|
|
260
|
-
const c=Ca[s],l=c==="yarn"?vp(s)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(i?.(
|
|
261
|
-
e,"utf8"));let n;const i=yp(r);if(i){const
|
|
262
|
-
if(Ta("react")&&Ta("react-dom")){Ae.debug("react already installed");return}Ae.debug("react not installed");const e=await mp();e||(Ae.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));const t=fp(e.agent,"add",
|
|
263
|
-
react"} ${"react-dom"}`,process.exit(1)}}function
|
|
264
|
-
|
|
243
|
+
`.trimStart()}const es=async({languageServices:e,likec4AssetsDir:t,...r})=>{const n=r.customLogger??Cd,i=On(),a=r?.useOverviewGraph===!0;n.info(`${N.cyan("likec4 app root")} ${N.dim(i)}`);const o=r.outputDir??oe(e.workspace,"dist");n.info(N.cyan("outDir")+" "+N.dim(o));let s="/";r.base&&(s=Oo(r.base),!Of(s)&&s!=="./"&&(s=Nf(s))),s!=="/"&&n.info(`${N.green("app base url")} ${N.dim(s)}`);const u=r.webcomponentPrefix??"likec4",c=r.title??"LikeC4",l=r.outputSingleFile??!1;return{isDev:!1,likec4AssetsDir:t,
|
|
244
|
+
webcomponentPrefix:u,title:c,root:i,languageServices:e,clearScreen:!1,base:s,resolve:{conditions:["production"],dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client"],alias:{...jn(),"likec4/previews":t}},configFile:!1,mode:"production",optimizeDeps:{include:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client","@likec4/core/types","@likec4/core/model","@likec4/core/styles","@likec4/core/compute-view/relationships","@likec4/core/u\
|
|
245
|
+
tils","@likec4/core","likec4/model","likec4/react","likec4/vite-plugin/internal"],noDiscovery:!0},esbuild:{tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},define:{WEBCOMPONENT_PREFIX:JSON.stringify(u),PAGE_TITLE:JSON.stringify(c),__USE_OVERVIEW_GRAPH__:a?"true":"false",__USE_HASH_HISTORY__:r?.useHashHistory===!0?"true":"false","process.env.NODE_ENV":'"production"'},build:{outDir:o,emptyOutDir:!1,sourcemap:!1,cssMinify:!1,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:In,rollupOptions:{
|
|
246
|
+
treeshake:{preset:"recommended"},...!l&&{input:[oe(i,"index.html"),oe(i,"src","main.js"),oe(i,"src","fonts.css"),oe(i,"src","style.css")],output:{manualChunks:m=>{if(!(m.endsWith(".css")||m.endsWith(".html")||m.includes("likec4/icons"))){if(m.includes("__app__")){let y=m.match(/__app__\/src\/([\w]+)\.js/)?.[1];return y?y[1]:void 0}if(m.includes("node_modules/likec4")||m.includes("node_modules/@likec4"))return"likec4";if(m.includes("node_modules"))return"vendors"}}}}}},customLogger:n,plugins:[bn(),
|
|
247
|
+
Sn({languageServices:e.languageServices,useOverviewGraph:a}),l?Jd():void 0].filter(Boolean)}};async function ts({languageServices:e,outDir:t,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const a=Te(["vite","webcomponent"]),o=On();return a.info(N.cyan("outDir")+" "+N.dim(t)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn(),dedupe:["react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom\
|
|
248
|
+
/client"]},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Tn,tsconfigRaw:{compilerOptions:{target:"ESNext",jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:In,lib:{entry:"src/webcomponent.js",fileName(s,u){return i},formats:["iife"],name:"LikeC4Views"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:a,
|
|
249
|
+
plugins:[bn(),Sn({languageServices:e.languageServices,useOverviewGraph:!1})]}}const np=["favicon.ico","robots.txt"],sp=async({buildWebcomponent:e=!0,webcomponentPrefix:t="likec4",title:r,languageServices:n,likec4AssetsDir:i,outputSingleFile:a,...o})=>{i??=await Vt(Et(zt(),".likec4-assets-"));const s=await es({...o,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:t,title:r,outputSingleFile:a}),u=await Nn();for(const l of np){const m=oe(s.root,l);He(m)&&Mo(m,oe(u,l))}const c=n.languageServices.
|
|
250
|
+
projects();if(c.length===1){const l=await n.viewsService.computedViews(),m=await n.diagrams();if(m.length===0)throw process.exitCode=1,new Error("no views found");m.length===l.length?s.customLogger.info(`${N.dim("workspace:")} ${N.green("\u2713 all views layouted")}`):s.customLogger.warn(`${N.dim("workspace:")} ${N.yellow(`\u2717 layouted ${m.length} of ${l.length} views`)}`),m.forEach(y=>{(y.hasLayoutDrift||y.drifts&&y.drifts.length>0)&&s.customLogger.warn(N.dim("view")+" "+N.red(y.id)+" "+N.yellow(
|
|
251
|
+
"is out of date, layout drift detected"))})}else for(const l of c){const m=await n.viewsService.computedViews(l.id);m.length===0?s.customLogger.warn(`${N.dim("project:")} ${l.id} ${N.yellow("\u2717 no views found")}`):s.customLogger.info(`${N.dim("project:")} ${l.id} ${N.green(`${m.length} views`)}`)}if(e){const l=await ts({webcomponentPrefix:t,languageServices:n,outDir:u,base:s.base});await At(l)}if(await At({...s,publicDir:u,mode:"production"}),a)for(let l of Uf(oe(s.build.outDir)).filter(m=>m!==
|
|
252
|
+
"index.html"))$n(oe(s.build.outDir,l),{recursive:!0});else{const l=oe(s.build.outDir,"index.html");He(l)&&Mo(l,oe(s.build.outDir,"404.html"))}};function rs(e,t){return r=>r.length>1?[e,t,r[0],"--",...r.slice(1)]:[e,t,r[0]]}function op(){return e=>["deno","run",`npm:${e[0]}`,...e.slice(1)]}const ap={agent:["npm",0],run:rs("npm","run"),install:["npm","i",0],frozen:["npm","ci",0],global:["npm","i","-g",0],add:["npm","i",0],upgrade:["npm","update",0],"upgrade-interactive":null,dedupe:["npm","dedupe",
|
|
253
|
+
0],execute:["npx",0],"execute-local":["npx",0],uninstall:["npm","uninstall",0],global_uninstall:["npm","uninstall","-g",0]},Ra={agent:["yarn",0],run:["yarn","run",0],install:["yarn","install",0],frozen:["yarn","install","--frozen-lockfile",0],global:["yarn","global","add",0],add:["yarn","add",0],upgrade:["yarn","upgrade",0],"upgrade-interactive":["yarn","upgrade-interactive",0],dedupe:null,execute:["npx",0],"execute-local":rs("yarn","exec"),uninstall:["yarn","remove",0],global_uninstall:["yarn",
|
|
254
|
+
"global","remove",0]},ip={...Ra,frozen:["yarn","install","--immutable",0],upgrade:["yarn","up",0],"upgrade-interactive":["yarn","up","-i",0],dedupe:["yarn","dedupe",0],execute:["yarn","dlx",0],"execute-local":["yarn","exec",0],global:["npm","i","-g",0],global_uninstall:["npm","uninstall","-g",0]},Aa={agent:["pnpm",0],run:["pnpm","run",0],install:["pnpm","i",0],frozen:["pnpm","i","--frozen-lockfile",0],global:["pnpm","add","-g",0],add:["pnpm","add",0],upgrade:["pnpm","update",0],"upgrade-interact\
|
|
255
|
+
ive":["pnpm","update","-i",0],dedupe:["pnpm","dedupe",0],execute:["pnpm","dlx",0],"execute-local":["pnpm","exec",0],uninstall:["pnpm","remove",0],global_uninstall:["pnpm","remove","--global",0]},cp={agent:["bun",0],run:["bun","run",0],install:["bun","install",0],frozen:["bun","install","--frozen-lockfile",0],global:["bun","add","-g",0],add:["bun","add",0],upgrade:["bun","update",0],"upgrade-interactive":["bun","update","-i",0],dedupe:null,execute:["bun","x",0],"execute-local":["bun","x",0],uninstall:[
|
|
256
|
+
"bun","remove",0],global_uninstall:["bun","remove","-g",0]},up={agent:["deno",0],run:["deno","task",0],install:["deno","install",0],frozen:["deno","install","--frozen",0],global:["deno","install","-g",0],add:["deno","add",0],upgrade:["deno","outdated","--update",0],"upgrade-interactive":["deno","outdated","--update",0],dedupe:null,execute:op(),"execute-local":["deno","task","--eval",0],uninstall:["deno","remove",0],global_uninstall:["deno","uninstall","-g",0]},lp={npm:ap,yarn:Ra,"yarn@berry":ip,
|
|
257
|
+
pnpm:Aa,"pnpm@6":{...Aa,run:rs("pnpm","run")},bun:cp,deno:up};function fp(e,t,r){const n=lp[e][t];return dp(n,r)}function dp(e,t){if(e==null)return null;const r=typeof e=="function"?e(t):e.flatMap(n=>typeof n=="number"?t:[n]);return{command:r[0],args:r.slice(1)}}const pp=["npm","yarn","yarn@berry","pnpm","pnpm@6","bun","deno"],Pa={"bun.lock":"bun","bun.lockb":"bun","deno.lock":"deno","pnpm-lock.yaml":"pnpm","pnpm-workspace.yaml":"pnpm","yarn.lock":"yarn","package-lock.json":"npm","npm-shrinkwrap\
|
|
258
|
+
.json":"npm"},Ca={"node_modules/.deno/":"deno","node_modules/.pnpm/":"pnpm","node_modules/.yarn-state.yml":"yarn","node_modules/.yarn_integrity":"yarn","node_modules/.package-lock.json":"npm",".pnp.cjs":"yarn",".pnp.js":"yarn","bun.lock":"bun","bun.lockb":"bun"};async function ns(e,t){try{const r=await Go.stat(e);return t==="file"?r.isFile():r.isDirectory()}catch{return!1}}function*hp(e=me.cwd()){let t=ie.resolve(e);const{root:r}=ie.parse(t);for(;t&&t!==r;)yield t,t=ie.dirname(t)}async function ka(e,t){
|
|
259
|
+
return!e||!ns(e,"file")?null:await gp(e,t)}async function mp(e={}){const{cwd:t,strategies:r=["lockfile","packageManager-field","devEngines-field"],onUnknown:n}=e;let i;if(typeof e.stopDir=="string"){const a=ie.resolve(e.stopDir);i=o=>o===a}else i=e.stopDir;for(const a of hp(t)){for(const o of r)switch(o){case"lockfile":{for(const s of Object.keys(Pa))if(await ns(ie.join(a,s),"file")){const u=Pa[s],c=await ka(ie.join(a,"package.json"),n);return c||{name:u,agent:u}}break}case"packageManager-field":case"\
|
|
260
|
+
devEngines-field":{const s=await ka(ie.join(a,"package.json"),n);if(s)return s;break}case"install-metadata":{for(const s of Object.keys(Ca)){const u=s.endsWith("/")?"dir":"file";if(await ns(ie.join(a,s),u)){const c=Ca[s],l=c==="yarn"?vp(s)?"yarn":"yarn@berry":c;return{name:c,agent:l}}}break}}if(i?.(a))break}return null}function yp(e){const t=r=>r?.match(/\d+(\.\d+){0,2}/)?.[0]??r;if(typeof e.packageManager=="string"){const[r,n]=e.packageManager.replace(/^\^/,"").split("@");return{name:r,ver:t(n)}}
|
|
261
|
+
if(typeof e.devEngines?.packageManager?.name=="string")return{name:e.devEngines.packageManager.name,ver:t(e.devEngines.packageManager.version)}}async function gp(e,t){try{const r=JSON.parse(await Go.readFile(e,"utf8"));let n;const i=yp(r);if(i){const a=i.name,o=i.ver;let s=o;return a==="yarn"&&o&&Number.parseInt(o)>1?(n="yarn@berry",s="berry",{name:a,agent:n,version:s}):a==="pnpm"&&o&&Number.parseInt(o)<7?(n="pnpm@6",{name:a,agent:n,version:s}):pp.includes(a)?(n=a,{name:a,agent:n,version:s}):t?.(
|
|
262
|
+
r.packageManager)??null}}catch{}return null}function vp(e){return e.endsWith(".yarn_integrity")}function Ta(e){try{return!!ad.createRequire(import.meta.url).resolve(e)}catch(t){return Ae.debug(Ht(t)),!1}}async function kt(){if(Ta("react")&&Ta("react-dom")){Ae.debug("react already installed");return}Ae.debug("react not installed");const e=await mp();e||(Ae.error`Package manager not detected, please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));const t=fp(e.agent,"add",
|
|
263
|
+
["react","react-dom"]);t||(Ae.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1));try{await No(t.command,t.args,{stdio:"inherit"})}catch(r){Ae.debug(Ht(r)),Ae.error`Please install dependencies manually: ${"react"} ${"react-dom"}`,process.exit(1)}}function Oa(e){if(e.resolvedUrls)return Io(e.resolvedUrls.network)??Io(e.resolvedUrls.local)}function Na(e){if(!e.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");Ke([N.green("LikeC4 served at\
|
|
264
|
+
:"),"",N.dim("Local: ")+e.resolvedUrls.local.join(`
|
|
265
|
+
`+"".padEnd(9," ")),e.resolvedUrls.network.length?N.dim("Network: ")+e.resolvedUrls.network.join(`
|
|
265
266
|
`+"".padEnd(9," ")):void 0].filter(t=>If(t)).join(`
|
|
266
|
-
`))}class Ia extends Error{constructor(t){super(`${t} is locked`)}}const dt={old:new Set,young:new Set},$p=1e3*15,Xt=1024,Jt=65535;let
|
|
267
|
-
try{await ja({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},wp=function*(e){e&&(yield*e),yield 0};async function ss(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const i=e.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const
|
|
268
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(
|
|
269
|
-
if(!["EADDRINUSE","EACCES"].includes(
|
|
270
|
-
i;
|
|
271
|
-
"0.0.0.0":"localhost");t?(y.info(`Enabling HMR: localhost:${
|
|
272
|
-
|
|
273
|
-
catch($=>n.error(`failed to close page: ${$}`)),c=void 0);const v=jo(S*200,{min:200,max:1e3});n.info(
|
|
274
|
-
(f=_.sequenceLayout.bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(jf(g,{padding:20,theme:u,dynamic:
|
|
275
|
-
|
|
276
|
-
`+
|
|
277
|
-
cDispose")],n===void 0&&(n=t[qa("dispose")],i=n),typeof n!="function"&&xa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(
|
|
278
|
-
return Promise.resolve(s).then(
|
|
279
|
-
`);const{chromium:l}=await import("playwright"),m=l.executablePath();e.info(
|
|
280
|
-
`);const _=await y.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:t,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});_.setDefaultNavigationTimeout(n),_.setDefaultTimeout(n);try{return await bp({browserContext:_,views:i,output:
|
|
281
|
-
timeoutMs:
|
|
282
|
-
|
|
283
|
-
o,"project"
|
|
284
|
-
`),
|
|
285
|
-
throw TypeError(e)},Ap=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Fa("Object expected");var n,i;n=t[Ua("asyncDispose")],n===void 0&&(n=t[Ua("dispose")],i=n),typeof n!="function"&&Fa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(
|
|
286
|
-
i=
|
|
287
|
-
te",watch:!1}),!0),g=
|
|
288
|
-
`),await Ha({path:e,useDotBin:t,output:
|
|
289
|
-
var y=Pp(c,l,m);y&&await y}}const kp=e=>e.command({command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",be).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:oe}).option("base",ta).option("use-hash-history",Zo).option("use-dot",Re).option("webcomponent-prefix",kn).option("title",ea).option("output-single-file",Ed).example(`${
|
|
290
|
-
|
|
291
|
-
switch(
|
|
292
|
-
break}if(n==="property"){if(os.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Tp.has(
|
|
293
|
-
r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function as(e,t){if(typeof t!="number"&&Array.isArray(e)){const r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function Ga(e,t){if(as(e,t))throw new Error("Cannot use string index")}function
|
|
294
|
-
e=e[
|
|
295
|
-
"string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,jp=e=>{const t=ie.join(Je,"Library");return{data:ie.join(t,"Application Support",e),config:ie.join(t,"Preferences",e),cache:ie.join(t,"Caches",e),log:ie.join(t,"Logs",e),temp:ie.join(is,e)}},Lp=e=>{const t=pt.APPDATA||ie.join(Je,"AppData","Roaming"),r=pt.LOCALAPPDATA||ie.join(Je,"AppData","Local");return{data:ie.
|
|
296
|
-
e,"Data"),config:ie.join(t,e,"Config"),cache:ie.join(r,e,"Cache"),log:ie.join(r,e,"Log"),temp:ie.join(is,e)}},Dp=e=>{const t=ie.basename(Je);return{data:ie.join(pt.XDG_DATA_HOME||ie.join(Je,".local","share"),e),config:ie.join(pt.XDG_CONFIG_HOME||ie.join(Je,".config"),e),cache:ie.join(pt.XDG_CACHE_HOME||ie.join(Je,".cache"),e),log:ie.join(pt.XDG_STATE_HOME||ie.join(Je,".local","state"),e),temp:ie.join(is,t,e)}};function qp(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(
|
|
297
|
-
|
|
298
|
-
e))return!1;const{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!pe.isNodeError(e))throw e;if(!pe.isChangeErrorOk(e))throw e}};class Hp{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Mp,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(
|
|
299
|
-
delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{const r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(
|
|
300
|
-
add(t),t()}}}}}const Up=new Hp,Qe=(e,t)=>function(n){return function i(...
|
|
301
|
-
se.chmod),pe.onChangeError),chown:Ye(ve(se.chown),pe.onChangeError),close:Ye(ve(se.close),Ce),fsync:Ye(ve(se.fsync),Ce),mkdir:Ye(ve(se.mkdir),Ce),realpath:Ye(ve(se.realpath),Ce),stat:Ye(ve(se.stat),Ce),unlink:Ye(ve(se.unlink),Ce),chmodSync:
|
|
302
|
-
unlinkSync:
|
|
267
|
+
`))}class Ia extends Error{constructor(t){super(`${t} is locked`)}}const dt={old:new Set,young:new Set},$p=1e3*15,Xt=1024,Jt=65535;let Tt;const _p=()=>{const e=Rt.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(e))for(const n of r)t.add(n.address);return t},ja=e=>new Promise((t,r)=>{const n=id.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{const{port:i}=n.address();n.close(()=>{t(i)})})}),La=async(e,t)=>{if(e.host||e.port===0)return ja(e);for(const r of t)
|
|
268
|
+
try{await ja({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},wp=function*(e){e&&(yield*e),yield 0};async function ss(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){const i=e.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const a of i){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
269
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(a))throw new TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}Tt===void 0&&(Tt=setTimeout(()=>{Tt=void 0,dt.old=dt.young,dt.young=new Set},$p),Tt.unref&&Tt.unref());const n=_p();for(const i of wp(t))try{if(r.has(i))continue;let a=await La({...e,port:i},n);for(;dt.old.has(a)||dt.young.has(a);){if(i!==0)throw new Ia(i);a=await La({...e,port:i},n)}return dt.young.add(a),a}catch(a){
|
|
270
|
+
if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof Ia))throw a}throw new Error("No available ports found")}function Yt(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("`from` and `to` must be integer numbers");if(e<Xt||e>Jt)throw new RangeError(`'from' must be between ${Xt} and ${Jt}`);if(t<Xt||t>Jt)throw new RangeError(`'to' must be between ${Xt} and ${Jt}`);if(e>t)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let a=n;a<=
|
|
271
|
+
i;a++)yield a}(e,t)}async function Da({buildWebcomponent:e=!0,hmr:t=!0,webcomponentPrefix:r="likec4",title:n,languageServices:i,likec4AssetsDir:a,openBrowser:o,listen:s,port:u,...c}){a??=await Vt(Et(zt(),".likec4-assets-"));const{isDev:l,...m}=await es({...c,languageServices:i,likec4AssetsDir:a,webcomponentPrefix:r,title:n}),y=m.customLogger;u??=Vo.PORT?parseInt(Vo.PORT,10):void 0,u||(u=await ss({port:[5173,5174,...Yt(61e3,61010),...Yt(62002,62010)]}));const _=await ss({port:Yt(24678,24690)}),S=await Nn(),
|
|
272
|
+
g=s??(Xe()?"0.0.0.0":"localhost");t?(y.info(`Enabling HMR: localhost:${_}`),Xe()&&y.info(N.yellow(`ensure port ${_} is published from container`))):y.info("Disabling HMR");const h=await sd({...m,define:t?{...m.define,"process.env.NODE_ENV":'"development"'}:m.define,mode:t?"development":m.mode,publicDir:S,server:{host:g,allowedHosts:!0,port:u,hmr:t&&{overlay:!0,port:_},fs:{strict:!1},open:o??(!l&&!Xe())}});return e?(y.info("Building webcomponent"),ts({webcomponentPrefix:r,languageServices:i,outDir:S,
|
|
273
|
+
base:m.base}).then(p=>At({...p,logLevel:"warn"})).catch(p=>{y.warn(Ht(p)),y.warn("webcomponent build failed, ignoring error and continue")})):y.info("Skip webcomponent build"),await h.listen(),h}async function bp({browserContext:e,views:t,output:r,logger:n,timeout:i,maxAttempts:a,dynamicVariant:o,outputType:s,theme:u}){let c;const l=t.map(_=>({view:_,attempt:1})),m=[];let y;for(;y=l.shift();){const{view:_,attempt:S}=y,g=`export/${encodeURIComponent(_.id)}/`;try{if(S>1){c&&(c.close({runBeforeUnload:!0}).
|
|
274
|
+
catch($=>n.error(`failed to close page: ${$}`)),c=void 0);const v=jo(S*200,{min:200,max:1e3});n.info(N.cyan(g)+N.dim(` attempt ${S} of ${a} after ${v}ms`)),await cd(v)}else _.hasLayoutDrift&&n.warn(N.yellow("Drift detected, manual layout can not be applied, view may be invalid: ")+N.red(_.id));let h=".";s==="relative"&&(h=_.sourcePath??".",h.includes("/")?h=h.slice(0,h.lastIndexOf("/")):h=".");const p=oe(r,h,`${_.id}.png`);c??=await e.newPage();let f=_.bounds;o==="sequence"&&_._type==="dynamic"&&
|
|
275
|
+
(f=_.sequenceLayout.bounds);const d=20;await c.setViewportSize({width:f.width+40+d,height:f.height+40+d}),await c.goto(jf(g,{padding:20,theme:u,dynamic:o})),n.info(N.cyan(g)+N.dim(` -> ${Ue(r,p)}`)),await c.waitForSelector(".react-flow.initialized"),_.nodes.some(v=>Lf(v.icon)&&v.icon.toLowerCase().startsWith("http"))&&await Ep(c,i),await c.getByTestId("export-page").screenshot({animations:"disabled",path:p,omitBackground:!0}),m.push({view:_,path:p})}catch(h){c?.close({runBeforeUnload:!0}).catch(
|
|
276
|
+
p=>n.error(`failed to close page: ${p}`)),n.error(N.red("failed "+g+`
|
|
277
|
+
`+h)),S<a&&(l.push({view:_,attempt:S+1}),n.info(N.dim(`retry ${g}`))),c=void 0}}return m}async function Ep(e,t){let r=await e.locator("//img").all();if(!r.length)return;const n=r.map(i=>i.evaluate(a=>a.complete||new Promise(o=>{a.onload=o,a.onerror=o}),{timeout:Math.max(15e3,t)}));await Promise.allSettled(n)}var qa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),xa=e=>{throw TypeError(e)},Sp=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&xa("Object expected");var n,i;n=t[qa("asyn\
|
|
278
|
+
cDispose")],n===void 0&&(n=t[qa("dispose")],i=n),typeof n!="function"&&xa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.push([r,n,t])}else e.push([r]);return t},Rp=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])
|
|
279
|
+
return Promise.resolve(s).then(a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()};async function Ma({logger:e,serverUrl:t,theme:r="light",timeoutMs:n=15e3,views:i,output:a,outputType:o="relative",maxAttempts:s=3,chromiumSandbox:u=!1,sequence:c=!1}){e.info(`${N.dim("output")} ${a}`),e.info(`${N.dim("base url")} ${t}
|
|
280
|
+
`);const{chromium:l}=await import("playwright"),m=l.executablePath();e.info(N.cyan("Start chromium")+" "+N.dim(m));const y=await l.launch({chromiumSandbox:u,headless:!0});e.info(N.cyan("Color scheme: ")+r+`
|
|
281
|
+
`);const _=await y.newContext({deviceScaleFactor:2,colorScheme:r,baseURL:t,bypassCSP:!0,ignoreHTTPSErrors:!0,isMobile:!1});_.setDefaultNavigationTimeout(n),_.setDefaultTimeout(n);try{return await bp({browserContext:_,views:i,output:a,outputType:o,logger:e,maxAttempts:s,dynamicVariant:c?"sequence":"diagram",timeout:n,theme:r})}finally{e.info(N.cyan("close chromium")),await _.close(),await y.close()}}async function Ha({path:e,useDotBin:t,project:r,theme:n="light",output:i,outputType:a,serverUrl:o,
|
|
282
|
+
ignore:s=!1,timeoutMs:u=1e4,maxAttempts:c=3,filter:l,sequence:m=!1,chromiumSandbox:y=!1}){var _=[];try{const p=Te("export"),f=Vf(),d=Sp(_,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0);i??=d.workspace;let v,$=[...d.languageServices.projects()];if(r&&!$.some(w=>w.id===r))throw p.error(`project not found: ${r}`),new Error(`project not found: ${r}`);if(!o&&(p.info(N.cyan("start preview server")),v=await Da({languageServices:d,buildWebcomponent:!1,openBrowser:!1,useOverviewGraph:!1,
|
|
283
|
+
hmr:!1}),o=Oa(v),!o))throw p.error("Vite server is not ready, no resolvedUrls"),new Error("Vite server is not ready, no resolvedUrls");for(const w of $){if(r&&w.id!==r)continue;$.length>1&&(p.info(N.dim("---------")),p.info(`${N.dim("project:")} ${w.id}`),p.info(`${N.dim("folder:")} ${w.folder.fsPath}`));let b=await d.diagrams(w.id);if(l&&bt(l,1)&&bt(b,1)){const U=Df(l);p.info(`${N.cyan("filter")} ${N.dim(JSON.stringify(l))}`),b=b.filter(L=>U(L.id)?(p.info(`${N.green("include")} ${L.id} \u2705`),
|
|
284
|
+
!0):(p.info(`${N.gray("skip")} ${N.dim(L.id)}`),!1))}if(!bt(b,1)){p.warn("no views found");continue}let P=$.length>1?Oo(Lo(o,"project",w.id)):o,I=$.length>1?Lo(i,w.id):i;const H=await Ma({logger:p,serverUrl:P,theme:n,timeoutMs:u,views:b,output:I,outputType:a,maxAttempts:c,sequence:m,chromiumSandbox:y}),{pretty:x}=qf(f);if(H.length>0&&p.info(N.green(`exported ${H.length} views in ${x}`)+`
|
|
285
|
+
`),H.length!==b.length&&(s&&H.length>0?p.info(N.dim("ignore")+" "+N.red(`failed ${b.length-H.length} out of ${b.length} views`)):p.error(N.red(`failed ${b.length-H.length} out of ${b.length} views`))),H.length!==b.length&&(H.length===0||!s))throw new Error(`Failed ${b.length-H.length} out of ${b.length} views`)}v&&(p.info(N.cyan("stop server")),await v.close().catch(w=>{p.error(w)}))}catch(p){var S=p,g=!0}finally{var h=Rp(_,S,g);h&&await h}}var Ua=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Fa=e=>{
|
|
286
|
+
throw TypeError(e)},Ap=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Fa("Object expected");var n,i;n=t[Ua("asyncDispose")],n===void 0&&(n=t[Ua("dispose")],i=n),typeof n!="function"&&Fa("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.push([r,n,t])}else e.push([r]);return t},Pp=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},
|
|
287
|
+
i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(s).then(a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()};const{cyan:Va,dim:za}=N;async function Cp({path:e,useDotBin:t,useHashHistory:r,webcomponentPrefix:n,title:i,useOverview:a=!1,output:o,outputSingleFile:s,base:u}){var c=[];try{await kt();const _=Te("c4:build"),S=Ap(c,await Pe.fromWorkspace(e,{graphviz:t?"binary":"wasm",logger:"vi\
|
|
288
|
+
te",watch:!1}),!0),g=o??oe(S.workspace,"dist");let h=oe(g,"assets");if(a)try{h=oe(g,"assets","previews"),await xe(h,{recursive:!0}),_.info(`${Va("Generate previews")} ${za(h)}
|
|
289
|
+
`),await Ha({path:e,useDotBin:t,project:void 0,output:h,outputType:"flat",ignore:!0})}catch(p){_.error(N.red("Failed to generate previews")),_.error(p),_.warn(N.yellow("Ignore previews and continue build")),$n(h,{recursive:!0,force:!0}),a=!1}await sp({base:u,useHashHistory:s||r,customLogger:_,useOverviewGraph:a,webcomponentPrefix:n,title:i,languageServices:S,likec4AssetsDir:h,outputDir:o,outputSingleFile:s}),a&&(_.info(`${Va("clean previews")} ${za(h)}`),$n(h,{recursive:!0,force:!0}))}catch(_){var l=_,
|
|
290
|
+
m=!0}finally{var y=Pp(c,l,m);y&&await y}}const kp=e=>e.command({command:"build [path]",aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("path",be).option("output",{alias:"o",type:"string",desc:"output directory for production build",normalize:!0,coerce:oe}).option("base",ta).option("use-hash-history",Zo).option("use-dot",Re).option("webcomponent-prefix",kn).option("title",ea).option("output-single-file",Ed).example(`${N.green("$0 build -o ./build ./src")}`,N.gray("Sea\
|
|
291
|
+
rch for likec4 files in 'src' and output static site to 'build'")),handler:async t=>{await Cp({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],webcomponentPrefix:t["webcomponent-prefix"],title:t.title,outputSingleFile:t["output-single-file"]??!1})}}),rt=e=>{const t=typeof e;return e!==null&&(t==="object"||t==="function")},os=new Set(["__proto__","prototype","constructor"]),Tp=new Set("0123456789");function Qt(e){const t=[];let r="",n="start",i=!1;
|
|
292
|
+
for(const a of e)switch(a){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=a),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=a;break}if(os.has(r))return[];t.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}
|
|
293
|
+
if(i){i=!1,r+=a;break}if(n==="property"){if(os.has(r))return[];t.push(r),r=""}n="index";break}case"]":{if(n==="index"){t.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Tp.has(a))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=a}}switch(i&&(r+="\\"),n){case"property":{if(os.has(r))
|
|
294
|
+
return[];t.push(r);break}case"index":throw new Error("Index was not closed");case"start":{t.push("");break}}return t}function as(e,t){if(typeof t!="number"&&Array.isArray(e)){const r=Number.parseInt(t,10);return Number.isInteger(r)&&e[r]===e[t]}return!1}function Ga(e,t){if(as(e,t))throw new Error("Cannot use string index")}function Op(e,t,r){if(!rt(e)||typeof t!="string")return r===void 0?e:r;const n=Qt(t);if(n.length===0)return r;for(let i=0;i<n.length;i++){const a=n[i];if(as(e,a)?e=i===n.length-
|
|
295
|
+
1?void 0:null:e=e[a],e==null){if(i!==n.length-1)return r;break}}return e===void 0?r:e}function Ba(e,t,r){if(!rt(e)||typeof t!="string")return e;const n=e,i=Qt(t);for(let a=0;a<i.length;a++){const o=i[a];Ga(e,o),a===i.length-1?e[o]=r:rt(e[o])||(e[o]=typeof i[a+1]=="number"?[]:{}),e=e[o]}return n}function Np(e,t){if(!rt(e)||typeof t!="string")return!1;const r=Qt(t);for(let n=0;n<r.length;n++){const i=r[n];if(Ga(e,i),n===r.length-1)return delete e[i],!0;if(e=e[i],!rt(e))return!1}}function Ip(e,t){if(!rt(
|
|
296
|
+
e)||typeof t!="string")return!1;const r=Qt(t);if(r.length===0)return!1;for(const n of r){if(!rt(e)||!(n in e)||as(e,n))return!1;e=e[n]}return!0}const Je=Rt.homedir(),is=Rt.tmpdir(),{env:pt}=me,jp=e=>{const t=ie.join(Je,"Library");return{data:ie.join(t,"Application Support",e),config:ie.join(t,"Preferences",e),cache:ie.join(t,"Caches",e),log:ie.join(t,"Logs",e),temp:ie.join(is,e)}},Lp=e=>{const t=pt.APPDATA||ie.join(Je,"AppData","Roaming"),r=pt.LOCALAPPDATA||ie.join(Je,"AppData","Local");return{data:ie.
|
|
297
|
+
join(r,e,"Data"),config:ie.join(t,e,"Config"),cache:ie.join(r,e,"Cache"),log:ie.join(r,e,"Log"),temp:ie.join(is,e)}},Dp=e=>{const t=ie.basename(Je);return{data:ie.join(pt.XDG_DATA_HOME||ie.join(Je,".local","share"),e),config:ie.join(pt.XDG_CONFIG_HOME||ie.join(Je,".config"),e),cache:ie.join(pt.XDG_CACHE_HOME||ie.join(Je,".cache"),e),log:ie.join(pt.XDG_STATE_HOME||ie.join(Je,".local","state"),e),temp:ie.join(is,t,e)}};function qp(e,{suffix:t="nodejs"}={}){if(typeof e!="string")throw new TypeError(
|
|
298
|
+
`Expected a string, got ${typeof e}`);return t&&(e+=`-${t}`),me.platform==="darwin"?jp(e):me.platform==="win32"?Lp(e):Dp(e)}const Ye=(e,t)=>function(...n){return e.apply(void 0,n).catch(t)},Fe=(e,t)=>function(...n){try{return e.apply(void 0,n)}catch(i){return t(i)}},xp=me.getuid?!me.getuid():!1,Mp=1e4,Ce=()=>{},pe={isChangeErrorOk:e=>{if(!pe.isNodeError(e))return!1;const{code:t}=e;return t==="ENOSYS"||!xp&&(t==="EINVAL"||t==="EPERM")},isNodeError:e=>e instanceof Error,isRetriableError:e=>{if(!pe.
|
|
299
|
+
isNodeError(e))return!1;const{code:t}=e;return t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM"},onChangeError:e=>{if(!pe.isNodeError(e))throw e;if(!pe.isChangeErrorOk(e))throw e}};class Hp{constructor(){this.interval=25,this.intervalId=void 0,this.limit=Mp,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(
|
|
300
|
+
this.intervalId),delete this.intervalId)},this.add=t=>{this.queueWaiting.add(t),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=t=>{this.queueWaiting.delete(t),this.queueActive.delete(t)},this.schedule=()=>new Promise(t=>{const r=()=>this.remove(n),n=()=>t(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const t of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(
|
|
301
|
+
t),this.queueActive.add(t),t()}}}}}const Up=new Hp,Qe=(e,t)=>function(n){return function i(...a){return Up.schedule().then(o=>{const s=c=>(o(),c),u=c=>{if(o(),Date.now()>=n)throw c;if(t(c)){const l=Math.round(100*Math.random());return new Promise(y=>setTimeout(y,l)).then(()=>i.apply(void 0,a))}throw c};return e.apply(void 0,a).then(s,u)})}},Ze=(e,t)=>function(n){return function i(...a){try{return e.apply(void 0,a)}catch(o){if(Date.now()>n)throw o;if(t(o))return i.apply(void 0,a);throw o}}},$e={attempt:{
|
|
302
|
+
chmod:Ye(ve(se.chmod),pe.onChangeError),chown:Ye(ve(se.chown),pe.onChangeError),close:Ye(ve(se.close),Ce),fsync:Ye(ve(se.fsync),Ce),mkdir:Ye(ve(se.mkdir),Ce),realpath:Ye(ve(se.realpath),Ce),stat:Ye(ve(se.stat),Ce),unlink:Ye(ve(se.unlink),Ce),chmodSync:Fe(se.chmodSync,pe.onChangeError),chownSync:Fe(se.chownSync,pe.onChangeError),closeSync:Fe(se.closeSync,Ce),existsSync:Fe(se.existsSync,Ce),fsyncSync:Fe(se.fsync,Ce),mkdirSync:Fe(se.mkdirSync,Ce),realpathSync:Fe(se.realpathSync,Ce),statSync:Fe(se.statSync,
|
|
303
|
+
Ce),unlinkSync:Fe(se.unlinkSync,Ce)},retry:{close:Qe(ve(se.close),pe.isRetriableError),fsync:Qe(ve(se.fsync),pe.isRetriableError),open:Qe(ve(se.open),pe.isRetriableError),readFile:Qe(ve(se.readFile),pe.isRetriableError),rename:Qe(ve(se.rename),pe.isRetriableError),stat:Qe(ve(se.stat),pe.isRetriableError),write:Qe(ve(se.write),pe.isRetriableError),writeFile:Qe(ve(se.writeFile),pe.isRetriableError),closeSync:Ze(se.closeSync,pe.isRetriableError),fsyncSync:Ze(se.fsyncSync,pe.isRetriableError),openSync:Ze(
|
|
303
304
|
se.openSync,pe.isRetriableError),readFileSync:Ze(se.readFileSync,pe.isRetriableError),renameSync:Ze(se.renameSync,pe.isRetriableError),statSync:Ze(se.statSync,pe.isRetriableError),writeSync:Ze(se.writeSync,pe.isRetriableError),writeFileSync:Ze(se.writeFileSync,pe.isRetriableError)}},Fp="utf8",Ka=438,Vp=511,zp={},Gp=Rt.userInfo().uid,Bp=Rt.userInfo().gid,Kp=1e3,Wp=!!me.getuid;me.getuid&&me.getuid();const Wa=128,Xp=e=>e instanceof Error&&"code"in e,Xa=e=>typeof e=="string",cs=e=>e===void 0,Jp=me.platform===
|
|
304
305
|
"linux",Ja=me.platform==="win32",us=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];Ja||us.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),Jp&&us.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class Yp{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=t=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();t&&(Ja&&t!=="SIGINT"&&t!=="SIGTERM"&&t!=="SIGKILL"?me.kill(me.pid,"SIGTERM"):me.kill(me.pid,t))}},this.hook=()=>{me.
|
|
305
306
|
once("exit",()=>this.exit());for(const t of us)try{me.once(t,()=>this.exit(t))}catch{}},this.register=t=>(this.callbacks.add(t),()=>{this.callbacks.delete(t)}),this.hook()}}const Qp=new Yp,Zp=Qp.register,_e={store:{},create:e=>{const t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),i=`.tmp-${Date.now().toString().slice(-10)}${t}`;return`${e}${i}`},get:(e,t,r=!0)=>{const n=_e.truncate(t(e));return n in _e.store?_e.get(e,t,r):(_e.store[n]=r,[n,()=>delete _e.store[n]])},purge:e=>{
|
|
306
307
|
_e.store[e]&&(delete _e.store[e],$e.attempt.unlink(e))},purgeSync:e=>{_e.store[e]&&(delete _e.store[e],$e.attempt.unlinkSync(e))},purgeSyncAll:()=>{for(const e in _e.store)_e.purgeSync(e)},truncate:e=>{const t=ie.basename(e);if(t.length<=Wa)return e;const r=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!r)return e;const n=t.length-Wa;return`${e.slice(0,-t.length)}${r[1]}${r[2].slice(0,-n)}${r[3]}`}};Zp(_e.purgeSyncAll);function Ya(e,t,r=zp){if(Xa(r))return Ya(e,t,{encoding:r});
|
|
307
|
-
const n=Date.now()+((r.timeout??Kp)||-1);let i=null,
|
|
308
|
-
t,0,r.encoding||Fp):cs(t)||$e.retry.writeSync(n)(
|
|
309
|
-
purge(
|
|
308
|
+
const n=Date.now()+((r.timeout??Kp)||-1);let i=null,a=null,o=null;try{const s=$e.attempt.realpathSync(e),u=!!s;e=s||e,[a,i]=_e.get(e,r.tmpCreate||_e.create,r.tmpPurge!==!1);const c=Wp&&cs(r.chown),l=cs(r.mode);if(u&&(c||l)){const m=$e.attempt.statSync(e);m&&(r={...r},c&&(r.chown={uid:m.uid,gid:m.gid}),l&&(r.mode=m.mode))}if(!u){const m=ie.dirname(e);$e.attempt.mkdirSync(m,{mode:Vp,recursive:!0})}o=$e.retry.openSync(n)(a,"w",r.mode||Ka),r.tmpCreated&&r.tmpCreated(a),Xa(t)?$e.retry.writeSync(n)(o,
|
|
309
|
+
t,0,r.encoding||Fp):cs(t)||$e.retry.writeSync(n)(o,t,0,t.length,0),r.fsync!==!1&&(r.fsyncWait!==!1?$e.retry.fsyncSync(n)(o):$e.attempt.fsync(o)),$e.retry.closeSync(n)(o),o=null,r.chown&&(r.chown.uid!==Gp||r.chown.gid!==Bp)&&$e.attempt.chownSync(a,r.chown.uid,r.chown.gid),r.mode&&r.mode!==Ka&&$e.attempt.chmodSync(a,r.mode);try{$e.retry.renameSync(n)(a,e)}catch(m){if(!Xp(m)||m.code!=="ENAMETOOLONG")throw m;$e.retry.renameSync(n)(a,_e.truncate(e))}i(),a=null}finally{o&&$e.attempt.closeSync(o),a&&_e.
|
|
310
|
+
purge(a)}}var Zt={exports:{}},ls={},Ve={},nt={},fs={},ds={},ps={},Qa;function er(){return Qa||(Qa=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;class t{}e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class r extends t{constructor(f){if(super(),!e.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid\
|
|
310
311
|
identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}e.Name=r;class n extends t{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((d,v)=>`${d}${v}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.
|
|
311
|
-
reduce((d,v)=>(v instanceof r&&(d[v.str]=(d[v.str]||0)+1),d),{})}}e._Code=n,e.nil=new n("");function i(
|
|
312
|
-
|
|
313
|
-
typeof
|
|
314
|
-
g;function p
|
|
312
|
+
reduce((d,v)=>(v instanceof r&&(d[v.str]=(d[v.str]||0)+1),d),{})}}e._Code=n,e.nil=new n("");function i(p,...f){const d=[p[0]];let v=0;for(;v<f.length;)s(d,f[v]),d.push(p[++v]);return new n(d)}e._=i;const a=new n("+");function o(p,...f){const d=[_(p[0])];let v=0;for(;v<f.length;)d.push(a),s(d,f[v]),d.push(a,_(p[++v]));return u(d),new n(d)}e.str=o;function s(p,f){f instanceof n?p.push(...f._items):f instanceof r?p.push(f):p.push(m(f))}e.addCodeArg=s;function u(p){let f=1;for(;f<p.length-1;){if(p[f]===
|
|
313
|
+
a){const d=c(p[f-1],p[f+1]);if(d!==void 0){p.splice(f-1,3,d);continue}p[f++]="+"}f++}}function c(p,f){if(f==='""')return p;if(p==='""')return f;if(typeof p=="string")return f instanceof r||p[p.length-1]!=='"'?void 0:typeof f!="string"?`${p.slice(0,-1)}${f}"`:f[0]==='"'?p.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(p instanceof r))return`"${p}${f.slice(1)}`}function l(p,f){return f.emptyStr()?p:p.emptyStr()?f:o`${p}${f}`}e.strConcat=l;function m(p){return typeof p=="number"||
|
|
314
|
+
typeof p=="boolean"||p===null?p:_(Array.isArray(p)?p.join(","):p)}function y(p){return new n(_(p))}e.stringify=y;function _(p){return JSON.stringify(p).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=_;function S(p){return typeof p=="string"&&e.IDENTIFIER.test(p)?new n(`.${p}`):i`[${p}]`}e.getProperty=S;function g(p){if(typeof p=="string"&&e.IDENTIFIER.test(p))return new n(`${p}`);throw new Error(`CodeGen: invalid export name: ${p}, use explicit $id name mapping`)}e.getEsmExportName=
|
|
315
|
+
g;function h(p){return new n(p.toString())}e.regexpCode=h})(ps)),ps}var hs={},Za;function ei(){return Za||(Za=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;const t=er();class r extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value}}var n;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(n||(e.UsedValueState=n={})),e.varKinds={const:new t.Name("cons\
|
|
315
316
|
t"),let:new t.Name("let"),var:new t.Name("var")};class i{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){const l=this._names[c]||this._nameGroup(c);return`${c}${l.index++}`}_nameGroup(c){var l,m;if(!((m=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||m===void 0)&&m.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: \
|
|
316
|
-
prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=i;class
|
|
317
|
-
ref===void 0)throw new Error("CodeGen: ref must be passed in value");const y=this.toName(c),{prefix:_}=y,S=(m=l.key)!==null&&m!==void 0?m:l.ref;let g=this._values[_];if(g){const f=g.get(S);if(f)return f}else g=this._values[_]=new Map;g.set(S,y);const
|
|
318
|
-
throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,l,m){return this._reduceValues(c,y=>{if(y.value===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return y.value.code},l,m)}_reduceValues(c,l,m={},y){let _=t.nil;for(const S in c){const g=c[S];if(!g)continue;const
|
|
319
|
-
opts._n}`}else if(f=y?.(
|
|
317
|
+
prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}}e.Scope=i;class a extends t.Name{constructor(c,l){super(l),this.prefix=c}setValue(c,{property:l,itemIndex:m}){this.value=c,this.scopePath=(0,t._)`.${new t.Name(l)}[${m}]`}}e.ValueScopeName=a;const o=(0,t._)`\n`;class s extends i{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?o:t.nil}}get(){return this._scope}name(c){return new a(c,this._newName(c))}value(c,l){var m;if(l.
|
|
318
|
+
ref===void 0)throw new Error("CodeGen: ref must be passed in value");const y=this.toName(c),{prefix:_}=y,S=(m=l.key)!==null&&m!==void 0?m:l.ref;let g=this._values[_];if(g){const f=g.get(S);if(f)return f}else g=this._values[_]=new Map;g.set(S,y);const h=this._scope[_]||(this._scope[_]=[]),p=h.length;return h[p]=l.ref,y.setValue(l,{property:_,itemIndex:p}),y}getValue(c,l){const m=this._values[c];if(m)return m.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,m=>{if(m.scopePath===void 0)
|
|
319
|
+
throw new Error(`CodeGen: name "${m}" has no value`);return(0,t._)`${c}${m.scopePath}`})}scopeCode(c=this._values,l,m){return this._reduceValues(c,y=>{if(y.value===void 0)throw new Error(`CodeGen: name "${y}" has no value`);return y.value.code},l,m)}_reduceValues(c,l,m={},y){let _=t.nil;for(const S in c){const g=c[S];if(!g)continue;const h=m[S]=m[S]||new Map;g.forEach(p=>{if(h.has(p))return;h.set(p,n.Started);let f=l(p);if(f){const d=this.opts.es5?e.varKinds.var:e.varKinds.const;_=(0,t._)`${_}${d} ${p} = ${f};${this.
|
|
320
|
+
opts._n}`}else if(f=y?.(p))_=(0,t._)`${_}${f}${this.opts._n}`;else throw new r(p);h.set(p,n.Completed)})}return _}}e.ValueScope=s})(hs)),hs}var ti;function ae(){return ti||(ti=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;const t=er(),r=ei();var n=er();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n.
|
|
320
321
|
_}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return n.
|
|
321
322
|
regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}});var i=ei();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t.
|
|
322
|
-
_Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class
|
|
323
|
-
str])return this.rhs&&(this.rhs=
|
|
324
|
-
super(R,C,B),this.op=
|
|
325
|
-
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,
|
|
326
|
-
length>0?this:void 0}optimizeNames(R,
|
|
327
|
-
"else "+this.else.render(R)),
|
|
328
|
-
condition=
|
|
329
|
-
R,this.name=
|
|
330
|
-
iterable=
|
|
331
|
-
|
|
332
|
-
this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}
|
|
333
|
-
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,
|
|
334
|
-
const K=this._scope.toName(
|
|
335
|
-
|
|
336
|
-
return this._for(new d(R),
|
|
337
|
-
if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${
|
|
338
|
-
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),
|
|
339
|
-
R!==void 0&&C!==R)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=
|
|
340
|
-
const C=this._currNode;if(C instanceof R||
|
|
341
|
-
(T[
|
|
342
|
-
void 0)}}function M(T,R){for(const
|
|
343
|
-
ri=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=ae(),t=er();function r($){const w={};for(const
|
|
344
|
-
"boolean"?w:Object.keys(w).length===0?!0:(i($,w),!
|
|
345
|
-
return!1}ce.schemaHasRulesButRef=
|
|
346
|
-
return $.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=m;function y($,w){if(Array.isArray($))for(const
|
|
347
|
-
()=>{$.if((0,e._)`${w} === true`,()=>$.assign(
|
|
348
|
-
()=>$.assign(
|
|
349
|
-
w.code))})}ce.useFunc=
|
|
350
|
-
checkStrictMode=v,ce}var tr={},ni;function
|
|
351
|
-
Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return tr.default=t,tr}var si;function rr(){return si||(si=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ae(),r=fe(),n=
|
|
352
|
-
keyword:
|
|
353
|
-
()=>
|
|
354
|
-
(0,t._)`${w}.schemaPath`,(0,t.str)`${$.errSchemaPath}/${
|
|
355
|
-
(0,t._)`${d}.errors`,
|
|
356
|
-
(0,t.str)`${
|
|
357
|
-
h
|
|
358
|
-
ect"&&c.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${l}.errors`,null),u.return(!0))}nt.topBoolOrEmptySchema=i;function
|
|
359
|
-
st.getRules=st.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}st.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return st.getRules=n,st}var
|
|
360
|
-
ci;function ui(){if(ci)return
|
|
361
|
-
function nr(){if(li)return ge;li=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;const e=ii(),t=ui(),r=rr(),n=ae(),i=fe();var
|
|
362
|
-
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=
|
|
363
|
-
v.if(
|
|
364
|
-
if(S(d,w,
|
|
365
|
-
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(
|
|
366
|
-
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(
|
|
367
|
-
|| ${P} === "boolean" || ${w} === null`).assign(
|
|
368
|
-
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":
|
|
369
|
-
w=n.nil;
|
|
370
|
-
it:f}}return ge}var
|
|
371
|
-
i,`default is ignored for: ${m}`);return}let y=(0,e._)`${m} === undefined`;l.useDefaults==="empty"&&(y=(0,e._)`${y} || ${m} === null || ${m} === ""`),s.if(y,(0,e._)`${m} = ${(0,e.stringify)(
|
|
372
|
-
de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ae(),t=fe(),r=
|
|
323
|
+
_Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};class a{optimizeNodes(){return this}optimizeNames(R,E){return this}}class o extends a{constructor(R,E,C){super(),this.varKind=R,this.name=E,this.rhs=C}render({es5:R,_n:E}){const C=R?r.varKinds.var:this.varKind,B=this.rhs===void 0?"":` = ${this.rhs}`;return`${C} ${this.name}${B};`+E}optimizeNames(R,E){if(R[this.name.
|
|
324
|
+
str])return this.rhs&&(this.rhs=j(this.rhs,R,E)),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}}class s extends a{constructor(R,E,C){super(),this.lhs=R,this.rhs=E,this.sideEffects=C}render({_n:R}){return`${this.lhs} = ${this.rhs};`+R}optimizeNames(R,E){if(!(this.lhs instanceof t.Name&&!R[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,R,E),this}get names(){const R=this.lhs instanceof t.Name?{}:{...this.lhs.names};return L(R,this.rhs)}}class u extends s{constructor(R,E,C,B){
|
|
325
|
+
super(R,C,B),this.op=E}render({_n:R}){return`${this.lhs} ${this.op}= ${this.rhs};`+R}}class c extends a{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`${this.label}:`+R}}class l extends a{constructor(R){super(),this.label=R,this.names={}}render({_n:R}){return`break${this.label?` ${this.label}`:""};`+R}}class m extends a{constructor(R){super(),this.error=R}render({_n:R}){return`throw ${this.error};`+R}get names(){return this.error.names}}class y extends a{constructor(R){super(),
|
|
326
|
+
this.code=R}render({_n:R}){return`${this.code};`+R}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(R,E){return this.code=j(this.code,R,E),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}}class _ extends a{constructor(R=[]){super(),this.nodes=R}render(R){return this.nodes.reduce((E,C)=>E+C.render(R),"")}optimizeNodes(){const{nodes:R}=this;let E=R.length;for(;E--;){const C=R[E].optimizeNodes();Array.isArray(C)?R.splice(E,1,...C):C?R[E]=C:R.splice(E,1)}return R.
|
|
327
|
+
length>0?this:void 0}optimizeNames(R,E){const{nodes:C}=this;let B=C.length;for(;B--;){const K=C[B];K.optimizeNames(R,E)||(M(R,K.names),C.splice(B,1))}return C.length>0?this:void 0}get names(){return this.nodes.reduce((R,E)=>U(R,E.names),{})}}class S extends _{render(R){return"{"+R._n+super.render(R)+"}"+R._n}}class g extends _{}class h extends S{}h.kind="else";class p extends S{constructor(R,E){super(E),this.condition=R}render(R){let E=`if(${this.condition})`+super.render(R);return this.else&&(E+=
|
|
328
|
+
"else "+this.else.render(R)),E}optimizeNodes(){super.optimizeNodes();const R=this.condition;if(R===!0)return this.nodes;let E=this.else;if(E){const C=E.optimizeNodes();E=this.else=Array.isArray(C)?new h(C):C}if(E)return R===!1?E instanceof p?E:E.nodes:this.nodes.length?this:new p(z(R),E instanceof p?[E]:E.nodes);if(!(R===!1||!this.nodes.length))return this}optimizeNames(R,E){var C;if(this.else=(C=this.else)===null||C===void 0?void 0:C.optimizeNames(R,E),!!(super.optimizeNames(R,E)||this.else))return this.
|
|
329
|
+
condition=j(this.condition,R,E),this}get names(){const R=super.names;return L(R,this.condition),this.else&&U(R,this.else.names),R}}p.kind="if";class f extends S{}f.kind="for";class d extends f{constructor(R){super(),this.iteration=R}render(R){return`for(${this.iteration})`+super.render(R)}optimizeNames(R,E){if(super.optimizeNames(R,E))return this.iteration=j(this.iteration,R,E),this}get names(){return U(super.names,this.iteration.names)}}class v extends f{constructor(R,E,C,B){super(),this.varKind=
|
|
330
|
+
R,this.name=E,this.from=C,this.to=B}render(R){const E=R.es5?r.varKinds.var:this.varKind,{name:C,from:B,to:K}=this;return`for(${E} ${C}=${B}; ${C}<${K}; ${C}++)`+super.render(R)}get names(){const R=L(super.names,this.from);return L(R,this.to)}}class $ extends f{constructor(R,E,C,B){super(),this.loop=R,this.varKind=E,this.name=C,this.iterable=B}render(R){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(R)}optimizeNames(R,E){if(super.optimizeNames(R,E))return this.
|
|
331
|
+
iterable=j(this.iterable,R,E),this}get names(){return U(super.names,this.iterable.names)}}class w extends S{constructor(R,E,C){super(),this.name=R,this.args=E,this.async=C}render(R){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(R)}}w.kind="func";class b extends _{render(R){return"return "+super.render(R)}}b.kind="return";class P extends S{render(R){let E="try"+super.render(R);return this.catch&&(E+=this.catch.render(R)),this.finally&&(E+=this.finally.render(R)),
|
|
332
|
+
E}optimizeNodes(){var R,E;return super.optimizeNodes(),(R=this.catch)===null||R===void 0||R.optimizeNodes(),(E=this.finally)===null||E===void 0||E.optimizeNodes(),this}optimizeNames(R,E){var C,B;return super.optimizeNames(R,E),(C=this.catch)===null||C===void 0||C.optimizeNames(R,E),(B=this.finally)===null||B===void 0||B.optimizeNames(R,E),this}get names(){const R=super.names;return this.catch&&U(R,this.catch.names),this.finally&&U(R,this.finally.names),R}}class I extends S{constructor(R){super(),
|
|
333
|
+
this.error=R}render(R){return`catch(${this.error})`+super.render(R)}}I.kind="catch";class H extends S{render(R){return"finally"+super.render(R)}}H.kind="finally";class x{constructor(R,E={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...E,_n:E.lines?`
|
|
334
|
+
`:""},this._extScope=R,this._scope=new r.Scope({parent:R}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(R){return this._scope.name(R)}scopeName(R){return this._extScope.name(R)}scopeValue(R,E){const C=this._extScope.value(R,E);return(this._values[C.prefix]||(this._values[C.prefix]=new Set)).add(C),C}getScopeValue(R,E){return this._extScope.getValue(R,E)}scopeRefs(R){return this._extScope.scopeRefs(R,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(R,E,C,B){
|
|
335
|
+
const K=this._scope.toName(E);return C!==void 0&&B&&(this._constants[K.str]=C),this._leafNode(new o(R,K,C)),K}const(R,E,C){return this._def(r.varKinds.const,R,E,C)}let(R,E,C){return this._def(r.varKinds.let,R,E,C)}var(R,E,C){return this._def(r.varKinds.var,R,E,C)}assign(R,E,C){return this._leafNode(new s(R,E,C))}add(R,E){return this._leafNode(new u(R,e.operators.ADD,E))}code(R){return typeof R=="function"?R():R!==t.nil&&this._leafNode(new y(R)),this}object(...R){const E=["{"];for(const[C,B]of R)
|
|
336
|
+
E.length>1&&E.push(","),E.push(C),(C!==B||this.opts.es5)&&(E.push(":"),(0,t.addCodeArg)(E,B));return E.push("}"),new t._Code(E)}if(R,E,C){if(this._blockNode(new p(R)),E&&C)this.code(E).else().code(C).endIf();else if(E)this.code(E).endIf();else if(C)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(R){return this._elseNode(new p(R))}else(){return this._elseNode(new h)}endIf(){return this._endBlockNode(p,h)}_for(R,E){return this._blockNode(R),E&&this.code(E).endFor(),this}for(R,E){
|
|
337
|
+
return this._for(new d(R),E)}forRange(R,E,C,B,K=this.opts.es5?r.varKinds.var:r.varKinds.let){const ee=this._scope.toName(R);return this._for(new v(K,ee,E,C),()=>B(ee))}forOf(R,E,C,B=r.varKinds.const){const K=this._scope.toName(R);if(this.opts.es5){const ee=E instanceof t.Name?E:this.var("_arr",E);return this.forRange("_i",0,(0,t._)`${ee}.length`,re=>{this.var(K,(0,t._)`${ee}[${re}]`),C(K)})}return this._for(new $("of",B,K,E),()=>C(K))}forIn(R,E,C,B=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
338
|
+
if(this.opts.ownProperties)return this.forOf(R,(0,t._)`Object.keys(${E})`,C);const K=this._scope.toName(R);return this._for(new $("in",B,K,E),()=>C(K))}endFor(){return this._endBlockNode(f)}label(R){return this._leafNode(new c(R))}break(R){return this._leafNode(new l(R))}return(R){const E=new b;if(this._blockNode(E),this.code(R),E.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(R,E,C){if(!E&&!C)throw new Error('CodeGen: "try" without "c\
|
|
339
|
+
atch" and "finally"');const B=new P;if(this._blockNode(B),this.code(R),E){const K=this.name("e");this._currNode=B.catch=new I(K),E(K)}return C&&(this._currNode=B.finally=new H,this.code(C)),this._endBlockNode(I,H)}throw(R){return this._leafNode(new m(R))}block(R,E){return this._blockStarts.push(this._nodes.length),R&&this.code(R).endBlock(E),this}endBlock(R){const E=this._blockStarts.pop();if(E===void 0)throw new Error("CodeGen: not in self-balancing block");const C=this._nodes.length-E;if(C<0||
|
|
340
|
+
R!==void 0&&C!==R)throw new Error(`CodeGen: wrong number of nodes: ${C} vs ${R} expected`);return this._nodes.length=E,this}func(R,E=t.nil,C,B){return this._blockNode(new w(R,E,C)),B&&this.code(B).endFunc(),this}endFunc(){return this._endBlockNode(w)}optimize(R=1){for(;R-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(R){return this._currNode.nodes.push(R),this}_blockNode(R){this._currNode.nodes.push(R),this._nodes.push(R)}_endBlockNode(R,E){
|
|
341
|
+
const C=this._currNode;if(C instanceof R||E&&C instanceof E)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${E?`${R.kind}/${E.kind}`:R.kind}"`)}_elseNode(R){const E=this._currNode;if(!(E instanceof p))throw new Error('CodeGen: "else" without "if"');return this._currNode=E.else=R,this}get _root(){return this._nodes[0]}get _currNode(){const R=this._nodes;return R[R.length-1]}set _currNode(R){const E=this._nodes;E[E.length-1]=R}}e.CodeGen=x;function U(T,R){for(const E in R)T[E]=
|
|
342
|
+
(T[E]||0)+(R[E]||0);return T}function L(T,R){return R instanceof t._CodeOrName?U(T,R.names):T}function j(T,R,E){if(T instanceof t.Name)return C(T);if(!B(T))return T;return new t._Code(T._items.reduce((K,ee)=>(ee instanceof t.Name&&(ee=C(ee)),ee instanceof t._Code?K.push(...ee._items):K.push(ee),K),[]));function C(K){const ee=E[K.str];return ee===void 0||R[K.str]!==1?K:(delete R[K.str],ee)}function B(K){return K instanceof t._Code&&K._items.some(ee=>ee instanceof t.Name&&R[ee.str]===1&&E[ee.str]!==
|
|
343
|
+
void 0)}}function M(T,R){for(const E in R)T[E]=(T[E]||0)-(R[E]||0)}function z(T){return typeof T=="boolean"||typeof T=="number"||T===null?!T:(0,t._)`!${D(T)}`}e.not=z;const F=A(e.operators.AND);function G(...T){return T.reduce(F)}e.and=G;const Q=A(e.operators.OR);function q(...T){return T.reduce(Q)}e.or=q;function A(T){return(R,E)=>R===t.nil?E:E===t.nil?R:(0,t._)`${D(R)} ${T} ${D(E)}`}function D(T){return T instanceof t.Name?T:(0,t._)`(${T})`}})(ds)),ds}var ce={},ri;function fe(){if(ri)return ce;
|
|
344
|
+
ri=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.checkStrictMode=ce.getErrorPath=ce.Type=ce.useFunc=ce.setEvaluated=ce.evaluatedPropsToName=ce.mergeEvaluated=ce.eachItem=ce.unescapeJsonPointer=ce.escapeJsonPointer=ce.escapeFragment=ce.unescapeFragment=ce.schemaRefOrVal=ce.schemaHasRulesButRef=ce.schemaHasRules=ce.checkUnknownRules=ce.alwaysValidSchema=ce.toHash=void 0;const e=ae(),t=er();function r($){const w={};for(const b of $)w[b]=!0;return w}ce.toHash=r;function n($,w){return typeof w==
|
|
345
|
+
"boolean"?w:Object.keys(w).length===0?!0:(i($,w),!a(w,$.self.RULES.all))}ce.alwaysValidSchema=n;function i($,w=$.schema){const{opts:b,self:P}=$;if(!b.strictSchema||typeof w=="boolean")return;const I=P.RULES.keywords;for(const H in w)I[H]||v($,`unknown keyword: "${H}"`)}ce.checkUnknownRules=i;function a($,w){if(typeof $=="boolean")return!$;for(const b in $)if(w[b])return!0;return!1}ce.schemaHasRules=a;function o($,w){if(typeof $=="boolean")return!$;for(const b in $)if(b!=="$ref"&&w.all[b])return!0;
|
|
346
|
+
return!1}ce.schemaHasRulesButRef=o;function s({topSchemaRef:$,schemaPath:w},b,P,I){if(!I){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,e._)`${b}`}return(0,e._)`${$}${w}${(0,e.getProperty)(P)}`}ce.schemaRefOrVal=s;function u($){return m(decodeURIComponent($))}ce.unescapeFragment=u;function c($){return encodeURIComponent(l($))}ce.escapeFragment=c;function l($){return typeof $=="number"?`${$}`:$.replace(/~/g,"~0").replace(/\//g,"~1")}ce.escapeJsonPointer=l;function m($){
|
|
347
|
+
return $.replace(/~1/g,"/").replace(/~0/g,"~")}ce.unescapeJsonPointer=m;function y($,w){if(Array.isArray($))for(const b of $)w(b);else w($)}ce.eachItem=y;function _({mergeNames:$,mergeToName:w,mergeValues:b,resultToName:P}){return(I,H,x,U)=>{const L=x===void 0?H:x instanceof e.Name?(H instanceof e.Name?$(I,H,x):w(I,H,x),x):H instanceof e.Name?(w(I,x,H),H):b(H,x);return U===e.Name&&!(L instanceof e.Name)?P(I,L):L}}ce.mergeEvaluated={props:_({mergeNames:($,w,b)=>$.if((0,e._)`${b} !== true && ${w} !== undefined`,
|
|
348
|
+
()=>{$.if((0,e._)`${w} === true`,()=>$.assign(b,!0),()=>$.assign(b,(0,e._)`${b} || {}`).code((0,e._)`Object.assign(${b}, ${w})`))}),mergeToName:($,w,b)=>$.if((0,e._)`${b} !== true`,()=>{w===!0?$.assign(b,!0):($.assign(b,(0,e._)`${b} || {}`),g($,b,w))}),mergeValues:($,w)=>$===!0?!0:{...$,...w},resultToName:S}),items:_({mergeNames:($,w,b)=>$.if((0,e._)`${b} !== true && ${w} !== undefined`,()=>$.assign(b,(0,e._)`${w} === true ? true : ${b} > ${w} ? ${b} : ${w}`)),mergeToName:($,w,b)=>$.if((0,e._)`${b} !== true`,
|
|
349
|
+
()=>$.assign(b,w===!0?!0:(0,e._)`${b} > ${w} ? ${b} : ${w}`)),mergeValues:($,w)=>$===!0?!0:Math.max($,w),resultToName:($,w)=>$.var("items",w)})};function S($,w){if(w===!0)return $.var("props",!0);const b=$.var("props",(0,e._)`{}`);return w!==void 0&&g($,b,w),b}ce.evaluatedPropsToName=S;function g($,w,b){Object.keys(b).forEach(P=>$.assign((0,e._)`${w}${(0,e.getProperty)(P)}`,!0))}ce.setEvaluated=g;const h={};function p($,w){return $.scopeValue("func",{ref:w,code:h[w.code]||(h[w.code]=new t._Code(
|
|
350
|
+
w.code))})}ce.useFunc=p;var f;(function($){$[$.Num=0]="Num",$[$.Str=1]="Str"})(f||(ce.Type=f={}));function d($,w,b){if($ instanceof e.Name){const P=w===f.Num;return b?P?(0,e._)`"[" + ${$} + "]"`:(0,e._)`"['" + ${$} + "']"`:P?(0,e._)`"/" + ${$}`:(0,e._)`"/" + ${$}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return b?(0,e.getProperty)($).toString():"/"+l($)}ce.getErrorPath=d;function v($,w,b=$.opts.strictSchema){if(b){if(w=`strict mode: ${w}`,b===!0)throw new Error(w);$.self.logger.warn(w)}}return ce.
|
|
351
|
+
checkStrictMode=v,ce}var tr={},ni;function Oe(){if(ni)return tr;ni=1,Object.defineProperty(tr,"__esModule",{value:!0});const e=ae(),t={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.
|
|
352
|
+
Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};return tr.default=t,tr}var si;function rr(){return si||(si=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;const t=ae(),r=fe(),n=Oe();e.keywordError={message:({keyword:h})=>(0,t.str)`must pass "${h}" keyword validation`},e.keyword$DataError={message:({
|
|
353
|
+
keyword:h,schemaType:p})=>p?(0,t.str)`"${h}" keyword must be ${p} ($data)`:(0,t.str)`"${h}" keyword is invalid ($data)`};function i(h,p=e.keywordError,f,d){const{it:v}=h,{gen:$,compositeRule:w,allErrors:b}=v,P=m(h,p,f);d??(w||b)?u($,P):c(v,(0,t._)`[${P}]`)}e.reportError=i;function a(h,p=e.keywordError,f){const{it:d}=h,{gen:v,compositeRule:$,allErrors:w}=d,b=m(h,p,f);u(v,b),$||w||c(d,n.default.vErrors)}e.reportExtraError=a;function o(h,p){h.assign(n.default.errors,p),h.if((0,t._)`${n.default.vErrors} !== null`,
|
|
354
|
+
()=>h.if(p,()=>h.assign((0,t._)`${n.default.vErrors}.length`,p),()=>h.assign(n.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:h,keyword:p,schemaValue:f,data:d,errsCount:v,it:$}){if(v===void 0)throw new Error("ajv implementation error");const w=h.name("err");h.forRange("i",v,n.default.errors,b=>{h.const(w,(0,t._)`${n.default.vErrors}[${b}]`),h.if((0,t._)`${w}.instancePath === undefined`,()=>h.assign((0,t._)`${w}.instancePath`,(0,t.strConcat)(n.default.instancePath,$.errorPath))),h.assign(
|
|
355
|
+
(0,t._)`${w}.schemaPath`,(0,t.str)`${$.errSchemaPath}/${p}`),$.opts.verbose&&(h.assign((0,t._)`${w}.schema`,f),h.assign((0,t._)`${w}.data`,d))})}e.extendErrors=s;function u(h,p){const f=h.const("err",p);h.if((0,t._)`${n.default.vErrors} === null`,()=>h.assign(n.default.vErrors,(0,t._)`[${f}]`),(0,t._)`${n.default.vErrors}.push(${f})`),h.code((0,t._)`${n.default.errors}++`)}function c(h,p){const{gen:f,validateName:d,schemaEnv:v}=h;v.$async?f.throw((0,t._)`new ${h.ValidationError}(${p})`):(f.assign(
|
|
356
|
+
(0,t._)`${d}.errors`,p),f.return(!1))}const l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function m(h,p,f){const{createErrors:d}=h.it;return d===!1?(0,t._)`{}`:y(h,p,f)}function y(h,p,f={}){const{gen:d,it:v}=h,$=[_(v,f),S(h,f)];return g(h,p,$),d.object(...$)}function _({errorPath:h},{instancePath:p}){const f=p?
|
|
357
|
+
(0,t.str)`${h}${(0,r.getErrorPath)(p,r.Type.Str)}`:h;return[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,f)]}function S({keyword:h,it:{errSchemaPath:p}},{schemaPath:f,parentSchema:d}){let v=d?p:(0,t.str)`${p}/${h}`;return f&&(v=(0,t.str)`${v}${(0,r.getErrorPath)(f,r.Type.Str)}`),[l.schemaPath,v]}function g(h,{params:p,message:f},d){const{keyword:v,data:$,schemaValue:w,it:b}=h,{opts:P,propertyName:I,topSchemaRef:H,schemaPath:x}=b;d.push([l.keyword,v],[l.params,typeof p=="function"?
|
|
358
|
+
p(h):p||(0,t._)`{}`]),P.messages&&d.push([l.message,typeof f=="function"?f(h):f]),P.verbose&&d.push([l.schema,w],[l.parentSchema,(0,t._)`${H}${x}`],[n.default.data,$]),I&&d.push([l.propertyName,I])}})(fs)),fs}var oi;function eh(){if(oi)return nt;oi=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.boolOrEmptySchema=nt.topBoolOrEmptySchema=void 0;const e=rr(),t=ae(),r=Oe(),n={message:"boolean schema is false"};function i(s){const{gen:u,schema:c,validateName:l}=s;c===!1?o(s,!1):typeof c=="obj\
|
|
359
|
+
ect"&&c.$async===!0?u.return(r.default.data):(u.assign((0,t._)`${l}.errors`,null),u.return(!0))}nt.topBoolOrEmptySchema=i;function a(s,u){const{gen:c,schema:l}=s;l===!1?(c.var(u,!1),o(s)):c.var(u,!0)}nt.boolOrEmptySchema=a;function o(s,u){const{gen:c,data:l}=s,m={gen:c,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:s};(0,e.reportError)(m,n,void 0,u)}return nt}var ge={},st={},ai;function ii(){if(ai)return st;ai=1,Object.defineProperty(st,"__esModule",{value:!0}),
|
|
360
|
+
st.getRules=st.isJSONType=void 0;const e=["string","number","integer","boolean","null","object","array"],t=new Set(e);function r(i){return typeof i=="string"&&t.has(i)}st.isJSONType=r;function n(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return st.getRules=n,st}var ze={},
|
|
361
|
+
ci;function ui(){if(ci)return ze;ci=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.shouldUseRule=ze.shouldUseGroup=ze.schemaHasRulesForType=void 0;function e({schema:n,self:i},a){const o=i.RULES.types[a];return o&&o!==!0&&t(n,o)}ze.schemaHasRulesForType=e;function t(n,i){return i.rules.some(a=>r(n,a))}ze.shouldUseGroup=t;function r(n,i){var a;return n[i.keyword]!==void 0||((a=i.definition.implements)===null||a===void 0?void 0:a.some(o=>n[o]!==void 0))}return ze.shouldUseRule=r,ze}var li;
|
|
362
|
+
function nr(){if(li)return ge;li=1,Object.defineProperty(ge,"__esModule",{value:!0}),ge.reportTypeError=ge.checkDataTypes=ge.checkDataType=ge.coerceAndCheckDataType=ge.getJSONTypes=ge.getSchemaTypes=ge.DataType=void 0;const e=ii(),t=ui(),r=rr(),n=ae(),i=fe();var a;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(a||(ge.DataType=a={}));function o(f){const d=s(f.type);if(d.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!d.length&&
|
|
363
|
+
f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&d.push("null")}return d}ge.getSchemaTypes=o;function s(f){const d=Array.isArray(f)?f:f?[f]:[];if(d.every(e.isJSONType))return d;throw new Error("type must be JSONType or JSONType[]: "+d.join(","))}ge.getJSONTypes=s;function u(f,d){const{gen:v,data:$,opts:w}=f,b=l(d,w.coerceTypes),P=d.length>0&&!(b.length===0&&d.length===1&&(0,t.schemaHasRulesForType)(f,d[0]));if(P){const I=S(d,$,w.strictNumbers,a.Wrong);
|
|
364
|
+
v.if(I,()=>{b.length?m(f,d,b):h(f)})}return P}ge.coerceAndCheckDataType=u;const c=new Set(["string","number","integer","boolean","null"]);function l(f,d){return d?f.filter(v=>c.has(v)||d==="array"&&v==="array"):[]}function m(f,d,v){const{gen:$,data:w,opts:b}=f,P=$.let("dataType",(0,n._)`typeof ${w}`),I=$.let("coerced",(0,n._)`undefined`);b.coerceTypes==="array"&&$.if((0,n._)`${P} == 'object' && Array.isArray(${w}) && ${w}.length == 1`,()=>$.assign(w,(0,n._)`${w}[0]`).assign(P,(0,n._)`typeof ${w}`).
|
|
365
|
+
if(S(d,w,b.strictNumbers),()=>$.assign(I,w))),$.if((0,n._)`${I} !== undefined`);for(const x of v)(c.has(x)||x==="array"&&b.coerceTypes==="array")&&H(x);$.else(),h(f),$.endIf(),$.if((0,n._)`${I} !== undefined`,()=>{$.assign(w,I),y(f,I)});function H(x){switch(x){case"string":$.elseIf((0,n._)`${P} == "number" || ${P} == "boolean"`).assign(I,(0,n._)`"" + ${w}`).elseIf((0,n._)`${w} === null`).assign(I,(0,n._)`""`);return;case"number":$.elseIf((0,n._)`${P} == "boolean" || ${w} === null
|
|
366
|
+
|| (${P} == "string" && ${w} && ${w} == +${w})`).assign(I,(0,n._)`+${w}`);return;case"integer":$.elseIf((0,n._)`${P} === "boolean" || ${w} === null
|
|
367
|
+
|| (${P} === "string" && ${w} && ${w} == +${w} && !(${w} % 1))`).assign(I,(0,n._)`+${w}`);return;case"boolean":$.elseIf((0,n._)`${w} === "false" || ${w} === 0 || ${w} === null`).assign(I,!1).elseIf((0,n._)`${w} === "true" || ${w} === 1`).assign(I,!0);return;case"null":$.elseIf((0,n._)`${w} === "" || ${w} === 0 || ${w} === false`),$.assign(I,null);return;case"array":$.elseIf((0,n._)`${P} === "string" || ${P} === "number"
|
|
368
|
+
|| ${P} === "boolean" || ${w} === null`).assign(I,(0,n._)`[${w}]`)}}}function y({gen:f,parentData:d,parentDataProperty:v},$){f.if((0,n._)`${d} !== undefined`,()=>f.assign((0,n._)`${d}[${v}]`,$))}function _(f,d,v,$=a.Correct){const w=$===a.Correct?n.operators.EQ:n.operators.NEQ;let b;switch(f){case"null":return(0,n._)`${d} ${w} null`;case"array":b=(0,n._)`Array.isArray(${d})`;break;case"object":b=(0,n._)`${d} && typeof ${d} == "object" && !Array.isArray(${d})`;break;case"integer":b=
|
|
369
|
+
P((0,n._)`!(${d} % 1) && !isNaN(${d})`);break;case"number":b=P();break;default:return(0,n._)`typeof ${d} ${w} ${f}`}return $===a.Correct?b:(0,n.not)(b);function P(I=n.nil){return(0,n.and)((0,n._)`typeof ${d} == "number"`,I,v?(0,n._)`isFinite(${d})`:n.nil)}}ge.checkDataType=_;function S(f,d,v,$){if(f.length===1)return _(f[0],d,v,$);let w;const b=(0,i.toHash)(f);if(b.array&&b.object){const P=(0,n._)`typeof ${d} != "object"`;w=b.null?P:(0,n._)`!${d} || ${P}`,delete b.null,delete b.array,delete b.object}else
|
|
370
|
+
w=n.nil;b.number&&delete b.integer;for(const P in b)w=(0,n.and)(w,_(P,d,v,$));return w}ge.checkDataTypes=S;const g={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:d})=>typeof f=="string"?(0,n._)`{type: ${f}}`:(0,n._)`{type: ${d}}`};function h(f){const d=p(f);(0,r.reportError)(d,g)}ge.reportTypeError=h;function p(f){const{gen:d,data:v,schema:$}=f,w=(0,i.schemaRefOrVal)(f,$,"type");return{gen:d,keyword:"type",data:v,schema:$.type,schemaCode:w,schemaValue:w,parentSchema:$,params:{},
|
|
371
|
+
it:f}}return ge}var Ot={},fi;function th(){if(fi)return Ot;fi=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.assignDefaults=void 0;const e=ae(),t=fe();function r(i,a){const{properties:o,items:s}=i.schema;if(a==="object"&&o)for(const u in o)n(i,u,o[u].default);else a==="array"&&Array.isArray(s)&&s.forEach((u,c)=>n(i,c,u.default))}Ot.assignDefaults=r;function n(i,a,o){const{gen:s,compositeRule:u,data:c,opts:l}=i;if(o===void 0)return;const m=(0,e._)`${c}${(0,e.getProperty)(a)}`;if(u){(0,t.checkStrictMode)(
|
|
372
|
+
i,`default is ignored for: ${m}`);return}let y=(0,e._)`${m} === undefined`;l.useDefaults==="empty"&&(y=(0,e._)`${y} || ${m} === null || ${m} === ""`),s.if(y,(0,e._)`${m} = ${(0,e.stringify)(o)}`)}return Ot}var Ne={},de={},di;function Ie(){if(di)return de;di=1,Object.defineProperty(de,"__esModule",{value:!0}),de.validateUnion=de.validateArray=de.usePattern=de.callValidateCode=de.schemaProperties=de.allSchemaProperties=de.noPropertyInData=de.propertyInData=de.isOwnProperty=de.hasPropFunc=de.reportMissingProp=
|
|
373
|
+
de.checkMissingProp=de.checkReportMissingProp=void 0;const e=ae(),t=fe(),r=Oe(),n=fe();function i(f,d){const{gen:v,data:$,it:w}=f;v.if(l(v,$,d,w.opts.ownProperties),()=>{f.setParams({missingProperty:(0,e._)`${d}`},!0),f.error()})}de.checkReportMissingProp=i;function a({gen:f,data:d,it:{opts:v}},$,w){return(0,e.or)(...$.map(b=>(0,e.and)(l(f,d,b,v.ownProperties),(0,e._)`${w} = ${b}`)))}de.checkMissingProp=a;function o(f,d){f.setParams({missingProperty:d},!0),f.error()}de.reportMissingProp=o;function s(f){
|
|
373
374
|
return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,e._)`Object.prototype.hasOwnProperty`})}de.hasPropFunc=s;function u(f,d,v){return(0,e._)`${s(f)}.call(${d}, ${v})`}de.isOwnProperty=u;function c(f,d,v,$){const w=(0,e._)`${d}${(0,e.getProperty)(v)} !== undefined`;return $?(0,e._)`${w} && ${u(f,d,v)}`:w}de.propertyInData=c;function l(f,d,v,$){const w=(0,e._)`${d}${(0,e.getProperty)(v)} === undefined`;return $?(0,e.or)(w,(0,e.not)(u(f,d,v))):w}de.noPropertyInData=l;function m(f){
|
|
374
|
-
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=m;function y(f,d){return m(d).filter(v=>!(0,t.alwaysValidSchema)(f,d[v]))}de.schemaProperties=y;function _({schemaCode:f,data:d,it:{gen:v,topSchemaRef:$,schemaPath:w,errorPath:
|
|
375
|
-
P.opts.dynamicRef&&
|
|
376
|
-
data:v,keyword:$,it:w}=f,
|
|
377
|
-
!w.opts.unevaluated)return;const P=d.let("valid",!1),
|
|
378
|
-
const e=ae(),t=
|
|
379
|
-
_.compile.call(v.self,
|
|
380
|
-
return g.assign(
|
|
375
|
+
return f?Object.keys(f).filter(d=>d!=="__proto__"):[]}de.allSchemaProperties=m;function y(f,d){return m(d).filter(v=>!(0,t.alwaysValidSchema)(f,d[v]))}de.schemaProperties=y;function _({schemaCode:f,data:d,it:{gen:v,topSchemaRef:$,schemaPath:w,errorPath:b},it:P},I,H,x){const U=x?(0,e._)`${f}, ${d}, ${$}${w}`:d,L=[[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,b)],[r.default.parentData,P.parentData],[r.default.parentDataProperty,P.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
376
|
+
P.opts.dynamicRef&&L.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);const j=(0,e._)`${U}, ${v.object(...L)}`;return H!==e.nil?(0,e._)`${I}.call(${H}, ${j})`:(0,e._)`${I}(${j})`}de.callValidateCode=_;const S=(0,e._)`new RegExp`;function g({gen:f,it:{opts:d}},v){const $=d.unicodeRegExp?"u":"",{regExp:w}=d.code,b=w(v,$);return f.scopeValue("pattern",{key:b.toString(),ref:b,code:(0,e._)`${w.code==="new RegExp"?S:(0,n.useFunc)(f,w)}(${v}, ${$})`})}de.usePattern=g;function h(f){const{gen:d,
|
|
377
|
+
data:v,keyword:$,it:w}=f,b=d.name("valid");if(w.allErrors){const I=d.let("valid",!0);return P(()=>d.assign(I,!1)),I}return d.var(b,!0),P(()=>d.break()),b;function P(I){const H=d.const("len",(0,e._)`${v}.length`);d.forRange("i",0,H,x=>{f.subschema({keyword:$,dataProp:x,dataPropType:t.Type.Num},b),d.if((0,e.not)(b),I)})}}de.validateArray=h;function p(f){const{gen:d,schema:v,keyword:$,it:w}=f;if(!Array.isArray(v))throw new Error("ajv implementation error");if(v.some(H=>(0,t.alwaysValidSchema)(w,H))&&
|
|
378
|
+
!w.opts.unevaluated)return;const P=d.let("valid",!1),I=d.name("_valid");d.block(()=>v.forEach((H,x)=>{const U=f.subschema({keyword:$,schemaProp:x,compositeRule:!0},I);d.assign(P,(0,e._)`${P} || ${I}`),f.mergeValidEvaluated(U,I)||d.if((0,e.not)(P))})),f.result(P,()=>f.reset(),()=>f.error(!0))}return de.validateUnion=p,de}var pi;function rh(){if(pi)return Ne;pi=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.validateKeywordUsage=Ne.validSchemaType=Ne.funcKeywordCode=Ne.macroKeywordCode=void 0;
|
|
379
|
+
const e=ae(),t=Oe(),r=Ie(),n=rr();function i(y,_){const{gen:S,keyword:g,schema:h,parentSchema:p,it:f}=y,d=_.macro.call(f.self,h,p,f),v=c(S,g,d);f.opts.validateSchema!==!1&&f.self.validateSchema(d,!0);const $=S.name("valid");y.subschema({schema:d,schemaPath:e.nil,errSchemaPath:`${f.errSchemaPath}/${g}`,topSchemaRef:v,compositeRule:!0},$),y.pass($,()=>y.error(!0))}Ne.macroKeywordCode=i;function a(y,_){var S;const{gen:g,keyword:h,schema:p,parentSchema:f,$data:d,it:v}=y;u(v,_);const $=!d&&_.compile?
|
|
380
|
+
_.compile.call(v.self,p,f,v):_.validate,w=c(g,h,$),b=g.let("valid");y.block$data(b,P),y.ok((S=_.valid)!==null&&S!==void 0?S:b);function P(){if(_.errors===!1)x(),_.modifying&&o(y),U(()=>y.error());else{const L=_.async?I():H();_.modifying&&o(y),U(()=>s(y,L))}}function I(){const L=g.let("ruleErrs",null);return g.try(()=>x((0,e._)`await `),j=>g.assign(b,!1).if((0,e._)`${j} instanceof ${v.ValidationError}`,()=>g.assign(L,(0,e._)`${j}.errors`),()=>g.throw(j))),L}function H(){const L=(0,e._)`${w}.errors`;
|
|
381
|
+
return g.assign(L,null),x(e.nil),L}function x(L=_.async?(0,e._)`await `:e.nil){const j=v.opts.passContext?t.default.this:t.default.self,M=!("compile"in _&&!d||_.schema===!1);g.assign(b,(0,e._)`${L}${(0,r.callValidateCode)(y,w,j,M)}`,_.modifying)}function U(L){var j;g.if((0,e.not)((j=_.valid)!==null&&j!==void 0?j:b),L)}}Ne.funcKeywordCode=a;function o(y){const{gen:_,data:S,it:g}=y;_.if(g.parentData,()=>_.assign(S,(0,e._)`${g.parentData}[${g.parentDataProperty}]`))}function s(y,_){const{gen:S}=y;S.
|
|
381
382
|
if((0,e._)`Array.isArray(${_})`,()=>{S.assign(t.default.vErrors,(0,e._)`${t.default.vErrors} === null ? ${_} : ${t.default.vErrors}.concat(${_})`).assign(t.default.errors,(0,e._)`${t.default.vErrors}.length`),(0,n.extendErrors)(y)},()=>y.error())}function u({schemaEnv:y},_){if(_.async&&!y.$async)throw new Error("async keyword in sync schema")}function c(y,_,S){if(S===void 0)throw new Error(`keyword "${_}" failed to compile`);return y.scopeValue("keyword",typeof S=="function"?{ref:S}:{ref:S,code:(0,e.
|
|
382
|
-
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some(g=>g==="array"?Array.isArray(y):g==="object"?y&&typeof y=="object"&&!Array.isArray(y):typeof y==g||S&&typeof y>"u")}
|
|
383
|
-
f ${
|
|
384
|
-
schemaPath:c,errSchemaPath:l,topSchemaRef:m}){if(
|
|
385
|
-
l===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:c,topSchemaRef:m,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}
|
|
386
|
-
|
|
387
|
-
n;function i(
|
|
383
|
+
stringify)(S)})}function l(y,_,S=!1){return!_.length||_.some(g=>g==="array"?Array.isArray(y):g==="object"?y&&typeof y=="object"&&!Array.isArray(y):typeof y==g||S&&typeof y>"u")}Ne.validSchemaType=l;function m({schema:y,opts:_,self:S,errSchemaPath:g},h,p){if(Array.isArray(h.keyword)?!h.keyword.includes(p):h.keyword!==p)throw new Error("ajv implementation error");const f=h.dependencies;if(f?.some(d=>!Object.prototype.hasOwnProperty.call(y,d)))throw new Error(`parent schema must have dependencies o\
|
|
384
|
+
f ${p}: ${f.join(",")}`);if(h.validateSchema&&!h.validateSchema(y[p])){const v=`keyword "${p}" value is invalid at path "${g}": `+S.errorsText(h.validateSchema.errors);if(_.validateSchema==="log")S.logger.error(v);else throw new Error(v)}}return Ne.validateKeywordUsage=m,Ne}var Ge={},hi;function nh(){if(hi)return Ge;hi=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.extendSubschemaMode=Ge.extendSubschemaData=Ge.getSubschema=void 0;const e=ae(),t=fe();function r(a,{keyword:o,schemaProp:s,schema:u,
|
|
385
|
+
schemaPath:c,errSchemaPath:l,topSchemaRef:m}){if(o!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(o!==void 0){const y=a.schema[o];return s===void 0?{schema:y,schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}`,errSchemaPath:`${a.errSchemaPath}/${o}`}:{schema:y[s],schemaPath:(0,e._)`${a.schemaPath}${(0,e.getProperty)(o)}${(0,e.getProperty)(s)}`,errSchemaPath:`${a.errSchemaPath}/${o}/${(0,t.escapeFragment)(s)}`}}if(u!==void 0){if(c===void 0||
|
|
386
|
+
l===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:c,topSchemaRef:m,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}Ge.getSubschema=r;function n(a,o,{dataProp:s,dataPropType:u,data:c,dataTypes:l,propertyName:m}){if(c!==void 0&&s!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:y}=o;if(s!==void 0){const{errorPath:S,dataPathArr:g,opts:h}=o,
|
|
387
|
+
p=y.let("data",(0,e._)`${o.data}${(0,e.getProperty)(s)}`,!0);_(p),a.errorPath=(0,e.str)`${S}${(0,t.getErrorPath)(s,u,h.jsPropertySyntax)}`,a.parentDataProperty=(0,e._)`${s}`,a.dataPathArr=[...g,a.parentDataProperty]}if(c!==void 0){const S=c instanceof e.Name?c:y.let("data",c,!0);_(S),m!==void 0&&(a.propertyName=m)}l&&(a.dataTypes=l);function _(S){a.data=S,a.dataLevel=o.dataLevel+1,a.dataTypes=[],o.definedProperties=new Set,a.parentData=o.data,a.dataNames=[...o.dataNames,S]}}Ge.extendSubschemaData=
|
|
388
|
+
n;function i(a,{jtdDiscriminator:o,jtdMetadata:s,compositeRule:u,createErrors:c,allErrors:l}){u!==void 0&&(a.compositeRule=u),c!==void 0&&(a.createErrors=c),l!==void 0&&(a.allErrors=l),a.jtdDiscriminator=o,a.jtdMetadata=s}return Ge.extendSubschemaMode=i,Ge}var Ee={},ms={exports:{}},mi;function sh(){if(mi)return ms.exports;mi=1;var e=ms.exports=function(n,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var o=typeof a=="function"?a:a.pre||function(){},s=a.post||function(){};t(i,o,s,n,"",n)};e.keywords=
|
|
388
389
|
{additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};
|
|
389
|
-
function t(n,i,o,
|
|
390
|
-
"~1")}return ms.exports}var yi;function sr(){if(yi)return Ee;yi=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getSchemaRefs=Ee.resolveUrl=Ee.normalizeId=Ee._getFullPath=Ee.getFullPath=Ee.inlineRef=void 0;const e=fe(),t=Do(),r=sh(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(g,
|
|
391
|
-
|
|
392
|
-
u;function c(g,
|
|
393
|
-
|
|
394
|
-
return new Error(`reference "${
|
|
395
|
-
opts:Z},J){Z.code.es5?k.func(
|
|
396
|
-
k.var(u.default.instancePath,(0,s._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,s._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,s._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,s._)`${u.default.valCxt}.${u.default.rootData}`),
|
|
397
|
-
parentData,(0,s._)`undefined`),k.var(u.default.parentDataProperty,(0,s._)`undefined`),k.var(u.default.rootData,u.default.data),
|
|
398
|
-
()=>
|
|
399
|
-
function $(k){return typeof k.schema!="boolean"}function w(k,
|
|
400
|
-
(0,l.schemaHasRulesButRef)(
|
|
401
|
-
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,s._)`${u.default.self}.logger.log(${J})`);else if(typeof Z.$comment=="function"){const ue=(0,s.str)`${X}/$comment`,we=k.scopeValue("root",{ref:
|
|
402
|
-
default.vErrors})`)):(
|
|
403
|
-
return}Y.jtd||G(k,
|
|
404
|
-
J.definition,
|
|
405
|
-
if(typeof Z=="object"&&(0,r.shouldUseRule)(k.schema,Z)){const{type:J}=Z.definition;J.length&&!J.some(ue=>
|
|
406
|
-
k.errSchemaPath;
|
|
407
|
-
|
|
408
|
-
this.gen.else()}pass(
|
|
409
|
-
reportError)(this,this.def.error,V)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(
|
|
410
|
-
def:ue}=this;X.if((0,s.or)((0,s._)`${Z} === undefined`,V)),
|
|
411
|
-
return s.nil}function we(){if(Z.validateSchema){const Y=
|
|
412
|
-
!0&&
|
|
413
|
-
function re(k,{dataLevel:
|
|
414
|
-
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,s._)`${ue} && ${J}`);return ue;function Y(ne,W){return`Cannot access ${ne} ${W} levels up, current level is ${
|
|
415
|
-
ule",{value:!0});const e=sr();class t extends Error{constructor(n,i,o
|
|
416
|
-
class
|
|
417
|
-
{es5:d,lines:v}=this.opts.code,{ownProperties:$}=this.opts,w=new e.CodeGen(this.scope,{es5:d,lines:v,ownProperties:$});let
|
|
418
|
-
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:
|
|
419
|
-
scope)}return ${x}`,this.opts.code.process&&(
|
|
420
|
-
e.Name,dynamicItems:M instanceof e.Name},
|
|
421
|
-
opts;w&&($=new
|
|
422
|
-
|
|
423
|
-
{schemaId:P}=this.opts,
|
|
424
|
-
return;f=P;const
|
|
425
|
-
eta-schema for $data reference (JSON AnySchema extension proposal)",Ei="object",Si=["$data"],Ri={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ai=!1,oh={$id:wi,description:bi,type:Ei,required:Si,properties:Ri,additionalProperties:Ai},ah={__proto__:null,$id:wi,additionalProperties:Ai,default:oh,description:bi,properties:Ri,required:Si,type:Ei},ih=De(ah);var ur={},
|
|
426
|
-
8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),ys}var gs,Ci;function uh(){if(Ci)return gs;Ci=1;const{HEX:e}=ch(),t=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(g){if(s(g,".")<3)return{host:g,isIPV4:!1};const
|
|
427
|
-
"0"),
|
|
428
|
-
f.push(d.join("")):f.push(n(d))),
|
|
429
|
-
return
|
|
430
|
-
(g.scheme=
|
|
431
|
-
port=="string")&&(
|
|
432
|
-
"wss"}function n(f){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f}function i(f){const d=String(f.scheme).toLowerCase()==="https";return(f.port===(d?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}function
|
|
433
|
-
const[d,v]=f.resourceName.split("?");f.path=d&&d!=="/"?d:void 0,f.query=v,f.resourceName=void 0}return f.fragment=void 0,f}function s(f,d){if(!f.path)return f.error="URN can not be parsed",f;const v=f.path.match(t);if(v){const $=d.scheme||f.scheme||"urn";f.nid=v[1].toLowerCase(),f.nss=v[2];const w=`${$}:${d.nid||f.nid}`,
|
|
434
|
-
nid||$}`,
|
|
435
|
-
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},
|
|
436
|
-
const d=Object.assign({scheme:"null"},f),v=u(S(
|
|
437
|
-
userinfo!==void 0||
|
|
438
|
-
typeof
|
|
439
|
-
f,d),f.path!==void 0&&(d.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),d.reference!=="suffix"&&f.scheme&&v.push(f.scheme,":");const w=n(f);if(w!==void 0&&(d.reference!=="suffix"&&v.push("//"),v.push(w),f.path&&f.path.charAt(0)!=="/"&&v.push("/")),f.path!==void 0){let
|
|
440
|
-
void 0&&v.push("#",f.fragment),v.join("")}const m=Array.from({length:127},(p
|
|
441
|
-
v=
|
|
442
|
-
same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==d.reference&&(d.error=d.error||"URI is not a "+f.reference+" reference.");const
|
|
443
|
-
ot be converted to ASCII: "+P}(!
|
|
444
|
-
exports}var
|
|
445
|
-
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=
|
|
446
|
-
_=(q,A)=>new RegExp(q,A);_.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),
|
|
390
|
+
function t(n,i,a,o,s,u,c,l,m,y){if(o&&typeof o=="object"&&!Array.isArray(o)){i(o,s,u,c,l,m,y);for(var _ in o){var S=o[_];if(Array.isArray(S)){if(_ in e.arrayKeywords)for(var g=0;g<S.length;g++)t(n,i,a,S[g],s+"/"+_+"/"+g,u,s,_,o,g)}else if(_ in e.propsKeywords){if(S&&typeof S=="object")for(var h in S)t(n,i,a,S[h],s+"/"+_+"/"+r(h),u,s,_,o,h)}else(_ in e.keywords||n.allKeys&&!(_ in e.skipKeywords))&&t(n,i,a,S,s+"/"+_,u,s,_,o)}a(o,s,u,c,l,m,y)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,
|
|
391
|
+
"~1")}return ms.exports}var yi;function sr(){if(yi)return Ee;yi=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.getSchemaRefs=Ee.resolveUrl=Ee.normalizeId=Ee._getFullPath=Ee.getFullPath=Ee.inlineRef=void 0;const e=fe(),t=Do(),r=sh(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(g,h=!0){return typeof g=="boolean"?!0:h===!0?!o(g):h?s(g)<=
|
|
392
|
+
h:!1}Ee.inlineRef=i;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(g){for(const h in g){if(a.has(h))return!0;const p=g[h];if(Array.isArray(p)&&p.some(o)||typeof p=="object"&&o(p))return!0}return!1}function s(g){let h=0;for(const p in g){if(p==="$ref")return 1/0;if(h++,!n.has(p)&&(typeof g[p]=="object"&&(0,e.eachItem)(g[p],f=>h+=s(f)),h===1/0))return 1/0}return h}function u(g,h="",p){p!==!1&&(h=m(h));const f=g.parse(h);return c(g,f)}Ee.getFullPath=
|
|
393
|
+
u;function c(g,h){return g.serialize(h).split("#")[0]+"#"}Ee._getFullPath=c;const l=/#\/?$/;function m(g){return g?g.replace(l,""):""}Ee.normalizeId=m;function y(g,h,p){return p=m(p),g.resolve(h,p)}Ee.resolveUrl=y;const _=/^[a-z_][-a-z0-9._]*$/i;function S(g,h){if(typeof g=="boolean")return{};const{schemaId:p,uriResolver:f}=this.opts,d=m(g[p]||h),v={"":d},$=u(f,d,!1),w={},b=new Set;return r(g,{allKeys:!0},(H,x,U,L)=>{if(L===void 0)return;const j=$+x;let M=v[L];typeof H[p]=="string"&&(M=z.call(this,
|
|
394
|
+
H[p])),F.call(this,H.$anchor),F.call(this,H.$dynamicAnchor),v[x]=M;function z(G){const Q=this.opts.uriResolver.resolve;if(G=m(M?Q(M,G):G),b.has(G))throw I(G);b.add(G);let q=this.refs[G];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?P(H,q.schema,G):G!==m(j)&&(G[0]==="#"?(P(H,w[G],G),w[G]=H):this.refs[G]=j),G}function F(G){if(typeof G=="string"){if(!_.test(G))throw new Error(`invalid anchor "${G}"`);z.call(this,`#${G}`)}}}),w;function P(H,x,U){if(x!==void 0&&!t(H,x))throw I(U)}function I(H){
|
|
395
|
+
return new Error(`reference "${H}" resolves to more than one schema`)}}return Ee.getSchemaRefs=S,Ee}var gi;function Nt(){if(gi)return Ve;gi=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getData=Ve.KeywordCxt=Ve.validateFunctionCode=void 0;const e=eh(),t=nr(),r=ui(),n=nr(),i=th(),a=rh(),o=nh(),s=ae(),u=Oe(),c=sr(),l=fe(),m=rr();function y(k){if($(k)&&(b(k),v(k))){h(k);return}_(k,()=>(0,e.topBoolOrEmptySchema)(k))}Ve.validateFunctionCode=y;function _({gen:k,validateName:O,schema:V,schemaEnv:X,
|
|
396
|
+
opts:Z},J){Z.code.es5?k.func(O,(0,s._)`${u.default.data}, ${u.default.valCxt}`,X.$async,()=>{k.code((0,s._)`"use strict"; ${f(V,Z)}`),g(k,Z),k.code(J)}):k.func(O,(0,s._)`${u.default.data}, ${S(Z)}`,X.$async,()=>k.code(f(V,Z)).code(J))}function S(k){return(0,s._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${k.dynamicRef?(0,s._)`, ${u.default.dynamicAnchors}={}`:s.nil}}={}`}function g(k,O){k.if(u.default.valCxt,()=>{
|
|
397
|
+
k.var(u.default.instancePath,(0,s._)`${u.default.valCxt}.${u.default.instancePath}`),k.var(u.default.parentData,(0,s._)`${u.default.valCxt}.${u.default.parentData}`),k.var(u.default.parentDataProperty,(0,s._)`${u.default.valCxt}.${u.default.parentDataProperty}`),k.var(u.default.rootData,(0,s._)`${u.default.valCxt}.${u.default.rootData}`),O.dynamicRef&&k.var(u.default.dynamicAnchors,(0,s._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{k.var(u.default.instancePath,(0,s._)`""`),k.var(u.default.
|
|
398
|
+
parentData,(0,s._)`undefined`),k.var(u.default.parentDataProperty,(0,s._)`undefined`),k.var(u.default.rootData,u.default.data),O.dynamicRef&&k.var(u.default.dynamicAnchors,(0,s._)`{}`)})}function h(k){const{schema:O,opts:V,gen:X}=k;_(k,()=>{V.$comment&&O.$comment&&L(k),H(k),X.let(u.default.vErrors,null),X.let(u.default.errors,0),V.unevaluated&&p(k),P(k),j(k)})}function p(k){const{gen:O,validateName:V}=k;k.evaluated=O.const("evaluated",(0,s._)`${V}.evaluated`),O.if((0,s._)`${k.evaluated}.dynamicProps`,
|
|
399
|
+
()=>O.assign((0,s._)`${k.evaluated}.props`,(0,s._)`undefined`)),O.if((0,s._)`${k.evaluated}.dynamicItems`,()=>O.assign((0,s._)`${k.evaluated}.items`,(0,s._)`undefined`))}function f(k,O){const V=typeof k=="object"&&k[O.schemaId];return V&&(O.code.source||O.code.process)?(0,s._)`/*# sourceURL=${V} */`:s.nil}function d(k,O){if($(k)&&(b(k),v(k))){w(k,O);return}(0,e.boolOrEmptySchema)(k,O)}function v({schema:k,self:O}){if(typeof k=="boolean")return!k;for(const V in k)if(O.RULES.all[V])return!0;return!1}
|
|
400
|
+
function $(k){return typeof k.schema!="boolean"}function w(k,O){const{schema:V,gen:X,opts:Z}=k;Z.$comment&&V.$comment&&L(k),x(k),U(k);const J=X.const("_errs",u.default.errors);P(k,J),X.var(O,(0,s._)`${J} === ${u.default.errors}`)}function b(k){(0,l.checkUnknownRules)(k),I(k)}function P(k,O){if(k.opts.jtd)return z(k,[],!1,O);const V=(0,t.getSchemaTypes)(k.schema),X=(0,t.coerceAndCheckDataType)(k,V);z(k,V,!X,O)}function I(k){const{schema:O,errSchemaPath:V,opts:X,self:Z}=k;O.$ref&&X.ignoreKeywordsWithRef&&
|
|
401
|
+
(0,l.schemaHasRulesButRef)(O,Z.RULES)&&Z.logger.warn(`$ref: keywords ignored in schema at path "${V}"`)}function H(k){const{schema:O,opts:V}=k;O.default!==void 0&&V.useDefaults&&V.strictSchema&&(0,l.checkStrictMode)(k,"default is ignored in the schema root")}function x(k){const O=k.schema[k.opts.schemaId];O&&(k.baseId=(0,c.resolveUrl)(k.opts.uriResolver,k.baseId,O))}function U(k){if(k.schema.$async&&!k.schemaEnv.$async)throw new Error("async schema in sync schema")}function L({gen:k,schemaEnv:O,
|
|
402
|
+
schema:V,errSchemaPath:X,opts:Z}){const J=V.$comment;if(Z.$comment===!0)k.code((0,s._)`${u.default.self}.logger.log(${J})`);else if(typeof Z.$comment=="function"){const ue=(0,s.str)`${X}/$comment`,we=k.scopeValue("root",{ref:O.root});k.code((0,s._)`${u.default.self}.opts.$comment(${J}, ${ue}, ${we}.schema)`)}}function j(k){const{gen:O,schemaEnv:V,validateName:X,ValidationError:Z,opts:J}=k;V.$async?O.if((0,s._)`${u.default.errors} === 0`,()=>O.return(u.default.data),()=>O.throw((0,s._)`new ${Z}(${u.
|
|
403
|
+
default.vErrors})`)):(O.assign((0,s._)`${X}.errors`,u.default.vErrors),J.unevaluated&&M(k),O.return((0,s._)`${u.default.errors} === 0`))}function M({gen:k,evaluated:O,props:V,items:X}){V instanceof s.Name&&k.assign((0,s._)`${O}.props`,V),X instanceof s.Name&&k.assign((0,s._)`${O}.items`,X)}function z(k,O,V,X){const{gen:Z,schema:J,data:ue,allErrors:we,opts:Y,self:ne}=k,{RULES:W}=ne;if(J.$ref&&(Y.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(J,W))){Z.block(()=>B(k,"$ref",W.all.$ref.definition));
|
|
404
|
+
return}Y.jtd||G(k,O),Z.block(()=>{for(const le of W.rules)te(le);te(W.post)});function te(le){(0,r.shouldUseGroup)(J,le)&&(le.type?(Z.if((0,n.checkDataType)(le.type,ue,Y.strictNumbers)),F(k,le),O.length===1&&O[0]===le.type&&V&&(Z.else(),(0,n.reportTypeError)(k)),Z.endIf()):F(k,le),we||Z.if((0,s._)`${u.default.errors} === ${X||0}`))}}function F(k,O){const{gen:V,schema:X,opts:{useDefaults:Z}}=k;Z&&(0,i.assignDefaults)(k,O.type),V.block(()=>{for(const J of O.rules)(0,r.shouldUseRule)(X,J)&&B(k,J.keyword,
|
|
405
|
+
J.definition,O.type)})}function G(k,O){k.schemaEnv.meta||!k.opts.strictTypes||(Q(k,O),k.opts.allowUnionTypes||q(k,O),A(k,k.dataTypes))}function Q(k,O){if(O.length){if(!k.dataTypes.length){k.dataTypes=O;return}O.forEach(V=>{T(k.dataTypes,V)||E(k,`type "${V}" not allowed by context "${k.dataTypes.join(",")}"`)}),R(k,O)}}function q(k,O){O.length>1&&!(O.length===2&&O.includes("null"))&&E(k,"use allowUnionTypes to allow union type keyword")}function A(k,O){const V=k.self.RULES.all;for(const X in V){const Z=V[X];
|
|
406
|
+
if(typeof Z=="object"&&(0,r.shouldUseRule)(k.schema,Z)){const{type:J}=Z.definition;J.length&&!J.some(ue=>D(O,ue))&&E(k,`missing type "${J.join(",")}" for keyword "${X}"`)}}}function D(k,O){return k.includes(O)||O==="number"&&k.includes("integer")}function T(k,O){return k.includes(O)||O==="integer"&&k.includes("number")}function R(k,O){const V=[];for(const X of k.dataTypes)T(O,X)?V.push(X):O.includes("integer")&&X==="number"&&V.push("integer");k.dataTypes=V}function E(k,O){const V=k.schemaEnv.baseId+
|
|
407
|
+
k.errSchemaPath;O+=` at "${V}" (strictTypes)`,(0,l.checkStrictMode)(k,O,k.opts.strictTypes)}class C{constructor(O,V,X){if((0,a.validateKeywordUsage)(O,V,X),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=X,this.data=O.data,this.schema=O.schema[X],this.$data=V.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(O,this.schema,X,this.$data),this.schemaType=V.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=V,this.$data)this.schemaCode=
|
|
408
|
+
O.gen.const("vSchema",re(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${X} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==!1)&&(this.errsCount=O.gen.const("_errs",u.default.errors))}result(O,V,X){this.failResult((0,s.not)(O),V,X)}failResult(O,V,X){this.gen.if(O),X?X():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():
|
|
409
|
+
this.gen.else()}pass(O,V){this.failResult((0,s.not)(O),void 0,V)}fail(O){if(O===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(O),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);const{schemaCode:V}=this;this.fail((0,s._)`${V} !== undefined && (${(0,s.or)(this.invalid$data(),O)})`)}error(O,V,X){if(V){this.setParams(V),this._error(O,X),this.setParams({});return}this._error(O,X)}_error(O,V){(O?m.reportExtraError:m.
|
|
410
|
+
reportError)(this,this.def.error,V)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(O){this.allErrors||this.gen.if(O)}setParams(O,V){V?Object.assign(this.params,O):this.params=O}block$data(O,V,X=s.nil){this.gen.block(()=>{this.check$data(O,X),V()})}check$data(O=s.nil,V=s.nil){if(!this.$data)return;const{gen:X,schemaCode:Z,schemaType:J,
|
|
411
|
+
def:ue}=this;X.if((0,s.or)((0,s._)`${Z} === undefined`,V)),O!==s.nil&&X.assign(O,!0),(J.length||ue.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),O!==s.nil&&X.assign(O,!1)),X.else()}invalid$data(){const{gen:O,schemaCode:V,schemaType:X,def:Z,it:J}=this;return(0,s.or)(ue(),we());function ue(){if(X.length){if(!(V instanceof s.Name))throw new Error("ajv implementation error");const Y=Array.isArray(X)?X:[X];return(0,s._)`${(0,n.checkDataTypes)(Y,V,J.opts.strictNumbers,n.DataType.Wrong)}`}
|
|
412
|
+
return s.nil}function we(){if(Z.validateSchema){const Y=O.scopeValue("validate$data",{ref:Z.validateSchema});return(0,s._)`!${Y}(${V})`}return s.nil}}subschema(O,V){const X=(0,o.getSubschema)(this.it,O);(0,o.extendSubschemaData)(X,this.it,O),(0,o.extendSubschemaMode)(X,O);const Z={...this.it,...X,items:void 0,props:void 0};return d(Z,V),Z}mergeEvaluated(O,V){const{it:X,gen:Z}=this;X.opts.unevaluated&&(X.props!==!0&&O.props!==void 0&&(X.props=l.mergeEvaluated.props(Z,O.props,X.props,V)),X.items!==
|
|
413
|
+
!0&&O.items!==void 0&&(X.items=l.mergeEvaluated.items(Z,O.items,X.items,V)))}mergeValidEvaluated(O,V){const{it:X,gen:Z}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return Z.if(V,()=>this.mergeEvaluated(O,s.Name)),!0}}Ve.KeywordCxt=C;function B(k,O,V,X){const Z=new C(k,V,O);"code"in V?V.code(Z,X):Z.$data&&V.validate?(0,a.funcKeywordCode)(Z,V):"macro"in V?(0,a.macroKeywordCode)(Z,V):(V.compile||V.validate)&&(0,a.funcKeywordCode)(Z,V)}const K=/^\/(?:[^~]|~0|~1)*$/,ee=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
|
|
414
|
+
function re(k,{dataLevel:O,dataNames:V,dataPathArr:X}){let Z,J;if(k==="")return u.default.rootData;if(k[0]==="/"){if(!K.test(k))throw new Error(`Invalid JSON-pointer: ${k}`);Z=k,J=u.default.rootData}else{const ne=ee.exec(k);if(!ne)throw new Error(`Invalid JSON-pointer: ${k}`);const W=+ne[1];if(Z=ne[2],Z==="#"){if(W>=O)throw new Error(Y("property/index",W));return X[O-W]}if(W>O)throw new Error(Y("data",W));if(J=V[O-W],!Z)return J}let ue=J;const we=Z.split("/");for(const ne of we)ne&&(J=(0,s._)`${J}${(0,s.
|
|
415
|
+
getProperty)((0,l.unescapeJsonPointer)(ne))}`,ue=(0,s._)`${ue} && ${J}`);return ue;function Y(ne,W){return`Cannot access ${ne} ${W} levels up, current level is ${O}`}}return Ve.getData=re,Ve}var or={},vi;function ar(){if(vi)return or;vi=1,Object.defineProperty(or,"__esModule",{value:!0});class e extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return or.default=e,or}var ir={},$i;function It(){if($i)return ir;$i=1,Object.defineProperty(ir,"__esMod\
|
|
416
|
+
ule",{value:!0});const e=sr();class t extends Error{constructor(n,i,a,o){super(o||`can't resolve reference ${a} from id ${i}`),this.missingRef=(0,e.resolveUrl)(n,i,a),this.missingSchema=(0,e.normalizeId)((0,e.getFullPath)(n,this.missingRef))}}return ir.default=t,ir}var ke={},_i;function cr(){if(_i)return ke;_i=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.resolveSchema=ke.getCompilingSchema=ke.resolveRef=ke.compileSchema=ke.SchemaEnv=void 0;const e=ae(),t=ar(),r=Oe(),n=sr(),i=fe(),a=Nt();
|
|
417
|
+
class o{constructor(p){var f;this.refs={},this.dynamicAnchors={};let d;typeof p.schema=="object"&&(d=p.schema),this.schema=p.schema,this.schemaId=p.schemaId,this.root=p.root||this,this.baseId=(f=p.baseId)!==null&&f!==void 0?f:(0,n.normalizeId)(d?.[p.schemaId||"$id"]),this.schemaPath=p.schemaPath,this.localRefs=p.localRefs,this.meta=p.meta,this.$async=d?.$async,this.refs={}}}ke.SchemaEnv=o;function s(h){const p=l.call(this,h);if(p)return p;const f=(0,n.getFullPath)(this.opts.uriResolver,h.root.baseId),
|
|
418
|
+
{es5:d,lines:v}=this.opts.code,{ownProperties:$}=this.opts,w=new e.CodeGen(this.scope,{es5:d,lines:v,ownProperties:$});let b;h.$async&&(b=w.scopeValue("Error",{ref:t.default,code:(0,e._)`require("ajv/dist/runtime/validation_error").default`}));const P=w.scopeName("validate");h.validateName=P;const I={gen:w,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],
|
|
419
|
+
definedProperties:new Set,topSchemaRef:w.scopeValue("schema",this.opts.code.source===!0?{ref:h.schema,code:(0,e.stringify)(h.schema)}:{ref:h.schema}),validateName:P,ValidationError:b,schema:h.schema,schemaEnv:h,rootId:f,baseId:h.baseId||f,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,e._)`""`,opts:this.opts,self:this};let H;try{this._compilations.add(h),(0,a.validateFunctionCode)(I),w.optimize(this.opts.code.optimize);const x=w.toString();H=`${w.scopeRefs(r.default.
|
|
420
|
+
scope)}return ${x}`,this.opts.code.process&&(H=this.opts.code.process(H,h));const L=new Function(`${r.default.self}`,`${r.default.scope}`,H)(this,this.scope.get());if(this.scope.value(P,{ref:L}),L.errors=null,L.schema=h.schema,L.schemaEnv=h,h.$async&&(L.$async=!0),this.opts.code.source===!0&&(L.source={validateName:P,validateCode:x,scopeValues:w._values}),this.opts.unevaluated){const{props:j,items:M}=I;L.evaluated={props:j instanceof e.Name?void 0:j,items:M instanceof e.Name?void 0:M,dynamicProps:j instanceof
|
|
421
|
+
e.Name,dynamicItems:M instanceof e.Name},L.source&&(L.source.evaluated=(0,e.stringify)(L.evaluated))}return h.validate=L,h}catch(x){throw delete h.validate,delete h.validateName,H&&this.logger.error("Error compiling schema, function code:",H),x}finally{this._compilations.delete(h)}}ke.compileSchema=s;function u(h,p,f){var d;f=(0,n.resolveUrl)(this.opts.uriResolver,p,f);const v=h.refs[f];if(v)return v;let $=y.call(this,h,f);if($===void 0){const w=(d=h.localRefs)===null||d===void 0?void 0:d[f],{schemaId:b}=this.
|
|
422
|
+
opts;w&&($=new o({schema:w,schemaId:b,root:h,baseId:p}))}if($!==void 0)return h.refs[f]=c.call(this,$)}ke.resolveRef=u;function c(h){return(0,n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:s.call(this,h)}function l(h){for(const p of this._compilations)if(m(p,h))return p}ke.getCompilingSchema=l;function m(h,p){return h.schema===p.schema&&h.root===p.root&&h.baseId===p.baseId}function y(h,p){let f;for(;typeof(f=this.refs[p])=="string";)p=f;return f||this.schemas[p]||_.call(this,h,
|
|
423
|
+
p)}function _(h,p){const f=this.opts.uriResolver.parse(p),d=(0,n._getFullPath)(this.opts.uriResolver,f);let v=(0,n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&d===v)return g.call(this,f,h);const $=(0,n.normalizeId)(d),w=this.refs[$]||this.schemas[$];if(typeof w=="string"){const b=_.call(this,h,w);return typeof b?.schema!="object"?void 0:g.call(this,f,b)}if(typeof w?.schema=="object"){if(w.validate||s.call(this,w),$===(0,n.normalizeId)(p)){const{schema:b}=w,
|
|
424
|
+
{schemaId:P}=this.opts,I=b[P];return I&&(v=(0,n.resolveUrl)(this.opts.uriResolver,v,I)),new o({schema:b,schemaId:P,root:h,baseId:v})}return g.call(this,f,w)}}ke.resolveSchema=_;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(h,{baseId:p,schema:f,root:d}){var v;if(((v=h.fragment)===null||v===void 0?void 0:v[0])!=="/")return;for(const b of h.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const P=f[(0,i.unescapeFragment)(b)];if(P===void 0)
|
|
425
|
+
return;f=P;const I=typeof f=="object"&&f[this.opts.schemaId];!S.has(b)&&I&&(p=(0,n.resolveUrl)(this.opts.uriResolver,p,I))}let $;if(typeof f!="boolean"&&f.$ref&&!(0,i.schemaHasRulesButRef)(f,this.RULES)){const b=(0,n.resolveUrl)(this.opts.uriResolver,p,f.$ref);$=_.call(this,d,b)}const{schemaId:w}=this.opts;if($=$||new o({schema:f,schemaId:w,root:d,baseId:p}),$.schema!==$.root.schema)return $}return ke}const wi="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",bi="M\
|
|
426
|
+
eta-schema for $data reference (JSON AnySchema extension proposal)",Ei="object",Si=["$data"],Ri={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Ai=!1,oh={$id:wi,description:bi,type:Ei,required:Si,properties:Ri,additionalProperties:Ai},ah={__proto__:null,$id:wi,additionalProperties:Ai,default:oh,description:bi,properties:Ri,required:Si,type:Ei},ih=De(ah);var ur={},jt={exports:{}},ys,Pi;function ch(){return Pi||(Pi=1,ys={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,
|
|
427
|
+
8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),ys}var gs,Ci;function uh(){if(Ci)return gs;Ci=1;const{HEX:e}=ch(),t=/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;function r(g){if(s(g,".")<3)return{host:g,isIPV4:!1};const h=g.match(t)||[],[p]=h;return p?{host:o(p,"."),isIPV4:!0}:{host:g,isIPV4:!1}}function n(g,h=!1){let p="",f=!0;for(const d of g){if(e[d]===void 0)return;d!=="0"&&f===!0&&(f=!1),f||(p+=d)}return h&&p.length===0&&(p=
|
|
428
|
+
"0"),p}function i(g){let h=0;const p={error:!1,address:"",zone:""},f=[],d=[];let v=!1,$=!1,w=!1;function b(){if(d.length){if(v===!1){const P=n(d);if(P!==void 0)f.push(P);else return p.error=!0,!1}d.length=0}return!0}for(let P=0;P<g.length;P++){const I=g[P];if(!(I==="["||I==="]"))if(I===":"){if($===!0&&(w=!0),!b())break;if(h++,f.push(":"),h>7){p.error=!0;break}P-1>=0&&g[P-1]===":"&&($=!0);continue}else if(I==="%"){if(!b())break;v=!0}else{d.push(I);continue}}return d.length&&(v?p.zone=d.join(""):w?
|
|
429
|
+
f.push(d.join("")):f.push(n(d))),p.address=f.join(""),p}function a(g){if(s(g,":")<2)return{host:g,isIPV6:!1};const h=i(g);if(h.error)return{host:g,isIPV6:!1};{let p=h.address,f=h.address;return h.zone&&(p+="%"+h.zone,f+="%25"+h.zone),{host:p,escapedHost:f,isIPV6:!0}}}function o(g,h){let p="",f=!0;const d=g.length;for(let v=0;v<d;v++){const $=g[v];$==="0"&&f?(v+1<=d&&g[v+1]===h||v+1===d)&&(p+=$,f=!1):($===h?f=!0:f=!1,p+=$)}return p}function s(g,h){let p=0;for(let f=0;f<g.length;f++)g[f]===h&&p++;
|
|
430
|
+
return p}const u=/^\.\.?\//u,c=/^\/\.(?:\/|$)/u,l=/^\/\.\.(?:\/|$)/u,m=/^\/?(?:.|\n)*?(?=\/|$)/u;function y(g){const h=[];for(;g.length;)if(g.match(u))g=g.replace(u,"");else if(g.match(c))g=g.replace(c,"/");else if(g.match(l))g=g.replace(l,"/"),h.pop();else if(g==="."||g==="..")g="";else{const p=g.match(m);if(p){const f=p[0];g=g.slice(f.length),h.push(f)}else throw new Error("Unexpected dot segment condition")}return h.join("")}function _(g,h){const p=h!==!0?escape:unescape;return g.scheme!==void 0&&
|
|
431
|
+
(g.scheme=p(g.scheme)),g.userinfo!==void 0&&(g.userinfo=p(g.userinfo)),g.host!==void 0&&(g.host=p(g.host)),g.path!==void 0&&(g.path=p(g.path)),g.query!==void 0&&(g.query=p(g.query)),g.fragment!==void 0&&(g.fragment=p(g.fragment)),g}function S(g){const h=[];if(g.userinfo!==void 0&&(h.push(g.userinfo),h.push("@")),g.host!==void 0){let p=unescape(g.host);const f=r(p);if(f.isIPV4)p=f.host;else{const d=a(f.host);d.isIPV6===!0?p=`[${d.escapedHost}]`:p=g.host}h.push(p)}return(typeof g.port=="number"||typeof g.
|
|
432
|
+
port=="string")&&(h.push(":"),h.push(String(g.port))),h.length?h.join(""):void 0}return gs={recomposeAuthority:S,normalizeComponentEncoding:_,removeDotSegments:y,normalizeIPv4:r,normalizeIPv6:a,stringArrayToHexStripped:n},gs}var vs,ki;function lh(){if(ki)return vs;ki=1;const e=/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu,t=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;function r(f){return typeof f.secure=="boolean"?f.secure:String(f.scheme).toLowerCase()===
|
|
433
|
+
"wss"}function n(f){return f.host||(f.error=f.error||"HTTP URIs must have a host."),f}function i(f){const d=String(f.scheme).toLowerCase()==="https";return(f.port===(d?443:80)||f.port==="")&&(f.port=void 0),f.path||(f.path="/"),f}function a(f){return f.secure=r(f),f.resourceName=(f.path||"/")+(f.query?"?"+f.query:""),f.path=void 0,f.query=void 0,f}function o(f){if((f.port===(r(f)?443:80)||f.port==="")&&(f.port=void 0),typeof f.secure=="boolean"&&(f.scheme=f.secure?"wss":"ws",f.secure=void 0),f.resourceName){
|
|
434
|
+
const[d,v]=f.resourceName.split("?");f.path=d&&d!=="/"?d:void 0,f.query=v,f.resourceName=void 0}return f.fragment=void 0,f}function s(f,d){if(!f.path)return f.error="URN can not be parsed",f;const v=f.path.match(t);if(v){const $=d.scheme||f.scheme||"urn";f.nid=v[1].toLowerCase(),f.nss=v[2];const w=`${$}:${d.nid||f.nid}`,b=p[w];f.path=void 0,b&&(f=b.parse(f,d))}else f.error=f.error||"URN can not be parsed.";return f}function u(f,d){const v=d.scheme||f.scheme||"urn",$=f.nid.toLowerCase(),w=`${v}:${d.
|
|
435
|
+
nid||$}`,b=p[w];b&&(f=b.serialize(f,d));const P=f,I=f.nss;return P.path=`${$||d.nid}:${I}`,d.skipEscape=!0,P}function c(f,d){const v=f;return v.uuid=v.nss,v.nss=void 0,!d.tolerant&&(!v.uuid||!e.test(v.uuid))&&(v.error=v.error||"UUID is not valid."),v}function l(f){const d=f;return d.nss=(f.uuid||"").toLowerCase(),d}const m={scheme:"http",domainHost:!0,parse:n,serialize:i},y={scheme:"https",domainHost:m.domainHost,parse:n,serialize:i},_={scheme:"ws",domainHost:!0,parse:a,serialize:o},S={scheme:"w\
|
|
436
|
+
ss",domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},p={http:m,https:y,ws:_,wss:S,urn:{scheme:"urn",parse:s,serialize:u,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:c,serialize:l,skipNormalize:!0}};return vs=p,vs}var Ti;function fh(){if(Ti)return jt.exports;Ti=1;const{normalizeIPv6:e,normalizeIPv4:t,removeDotSegments:r,recomposeAuthority:n,normalizeComponentEncoding:i}=uh(),a=lh();function o(h,p){return typeof h=="string"?h=l(S(h,p),p):typeof h=="object"&&(h=S(l(h,p),p)),h}function s(h,p,f){
|
|
437
|
+
const d=Object.assign({scheme:"null"},f),v=u(S(h,d),S(p,d),d,!0);return l(v,{...d,skipEscape:!0})}function u(h,p,f,d){const v={};return d||(h=S(l(h,f),f),p=S(l(p,f),f)),f=f||{},!f.tolerant&&p.scheme?(v.scheme=p.scheme,v.userinfo=p.userinfo,v.host=p.host,v.port=p.port,v.path=r(p.path||""),v.query=p.query):(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0?(v.userinfo=p.userinfo,v.host=p.host,v.port=p.port,v.path=r(p.path||""),v.query=p.query):(p.path?(p.path.charAt(0)==="/"?v.path=r(p.path):((h.
|
|
438
|
+
userinfo!==void 0||h.host!==void 0||h.port!==void 0)&&!h.path?v.path="/"+p.path:h.path?v.path=h.path.slice(0,h.path.lastIndexOf("/")+1)+p.path:v.path=p.path,v.path=r(v.path)),v.query=p.query):(v.path=h.path,p.query!==void 0?v.query=p.query:v.query=h.query),v.userinfo=h.userinfo,v.host=h.host,v.port=h.port),v.scheme=h.scheme),v.fragment=p.fragment,v}function c(h,p,f){return typeof h=="string"?(h=unescape(h),h=l(i(S(h,f),!0),{...f,skipEscape:!0})):typeof h=="object"&&(h=l(i(h,!0),{...f,skipEscape:!0})),
|
|
439
|
+
typeof p=="string"?(p=unescape(p),p=l(i(S(p,f),!0),{...f,skipEscape:!0})):typeof p=="object"&&(p=l(i(p,!0),{...f,skipEscape:!0})),h.toLowerCase()===p.toLowerCase()}function l(h,p){const f={host:h.host,scheme:h.scheme,userinfo:h.userinfo,port:h.port,path:h.path,query:h.query,nid:h.nid,nss:h.nss,uuid:h.uuid,fragment:h.fragment,reference:h.reference,resourceName:h.resourceName,secure:h.secure,error:""},d=Object.assign({},p),v=[],$=a[(d.scheme||f.scheme||"").toLowerCase()];$&&$.serialize&&$.serialize(
|
|
440
|
+
f,d),f.path!==void 0&&(d.skipEscape?f.path=unescape(f.path):(f.path=escape(f.path),f.scheme!==void 0&&(f.path=f.path.split("%3A").join(":")))),d.reference!=="suffix"&&f.scheme&&v.push(f.scheme,":");const w=n(f);if(w!==void 0&&(d.reference!=="suffix"&&v.push("//"),v.push(w),f.path&&f.path.charAt(0)!=="/"&&v.push("/")),f.path!==void 0){let b=f.path;!d.absolutePath&&(!$||!$.absolutePath)&&(b=r(b)),w===void 0&&(b=b.replace(/^\/\//u,"/%2F")),v.push(b)}return f.query!==void 0&&v.push("?",f.query),f.fragment!==
|
|
441
|
+
void 0&&v.push("#",f.fragment),v.join("")}const m=Array.from({length:127},(h,p)=>/[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(p)));function y(h){let p=0;for(let f=0,d=h.length;f<d;++f)if(p=h.charCodeAt(f),p>126||m[p])return!0;return!1}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(h,p){const f=Object.assign({},p),d={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},
|
|
442
|
+
v=h.indexOf("%")!==-1;let $=!1;f.reference==="suffix"&&(h=(f.scheme?f.scheme+":":"")+"//"+h);const w=h.match(_);if(w){if(d.scheme=w[1],d.userinfo=w[3],d.host=w[4],d.port=parseInt(w[5],10),d.path=w[6]||"",d.query=w[7],d.fragment=w[8],isNaN(d.port)&&(d.port=w[5]),d.host){const P=t(d.host);if(P.isIPV4===!1){const I=e(P.host);d.host=I.host.toLowerCase(),$=I.isIPV6}else d.host=P.host,$=!0}d.scheme===void 0&&d.userinfo===void 0&&d.host===void 0&&d.port===void 0&&d.query===void 0&&!d.path?d.reference="\
|
|
443
|
+
same-document":d.scheme===void 0?d.reference="relative":d.fragment===void 0?d.reference="absolute":d.reference="uri",f.reference&&f.reference!=="suffix"&&f.reference!==d.reference&&(d.error=d.error||"URI is not a "+f.reference+" reference.");const b=a[(f.scheme||d.scheme||"").toLowerCase()];if(!f.unicodeSupport&&(!b||!b.unicodeSupport)&&d.host&&(f.domainHost||b&&b.domainHost)&&$===!1&&y(d.host))try{d.host=URL.domainToASCII(d.host.toLowerCase())}catch(P){d.error=d.error||"Host's domain name can n\
|
|
444
|
+
ot be converted to ASCII: "+P}(!b||b&&!b.skipNormalize)&&(v&&d.scheme!==void 0&&(d.scheme=unescape(d.scheme)),v&&d.host!==void 0&&(d.host=unescape(d.host)),d.path&&(d.path=escape(unescape(d.path))),d.fragment&&(d.fragment=encodeURI(decodeURIComponent(d.fragment)))),b&&b.parse&&b.parse(d,f)}else d.error=d.error||"URI can not be parsed.";return d}const g={SCHEMES:a,normalize:o,resolve:s,resolveComponents:u,equal:c,serialize:l,parse:S};return jt.exports=g,jt.exports.default=g,jt.exports.fastUri=g,jt.
|
|
445
|
+
exports}var Oi;function dh(){if(Oi)return ur;Oi=1,Object.defineProperty(ur,"__esModule",{value:!0});const e=fh();return e.code='require("ajv/dist/runtime/uri").default',ur.default=e,ur}var Ni;function Ii(){return Ni||(Ni=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Nt();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=ae();Object.defineProperty(e,"_",{enumerable:!0,
|
|
446
|
+
get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=ar(),i=It(),a=ii(),o=cr(),s=ae(),u=sr(),c=nr(),l=fe(),m=ih,y=dh(),
|
|
447
|
+
_=(q,A)=>new RegExp(q,A);_.code="new RegExp";const S=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),h={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",
|
|
447
448
|
missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cach\
|
|
448
|
-
e, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},
|
|
449
|
-
kf=(R=q.uriResolver)!==null&&R!==void 0?R:y.default;return{strictSchema:(C=(
|
|
449
|
+
e, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},p={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function d(q){var A,D,T,R,E,C,B,K,ee,re,k,O,V,X,Z,J,ue,we,Y,ne,W,te,le,ye,he;const Me=q.strict,Be=(A=q.code)===null||A===void 0?void 0:A.optimize,ko=Be===!0||Be===void 0?1:Be||0,To=(T=(D=q.code)===null||D===void 0?void 0:D.regExp)!==null&&T!==void 0?T:_,
|
|
450
|
+
kf=(R=q.uriResolver)!==null&&R!==void 0?R:y.default;return{strictSchema:(C=(E=q.strictSchema)!==null&&E!==void 0?E:Me)!==null&&C!==void 0?C:!0,strictNumbers:(K=(B=q.strictNumbers)!==null&&B!==void 0?B:Me)!==null&&K!==void 0?K:!0,strictTypes:(re=(ee=q.strictTypes)!==null&&ee!==void 0?ee:Me)!==null&&re!==void 0?re:"log",strictTuples:(O=(k=q.strictTuples)!==null&&k!==void 0?k:Me)!==null&&O!==void 0?O:"log",strictRequired:(X=(V=q.strictRequired)!==null&&V!==void 0?V:Me)!==null&&X!==void 0?X:!1,code:q.
|
|
450
451
|
code?{...q.code,optimize:ko,regExp:To}:{optimize:ko,regExp:To},loopRequired:(Z=q.loopRequired)!==null&&Z!==void 0?Z:f,loopEnum:(J=q.loopEnum)!==null&&J!==void 0?J:f,meta:(ue=q.meta)!==null&&ue!==void 0?ue:!0,messages:(we=q.messages)!==null&&we!==void 0?we:!0,inlineRefs:(Y=q.inlineRefs)!==null&&Y!==void 0?Y:!0,schemaId:(ne=q.schemaId)!==null&&ne!==void 0?ne:"$id",addUsedSchema:(W=q.addUsedSchema)!==null&&W!==void 0?W:!0,validateSchema:(te=q.validateSchema)!==null&&te!==void 0?te:!0,validateFormats:(le=
|
|
451
|
-
q.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ye=q.unicodeRegExp)!==null&&ye!==void 0?ye:!0,int32range:(he=q.int32range)!==null&&he!==void 0?he:!0,uriResolver:kf}}class v{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...d(A)};const{es5:
|
|
452
|
-
!1,this.RULES=(0,
|
|
453
|
-
addMetaSchema(R,R[T],!1)}defaultMeta(){const{meta:A,schemaId:
|
|
454
|
-
"options.loadSchema should be a function");const{loadSchema:T}=this.opts;return R.call(this,A,
|
|
455
|
-
missingRef:k}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${k} cannot be resolved`)}async function K(re){const k=await ee.call(this,re);this.refs[re]||await
|
|
456
|
-
let
|
|
457
|
-
this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(T,A);if(!R&&
|
|
458
|
-
_compileSchemaEnv(
|
|
459
|
-
(T=(0,u.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const
|
|
460
|
-
or non-empty array")}else throw new Error("invalid addKeywords parameters");if(
|
|
461
|
-
delete
|
|
462
|
-
for(const B of
|
|
463
|
-
e object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;T=(0,u.normalizeId)(C||T);const ee=u.getSchemaRefs.call(this,A,T);return K=new
|
|
464
|
-
dy exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):
|
|
465
|
-
q),this.schemas[q]||this.refs[q]}function
|
|
466
|
-
for(const A of S)delete q[A];return q}const x={log(){},warn(){},error(){}};function
|
|
467
|
-
idate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,A,
|
|
468
|
-
all[q]=B,(T=A.implements)===null||T===void 0||T.forEach(K=>this.addKeyword(K))}function z(q,A,
|
|
469
|
-
fr={},dr={},ji;function ph(){if(ji)return dr;ji=1,Object.defineProperty(dr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return dr.default=e,dr}var et={},Li;function $s(){if(Li)return et;Li=1,Object.defineProperty(et,"__esModule",{value:!0}),et.callRef=et.getValidate=void 0;const e=
|
|
470
|
-
validateName:g,opts:
|
|
471
|
-
|
|
472
|
-
by sync schema");const
|
|
473
|
-
default.vErrors}.length`)}function w(
|
|
474
|
-
S.items=
|
|
475
|
-
okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:
|
|
476
|
-
var mr={},Mi;function mh(){if(Mi)return mr;Mi=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=ae(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:
|
|
477
|
-
_)`(${
|
|
478
|
-
const e=ae(),t=fe(),r=yh(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:
|
|
479
|
-
_)`${m} ${l} ${u}`)}};return yr.default=i,yr}var vr={},Fi;function vh(){if(Fi)return vr;Fi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=Ie(),t=ae(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:
|
|
480
|
-
(0,t._)`!${m}.test(${
|
|
481
|
-
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${
|
|
482
|
-
schemaCode:u,data:c,$data:l,it:m}=
|
|
483
|
-
|
|
484
|
-
return _r.default=i,_r}var wr={},Gi;function wh(){if(Gi)return wr;Gi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ae(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const
|
|
485
|
-
_)`${
|
|
486
|
-
params:({params:{i:
|
|
487
|
-
const w=s.name("item"),
|
|
488
|
-
label(
|
|
489
|
-
l&&typeof l=="object"?
|
|
490
|
-
c.length===0)throw new Error("enum must have non-empty array");const y=c.length>=m.opts.loopEnum;let _;const S=()=>_??(_=(0,t.useFunc)(
|
|
491
|
-
ect"&&v!==null?(0,e._)`${S()}(${s}, ${f}[${d}])`:(0,e._)`${s} === ${v}`}}};return Rr.default=i,Rr}var Ji;function Yi(){if(Ji)return pr;Ji=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=hh(),t=mh(),r=gh(),n=vh(),i=$h(),
|
|
492
|
-
function Zi(){if(Qi)return ht;Qi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.validateAdditionalItems=void 0;const e=ae(),t=fe(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:
|
|
493
|
-
ms" is not an array of schemas');return}i(
|
|
494
|
-
s.if((0,e.not)(S),()=>s.break())})}}return ht.validateAdditionalItems=i,ht.default=n,ht}var Pr={},mt={},ec;function tc(){if(ec)return mt;ec=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.validateTuple=void 0;const e=ae(),t=fe(),r=Ie(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(
|
|
495
|
-
schema){const{gen:u,parentSchema:c,data:l,keyword:m,it:y}=
|
|
496
|
-
"${m}" is ${d}-tuple, but minItems or maxItems/${
|
|
497
|
-
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Ie(),n=Zi(),
|
|
498
|
-
if(sc)return kr;sc=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:
|
|
499
|
-
const{gen:
|
|
500
|
-
m!==void 0&&(d=(0,e._)`${d} && ${S} <= ${m}`),i.pass(d);return}c.items=!0;const g=
|
|
501
|
-
m===void 0?
|
|
452
|
+
q.validateFormats)!==null&&le!==void 0?le:!0,unicodeRegExp:(ye=q.unicodeRegExp)!==null&&ye!==void 0?ye:!0,int32range:(he=q.int32range)!==null&&he!==void 0?he:!0,uriResolver:kf}}class v{constructor(A={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,A=this.opts={...A,...d(A)};const{es5:D,lines:T}=this.opts.code;this.scope=new s.ValueScope({scope:{},prefixes:g,es5:D,lines:T}),this.logger=U(A.logger);const R=A.validateFormats;A.validateFormats=
|
|
453
|
+
!1,this.RULES=(0,a.getRules)(),$.call(this,h,A,"NOT SUPPORTED"),$.call(this,p,A,"DEPRECATED","warn"),this._metaOpts=H.call(this),A.formats&&P.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),A.keywords&&I.call(this,A.keywords),typeof A.meta=="object"&&this.addMetaSchema(A.meta),b.call(this),A.validateFormats=R}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:A,meta:D,schemaId:T}=this.opts;let R=m;T==="id"&&(R={...m},R.id=R.$id,delete R.$id),D&&A&&this.
|
|
454
|
+
addMetaSchema(R,R[T],!1)}defaultMeta(){const{meta:A,schemaId:D}=this.opts;return this.opts.defaultMeta=typeof A=="object"?A[D]||A:void 0}validate(A,D){let T;if(typeof A=="string"){if(T=this.getSchema(A),!T)throw new Error(`no schema with key or ref "${A}"`)}else T=this.compile(A);const R=T(D);return"$async"in T||(this.errors=T.errors),R}compile(A,D){const T=this._addSchema(A,D);return T.validate||this._compileSchemaEnv(T)}compileAsync(A,D){if(typeof this.opts.loadSchema!="function")throw new Error(
|
|
455
|
+
"options.loadSchema should be a function");const{loadSchema:T}=this.opts;return R.call(this,A,D);async function R(re,k){await E.call(this,re.$schema);const O=this._addSchema(re,k);return O.validate||C.call(this,O)}async function E(re){re&&!this.getSchema(re)&&await R.call(this,{$ref:re},!0)}async function C(re){try{return this._compileSchemaEnv(re)}catch(k){if(!(k instanceof i.default))throw k;return B.call(this,k),await K.call(this,k.missingSchema),C.call(this,re)}}function B({missingSchema:re,
|
|
456
|
+
missingRef:k}){if(this.refs[re])throw new Error(`AnySchema ${re} is loaded but ${k} cannot be resolved`)}async function K(re){const k=await ee.call(this,re);this.refs[re]||await E.call(this,k.$schema),this.refs[re]||this.addSchema(k,re,D)}async function ee(re){const k=this._loading[re];if(k)return k;try{return await(this._loading[re]=T(re))}finally{delete this._loading[re]}}}addSchema(A,D,T,R=this.opts.validateSchema){if(Array.isArray(A)){for(const C of A)this.addSchema(C,void 0,T,R);return this}
|
|
457
|
+
let E;if(typeof A=="object"){const{schemaId:C}=this.opts;if(E=A[C],E!==void 0&&typeof E!="string")throw new Error(`schema ${C} must be string`)}return D=(0,u.normalizeId)(D||E),this._checkUnique(D),this.schemas[D]=this._addSchema(A,T,D,R,!0),this}addMetaSchema(A,D,T=this.opts.validateSchema){return this.addSchema(A,D,!0,T),this}validateSchema(A,D){if(typeof A=="boolean")return!0;let T;if(T=A.$schema,T!==void 0&&typeof T!="string")throw new Error("$schema must be a string");if(T=T||this.opts.defaultMeta||
|
|
458
|
+
this.defaultMeta(),!T)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const R=this.validate(T,A);if(!R&&D){const E="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(E);else throw new Error(E)}return R}getSchema(A){let D;for(;typeof(D=w.call(this,A))=="string";)A=D;if(D===void 0){const{schemaId:T}=this.opts,R=new o.SchemaEnv({schema:{},schemaId:T});if(D=o.resolveSchema.call(this,R,A),!D)return;this.refs[A]=D}return D.validate||this.
|
|
459
|
+
_compileSchemaEnv(D)}removeSchema(A){if(A instanceof RegExp)return this._removeAllSchemas(this.schemas,A),this._removeAllSchemas(this.refs,A),this;switch(typeof A){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const D=w.call(this,A);return typeof D=="object"&&this._cache.delete(D.schema),delete this.schemas[A],delete this.refs[A],this}case"object":{const D=A;this._cache.delete(D);let T=A[this.opts.schemaId];return T&&
|
|
460
|
+
(T=(0,u.normalizeId)(T),delete this.schemas[T],delete this.refs[T]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(A){for(const D of A)this.addKeyword(D);return this}addKeyword(A,D){let T;if(typeof A=="string")T=A,typeof D=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),D.keyword=T);else if(typeof A=="object"&&D===void 0){if(D=A,T=D.keyword,Array.isArray(T)&&!T.length)throw new Error("addKeywords: keyword must be string\
|
|
461
|
+
or non-empty array")}else throw new Error("invalid addKeywords parameters");if(j.call(this,T,D),!D)return(0,l.eachItem)(T,E=>M.call(this,E)),this;F.call(this,D);const R={...D,type:(0,c.getJSONTypes)(D.type),schemaType:(0,c.getJSONTypes)(D.schemaType)};return(0,l.eachItem)(T,R.type.length===0?E=>M.call(this,E,R):E=>R.type.forEach(C=>M.call(this,E,R,C))),this}getKeyword(A){const D=this.RULES.all[A];return typeof D=="object"?D.definition:!!D}removeKeyword(A){const{RULES:D}=this;delete D.keywords[A],
|
|
462
|
+
delete D.all[A];for(const T of D.rules){const R=T.rules.findIndex(E=>E.keyword===A);R>=0&&T.rules.splice(R,1)}return this}addFormat(A,D){return typeof D=="string"&&(D=new RegExp(D)),this.formats[A]=D,this}errorsText(A=this.errors,{separator:D=", ",dataVar:T="data"}={}){return!A||A.length===0?"No errors":A.map(R=>`${T}${R.instancePath} ${R.message}`).reduce((R,E)=>R+D+E)}$dataMetaSchema(A,D){const T=this.RULES.all;A=JSON.parse(JSON.stringify(A));for(const R of D){const E=R.split("/").slice(1);let C=A;
|
|
463
|
+
for(const B of E)C=C[B];for(const B in T){const K=T[B];if(typeof K!="object")continue;const{$data:ee}=K.definition,re=C[B];ee&&re&&(C[B]=Q(re))}}return A}_removeAllSchemas(A,D){for(const T in A){const R=A[T];(!D||D.test(T))&&(typeof R=="string"?delete A[T]:R&&!R.meta&&(this._cache.delete(R.schema),delete A[T]))}}_addSchema(A,D,T,R=this.opts.validateSchema,E=this.opts.addUsedSchema){let C;const{schemaId:B}=this.opts;if(typeof A=="object")C=A[B];else{if(this.opts.jtd)throw new Error("schema must b\
|
|
464
|
+
e object");if(typeof A!="boolean")throw new Error("schema must be object or boolean")}let K=this._cache.get(A);if(K!==void 0)return K;T=(0,u.normalizeId)(C||T);const ee=u.getSchemaRefs.call(this,A,T);return K=new o.SchemaEnv({schema:A,schemaId:B,meta:D,baseId:T,localRefs:ee}),this._cache.set(K.schema,K),E&&!T.startsWith("#")&&(T&&this._checkUnique(T),this.refs[T]=K),R&&this.validateSchema(A,!0),K}_checkUnique(A){if(this.schemas[A]||this.refs[A])throw new Error(`schema with key or id "${A}" alrea\
|
|
465
|
+
dy exists`)}_compileSchemaEnv(A){if(A.meta?this._compileMetaSchema(A):o.compileSchema.call(this,A),!A.validate)throw new Error("ajv implementation error");return A.validate}_compileMetaSchema(A){const D=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,A)}finally{this.opts=D}}}v.ValidationError=n.default,v.MissingRefError=i.default,e.default=v;function $(q,A,D,T="error"){for(const R in q){const E=R;E in A&&this.logger[T](`${D}: option ${R}. ${q[E]}`)}}function w(q){return q=(0,u.normalizeId)(
|
|
466
|
+
q),this.schemas[q]||this.refs[q]}function b(){const q=this.opts.schemas;if(q)if(Array.isArray(q))this.addSchema(q);else for(const A in q)this.addSchema(q[A],A)}function P(){for(const q in this.opts.formats){const A=this.opts.formats[q];A&&this.addFormat(q,A)}}function I(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const A in q){const D=q[A];D.keyword||(D.keyword=A),this.addKeyword(D)}}function H(){const q={...this.opts};
|
|
467
|
+
for(const A of S)delete q[A];return q}const x={log(){},warn(){},error(){}};function U(q){if(q===!1)return x;if(q===void 0)return console;if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const L=/^[a-z_$][a-z0-9_$:-]*$/i;function j(q,A){const{RULES:D}=this;if((0,l.eachItem)(q,T=>{if(D.keywords[T])throw new Error(`Keyword ${T} is already defined`);if(!L.test(T))throw new Error(`Keyword ${T} has invalid name`)}),!!A&&A.$data&&!("code"in A||"val\
|
|
468
|
+
idate"in A))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,A,D){var T;const R=A?.post;if(D&&R)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:E}=this;let C=R?E.post:E.rules.find(({type:K})=>K===D);if(C||(C={type:D,rules:[]},E.rules.push(C)),E.keywords[q]=!0,!A)return;const B={keyword:q,definition:{...A,type:(0,c.getJSONTypes)(A.type),schemaType:(0,c.getJSONTypes)(A.schemaType)}};A.before?z.call(this,C,B,A.before):C.rules.push(B),E.
|
|
469
|
+
all[q]=B,(T=A.implements)===null||T===void 0||T.forEach(K=>this.addKeyword(K))}function z(q,A,D){const T=q.rules.findIndex(R=>R.keyword===D);T>=0?q.rules.splice(T,0,A):(q.rules.push(A),this.logger.warn(`rule ${D} is not defined`))}function F(q){let{metaSchema:A}=q;A!==void 0&&(q.$data&&this.opts.$data&&(A=Q(A)),q.validateSchema=this.compile(A,!0))}const G={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(q){return{anyOf:[q,G]}}})(ls)),ls}var lr={},
|
|
470
|
+
fr={},dr={},ji;function ph(){if(ji)return dr;ji=1,Object.defineProperty(dr,"__esModule",{value:!0});const e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return dr.default=e,dr}var et={},Li;function $s(){if(Li)return et;Li=1,Object.defineProperty(et,"__esModule",{value:!0}),et.callRef=et.getValidate=void 0;const e=It(),t=Ie(),r=ae(),n=Oe(),i=cr(),a=fe(),o={keyword:"$ref",schemaType:"string",code(c){const{gen:l,schema:m,it:y}=c,{baseId:_,schemaEnv:S,
|
|
471
|
+
validateName:g,opts:h,self:p}=y,{root:f}=S;if((m==="#"||m==="#/")&&_===f.baseId)return v();const d=i.resolveRef.call(p,f,_,m);if(d===void 0)throw new e.default(y.opts.uriResolver,_,m);if(d instanceof i.SchemaEnv)return $(d);return w(d);function v(){if(S===f)return u(c,g,S,S.$async);const b=l.scopeValue("root",{ref:f});return u(c,(0,r._)`${b}.validate`,f,f.$async)}function $(b){const P=s(c,b);u(c,P,b,b.$async)}function w(b){const P=l.scopeValue("schema",h.code.source===!0?{ref:b,code:(0,r.stringify)(
|
|
472
|
+
b)}:{ref:b}),I=l.name("valid"),H=c.subschema({schema:b,dataTypes:[],schemaPath:r.nil,topSchemaRef:P,errSchemaPath:m},I);c.mergeEvaluated(H),c.ok(I)}}};function s(c,l){const{gen:m}=c;return l.validate?m.scopeValue("validate",{ref:l.validate}):(0,r._)`${m.scopeValue("wrapper",{ref:l})}.validate`}et.getValidate=s;function u(c,l,m,y){const{gen:_,it:S}=c,{allErrors:g,schemaEnv:h,opts:p}=S,f=p.passContext?n.default.this:r.nil;y?d():v();function d(){if(!h.$async)throw new Error("async schema referenced\
|
|
473
|
+
by sync schema");const b=_.let("valid");_.try(()=>{_.code((0,r._)`await ${(0,t.callValidateCode)(c,l,f)}`),w(l),g||_.assign(b,!0)},P=>{_.if((0,r._)`!(${P} instanceof ${S.ValidationError})`,()=>_.throw(P)),$(P),g||_.assign(b,!1)}),c.ok(b)}function v(){c.result((0,t.callValidateCode)(c,l,f),()=>w(l),()=>$(l))}function $(b){const P=(0,r._)`${b}.errors`;_.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${P} : ${n.default.vErrors}.concat(${P})`),_.assign(n.default.errors,(0,r._)`${n.
|
|
474
|
+
default.vErrors}.length`)}function w(b){var P;if(!S.opts.unevaluated)return;const I=(P=m?.validate)===null||P===void 0?void 0:P.evaluated;if(S.props!==!0)if(I&&!I.dynamicProps)I.props!==void 0&&(S.props=a.mergeEvaluated.props(_,I.props,S.props));else{const H=_.var("props",(0,r._)`${b}.evaluated.props`);S.props=a.mergeEvaluated.props(_,H,S.props,r.Name)}if(S.items!==!0)if(I&&!I.dynamicItems)I.items!==void 0&&(S.items=a.mergeEvaluated.items(_,I.items,S.items));else{const H=_.var("items",(0,r._)`${b}.evaluated.items`);
|
|
475
|
+
S.items=a.mergeEvaluated.items(_,H,S.items,r.Name)}}}return et.callRef=u,et.default=o,et}var Di;function qi(){if(Di)return fr;Di=1,Object.defineProperty(fr,"__esModule",{value:!0});const e=ph(),t=$s(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,t.default];return fr.default=r,fr}var pr={},hr={},xi;function hh(){if(xi)return hr;xi=1,Object.defineProperty(hr,"__esModule",{value:!0});const e=ae(),t=e.operators,r={maximum:{okStr:"<=",ok:t.LTE,fail:t.GT},minimum:{
|
|
476
|
+
okStr:">=",ok:t.GTE,fail:t.LT},exclusiveMaximum:{okStr:"<",ok:t.LT,fail:t.GTE},exclusiveMinimum:{okStr:">",ok:t.GT,fail:t.LTE}},n={message:({keyword:a,schemaCode:o})=>(0,e.str)`must be ${r[a].okStr} ${o}`,params:({keyword:a,schemaCode:o})=>(0,e._)`{comparison: ${r[a].okStr}, limit: ${o}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(a){const{keyword:o,data:s,schemaCode:u}=a;a.fail$data((0,e._)`${s} ${r[o].fail} ${u} || isNaN(${s})`)}};return hr.default=i,hr}
|
|
477
|
+
var mr={},Mi;function mh(){if(Mi)return mr;Mi=1,Object.defineProperty(mr,"__esModule",{value:!0});const e=ae(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,e._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:a,schemaCode:o,it:s}=n,u=s.opts.multipleOfPrecision,c=i.let("res"),l=u?(0,e._)`Math.abs(Math.round(${c}) - ${c}) > 1e-${u}`:(0,e._)`${c} !== parseInt(${c})`;n.fail$data((0,e.
|
|
478
|
+
_)`(${o} === 0 || (${c} = ${a}/${o}, ${l}))`)}};return mr.default=r,mr}var yr={},gr={},Hi;function yh(){if(Hi)return gr;Hi=1,Object.defineProperty(gr,"__esModule",{value:!0});function e(t){const r=t.length;let n=0,i=0,a;for(;i<r;)n++,a=t.charCodeAt(i++),a>=55296&&a<=56319&&i<r&&(a=t.charCodeAt(i),(a&64512)===56320&&i++);return n}return gr.default=e,e.code='require("ajv/dist/runtime/ucs2length").default',gr}var Ui;function gh(){if(Ui)return yr;Ui=1,Object.defineProperty(yr,"__esModule",{value:!0});
|
|
479
|
+
const e=ae(),t=fe(),r=yh(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:o}){const s=a==="maxLength"?"more":"fewer";return(0,e.str)`must NOT have ${s} than ${o} characters`},params:({schemaCode:a})=>(0,e._)`{limit: ${a}}`},code(a){const{keyword:o,data:s,schemaCode:u,it:c}=a,l=o==="maxLength"?e.operators.GT:e.operators.LT,m=c.opts.unicode===!1?(0,e._)`${s}.length`:(0,e._)`${(0,t.useFunc)(a.gen,r.default)}(${s})`;a.fail$data((0,e.
|
|
480
|
+
_)`${m} ${l} ${u}`)}};return yr.default=i,yr}var vr={},Fi;function vh(){if(Fi)return vr;Fi=1,Object.defineProperty(vr,"__esModule",{value:!0});const e=Ie(),t=ae(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,t.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,t._)`{pattern: ${i}}`},code(i){const{data:a,$data:o,schema:s,schemaCode:u,it:c}=i,l=c.opts.unicodeRegExp?"u":"",m=o?(0,t._)`(new RegExp(${u}, ${l}))`:(0,e.usePattern)(i,s);i.fail$data(
|
|
481
|
+
(0,t._)`!${m}.test(${a})`)}};return vr.default=n,vr}var $r={},Vi;function $h(){if(Vi)return $r;Vi=1,Object.defineProperty($r,"__esModule",{value:!0});const e=ae(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const a=n==="maxProperties"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} properties`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:a,schemaCode:o}=n,s=i==="maxP\
|
|
482
|
+
roperties"?e.operators.GT:e.operators.LT;n.fail$data((0,e._)`Object.keys(${a}).length ${s} ${o}`)}};return $r.default=r,$r}var _r={},zi;function _h(){if(zi)return _r;zi=1,Object.defineProperty(_r,"__esModule",{value:!0});const e=Ie(),t=ae(),r=fe(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,t.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,t._)`{missingProperty: ${a}}`},code(a){const{gen:o,schema:s,
|
|
483
|
+
schemaCode:u,data:c,$data:l,it:m}=a,{opts:y}=m;if(!l&&s.length===0)return;const _=s.length>=y.loopRequired;if(m.allErrors?S():g(),y.strictRequired){const f=a.parentSchema.properties,{definedProperties:d}=a.it;for(const v of s)if(f?.[v]===void 0&&!d.has(v)){const $=m.schemaEnv.baseId+m.errSchemaPath,w=`required property "${v}" is not defined at "${$}" (strictRequired)`;(0,r.checkStrictMode)(m,w,m.opts.strictRequired)}}function S(){if(_||l)a.block$data(t.nil,h);else for(const f of s)(0,e.checkReportMissingProp)(
|
|
484
|
+
a,f)}function g(){const f=o.let("missing");if(_||l){const d=o.let("valid",!0);a.block$data(d,()=>p(f,d)),a.ok(d)}else o.if((0,e.checkMissingProp)(a,s,f)),(0,e.reportMissingProp)(a,f),o.else()}function h(){o.forOf("prop",u,f=>{a.setParams({missingProperty:f}),o.if((0,e.noPropertyInData)(o,c,f,y.ownProperties),()=>a.error())})}function p(f,d){a.setParams({missingProperty:f}),o.forOf(f,u,()=>{o.assign(d,(0,e.propertyInData)(o,c,f,y.ownProperties)),o.if((0,t.not)(d),()=>{a.error(),o.break()})},t.nil)}}};
|
|
485
|
+
return _r.default=i,_r}var wr={},Gi;function wh(){if(Gi)return wr;Gi=1,Object.defineProperty(wr,"__esModule",{value:!0});const e=ae(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const a=n==="maxItems"?"more":"fewer";return(0,e.str)`must NOT have ${a} than ${i} items`},params:({schemaCode:n})=>(0,e._)`{limit: ${n}}`},code(n){const{keyword:i,data:a,schemaCode:o}=n,s=i==="maxItems"?e.operators.GT:e.operators.LT;n.fail$data((0,e.
|
|
486
|
+
_)`${a}.length ${s} ${o}`)}};return wr.default=r,wr}var br={},Er={},Bi;function _s(){if(Bi)return Er;Bi=1,Object.defineProperty(Er,"__esModule",{value:!0});const e=Do();return e.code='require("ajv/dist/runtime/equal").default',Er.default=e,Er}var Ki;function bh(){if(Ki)return br;Ki=1,Object.defineProperty(br,"__esModule",{value:!0});const e=nr(),t=ae(),r=fe(),n=_s(),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:o,j:s}})=>(0,t.str)`must NOT have duplicate items (items ## ${s} and ${o} are identical)`,
|
|
487
|
+
params:({params:{i:o,j:s}})=>(0,t._)`{i: ${o}, j: ${s}}`},code(o){const{gen:s,data:u,$data:c,schema:l,parentSchema:m,schemaCode:y,it:_}=o;if(!c&&!l)return;const S=s.let("valid"),g=m.items?(0,e.getSchemaTypes)(m.items):[];o.block$data(S,h,(0,t._)`${y} === false`),o.ok(S);function h(){const v=s.let("i",(0,t._)`${u}.length`),$=s.let("j");o.setParams({i:v,j:$}),s.assign(S,!0),s.if((0,t._)`${v} > 1`,()=>(p()?f:d)(v,$))}function p(){return g.length>0&&!g.some(v=>v==="object"||v==="array")}function f(v,$){
|
|
488
|
+
const w=s.name("item"),b=(0,e.checkDataTypes)(g,w,_.opts.strictNumbers,e.DataType.Wrong),P=s.const("indices",(0,t._)`{}`);s.for((0,t._)`;${v}--;`,()=>{s.let(w,(0,t._)`${u}[${v}]`),s.if(b,(0,t._)`continue`),g.length>1&&s.if((0,t._)`typeof ${w} == "string"`,(0,t._)`${w} += "_"`),s.if((0,t._)`typeof ${P}[${w}] == "number"`,()=>{s.assign($,(0,t._)`${P}[${w}]`),o.error(),s.assign(S,!1).break()}).code((0,t._)`${P}[${w}] = ${v}`)})}function d(v,$){const w=(0,r.useFunc)(s,n.default),b=s.name("outer");s.
|
|
489
|
+
label(b).for((0,t._)`;${v}--;`,()=>s.for((0,t._)`${$} = ${v}; ${$}--;`,()=>s.if((0,t._)`${w}(${u}[${v}], ${u}[${$}])`,()=>{o.error(),s.assign(S,!1).break(b)})))}}};return br.default=a,br}var Sr={},Wi;function Eh(){if(Wi)return Sr;Wi=1,Object.defineProperty(Sr,"__esModule",{value:!0});const e=ae(),t=fe(),r=_s(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,e._)`{allowedValue: ${a}}`},code(a){const{gen:o,data:s,$data:u,schemaCode:c,schema:l}=a;u||
|
|
490
|
+
l&&typeof l=="object"?a.fail$data((0,e._)`!${(0,t.useFunc)(o,r.default)}(${s}, ${c})`):a.fail((0,e._)`${l} !== ${s}`)}};return Sr.default=i,Sr}var Rr={},Xi;function Sh(){if(Xi)return Rr;Xi=1,Object.defineProperty(Rr,"__esModule",{value:!0});const e=ae(),t=fe(),r=_s(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,e._)`{allowedValues: ${a}}`},code(a){const{gen:o,data:s,$data:u,schema:c,schemaCode:l,it:m}=a;if(!u&&
|
|
491
|
+
c.length===0)throw new Error("enum must have non-empty array");const y=c.length>=m.opts.loopEnum;let _;const S=()=>_??(_=(0,t.useFunc)(o,r.default));let g;if(y||u)g=o.let("valid"),a.block$data(g,h);else{if(!Array.isArray(c))throw new Error("ajv implementation error");const f=o.const("vSchema",l);g=(0,e.or)(...c.map((d,v)=>p(f,v)))}a.pass(g);function h(){o.assign(g,!1),o.forOf("v",l,f=>o.if((0,e._)`${S()}(${s}, ${f})`,()=>o.assign(g,!0).break()))}function p(f,d){const v=c[d];return typeof v=="obj\
|
|
492
|
+
ect"&&v!==null?(0,e._)`${S()}(${s}, ${f}[${d}])`:(0,e._)`${s} === ${v}`}}};return Rr.default=i,Rr}var Ji;function Yi(){if(Ji)return pr;Ji=1,Object.defineProperty(pr,"__esModule",{value:!0});const e=hh(),t=mh(),r=gh(),n=vh(),i=$h(),a=_h(),o=wh(),s=bh(),u=Eh(),c=Sh(),l=[e.default,t.default,r.default,n.default,i.default,a.default,o.default,s.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,c.default];return pr.default=l,pr}var Ar={},ht={},Qi;
|
|
493
|
+
function Zi(){if(Qi)return ht;Qi=1,Object.defineProperty(ht,"__esModule",{value:!0}),ht.validateAdditionalItems=void 0;const e=ae(),t=fe(),n={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,e.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,e._)`{limit: ${a}}`},code(a){const{parentSchema:o,it:s}=a,{items:u}=o;if(!Array.isArray(u)){(0,t.checkStrictMode)(s,'"additionalItems" is ignored when "ite\
|
|
494
|
+
ms" is not an array of schemas');return}i(a,u)}};function i(a,o){const{gen:s,schema:u,data:c,keyword:l,it:m}=a;m.items=!0;const y=s.const("len",(0,e._)`${c}.length`);if(u===!1)a.setParams({len:o.length}),a.pass((0,e._)`${y} <= ${o.length}`);else if(typeof u=="object"&&!(0,t.alwaysValidSchema)(m,u)){const S=s.var("valid",(0,e._)`${y} <= ${o.length}`);s.if((0,e.not)(S),()=>_(S)),a.ok(S)}function _(S){s.forRange("i",o.length,y,g=>{a.subschema({keyword:l,dataProp:g,dataPropType:t.Type.Num},S),m.allErrors||
|
|
495
|
+
s.if((0,e.not)(S),()=>s.break())})}}return ht.validateAdditionalItems=i,ht.default=n,ht}var Pr={},mt={},ec;function tc(){if(ec)return mt;ec=1,Object.defineProperty(mt,"__esModule",{value:!0}),mt.validateTuple=void 0;const e=ae(),t=fe(),r=Ie(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:o,it:s}=a;if(Array.isArray(o))return i(a,"additionalItems",o);s.items=!0,!(0,t.alwaysValidSchema)(s,o)&&a.ok((0,r.validateArray)(a))}};function i(a,o,s=a.
|
|
496
|
+
schema){const{gen:u,parentSchema:c,data:l,keyword:m,it:y}=a;g(c),y.opts.unevaluated&&s.length&&y.items!==!0&&(y.items=t.mergeEvaluated.items(u,s.length,y.items));const _=u.name("valid"),S=u.const("len",(0,e._)`${l}.length`);s.forEach((h,p)=>{(0,t.alwaysValidSchema)(y,h)||(u.if((0,e._)`${S} > ${p}`,()=>a.subschema({keyword:m,schemaProp:p,dataProp:p},_)),a.ok(_))});function g(h){const{opts:p,errSchemaPath:f}=y,d=s.length,v=d===h.minItems&&(d===h.maxItems||h[o]===!1);if(p.strictTuples&&!v){const $=`\
|
|
497
|
+
"${m}" is ${d}-tuple, but minItems or maxItems/${o} are not specified or different at path "${f}"`;(0,t.checkStrictMode)(y,$,p.strictTuples)}}}return mt.validateTuple=i,mt.default=n,mt}var rc;function Rh(){if(rc)return Pr;rc=1,Object.defineProperty(Pr,"__esModule",{value:!0});const e=tc(),t={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,e.validateTuple)(r,"items")};return Pr.default=t,Pr}var Cr={},nc;function Ah(){if(nc)return Cr;nc=1,Object.defineProperty(
|
|
498
|
+
Cr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Ie(),n=Zi(),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,e._)`{limit: ${o}}`},code(o){const{schema:s,parentSchema:u,it:c}=o,{prefixItems:l}=u;c.items=!0,!(0,t.alwaysValidSchema)(c,s)&&(l?(0,n.validateAdditionalItems)(o,l):o.ok((0,r.validateArray)(o)))}};return Cr.default=a,Cr}var kr={},sc;function Ph(){
|
|
499
|
+
if(sc)return kr;sc=1,Object.defineProperty(kr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:a}})=>a===void 0?(0,e.str)`must contain at least ${i} valid item(s)`:(0,e.str)`must contain at least ${i} and no more than ${a} valid item(s)`,params:({params:{min:i,max:a}})=>a===void 0?(0,e._)`{minContains: ${i}}`:(0,e._)`{minContains: ${i}, maxContains: ${a}}`},code(i){
|
|
500
|
+
const{gen:a,schema:o,parentSchema:s,data:u,it:c}=i;let l,m;const{minContains:y,maxContains:_}=s;c.opts.next?(l=y===void 0?1:y,m=_):l=1;const S=a.const("len",(0,e._)`${u}.length`);if(i.setParams({min:l,max:m}),m===void 0&&l===0){(0,t.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&l>m){(0,t.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,t.alwaysValidSchema)(c,o)){let d=(0,e._)`${S} >= ${l}`;
|
|
501
|
+
m!==void 0&&(d=(0,e._)`${d} && ${S} <= ${m}`),i.pass(d);return}c.items=!0;const g=a.name("valid");m===void 0&&l===1?p(g,()=>a.if(g,()=>a.break())):l===0?(a.let(g,!0),m!==void 0&&a.if((0,e._)`${u}.length > 0`,h)):(a.let(g,!1),h()),i.result(g,()=>i.reset());function h(){const d=a.name("_valid"),v=a.let("count",0);p(d,()=>a.if(d,()=>f(v)))}function p(d,v){a.forRange("i",0,S,$=>{i.subschema({keyword:"contains",dataProp:$,dataPropType:t.Type.Num,compositeRule:!0},d),v()})}function f(d){a.code((0,e._)`${d}++`),
|
|
502
|
+
m===void 0?a.if((0,e._)`${d} >= ${l}`,()=>a.assign(g,!0).break()):(a.if((0,e._)`${d} > ${m}`,()=>a.assign(g,!1).break()),l===1?a.assign(g,!0):a.if((0,e._)`${d} >= ${l}`,()=>a.assign(g,!0)))}}};return kr.default=n,kr}var ws={},oc;function bs(){return oc||(oc=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;const t=ae(),r=fe(),n=Ie();e.error={message:({params:{property:u,depsCount:c,deps:l}})=>{const m=c===1?"property":"prop\
|
|
502
503
|
erties";return(0,t.str)`must have ${m} ${l} when property ${u} is present`},params:({params:{property:u,depsCount:c,deps:l,missingProperty:m}})=>(0,t._)`{property: ${u},
|
|
503
504
|
missingProperty: ${m},
|
|
504
505
|
depsCount: ${c},
|
|
505
|
-
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,l]=
|
|
506
|
-
u.setParams({property:S,depsCount:g.length,deps:g.join(", ")}),y.allErrors?l.if(
|
|
507
|
-
u.mergeValidEvaluated(
|
|
508
|
-
alid");
|
|
509
|
-
error:{message:"must NOT have additional properties",params:({params:
|
|
510
|
-
function
|
|
511
|
-
w);return}if(u===!1){
|
|
512
|
-
|
|
513
|
-
props!==!0&&(l.props=r.mergeEvaluated.props(
|
|
514
|
-
return
|
|
515
|
-
c.properties,g=
|
|
516
|
-
patternProperties",schemaProp:v,dataProp:$,dataPropType:n.Type.Str},g),l.opts.unevaluated&&
|
|
517
|
-
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},
|
|
518
|
-
Module",{value:!0});const e=ae(),t=fe(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:
|
|
519
|
-
reset(),()=>i.error(!0));function _(){c.forEach((S,g)=>{let
|
|
520
|
-
y",code(r){const{gen:n,schema:i,it:
|
|
521
|
-
str)`must match "${
|
|
522
|
-
se"));
|
|
523
|
-
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var gc;function vc(){if(gc)return Ar;gc=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Zi(),t=Rh(),r=tc(),n=Ah(),i=Ph(),
|
|
524
|
-
S.default,g.default,
|
|
525
|
-
default.dynamicAnchors}${(0,e.getProperty)(u)}`,y=l.errSchemaPath==="#"?l.validateName:
|
|
526
|
-
sModule",{value:!0}),gt.dynamicRef=void 0;const e=ae(),t=
|
|
527
|
-
_))}else y(c.validateName,_)()}function y(_,S){return S?()=>s.block(()=>{(0,r.callRef)(
|
|
506
|
+
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(u){const[c,l]=a(u);o(u,c),s(u,l)}};function a({schema:u}){const c={},l={};for(const m in u){if(m==="__proto__")continue;const y=Array.isArray(u[m])?c:l;y[m]=u[m]}return[c,l]}function o(u,c=u.schema){const{gen:l,data:m,it:y}=u;if(Object.keys(c).length===0)return;const _=l.let("missing");for(const S in c){const g=c[S];if(g.length===0)continue;const h=(0,n.propertyInData)(l,m,S,y.opts.ownProperties);
|
|
507
|
+
u.setParams({property:S,depsCount:g.length,deps:g.join(", ")}),y.allErrors?l.if(h,()=>{for(const p of g)(0,n.checkReportMissingProp)(u,p)}):(l.if((0,t._)`${h} && (${(0,n.checkMissingProp)(u,g,_)})`),(0,n.reportMissingProp)(u,_),l.else())}}e.validatePropertyDeps=o;function s(u,c=u.schema){const{gen:l,data:m,keyword:y,it:_}=u,S=l.name("valid");for(const g in c)(0,r.alwaysValidSchema)(_,c[g])||(l.if((0,n.propertyInData)(l,m,g,_.opts.ownProperties),()=>{const h=u.subschema({keyword:y,schemaProp:g},S);
|
|
508
|
+
u.mergeValidEvaluated(h,S)},()=>l.var(S,!0)),u.ok(S))}e.validateSchemaDeps=s,e.default=i})(ws)),ws}var Tr={},ac;function Ch(){if(ac)return Tr;ac=1,Object.defineProperty(Tr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,e._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:a,schema:o,data:s,it:u}=i;if((0,t.alwaysValidSchema)(u,o))return;const c=a.name("v\
|
|
509
|
+
alid");a.forIn("key",s,l=>{i.setParams({propertyName:l}),i.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},c),a.if((0,e.not)(c),()=>{i.error(!0),u.allErrors||a.break()})}),i.ok(c)}};return Tr.default=n,Tr}var Or={},ic;function cc(){if(ic)return Or;ic=1,Object.defineProperty(Or,"__esModule",{value:!0});const e=Ie(),t=ae(),r=Oe(),n=fe(),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,
|
|
510
|
+
error:{message:"must NOT have additional properties",params:({params:o})=>(0,t._)`{additionalProperty: ${o.additionalProperty}}`},code(o){const{gen:s,schema:u,parentSchema:c,data:l,errsCount:m,it:y}=o;if(!m)throw new Error("ajv implementation error");const{allErrors:_,opts:S}=y;if(y.props=!0,S.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(y,u))return;const g=(0,e.allSchemaProperties)(c.properties),h=(0,e.allSchemaProperties)(c.patternProperties);p(),o.ok((0,t._)`${m} === ${r.default.errors}`);
|
|
511
|
+
function p(){s.forIn("key",l,w=>{!g.length&&!h.length?v(w):s.if(f(w),()=>v(w))})}function f(w){let b;if(g.length>8){const P=(0,n.schemaRefOrVal)(y,c.properties,"properties");b=(0,e.isOwnProperty)(s,P,w)}else g.length?b=(0,t.or)(...g.map(P=>(0,t._)`${w} === ${P}`)):b=t.nil;return h.length&&(b=(0,t.or)(b,...h.map(P=>(0,t._)`${(0,e.usePattern)(o,P)}.test(${w})`))),(0,t.not)(b)}function d(w){s.code((0,t._)`delete ${l}[${w}]`)}function v(w){if(S.removeAdditional==="all"||S.removeAdditional&&u===!1){d(
|
|
512
|
+
w);return}if(u===!1){o.setParams({additionalProperty:w}),o.error(),_||s.break();return}if(typeof u=="object"&&!(0,n.alwaysValidSchema)(y,u)){const b=s.name("valid");S.removeAdditional==="failing"?($(w,b,!1),s.if((0,t.not)(b),()=>{o.reset(),d(w)})):($(w,b),_||s.if((0,t.not)(b),()=>s.break()))}}function $(w,b,P){const I={keyword:"additionalProperties",dataProp:w,dataPropType:n.Type.Str};P===!1&&Object.assign(I,{compositeRule:!0,createErrors:!1,allErrors:!1}),o.subschema(I,b)}}};return Or.default=a,
|
|
513
|
+
Or}var Nr={},uc;function kh(){if(uc)return Nr;uc=1,Object.defineProperty(Nr,"__esModule",{value:!0});const e=Nt(),t=Ie(),r=fe(),n=cc(),i={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:o,schema:s,parentSchema:u,data:c,it:l}=a;l.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(l,n.default,"additionalProperties"));const m=(0,t.allSchemaProperties)(s);for(const h of m)l.definedProperties.add(h);l.opts.unevaluated&&m.length&&l.
|
|
514
|
+
props!==!0&&(l.props=r.mergeEvaluated.props(o,(0,r.toHash)(m),l.props));const y=m.filter(h=>!(0,r.alwaysValidSchema)(l,s[h]));if(y.length===0)return;const _=o.name("valid");for(const h of y)S(h)?g(h):(o.if((0,t.propertyInData)(o,c,h,l.opts.ownProperties)),g(h),l.allErrors||o.else().var(_,!0),o.endIf()),a.it.definedProperties.add(h),a.ok(_);function S(h){return l.opts.useDefaults&&!l.compositeRule&&s[h].default!==void 0}function g(h){a.subschema({keyword:"properties",schemaProp:h,dataProp:h},_)}}};
|
|
515
|
+
return Nr.default=i,Nr}var Ir={},lc;function Th(){if(lc)return Ir;lc=1,Object.defineProperty(Ir,"__esModule",{value:!0});const e=Ie(),t=ae(),r=fe(),n=fe(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:o,schema:s,data:u,parentSchema:c,it:l}=a,{opts:m}=l,y=(0,e.allSchemaProperties)(s),_=y.filter(v=>(0,r.alwaysValidSchema)(l,s[v]));if(y.length===0||_.length===y.length&&(!l.opts.unevaluated||l.props===!0))return;const S=m.strictSchema&&!m.allowMatchingProperties&&
|
|
516
|
+
c.properties,g=o.name("valid");l.props!==!0&&!(l.props instanceof t.Name)&&(l.props=(0,n.evaluatedPropsToName)(o,l.props));const{props:h}=l;p();function p(){for(const v of y)S&&f(v),l.allErrors?d(v):(o.var(g,!0),d(v),o.if(g))}function f(v){for(const $ in S)new RegExp(v).test($)&&(0,r.checkStrictMode)(l,`property ${$} matches pattern ${v} (use allowMatchingProperties)`)}function d(v){o.forIn("key",u,$=>{o.if((0,t._)`${(0,e.usePattern)(a,v)}.test(${$})`,()=>{const w=_.includes(v);w||a.subschema({keyword:"\
|
|
517
|
+
patternProperties",schemaProp:v,dataProp:$,dataPropType:n.Type.Str},g),l.opts.unevaluated&&h!==!0?o.assign((0,t._)`${h}[${$}]`,!0):!w&&!l.allErrors&&o.if((0,t.not)(g),()=>o.break())})})}}};return Ir.default=i,Ir}var jr={},fc;function Oh(){if(fc)return jr;fc=1,Object.defineProperty(jr,"__esModule",{value:!0});const e=fe(),t={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:a}=r;if((0,e.alwaysValidSchema)(a,i)){r.fail();return}const o=n.name("valid");r.subschema(
|
|
518
|
+
{keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return jr.default=t,jr}var Lr={},dc;function Nh(){if(dc)return Lr;dc=1,Object.defineProperty(Lr,"__esModule",{value:!0});const t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:Ie().validateUnion,error:{message:"must match a schema in anyOf"}};return Lr.default=t,Lr}var Dr={},pc;function Ih(){if(pc)return Dr;pc=1,Object.defineProperty(Dr,"__es\
|
|
519
|
+
Module",{value:!0});const e=ae(),t=fe(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,e._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:a,schema:o,parentSchema:s,it:u}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(u.opts.discriminator&&s.discriminator)return;const c=o,l=a.let("valid",!1),m=a.let("passing",null),y=a.name("_valid");i.setParams({passing:m}),a.block(_),i.result(l,()=>i.
|
|
520
|
+
reset(),()=>i.error(!0));function _(){c.forEach((S,g)=>{let h;(0,t.alwaysValidSchema)(u,S)?a.var(y,!0):h=i.subschema({keyword:"oneOf",schemaProp:g,compositeRule:!0},y),g>0&&a.if((0,e._)`${y} && ${l}`).assign(l,!1).assign(m,(0,e._)`[${m}, ${g}]`).else(),a.if(y,()=>{a.assign(l,!0),a.assign(m,g),h&&i.mergeEvaluated(h,e.Name)})})}}};return Dr.default=n,Dr}var qr={},hc;function jh(){if(hc)return qr;hc=1,Object.defineProperty(qr,"__esModule",{value:!0});const e=fe(),t={keyword:"allOf",schemaType:"arra\
|
|
521
|
+
y",code(r){const{gen:n,schema:i,it:a}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((s,u)=>{if((0,e.alwaysValidSchema)(a,s))return;const c=r.subschema({keyword:"allOf",schemaProp:u},o);r.ok(o),r.mergeEvaluated(c)})}};return qr.default=t,qr}var xr={},mc;function Lh(){if(mc)return xr;mc=1,Object.defineProperty(xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,e.
|
|
522
|
+
str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,e._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:o,parentSchema:s,it:u}=a;s.then===void 0&&s.else===void 0&&(0,t.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const c=i(u,"then"),l=i(u,"else");if(!c&&!l)return;const m=o.let("valid",!0),y=o.name("_valid");if(_(),a.reset(),c&&l){const g=o.let("ifClause");a.setParams({ifClause:g}),o.if(y,S("then",g),S("else",g))}else c?o.if(y,S("then")):o.if((0,e.not)(y),S("el\
|
|
523
|
+
se"));a.pass(m,()=>a.error(!0));function _(){const g=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},y);a.mergeEvaluated(g)}function S(g,h){return()=>{const p=a.subschema({keyword:g},y);o.assign(m,y),a.mergeValidEvaluated(p,m),h?o.assign(h,(0,e._)`${g}`):a.setParams({ifClause:g})}}}};function i(a,o){const s=a.schema[o];return s!==void 0&&!(0,t.alwaysValidSchema)(a,s)}return xr.default=n,xr}var Mr={},yc;function Dh(){if(yc)return Mr;yc=1,Object.defineProperty(Mr,"__esModu\
|
|
524
|
+
le",{value:!0});const e=fe(),t={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return Mr.default=t,Mr}var gc;function vc(){if(gc)return Ar;gc=1,Object.defineProperty(Ar,"__esModule",{value:!0});const e=Zi(),t=Rh(),r=tc(),n=Ah(),i=Ph(),a=bs(),o=Ch(),s=cc(),u=kh(),c=Th(),l=Oh(),m=Nh(),y=Ih(),_=jh(),S=Lh(),g=Dh();function h(p=!1){const f=[l.default,m.default,y.default,_.default,
|
|
525
|
+
S.default,g.default,o.default,s.default,a.default,u.default,c.default];return p?f.push(t.default,n.default):f.push(e.default,r.default),f.push(i.default),f}return Ar.default=h,Ar}var Hr={},yt={},$c;function _c(){if($c)return yt;$c=1,Object.defineProperty(yt,"__esModule",{value:!0}),yt.dynamicAnchor=void 0;const e=ae(),t=Oe(),r=cr(),n=$s(),i={keyword:"$dynamicAnchor",schemaType:"string",code:s=>a(s,s.schema)};function a(s,u){const{gen:c,it:l}=s;l.schemaEnv.root.dynamicAnchors[u]=!0;const m=(0,e._)`${t.
|
|
526
|
+
default.dynamicAnchors}${(0,e.getProperty)(u)}`,y=l.errSchemaPath==="#"?l.validateName:o(s);c.if((0,e._)`!${m}`,()=>c.assign(m,y))}yt.dynamicAnchor=a;function o(s){const{schemaEnv:u,schema:c,self:l}=s.it,{root:m,baseId:y,localRefs:_,meta:S}=u.root,{schemaId:g}=l.opts,h=new r.SchemaEnv({schema:c,schemaId:g,root:m,baseId:y,localRefs:_,meta:S});return r.compileSchema.call(l,h),(0,n.getValidate)(s,h)}return yt.default=i,yt}var gt={},wc;function bc(){if(wc)return gt;wc=1,Object.defineProperty(gt,"__e\
|
|
527
|
+
sModule",{value:!0}),gt.dynamicRef=void 0;const e=ae(),t=Oe(),r=$s(),n={keyword:"$dynamicRef",schemaType:"string",code:a=>i(a,a.schema)};function i(a,o){const{gen:s,keyword:u,it:c}=a;if(o[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const l=o.slice(1);if(c.allErrors)m();else{const _=s.let("valid",!1);m(_),a.ok(_)}function m(_){if(c.schemaEnv.root.dynamicAnchors[l]){const S=s.let("_v",(0,e._)`${t.default.dynamicAnchors}${(0,e.getProperty)(l)}`);s.if(S,y(S,_),y(c.validateName,
|
|
528
|
+
_))}else y(c.validateName,_)()}function y(_,S){return S?()=>s.block(()=>{(0,r.callRef)(a,_),s.let(S,!0)}):()=>(0,r.callRef)(a,_)}}return gt.dynamicRef=i,gt.default=n,gt}var Ur={},Ec;function qh(){if(Ec)return Ur;Ec=1,Object.defineProperty(Ur,"__esModule",{value:!0});const e=_c(),t=fe(),r={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0,e.dynamicAnchor)(n,""):(0,t.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};return Ur.default=r,Ur}var Fr={},Sc;function xh(){if(Sc)
|
|
528
529
|
return Fr;Sc=1,Object.defineProperty(Fr,"__esModule",{value:!0});const e=bc(),t={keyword:"$recursiveRef",schemaType:"string",code:r=>(0,e.dynamicRef)(r,r.schema)};return Fr.default=t,Fr}var Rc;function Mh(){if(Rc)return Hr;Rc=1,Object.defineProperty(Hr,"__esModule",{value:!0});const e=_c(),t=bc(),r=qh(),n=xh(),i=[e.default,t.default,r.default,n.default];return Hr.default=i,Hr}var Vr={},zr={},Ac;function Hh(){if(Ac)return zr;Ac=1,Object.defineProperty(zr,"__esModule",{value:!0});const e=bs(),t={keyword:"\
|
|
529
530
|
dependentRequired",type:"object",schemaType:"object",error:e.error,code:r=>(0,e.validatePropertyDeps)(r)};return zr.default=t,zr}var Gr={},Pc;function Uh(){if(Pc)return Gr;Pc=1,Object.defineProperty(Gr,"__esModule",{value:!0});const e=bs(),t={keyword:"dependentSchemas",type:"object",schemaType:"object",code:r=>(0,e.validateSchemaDeps)(r)};return Gr.default=t,Gr}var Br={},Cc;function Fh(){if(Cc)return Br;Cc=1,Object.defineProperty(Br,"__esModule",{value:!0});const e=fe(),t={keyword:["maxContains",
|
|
530
|
-
"minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Br.default=t,Br}var kc;function Vh(){if(kc)return Vr;kc=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=Hh(),t=Uh(),r=Fh(),n=[e.default,t.default,r.default];return Vr.default=n,Vr}var Kr={},Wr={},Tc;function zh(){if(Tc)return Wr;Tc=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=ae(),t=fe(),r=
|
|
531
|
-
i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:
|
|
532
|
-
|
|
533
|
-
...f)}}};return Wr.default=i,Wr}var Xr={},
|
|
534
|
-
i.fail((0,e._)`${l} > ${c}`);else if(typeof
|
|
535
|
-
default];return Kr.default=r,Kr}var Jr={},Yr={},Ic;function Kh(){if(Ic)return Yr;Ic=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ae(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:
|
|
536
|
-
const
|
|
537
|
-
(0,e._)`${v}(${
|
|
538
|
-
code.formats}${(0,e.getProperty)(u)}`:void 0,
|
|
531
|
+
"minContains"],type:"array",schemaType:"number",code({keyword:r,parentSchema:n,it:i}){n.contains===void 0&&(0,e.checkStrictMode)(i,`"${r}" without "contains" is ignored`)}};return Br.default=t,Br}var kc;function Vh(){if(kc)return Vr;kc=1,Object.defineProperty(Vr,"__esModule",{value:!0});const e=Hh(),t=Uh(),r=Fh(),n=[e.default,t.default,r.default];return Vr.default=n,Vr}var Kr={},Wr={},Tc;function zh(){if(Tc)return Wr;Tc=1,Object.defineProperty(Wr,"__esModule",{value:!0});const e=ae(),t=fe(),r=Oe(),
|
|
532
|
+
i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:a})=>(0,e._)`{unevaluatedProperty: ${a.unevaluatedProperty}}`},code(a){const{gen:o,schema:s,data:u,errsCount:c,it:l}=a;if(!c)throw new Error("ajv implementation error");const{allErrors:m,props:y}=l;y instanceof e.Name?o.if((0,e._)`${y} !== true`,()=>o.forIn("key",u,h=>o.if(S(y,h),()=>_(h)))):y!==!0&&o.forIn("key",u,h=>y===void 0?_(h):
|
|
533
|
+
o.if(g(y,h),()=>_(h))),l.props=!0,a.ok((0,e._)`${c} === ${r.default.errors}`);function _(h){if(s===!1){a.setParams({unevaluatedProperty:h}),a.error(),m||o.break();return}if(!(0,t.alwaysValidSchema)(l,s)){const p=o.name("valid");a.subschema({keyword:"unevaluatedProperties",dataProp:h,dataPropType:t.Type.Str},p),m||o.if((0,e.not)(p),()=>o.break())}}function S(h,p){return(0,e._)`!${h} || !${h}[${p}]`}function g(h,p){const f=[];for(const d in h)h[d]===!0&&f.push((0,e._)`${p} !== ${d}`);return(0,e.and)(
|
|
534
|
+
...f)}}};return Wr.default=i,Wr}var Xr={},Oc;function Gh(){if(Oc)return Xr;Oc=1,Object.defineProperty(Xr,"__esModule",{value:!0});const e=ae(),t=fe(),n={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,e.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,e._)`{limit: ${i}}`},code(i){const{gen:a,schema:o,data:s,it:u}=i,c=u.items||0;if(c===!0)return;const l=a.const("len",(0,e._)`${s}.length`);if(o===!1)i.setParams({len:c}),
|
|
535
|
+
i.fail((0,e._)`${l} > ${c}`);else if(typeof o=="object"&&!(0,t.alwaysValidSchema)(u,o)){const y=a.var("valid",(0,e._)`${l} <= ${c}`);a.if((0,e.not)(y),()=>m(y,c)),i.ok(y)}u.items=!0;function m(y,_){a.forRange("i",_,l,S=>{i.subschema({keyword:"unevaluatedItems",dataProp:S,dataPropType:t.Type.Num},y),u.allErrors||a.if((0,e.not)(y),()=>a.break())})}}};return Xr.default=n,Xr}var Nc;function Bh(){if(Nc)return Kr;Nc=1,Object.defineProperty(Kr,"__esModule",{value:!0});const e=zh(),t=Gh(),r=[e.default,t.
|
|
536
|
+
default];return Kr.default=r,Kr}var Jr={},Yr={},Ic;function Kh(){if(Ic)return Yr;Ic=1,Object.defineProperty(Yr,"__esModule",{value:!0});const e=ae(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:n})=>(0,e.str)`must match format "${n}"`,params:({schemaCode:n})=>(0,e._)`{format: ${n}}`},code(n,i){const{gen:a,data:o,$data:s,schema:u,schemaCode:c,it:l}=n,{opts:m,errSchemaPath:y,schemaEnv:_,self:S}=l;if(!m.validateFormats)return;s?g():h();function g(){
|
|
537
|
+
const p=a.scopeValue("formats",{ref:S.formats,code:m.code.formats}),f=a.const("fDef",(0,e._)`${p}[${c}]`),d=a.let("fType"),v=a.let("format");a.if((0,e._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>a.assign(d,(0,e._)`${f}.type || "string"`).assign(v,(0,e._)`${f}.validate`),()=>a.assign(d,(0,e._)`"string"`).assign(v,f)),n.fail$data((0,e.or)($(),w()));function $(){return m.strictSchema===!1?e.nil:(0,e._)`${c} && !${v}`}function w(){const b=_.$async?(0,e._)`(${f}.async ? await ${v}(${o}) : ${v}(${o}))`:
|
|
538
|
+
(0,e._)`${v}(${o})`,P=(0,e._)`(typeof ${v} == "function" ? ${b} : ${v}.test(${o}))`;return(0,e._)`${v} && ${v} !== true && ${d} === ${i} && !${P}`}}function h(){const p=S.formats[u];if(!p){$();return}if(p===!0)return;const[f,d,v]=w(p);f===i&&n.pass(b());function $(){if(m.strictSchema===!1){S.logger.warn(P());return}throw new Error(P());function P(){return`unknown format "${u}" ignored in schema at path "${y}"`}}function w(P){const I=P instanceof RegExp?(0,e.regexpCode)(P):m.code.formats?(0,e._)`${m.
|
|
539
|
+
code.formats}${(0,e.getProperty)(u)}`:void 0,H=a.scopeValue("formats",{key:u,ref:P,code:I});return typeof P=="object"&&!(P instanceof RegExp)?[P.type||"string",P.validate,(0,e._)`${H}.validate`]:["string",P,H]}function b(){if(typeof p=="object"&&!(p instanceof RegExp)&&p.async){if(!_.$async)throw new Error("async format in sync schema");return(0,e._)`await ${v}(${o})`}return typeof d=="function"?(0,e._)`${v}(${o})`:(0,e._)`${v}.test(${o})`}}}};return Yr.default=r,Yr}var jc;function Lc(){if(jc)return Jr;
|
|
539
540
|
jc=1,Object.defineProperty(Jr,"__esModule",{value:!0});const t=[Kh().default];return Jr.default=t,Jr}var ot={},Dc;function qc(){return Dc||(Dc=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.contentVocabulary=ot.metadataVocabulary=void 0,ot.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],ot.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),ot}var xc;function Wh(){if(xc)return lr;xc=1,Object.defineProperty(lr,"__es\
|
|
540
|
-
Module",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Mh(),i=Vh(),
|
|
541
|
-
Qr,"__esModule",{value:!0});const e=ae(),t=Xh(),r=cr(),n=
|
|
542
|
-
equires discriminator option");const S=l.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const g=u.let("valid",!1),
|
|
543
|
-
u.elseIf((0,e._)`${
|
|
544
|
-
|
|
545
|
-
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function
|
|
541
|
+
Module",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Mh(),i=Vh(),a=Bh(),o=Lc(),s=qc(),u=[n.default,e.default,t.default,(0,r.default)(!0),o.default,s.metadataVocabulary,s.contentVocabulary,i.default,a.default];return lr.default=u,lr}var Qr={},Lt={},Mc;function Xh(){if(Mc)return Lt;Mc=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.DiscrError=void 0;var e;return(function(t){t.Tag="tag",t.Mapping="mapping"})(e||(Lt.DiscrError=e={})),Lt}var Hc;function Uc(){if(Hc)return Qr;Hc=1,Object.defineProperty(
|
|
542
|
+
Qr,"__esModule",{value:!0});const e=ae(),t=Xh(),r=cr(),n=It(),i=fe(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:s,tagName:u}})=>s===t.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:s,tag:u,tagName:c}})=>(0,e._)`{error: ${s}, tag: ${c}, tagValue: ${u}}`},code(s){const{gen:u,data:c,schema:l,parentSchema:m,it:y}=s,{oneOf:_}=m;if(!y.opts.discriminator)throw new Error("discriminator: r\
|
|
543
|
+
equires discriminator option");const S=l.propertyName;if(typeof S!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!_)throw new Error("discriminator: requires oneOf keyword");const g=u.let("valid",!1),h=u.const("tag",(0,e._)`${c}${(0,e.getProperty)(S)}`);u.if((0,e._)`typeof ${h} == "string"`,()=>p(),()=>s.error(!1,{discrError:t.DiscrError.Tag,tag:h,tagName:S})),s.ok(g);function p(){const v=d();u.if(!1);for(const $ in v)
|
|
544
|
+
u.elseIf((0,e._)`${h} === ${$}`),u.assign(g,f(v[$]));u.else(),s.error(!1,{discrError:t.DiscrError.Mapping,tag:h,tagName:S}),u.endIf()}function f(v){const $=u.name("valid"),w=s.subschema({keyword:"oneOf",schemaProp:v},$);return s.mergeEvaluated(w,e.Name),$}function d(){var v;const $={},w=P(m);let b=!0;for(let x=0;x<_.length;x++){let U=_[x];if(U?.$ref&&!(0,i.schemaHasRulesButRef)(U,y.self.RULES)){const j=U.$ref;if(U=r.resolveRef.call(y.self,y.schemaEnv.root,y.baseId,j),U instanceof r.SchemaEnv&&(U=
|
|
545
|
+
U.schema),U===void 0)throw new n.default(y.opts.uriResolver,y.baseId,j)}const L=(v=U?.properties)===null||v===void 0?void 0:v[S];if(typeof L!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${S}"`);b=b&&(w||P(U)),I(L,x)}if(!b)throw new Error(`discriminator: "${S}" must be required`);return $;function P({required:x}){return Array.isArray(x)&&x.includes(S)}function I(x,U){if(x.const)H(x.const,U);else if(x.enum)for(const L of x.enum)H(L,U);else
|
|
546
|
+
throw new Error(`discriminator: "properties/${S}" must have "const" or "enum"`)}function H(x,U){if(typeof x!="string"||x in $)throw new Error(`discriminator: "${S}" values must be unique strings`);$[x]=U}}}};return Qr.default=o,Qr}var Zr={};const Fc="https://json-schema.org/draft/2020-12/schema",Vc="https://json-schema.org/draft/2020-12/schema",zc={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020\
|
|
546
547
|
-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},Gc="meta",Bc="Core and Validation specifications meta-schema",Kc=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/c\
|
|
547
548
|
ontent"}],Wc=["object","boolean"],Xc="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Jc={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantic\
|
|
548
549
|
s.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},Jh={$schema:Fc,$id:Vc,$vocabulary:zc,$dynamicAnchor:Gc,title:Bc,allOf:Kc,type:Wc,$comment:Xc,
|
|
@@ -553,183 +554,183 @@ tps://json-schema.org/draft/2020-12/vocab/unevaluated":!0},cu="meta",uu="Unevalu
|
|
|
553
554
|
s://json-schema.org/draft/2020-12/meta/content",hu={"https://json-schema.org/draft/2020-12/vocab/content":!0},mu="meta",yu="Content vocabulary meta-schema",gu=["object","boolean"],vu={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},om={$schema:du,$id:pu,$vocabulary:hu,$dynamicAnchor:mu,title:yu,type:gu,properties:vu},am={__proto__:null,$dynamicAnchor:mu,$id:pu,$schema:du,$vocabulary:hu,default:om,properties:vu,title:yu,type:gu},im=De(am),$u="\
|
|
554
555
|
https://json-schema.org/draft/2020-12/schema",_u="https://json-schema.org/draft/2020-12/meta/core",wu={"https://json-schema.org/draft/2020-12/vocab/core":!0},bu="meta",Eu="Core vocabulary meta-schema",Su=["object","boolean"],Ru={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{
|
|
555
556
|
$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},Au={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},cm={$schema:$u,$id:_u,$vocabulary:wu,$dynamicAnchor:bu,title:Eu,type:Su,properties:Ru,$defs:Au},um={__proto__:null,
|
|
556
|
-
$defs:Au,$dynamicAnchor:bu,$id:_u,$schema:$u,$vocabulary:wu,default:cm,properties:Ru,title:Eu,type:Su},lm=De(um),Pu="https://json-schema.org/draft/2020-12/schema",Cu="https://json-schema.org/draft/2020-12/meta/format-annotation",ku={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Tu="meta",
|
|
557
|
-
dm={__proto__:null,$dynamicAnchor:Tu,$id:Cu,$schema:Pu,$vocabulary:ku,default:fm,properties:Iu,title:
|
|
557
|
+
$defs:Au,$dynamicAnchor:bu,$id:_u,$schema:$u,$vocabulary:wu,default:cm,properties:Ru,title:Eu,type:Su},lm=De(um),Pu="https://json-schema.org/draft/2020-12/schema",Cu="https://json-schema.org/draft/2020-12/meta/format-annotation",ku={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},Tu="meta",Ou="Format vocabulary meta-schema for annotation results",Nu=["object","boolean"],Iu={format:{type:"string"}},fm={$schema:Pu,$id:Cu,$vocabulary:ku,$dynamicAnchor:Tu,title:Ou,type:Nu,properties:Iu},
|
|
558
|
+
dm={__proto__:null,$dynamicAnchor:Tu,$id:Cu,$schema:Pu,$vocabulary:ku,default:fm,properties:Iu,title:Ou,type:Nu},pm=De(dm),ju="https://json-schema.org/draft/2020-12/schema",Lu="https://json-schema.org/draft/2020-12/meta/meta-data",Du={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},qu="meta",xu="Meta-data vocabulary meta-schema",Mu=["object","boolean"],Hu={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},
|
|
558
559
|
writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},hm={$schema:ju,$id:Lu,$vocabulary:Du,$dynamicAnchor:qu,title:xu,type:Mu,properties:Hu},mm={__proto__:null,$dynamicAnchor:qu,$id:Lu,$schema:ju,$vocabulary:Du,default:hm,properties:Hu,title:xu,type:Mu},ym=De(mm),Uu="https://json-schema.org/draft/2020-12/schema",Fu="https://json-schema.org/draft/2020-12/meta/validation",Vu={"https://json-schema.org/draft/2020-12/vocab/validation":!0},zu="meta",Gu="Validation vocabulary meta-sch\
|
|
559
560
|
ema",Bu=["object","boolean"],Ku={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{
|
|
560
561
|
$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},Wu={nonNegativeInteger:{type:"integ\
|
|
561
562
|
er",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},gm={$schema:Uu,$id:Fu,$vocabulary:Vu,$dynamicAnchor:zu,title:Gu,type:Bu,properties:Ku,$defs:Wu},vm={__proto__:null,$defs:Wu,$dynamicAnchor:zu,$id:Fu,$schema:Uu,$vocabulary:Vu,default:gm,properties:Ku,title:Gu,type:Bu},$m=De(vm);var Xu;function _m(){if(Xu)
|
|
562
|
-
return Zr;Xu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=Qh,t=tm,r=sm,n=im,i=lm,
|
|
563
|
-
t.Ajv2020=void 0;const r=Ii(),n=Wh(),i=Uc(),
|
|
564
|
-
return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(
|
|
565
|
-
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var m=
|
|
566
|
-
en={exports:{}},Es={},Yu;function Em(){return Yu||(Yu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(x,
|
|
563
|
+
return Zr;Xu=1,Object.defineProperty(Zr,"__esModule",{value:!0});const e=Qh,t=tm,r=sm,n=im,i=lm,a=pm,o=ym,s=$m,u=["/properties"];function c(l){return[e,t,r,n,i,m(this,a),o,m(this,s)].forEach(y=>this.addMetaSchema(y,void 0,!1)),this;function m(y,_){return l?y.$dataMetaSchema(_,u):_}}return Zr.default=c,Zr}var Ju;function wm(){return Ju||(Ju=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=
|
|
564
|
+
t.Ajv2020=void 0;const r=Ii(),n=Wh(),i=Uc(),a=_m(),o="https://json-schema.org/draft/2020-12/schema";class s extends r.default{constructor(_={}){super({..._,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),n.default.forEach(_=>this.addVocabulary(_)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:_,meta:S}=this.opts;S&&(a.default.call(this,_),this.refs["http://json-schema.org/schema"]=o)}defaultMeta(){
|
|
565
|
+
return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}}t.Ajv2020=s,e.exports=t=s,e.exports.Ajv2020=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var u=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var c=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){
|
|
566
|
+
return c.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var l=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return l.default}});var m=It();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(Zt,Zt.exports)),Zt.exports}var bm=wm(),
|
|
567
|
+
en={exports:{}},Es={},Yu;function Em(){return Yu||(Yu=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(x,U){return{validate:x,compare:U}}e.fullFormats={date:t(a,o),time:t(u(!0),c),"date-time":t(y(!0),_),"iso-time":t(u(),l),"iso-date-time":t(y(),S),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:p,"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,
|
|
567
568
|
"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,
|
|
568
569
|
email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
|
|
569
|
-
regex:
|
|
570
|
-
|
|
571
|
-
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function
|
|
572
|
-
function u(x){return function(
|
|
573
|
-
|
|
574
|
-
function
|
|
575
|
-
rn,"__esModule",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Lc(),i=qc(),
|
|
570
|
+
regex:H,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:d,int32:{type:"number",validate:w},int64:{type:"number",validate:b},float:{type:"number",validate:P},double:{type:"number",validate:P},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
571
|
+
o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,_),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,S),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
572
|
+
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(x){return x%4===0&&(x%100!==0||x%400===0)}const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(x){const U=n.exec(x);if(!U)return!1;const L=+U[1],j=+U[2],M=+U[3];return j>=1&&j<=12&&M>=1&&M<=(j===2&&r(L)?29:i[j])}function o(x,U){if(x&&U)return x>U?1:x<U?-1:0}const s=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
573
|
+
function u(x){return function(L){const j=s.exec(L);if(!j)return!1;const M=+j[1],z=+j[2],F=+j[3],G=j[4],Q=j[5]==="-"?-1:1,q=+(j[6]||0),A=+(j[7]||0);if(q>23||A>59||x&&!G)return!1;if(M<=23&&z<=59&&F<60)return!0;const D=z-A*Q,T=M-q*Q-(D<0?1:0);return(T===23||T===-1)&&(D===59||D===-1)&&F<61}}function c(x,U){if(!(x&&U))return;const L=new Date("2020-01-01T"+x).valueOf(),j=new Date("2020-01-01T"+U).valueOf();if(L&&j)return L-j}function l(x,U){if(!(x&&U))return;const L=s.exec(x),j=s.exec(U);if(L&&j)return x=
|
|
574
|
+
L[1]+L[2]+L[3],U=j[1]+j[2]+j[3],x>U?1:x<U?-1:0}const m=/t|\s/i;function y(x){const U=u(x);return function(j){const M=j.split(m);return M.length===2&&a(M[0])&&U(M[1])}}function _(x,U){if(!(x&&U))return;const L=new Date(x).valueOf(),j=new Date(U).valueOf();if(L&&j)return L-j}function S(x,U){if(!(x&&U))return;const[L,j]=x.split(m),[M,z]=U.split(m),F=o(L,M);if(F!==void 0)return F||c(j,z)}const g=/\/|:/,h=/^(?:[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;
|
|
575
|
+
function p(x){return g.test(x)&&h.test(x)}const f=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function d(x){return f.lastIndex=0,f.test(x)}const v=-2147483648,$=2**31-1;function w(x){return Number.isInteger(x)&&x<=$&&x>=v}function b(x){return Number.isInteger(x)}function P(){return!0}const I=/[^\\]\\Z/;function H(x){if(I.test(x))return!1;try{return new RegExp(x),!0}catch{return!1}}})(Es)),Es}var Ss={},tn={exports:{}},rn={},Qu;function Sm(){if(Qu)return rn;Qu=1,Object.defineProperty(
|
|
576
|
+
rn,"__esModule",{value:!0});const e=qi(),t=Yi(),r=vc(),n=Lc(),i=qc(),a=[e.default,t.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return rn.default=a,rn}const Zu="http://json-schema.org/draft-07/schema#",el="http://json-schema.org/draft-07/schema#",tl="Core schema meta-schema",rl={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
576
577
|
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},nl=["object","boolean"],sl={$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},
|
|
577
578
|
maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolea\
|
|
578
579
|
n",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"\
|
|
579
580
|
object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/def\
|
|
580
581
|
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},Rm={$schema:Zu,$id:el,title:tl,definitions:rl,type:nl,properties:sl,default:!0},Am={__proto__:null,$id:el,$schema:Zu,default:Rm,definitions:rl,properties:sl,title:tl,type:nl},Pm=De(Am);var ol;function Cm(){return ol||(ol=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const r=Ii(),n=Sm(),i=Uc(),
|
|
581
|
-
|
|
582
|
+
a=Pm,o=["/properties"],s="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach(S=>this.addVocabulary(S)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const S=this.opts.$data?this.$dataMetaSchema(a,o):a;this.addMetaSchema(S,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
582
583
|
(this.getSchema(s)?s:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var c=Nt();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var l=ae();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(t,
|
|
583
|
-
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var m=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var y=
|
|
584
|
-
Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Cm(),r=ae(),n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},
|
|
585
|
-
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:
|
|
586
|
-
f(v)))}function
|
|
587
|
-
s);e.default=
|
|
588
|
-
throw new Error(`Unknown format "${c}"`);return y};function u(c,l,m,y){var _,S;(_=(S=c.opts.code).formats)!==null&&_!==void 0||(S.formats=(0,i._)`require("ajv-formats/dist/formats").${y}`);for(const g of l)c.addFormat(g,m[g])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s})(en,en.exports)),en.exports}var
|
|
589
|
-
t,r);!jm(i,
|
|
590
|
-
${t}`,qm=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xm=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Mm=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=Dm.bind(null,n,t.toString());Object.defineProperty(i,"name",xm);const{writable:
|
|
591
|
-
t,i,r);return Lm(e,t),Mm(e,t,n),e}const cl=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:
|
|
592
|
-
void 0),
|
|
593
|
-
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rs}var As,ll;function on(){return ll||(ll=1,As=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),As}var fl;function
|
|
594
|
-
MAX_LENGTH:i}=sn(),
|
|
584
|
+
"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var m=ar();Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return m.default}});var y=It();Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return y.default}})})(tn,tn.exports)),tn.exports}var al;function km(){return al||(al=1,(function(e){
|
|
585
|
+
Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const t=Cm(),r=ae(),n=r.operators,i={formatMaximum:{okStr:"<=",ok:n.LTE,fail:n.GT},formatMinimum:{okStr:">=",ok:n.GTE,fail:n.LT},formatExclusiveMaximum:{okStr:"<",ok:n.LT,fail:n.GTE},formatExclusiveMinimum:{okStr:">",ok:n.GT,fail:n.LTE}},a={message:({keyword:s,schemaCode:u})=>(0,r.str)`should be ${i[s].okStr} ${u}`,params:({keyword:s,schemaCode:u})=>(0,r._)`{comparison: ${i[s].okStr}, limit: ${u}}`};e.formatLimitDefinition=
|
|
586
|
+
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:a,code(s){const{gen:u,data:c,schemaCode:l,keyword:m,it:y}=s,{opts:_,self:S}=y;if(!_.validateFormats)return;const g=new t.KeywordCxt(y,S.RULES.all.format.definition,"format");g.$data?h():p();function h(){const d=u.scopeValue("formats",{ref:S.formats,code:_.code.formats}),v=u.const("fmt",(0,r._)`${d}[${g.schemaCode}]`);s.fail$data((0,r.or)((0,r._)`typeof ${v} != "object"`,(0,r._)`${v} instanceof RegExp`,(0,r._)`typeof ${v}.compare != "function"`,
|
|
587
|
+
f(v)))}function p(){const d=g.schema,v=S.formats[d];if(!v||v===!0)return;if(typeof v!="object"||v instanceof RegExp||typeof v.compare!="function")throw new Error(`"${m}": format "${d}" does not define "compare" function`);const $=u.scopeValue("formats",{key:d,ref:v,code:_.code.formats?(0,r._)`${_.code.formats}${(0,r.getProperty)(d)}`:void 0});s.fail$data(f($))}function f(d){return(0,r._)`${d}.compare(${c}, ${l}) ${i[m].fail} 0`}},dependencies:["format"]};const o=s=>(s.addKeyword(e.formatLimitDefinition),
|
|
588
|
+
s);e.default=o})(Ss)),Ss}var il;function Tm(){return il||(il=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});const r=Em(),n=km(),i=ae(),a=new i.Name("fullFormats"),o=new i.Name("fastFormats"),s=(c,l={keywords:!0})=>{if(Array.isArray(l))return u(c,l,r.fullFormats,a),c;const[m,y]=l.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,a],_=l.formats||r.formatNames;return u(c,_,m,y),l.keywords&&(0,n.default)(c),c};s.get=(c,l="full")=>{const y=(l==="fast"?r.fastFormats:r.fullFormats)[c];if(!y)
|
|
589
|
+
throw new Error(`Unknown format "${c}"`);return y};function u(c,l,m,y){var _,S;(_=(S=c.opts.code).formats)!==null&&_!==void 0||(S.formats=(0,i._)`require("ajv-formats/dist/formats").${y}`);for(const g of l)c.addFormat(g,m[g])}e.exports=t=s,Object.defineProperty(t,"__esModule",{value:!0}),t.default=s})(en,en.exports)),en.exports}var Om=Tm();const Nm=mn(Om),Im=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(e,r),a=Object.getOwnPropertyDescriptor(
|
|
590
|
+
t,r);!jm(i,a)&&n||Object.defineProperty(e,r,a)},jm=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Lm=(e,t)=>{const r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},Dm=(e,t)=>`/* Wrapped ${e}*/
|
|
591
|
+
${t}`,qm=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xm=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Mm=(e,t,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=Dm.bind(null,n,t.toString());Object.defineProperty(i,"name",xm);const{writable:a,enumerable:o,configurable:s}=qm;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:o,configurable:s})};function Hm(e,t,{ignoreNonConfigurable:r=!1}={}){const{name:n}=e;for(const i of Reflect.ownKeys(t))Im(e,
|
|
592
|
+
t,i,r);return Lm(e,t),Mm(e,t,n),e}const cl=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:a=!0}=t;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!a)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,s,u;const c=function(...l){const m=this,y=()=>{o=void 0,s&&(clearTimeout(s),s=
|
|
593
|
+
void 0),a&&(u=e.apply(m,l))},_=()=>{s=void 0,o&&(clearTimeout(o),o=void 0),a&&(u=e.apply(m,l))},S=i&&!o;return clearTimeout(o),o=setTimeout(y,r),n>0&&n!==Number.POSITIVE_INFINITY&&!s&&(s=setTimeout(_,n)),S&&(u=e.apply(m,l)),u};return Hm(c,e),c.cancel=()=>{o&&(clearTimeout(o),o=void 0),s&&(clearTimeout(s),s=void 0)},c};var nn={exports:{}},Rs,ul;function sn(){if(ul)return Rs;ul=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,i=t-6;return Rs={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,
|
|
594
|
+
MAX_SAFE_BUILD_LENGTH:i,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rs}var As,ll;function on(){return ll||(ll=1,As=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),As}var fl;function Dt(){return fl||(fl=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,
|
|
595
|
+
MAX_LENGTH:i}=sn(),a=on();t=e.exports={};const o=t.re=[],s=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],l=t.t={};let m=0;const y="[a-zA-Z0-9-]",_=[["\\s",1],["\\d",i],[y,n]],S=h=>{for(const[p,f]of _)h=h.split(`${p}*`).join(`${p}{0,${f}}`).split(`${p}+`).join(`${p}{1,${f}}`);return h},g=(h,p,f)=>{const d=S(p),v=m++;a(h,v,p),l[h]=v,u[v]=p,c[v]=d,o[v]=new RegExp(p,f?"g":void 0),s[v]=new RegExp(d,f?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",
|
|
595
596
|
`\\d*[a-zA-Z-]${y}*`),g("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NONNUMERICIDENTIFIER]}|${u[l.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.
|
|
596
597
|
PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${y}+`),g("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),g("FULL",`^${u[l.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),g("LOOSE",`^${u[l.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRAN\
|
|
597
598
|
GEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),g("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}\
|
|
598
599
|
$`),g("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),g("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?(?:${u[l.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",u[l.COERCE],!0),g("COERCERTLFULL",u[l.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}\
|
|
599
600
|
$`),g("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace=
|
|
600
601
|
"$1$2$3",g("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(nn,nn.exports)),nn.exports}var Ps,dl;function Cs(){if(dl)return Ps;dl=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return Ps=n=>n?typeof n!="object"?e:n:t,Ps}var ks,pl;function hl(){if(pl)return ks;
|
|
601
|
-
pl=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const
|
|
602
|
+
pl=1;const e=/^[0-9]+$/,t=(n,i)=>{if(typeof n=="number"&&typeof i=="number")return n===i?0:n<i?-1:1;const a=e.test(n),o=e.test(i);return a&&o&&(n=+n,i=+i),n===i?0:a&&!o?-1:o&&!a?1:n<i?-1:1};return ks={compareIdentifiers:t,rcompareIdentifiers:(n,i)=>t(i,n)},ks}var Ts,ml;function Se(){if(ml)return Ts;ml=1;const e=on(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=sn(),{safeRe:n,t:i}=Dt(),a=Cs(),{compareIdentifiers:o}=hl();class s{constructor(c,l){if(l=a(l),c instanceof s){if(c.loose===!!l.loose&&c.includePrerelease===
|
|
602
603
|
!!l.includePrerelease)return c;c=c.version}else if(typeof c!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof c}".`);if(c.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",c,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const m=c.trim().match(l.loose?n[i.LOOSE]:n[i.FULL]);if(!m)throw new TypeError(`Invalid Version: ${c}`);if(this.raw=c,this.major=+m[1],this.minor=+m[2],this.patch=+m[3],this.major>
|
|
603
604
|
r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");m[4]?this.prerelease=m[4].split(".").map(y=>{if(/^[0-9]+$/.test(y)){const _=+y;if(_>=0&&_<r)return _}return y}):this.prerelease=[],this.build=m[5]?m[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=
|
|
604
605
|
`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(c){if(e("SemVer.compare",this.version,this.options,c),!(c instanceof s)){if(typeof c=="string"&&c===this.version)return 0;c=new s(c,this.options)}return c.version===this.version?0:this.compareMain(c)||this.comparePre(c)}compareMain(c){return c instanceof s||(c=new s(c,this.options)),this.major<c.major?-1:this.major>c.major?1:this.minor<c.minor?-1:this.minor>c.minor?1:this.patch<c.patch?-1:this.patch>c.patch?1:0}comparePre(c){
|
|
605
|
-
if(c instanceof s||(c=new s(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const m=this.prerelease[l],y=c.prerelease[l];if(e("prerelease compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return
|
|
606
|
-
build[l],y=c.build[l];if(e("build compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return
|
|
606
|
+
if(c instanceof s||(c=new s(c,this.options)),this.prerelease.length&&!c.prerelease.length)return-1;if(!this.prerelease.length&&c.prerelease.length)return 1;if(!this.prerelease.length&&!c.prerelease.length)return 0;let l=0;do{const m=this.prerelease[l],y=c.prerelease[l];if(e("prerelease compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return o(m,y)}while(++l)}compareBuild(c){c instanceof s||(c=new s(c,this.options));let l=0;do{const m=this.
|
|
607
|
+
build[l],y=c.build[l];if(e("build compare",l,m,y),m===void 0&&y===void 0)return 0;if(y===void 0)return 1;if(m===void 0)return-1;if(m===y)continue;return o(m,y)}while(++l)}inc(c,l,m){if(c.startsWith("pre")){if(!l&&m===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const y=`-${l}`.match(this.options.loose?n[i.PRERELEASELOOSE]:n[i.PRERELEASE]);if(!y||y[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(c){case"premajor":this.prerelease.length=0,this.patch=0,this.
|
|
607
608
|
minor=0,this.major++,this.inc("pre",l,m);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,m);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,m),this.inc("pre",l,m);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,m),this.inc("pre",l,m);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.
|
|
608
609
|
prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const y=Number(m)?1:0;if(this.prerelease.length===0)this.prerelease=[y];else{let _=this.prerelease.length;for(;--_>=0;)typeof this.prerelease[_]=="number"&&(this.prerelease[_]++,_=-2);if(_===-1){if(l===this.prerelease.
|
|
609
|
-
join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(l){let _=[l,y];m===!1&&(_=[l]),
|
|
610
|
-
e)return r;try{return new e(r,n)}catch(
|
|
611
|
-
r,i).inc(n,o
|
|
610
|
+
join(".")&&m===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(y)}}if(l){let _=[l,y];m===!1&&(_=[l]),o(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=_):this.prerelease=_}break}default:throw new Error(`invalid increment argument: ${c}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ts=s,Ts}var Os,yl;function vt(){if(yl)return Os;yl=1;const e=Se();return Os=(r,n,i=!1)=>{if(r instanceof
|
|
611
|
+
e)return r;try{return new e(r,n)}catch(a){if(!i)return null;throw a}},Os}var Ns,gl;function Um(){if(gl)return Ns;gl=1;const e=vt();return Ns=(r,n)=>{const i=e(r,n);return i?i.version:null},Ns}var Is,vl;function Fm(){if(vl)return Is;vl=1;const e=vt();return Is=(r,n)=>{const i=e(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},Is}var js,$l;function Vm(){if($l)return js;$l=1;const e=Se();return js=(r,n,i,a,o)=>{typeof i=="string"&&(o=a,a=i,i=void 0);try{return new e(r instanceof e?r.version:
|
|
612
|
+
r,i).inc(n,a,o).version}catch{return null}},js}var Ls,_l;function zm(){if(_l)return Ls;_l=1;const e=vt();return Ls=(r,n)=>{const i=e(r,null,!0),a=e(n,null,!0),o=i.compare(a);if(o===0)return null;const s=o>0,u=s?i:a,c=s?a:i,l=!!u.prerelease.length;if(!!c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(c.compareMain(u)===0)return c.minor&&!c.patch?"minor":"patch"}const y=l?"pre":"";return i.major!==a.major?y+"major":i.minor!==a.minor?y+"minor":i.patch!==a.patch?y+"patch":"prerelease"},
|
|
612
613
|
Ls}var Ds,wl;function Gm(){if(wl)return Ds;wl=1;const e=Se();return Ds=(r,n)=>new e(r,n).major,Ds}var qs,bl;function Bm(){if(bl)return qs;bl=1;const e=Se();return qs=(r,n)=>new e(r,n).minor,qs}var xs,El;function Km(){if(El)return xs;El=1;const e=Se();return xs=(r,n)=>new e(r,n).patch,xs}var Ms,Sl;function Wm(){if(Sl)return Ms;Sl=1;const e=vt();return Ms=(r,n)=>{const i=e(r,n);return i&&i.prerelease.length?i.prerelease:null},Ms}var Hs,Rl;function je(){if(Rl)return Hs;Rl=1;const e=Se();return Hs=(r,n,i)=>new e(
|
|
613
|
-
r,i).compare(new e(n,i)),Hs}var Us,Al;function Xm(){if(Al)return Us;Al=1;const e=je();return Us=(r,n,i)=>e(n,r,i),Us}var Fs,Pl;function Jm(){if(Pl)return Fs;Pl=1;const e=je();return Fs=(r,n)=>e(r,n,!0),Fs}var Vs,Cl;function zs(){if(Cl)return Vs;Cl=1;const e=Se();return Vs=(r,n,i)=>{const
|
|
614
|
-
Tl=1;const e=zs();return Bs=(r,n)=>r.sort((i,
|
|
615
|
-
r,n,i)>=0,Qs}var eo,xl;function to(){if(xl)return eo;xl=1;const e=je();return eo=(r,n,i)=>e(r,n,i)<=0,eo}var ro,Ml;function Hl(){if(Ml)return ro;Ml=1;const e=jl(),t=Dl(),r=an(),n=Zs(),i=Xs(),
|
|
616
|
-
>=":return n(s,c,l);case"<":return i(s,c,l);case"<=":return
|
|
617
|
-
|
|
618
|
-
delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const
|
|
619
|
-
void 0,this;if(this.options=z,this.loose=!!z.loose,this.includePrerelease=!!z.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&
|
|
614
|
+
r,i).compare(new e(n,i)),Hs}var Us,Al;function Xm(){if(Al)return Us;Al=1;const e=je();return Us=(r,n,i)=>e(n,r,i),Us}var Fs,Pl;function Jm(){if(Pl)return Fs;Pl=1;const e=je();return Fs=(r,n)=>e(r,n,!0),Fs}var Vs,Cl;function zs(){if(Cl)return Vs;Cl=1;const e=Se();return Vs=(r,n,i)=>{const a=new e(r,i),o=new e(n,i);return a.compare(o)||a.compareBuild(o)},Vs}var Gs,kl;function Ym(){if(kl)return Gs;kl=1;const e=zs();return Gs=(r,n)=>r.sort((i,a)=>e(i,a,n)),Gs}var Bs,Tl;function Qm(){if(Tl)return Bs;
|
|
615
|
+
Tl=1;const e=zs();return Bs=(r,n)=>r.sort((i,a)=>e(a,i,n)),Bs}var Ks,Ol;function an(){if(Ol)return Ks;Ol=1;const e=je();return Ks=(r,n,i)=>e(r,n,i)>0,Ks}var Ws,Nl;function Xs(){if(Nl)return Ws;Nl=1;const e=je();return Ws=(r,n,i)=>e(r,n,i)<0,Ws}var Js,Il;function jl(){if(Il)return Js;Il=1;const e=je();return Js=(r,n,i)=>e(r,n,i)===0,Js}var Ys,Ll;function Dl(){if(Ll)return Ys;Ll=1;const e=je();return Ys=(r,n,i)=>e(r,n,i)!==0,Ys}var Qs,ql;function Zs(){if(ql)return Qs;ql=1;const e=je();return Qs=(r,n,i)=>e(
|
|
616
|
+
r,n,i)>=0,Qs}var eo,xl;function to(){if(xl)return eo;xl=1;const e=je();return eo=(r,n,i)=>e(r,n,i)<=0,eo}var ro,Ml;function Hl(){if(Ml)return ro;Ml=1;const e=jl(),t=Dl(),r=an(),n=Zs(),i=Xs(),a=to();return ro=(s,u,c,l)=>{switch(u){case"===":return typeof s=="object"&&(s=s.version),typeof c=="object"&&(c=c.version),s===c;case"!==":return typeof s=="object"&&(s=s.version),typeof c=="object"&&(c=c.version),s!==c;case"":case"=":case"==":return e(s,c,l);case"!=":return t(s,c,l);case">":return r(s,c,l);case"\
|
|
617
|
+
>=":return n(s,c,l);case"<":return i(s,c,l);case"<=":return a(s,c,l);default:throw new TypeError(`Invalid operator: ${u}`)}},ro}var no,Ul;function Zm(){if(Ul)return no;Ul=1;const e=Se(),t=vt(),{safeRe:r,t:n}=Dt();return no=(a,o)=>{if(a instanceof e)return a;if(typeof a=="number"&&(a=String(a)),typeof a!="string")return null;o=o||{};let s=null;if(!o.rtl)s=a.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const _=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let S;for(;(S=_.exec(
|
|
618
|
+
a))&&(!s||s.index+s[0].length!==a.length);)(!s||S.index+S[0].length!==s.index+s[0].length)&&(s=S),_.lastIndex=S.index+S[1].length+S[2].length;_.lastIndex=-1}if(s===null)return null;const u=s[2],c=s[3]||"0",l=s[4]||"0",m=o.includePrerelease&&s[5]?`-${s[5]}`:"",y=o.includePrerelease&&s[6]?`+${s[6]}`:"";return t(`${u}.${c}.${l}${m}${y}`,o)},no}var so,Fl;function ey(){if(Fl)return so;Fl=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.
|
|
619
|
+
delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const a=this.map.keys().next().value;this.delete(a)}this.map.set(r,n)}return this}}return so=e,so}var oo,Vl;function Le(){if(Vl)return oo;Vl=1;const e=/\s+/g;class t{constructor(M,z){if(z=i(z),M instanceof t)return M.loose===!!z.loose&&M.includePrerelease===!!z.includePrerelease?M:new t(M.raw,z);if(M instanceof a)return this.raw=M.value,this.set=[[M]],this.formatted=
|
|
620
|
+
void 0,this;if(this.options=z,this.loose=!!z.loose,this.includePrerelease=!!z.includePrerelease,this.raw=M.trim().replace(e," "),this.set=this.raw.split("||").map(F=>this.parseRange(F.trim())).filter(F=>F.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const F=this.set[0];if(this.set=this.set.filter(G=>!g(G[0])),this.set.length===0)this.set=[F];else if(this.set.length>1){for(const G of this.set)if(G.length===1&&h(G[0])){this.set=[G];break}}}
|
|
620
621
|
this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const z=this.set[M];for(let F=0;F<z.length;F++)F>0&&(this.formatted+=" "),this.formatted+=z[F].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const F=((this.options.includePrerelease&&_)|(this.options.loose&&S))+":"+M,G=n.get(F);if(G)return G;const Q=this.options.loose,q=Q?u[c.HYPHENRANGELOOSE]:
|
|
621
|
-
u[c.HYPHENRANGE];M=M.replace(q,
|
|
622
|
-
if(g(
|
|
623
|
-
|
|
624
|
-
trim().split(/\s+/).map(z=>$(z,M)).join(" "),$=(
|
|
625
|
-
u[c.CARET],F=M.includePrerelease?"-0":"";return
|
|
626
|
-
`>=${Q}.${q}.${A}${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A} <${+Q+1}.0.0-0`),
|
|
627
|
-
0)):G==="<="&&(G="<",R?Q=+Q+1:q=+q+1),G==="<"&&(
|
|
628
|
-
d(R)?
|
|
629
|
-
zl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,m){if(m=r(m),l instanceof t){if(l.loose===!!m.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),
|
|
630
|
-
y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new s(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(
|
|
631
|
-
test(this.value):l.operator===""?l.value===""?!0:new u(this.value,m).test(l.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||
|
|
632
|
-
operator.startsWith(">")&&l.operator.startsWith("<")||
|
|
633
|
-
var uo,Kl;function ry(){if(Kl)return uo;Kl=1;const e=Se(),t=Le();return uo=(n,i,
|
|
634
|
-
1;const e=Se(),t=Le(),r=an();return fo=(i,
|
|
635
|
-
return
|
|
636
|
-
l,m,_))return!1;for(let d=0;d<m.set.length;++d){const v=m.set[d];let $=null,w=null;if(v.forEach(
|
|
637
|
-
return go=(r,n,i)=>e(r,n,"<",i),go}var vo,ef;function cy(){if(ef)return vo;ef=1;const e=Le();return vo=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),vo}var $o,tf;function uy(){if(tf)return $o;tf=1;const e=un(),t=je();return $o=(r,n,i)=>{const
|
|
638
|
-
c.push(`${y} - ${_}`):c.push(`>=${y}`);const l=c.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return l.length<m.length?l:n},$o}var _o,rf;function ly(){if(rf)return _o;rf=1;const e=Le(),t=cn(),{ANY:r}=t,n=un(),i=je(),
|
|
639
|
-
m[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;_.includePrerelease?m=
|
|
640
|
-
P,String(
|
|
641
|
-
|
|
642
|
-
v&&!p
|
|
643
|
-
P=to(),
|
|
622
|
+
u[c.HYPHENRANGE];M=M.replace(q,U(this.options.includePrerelease)),o("hyphen replace",M),M=M.replace(u[c.COMPARATORTRIM],l),o("comparator trim",M),M=M.replace(u[c.TILDETRIM],m),o("tilde trim",M),M=M.replace(u[c.CARETTRIM],y),o("caret trim",M);let A=M.split(" ").map(E=>f(E,this.options)).join(" ").split(/\s+/).map(E=>x(E,this.options));Q&&(A=A.filter(E=>(o("loose invalid filter",E,this.options),!!E.match(u[c.COMPARATORLOOSE])))),o("range list",A);const D=new Map,T=A.map(E=>new a(E,this.options));for(const E of T){
|
|
623
|
+
if(g(E))return[E];D.set(E.value,E)}D.size>1&&D.has("")&&D.delete("");const R=[...D.values()];return n.set(F,R),R}intersects(M,z){if(!(M instanceof t))throw new TypeError("a Range is required");return this.set.some(F=>p(F,z)&&M.set.some(G=>p(G,z)&&F.every(Q=>G.every(q=>Q.intersects(q,z)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new s(M,this.options)}catch{return!1}for(let z=0;z<this.set.length;z++)if(L(this.set[z],M,this.options))return!0;return!1}}oo=t;const r=ey(),n=new r,i=Cs(),a=cn(),
|
|
624
|
+
o=on(),s=Se(),{safeRe:u,t:c,comparatorTrimReplace:l,tildeTrimReplace:m,caretTrimReplace:y}=Dt(),{FLAG_INCLUDE_PRERELEASE:_,FLAG_LOOSE:S}=sn(),g=j=>j.value==="<0.0.0-0",h=j=>j.value==="",p=(j,M)=>{let z=!0;const F=j.slice();let G=F.pop();for(;z&&F.length;)z=F.every(Q=>G.intersects(Q,M)),G=F.pop();return z},f=(j,M)=>(j=j.replace(u[c.BUILD],""),o("comp",j,M),j=w(j,M),o("caret",j),j=v(j,M),o("tildes",j),j=P(j,M),o("xrange",j),j=H(j,M),o("stars",j),j),d=j=>!j||j.toLowerCase()==="x"||j==="*",v=(j,M)=>j.
|
|
625
|
+
trim().split(/\s+/).map(z=>$(z,M)).join(" "),$=(j,M)=>{const z=M.loose?u[c.TILDELOOSE]:u[c.TILDE];return j.replace(z,(F,G,Q,q,A)=>{o("tilde",j,F,G,Q,q,A);let D;return d(G)?D="":d(Q)?D=`>=${G}.0.0 <${+G+1}.0.0-0`:d(q)?D=`>=${G}.${Q}.0 <${G}.${+Q+1}.0-0`:A?(o("replaceTilde pr",A),D=`>=${G}.${Q}.${q}-${A} <${G}.${+Q+1}.0-0`):D=`>=${G}.${Q}.${q} <${G}.${+Q+1}.0-0`,o("tilde return",D),D})},w=(j,M)=>j.trim().split(/\s+/).map(z=>b(z,M)).join(" "),b=(j,M)=>{o("caret",j,M);const z=M.loose?u[c.CARETLOOSE]:
|
|
626
|
+
u[c.CARET],F=M.includePrerelease?"-0":"";return j.replace(z,(G,Q,q,A,D)=>{o("caret",j,G,Q,q,A,D);let T;return d(Q)?T="":d(q)?T=`>=${Q}.0.0${F} <${+Q+1}.0.0-0`:d(A)?Q==="0"?T=`>=${Q}.${q}.0${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.0${F} <${+Q+1}.0.0-0`:D?(o("replaceCaret pr",D),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}-${D} <${Q}.${q}.${+A+1}-0`:T=`>=${Q}.${q}.${A}-${D} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A}-${D} <${+Q+1}.0.0-0`):(o("no pr"),Q==="0"?q==="0"?T=`>=${Q}.${q}.${A}${F} <${Q}.${q}.${+A+1}-0`:T=
|
|
627
|
+
`>=${Q}.${q}.${A}${F} <${Q}.${+q+1}.0-0`:T=`>=${Q}.${q}.${A} <${+Q+1}.0.0-0`),o("caret return",T),T})},P=(j,M)=>(o("replaceXRanges",j,M),j.split(/\s+/).map(z=>I(z,M)).join(" ")),I=(j,M)=>{j=j.trim();const z=M.loose?u[c.XRANGELOOSE]:u[c.XRANGE];return j.replace(z,(F,G,Q,q,A,D)=>{o("xRange",j,F,G,Q,q,A,D);const T=d(Q),R=T||d(q),E=R||d(A),C=E;return G==="="&&C&&(G=""),D=M.includePrerelease?"-0":"",T?G===">"||G==="<"?F="<0.0.0-0":F="*":G&&C?(R&&(q=0),A=0,G===">"?(G=">=",R?(Q=+Q+1,q=0,A=0):(q=+q+1,A=
|
|
628
|
+
0)):G==="<="&&(G="<",R?Q=+Q+1:q=+q+1),G==="<"&&(D="-0"),F=`${G+Q}.${q}.${A}${D}`):R?F=`>=${Q}.0.0${D} <${+Q+1}.0.0-0`:E&&(F=`>=${Q}.${q}.0${D} <${Q}.${+q+1}.0-0`),o("xRange return",F),F})},H=(j,M)=>(o("replaceStars",j,M),j.trim().replace(u[c.STAR],"")),x=(j,M)=>(o("replaceGTE0",j,M),j.trim().replace(u[M.includePrerelease?c.GTE0PRE:c.GTE0],"")),U=j=>(M,z,F,G,Q,q,A,D,T,R,E,C)=>(d(F)?z="":d(G)?z=`>=${F}.0.0${j?"-0":""}`:d(Q)?z=`>=${F}.${G}.0${j?"-0":""}`:q?z=`>=${z}`:z=`>=${z}${j?"-0":""}`,d(T)?D="":
|
|
629
|
+
d(R)?D=`<${+T+1}.0.0-0`:d(E)?D=`<${T}.${+R+1}.0-0`:C?D=`<=${T}.${R}.${E}-${C}`:j?D=`<${T}.${R}.${+E+1}-0`:D=`<=${D}`,`${z} ${D}`.trim()),L=(j,M,z)=>{for(let F=0;F<j.length;F++)if(!j[F].test(M))return!1;if(M.prerelease.length&&!z.includePrerelease){for(let F=0;F<j.length;F++)if(o(j[F].semver),j[F].semver!==a.ANY&&j[F].semver.prerelease.length>0){const G=j[F].semver;if(G.major===M.major&&G.minor===M.minor&&G.patch===M.patch)return!0}return!1}return!0};return oo}var ao,zl;function cn(){if(zl)return ao;
|
|
630
|
+
zl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,m){if(m=r(m),l instanceof t){if(l.loose===!!m.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),o("comparator",l,m),this.options=m,this.loose=!!m.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(l){const m=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=l.match(m);if(!y)throw new TypeError(`Invalid comparator: ${l}`);this.operator=
|
|
631
|
+
y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new s(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(o("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new s(l,this.options)}catch{return!1}return a(l,this.operator,this.semver,this.options)}intersects(l,m){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(l.value,m).
|
|
632
|
+
test(this.value):l.operator===""?l.value===""?!0:new u(this.value,m).test(l.semver):(m=r(m),m.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||a(this.semver,"<",l.semver,m)&&this.
|
|
633
|
+
operator.startsWith(">")&&l.operator.startsWith("<")||a(this.semver,">",l.semver,m)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}ao=t;const r=Cs(),{safeRe:n,t:i}=Dt(),a=Hl(),o=on(),s=Se(),u=Le();return ao}var io,Gl;function un(){if(Gl)return io;Gl=1;const e=Le();return io=(r,n,i)=>{try{n=new e(n,i)}catch{return!1}return n.test(r)},io}var co,Bl;function ty(){if(Bl)return co;Bl=1;const e=Le();return co=(r,n)=>new e(r,n).set.map(i=>i.map(a=>a.value).join(" ").trim().split(" ")),co}
|
|
634
|
+
var uo,Kl;function ry(){if(Kl)return uo;Kl=1;const e=Se(),t=Le();return uo=(n,i,a)=>{let o=null,s=null,u=null;try{u=new t(i,a)}catch{return null}return n.forEach(c=>{u.test(c)&&(!o||s.compare(c)===-1)&&(o=c,s=new e(o,a))}),o},uo}var lo,Wl;function ny(){if(Wl)return lo;Wl=1;const e=Se(),t=Le();return lo=(n,i,a)=>{let o=null,s=null,u=null;try{u=new t(i,a)}catch{return null}return n.forEach(c=>{u.test(c)&&(!o||s.compare(c)===1)&&(o=c,s=new e(o,a))}),o},lo}var fo,Xl;function sy(){if(Xl)return fo;Xl=
|
|
635
|
+
1;const e=Se(),t=Le(),r=an();return fo=(i,a)=>{i=new t(i,a);let o=new e("0.0.0");if(i.test(o)||(o=new e("0.0.0-0"),i.test(o)))return o;o=null;for(let s=0;s<i.set.length;++s){const u=i.set[s];let c=null;u.forEach(l=>{const m=new e(l.semver.version);switch(l.operator){case">":m.prerelease.length===0?m.patch++:m.prerelease.push(0),m.raw=m.format();case"":case">=":(!c||r(m,c))&&(c=m);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),c&&(!o||r(o,c))&&(o=c)}
|
|
636
|
+
return o&&i.test(o)?o:null},fo}var po,Jl;function oy(){if(Jl)return po;Jl=1;const e=Le();return po=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},po}var ho,Yl;function mo(){if(Yl)return ho;Yl=1;const e=Se(),t=cn(),{ANY:r}=t,n=Le(),i=un(),a=an(),o=Xs(),s=to(),u=Zs();return ho=(l,m,y,_)=>{l=new e(l,_),m=new n(m,_);let S,g,h,p,f;switch(y){case">":S=a,g=s,h=o,p=">",f=">=";break;case"<":S=o,g=u,h=a,p="<",f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(
|
|
637
|
+
l,m,_))return!1;for(let d=0;d<m.set.length;++d){const v=m.set[d];let $=null,w=null;if(v.forEach(b=>{b.semver===r&&(b=new t(">=0.0.0")),$=$||b,w=w||b,S(b.semver,$.semver,_)?$=b:h(b.semver,w.semver,_)&&(w=b)}),$.operator===p||$.operator===f||(!w.operator||w.operator===p)&&g(l,w.semver))return!1;if(w.operator===f&&h(l,w.semver))return!1}return!0},ho}var yo,Ql;function ay(){if(Ql)return yo;Ql=1;const e=mo();return yo=(r,n,i)=>e(r,n,">",i),yo}var go,Zl;function iy(){if(Zl)return go;Zl=1;const e=mo();
|
|
638
|
+
return go=(r,n,i)=>e(r,n,"<",i),go}var vo,ef;function cy(){if(ef)return vo;ef=1;const e=Le();return vo=(r,n,i)=>(r=new e(r,i),n=new e(n,i),r.intersects(n,i)),vo}var $o,tf;function uy(){if(tf)return $o;tf=1;const e=un(),t=je();return $o=(r,n,i)=>{const a=[];let o=null,s=null;const u=r.sort((y,_)=>t(y,_,i));for(const y of u)e(y,n,i)?(s=y,o||(o=y)):(s&&a.push([o,s]),s=null,o=null);o&&a.push([o,null]);const c=[];for(const[y,_]of a)y===_?c.push(y):!_&&y===u[0]?c.push("*"):_?y===u[0]?c.push(`<=${_}`):
|
|
639
|
+
c.push(`${y} - ${_}`):c.push(`>=${y}`);const l=c.join(" || "),m=typeof n.raw=="string"?n.raw:String(n);return l.length<m.length?l:n},$o}var _o,rf;function ly(){if(rf)return _o;rf=1;const e=Le(),t=cn(),{ANY:r}=t,n=un(),i=je(),a=(m,y,_={})=>{if(m===y)return!0;m=new e(m,_),y=new e(y,_);let S=!1;e:for(const g of m.set){for(const h of y.set){const p=u(g,h,_);if(S=S||p!==null,p)continue e}if(S)return!1}return!0},o=[new t(">=0.0.0-0")],s=[new t(">=0.0.0")],u=(m,y,_)=>{if(m===y)return!0;if(m.length===1&&
|
|
640
|
+
m[0].semver===r){if(y.length===1&&y[0].semver===r)return!0;_.includePrerelease?m=o:m=s}if(y.length===1&&y[0].semver===r){if(_.includePrerelease)return!0;y=s}const S=new Set;let g,h;for(const P of m)P.operator===">"||P.operator===">="?g=c(g,P,_):P.operator==="<"||P.operator==="<="?h=l(h,P,_):S.add(P.semver);if(S.size>1)return null;let p;if(g&&h){if(p=i(g.semver,h.semver,_),p>0)return null;if(p===0&&(g.operator!==">="||h.operator!=="<="))return null}for(const P of S){if(g&&!n(P,String(g),_)||h&&!n(
|
|
641
|
+
P,String(h),_))return null;for(const I of y)if(!n(P,String(I),_))return!1;return!0}let f,d,v,$,w=h&&!_.includePrerelease&&h.semver.prerelease.length?h.semver:!1,b=g&&!_.includePrerelease&&g.semver.prerelease.length?g.semver:!1;w&&w.prerelease.length===1&&h.operator==="<"&&w.prerelease[0]===0&&(w=!1);for(const P of y){if($=$||P.operator===">"||P.operator===">=",v=v||P.operator==="<"||P.operator==="<=",g){if(b&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===b.major&&P.semver.minor===
|
|
642
|
+
b.minor&&P.semver.patch===b.patch&&(b=!1),P.operator===">"||P.operator===">="){if(f=c(g,P,_),f===P&&f!==g)return!1}else if(g.operator===">="&&!n(g.semver,String(P),_))return!1}if(h){if(w&&P.semver.prerelease&&P.semver.prerelease.length&&P.semver.major===w.major&&P.semver.minor===w.minor&&P.semver.patch===w.patch&&(w=!1),P.operator==="<"||P.operator==="<="){if(d=l(h,P,_),d===P&&d!==h)return!1}else if(h.operator==="<="&&!n(h.semver,String(P),_))return!1}if(!P.operator&&(h||g)&&p!==0)return!1}return!(g&&
|
|
643
|
+
v&&!h&&p!==0||h&&$&&!g&&p!==0||b||w)},c=(m,y,_)=>{if(!m)return y;const S=i(m.semver,y.semver,_);return S>0?m:S<0||y.operator===">"&&m.operator===">="?y:m},l=(m,y,_)=>{if(!m)return y;const S=i(m.semver,y.semver,_);return S<0?m:S>0||y.operator==="<"&&m.operator==="<="?y:m};return _o=a,_o}var wo,nf;function fy(){if(nf)return wo;nf=1;const e=Dt(),t=sn(),r=Se(),n=hl(),i=vt(),a=Um(),o=Fm(),s=Vm(),u=zm(),c=Gm(),l=Bm(),m=Km(),y=Wm(),_=je(),S=Xm(),g=Jm(),h=zs(),p=Ym(),f=Qm(),d=an(),v=Xs(),$=jl(),w=Dl(),b=Zs(),
|
|
644
|
+
P=to(),I=Hl(),H=Zm(),x=cn(),U=Le(),L=un(),j=ty(),M=ry(),z=ny(),F=sy(),G=oy(),Q=mo(),q=ay(),A=iy(),D=cy(),T=uy(),R=ly();return wo={parse:i,valid:a,clean:o,inc:s,diff:u,major:c,minor:l,patch:m,prerelease:y,compare:_,rcompare:S,compareLoose:g,compareBuild:h,sort:p,rsort:f,gt:d,lt:v,eq:$,neq:w,gte:b,lte:P,cmp:I,coerce:H,Comparator:x,Range:U,satisfies:L,toComparators:j,maxSatisfying:M,minSatisfying:z,minVersion:F,validRange:G,outside:Q,gtr:q,ltr:A,intersects:D,simplifyRange:T,subset:R,SemVer:r,re:e.re,
|
|
644
645
|
src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},wo}var bo=fy();const $t=mn(bo),dy=Object.prototype.toString,py="[object Uint8Array]",hy="[object ArrayBuffer]";function sf(e,t,r){return e?e.constructor===t?!0:dy.call(e)===r:!1}function of(e){return sf(e,Uint8Array,py)}function my(e){return sf(e,ArrayBuffer,hy)}function yy(e){return of(e)||my(e)}function gy(e){if(!of(e))throw new TypeError(
|
|
645
|
-
`Expected \`Uint8Array\`, got \`${typeof e}\``)}function vy(e){if(!yy(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function af(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,
|
|
646
|
-
"string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}const _y=new globalThis.TextEncoder;function Eo(e){return $y(e),_y.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const wy=
|
|
646
|
+
`Expected \`Uint8Array\`, got \`${typeof e}\``)}function vy(e){if(!yy(e))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function af(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,a)=>i+a.length,0);const r=new Uint8Array(t);let n=0;for(const i of e)gy(i),r.set(i,n),n+=i.length;return r}const cf={utf8:new globalThis.TextDecoder("utf8")};function uf(e,t="utf8"){return vy(e),cf[t]??=new globalThis.TextDecoder(t),cf[t].decode(e)}function $y(e){if(typeof e!=
|
|
647
|
+
"string")throw new TypeError(`Expected \`string\`, got \`${typeof e}\``)}const _y=new globalThis.TextEncoder;function Eo(e){return $y(e),_y.encode(e)}Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));const wy=Nm.default,lf="aes-256-cbc",_t=()=>Object.create(null),by=e=>e!=null,Ey=(e,t)=>{const r=new Set(["undefined","symbol","function"]),n=typeof t;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ln="_\
|
|
647
648
|
_internal__",So=`${ln}.migrations.version`;class Sy{path;events;#n;#t;#e;#r={};constructor(t={}){const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...t};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=qp(r.projectName,{suffix:r.projectSuffix}).config}if(this.#e=r,r.schema??r.ajvOptions??r.rootSchema){if(r.schema&&typeof r.schema!="object")throw new TypeError(
|
|
648
|
-
"The `schema` option must be an object.");const
|
|
649
|
-
fileExtension}`:"";this.path=ie.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.store,
|
|
650
|
-
if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(o
|
|
651
|
-
|
|
649
|
+
"The `schema` option must be an object.");const o=new bm.Ajv2020({allErrors:!0,useDefaults:!0,...r.ajvOptions});wy(o);const s={...r.rootSchema,type:"object",properties:r.schema};this.#n=o.compile(s);for(const[u,c]of Object.entries(r.schema??{}))c?.default&&(this.#r[u]=c.default)}r.defaults&&(this.#r={...this.#r,...r.defaults}),r.serialize&&(this._serialize=r.serialize),r.deserialize&&(this._deserialize=r.deserialize),this.events=new EventTarget,this.#t=r.encryptionKey;const n=r.fileExtension?`.${r.
|
|
650
|
+
fileExtension}`:"";this.path=ie.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.store,a=Object.assign(_t(),r.defaults,i);if(r.migrations){if(!r.projectVersion)throw new Error("Please specify the `projectVersion` option.");this._migrate(r.migrations,r.projectVersion,r.beforeEachMigration)}this._validate(a);try{ld.deepEqual(i,a)}catch{this.store=a}r.watch&&this._watch()}get(t,r){if(this.#e.accessPropertiesByDotNotation)return this._get(t,r);const{store:n}=this;return t in n?n[t]:r}set(t,r){
|
|
651
|
+
if(typeof t!="string"&&typeof t!="object")throw new TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof t}`);if(typeof t!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(t))throw new TypeError(`Please don't use the ${ln} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(a,o)=>{Ey(a,o),this.#e.accessPropertiesByDotNotation?Ba(n,a,o):n[a]=o};if(typeof t=="object"){const a=t;for(const[
|
|
652
|
+
o,s]of Object.entries(a))i(o,s)}else i(t,r);this.store=n}has(t){return this.#e.accessPropertiesByDotNotation?Ip(this.store,t):t in this.store}reset(...t){for(const r of t)by(this.#r[r])&&this.set(r,this.#r[r])}delete(t){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Np(r,t):delete r[t],this.store=r}clear(){this.store=_t();for(const t of Object.keys(this.#r))this.reset(t)}onDidChange(t,r){if(typeof t!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof t}`);
|
|
652
653
|
if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);return this._handleChange(()=>this.get(t),r)}onDidAnyChange(t){if(typeof t!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.store,t)}get size(){return Object.keys(this.store).length}get store(){try{const t=se.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(t),n=this._deserialize(r);return this.
|
|
653
654
|
_validate(n),Object.assign(_t(),n)}catch(t){if(t?.code==="ENOENT")return this._ensureDirectory(),_t();if(this.#e.clearInvalidConfig&&t.name==="SyntaxError")return _t();throw t}}set store(t){this._ensureDirectory(),this._validate(t),this._write(t),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[t,r]of Object.entries(this.store))yield[t,r]}_encryptData(t){if(!this.#t)return typeof t=="string"?t:uf(t);try{const r=t.slice(0,16),n=Pt.pbkdf2Sync(this.#t,r.toString(),1e4,32,
|
|
654
|
-
"sha512"),i=Pt.createDecipheriv(lf,n,r),
|
|
655
|
-
instancePath:i,message:
|
|
656
|
-
if(n?.code==="EXDEV"){se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),se.existsSync(this.path)||this._write(_t()),me.platform==="win32"?se.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):se.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(So,"0.0.0");const
|
|
657
|
-
s,i,r));let
|
|
658
|
-
!1:this.#e.accessPropertiesByDotNotation?!!t.startsWith(`${ln}.`):!1}_isVersionInRangeFormat(t){return $t.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&$t.satisfies(r,t)?!1:$t.satisfies(n,t):!($t.lte(t,r)||$t.gt(t,n))}_get(t,r){return
|
|
659
|
-
trim(),s=
|
|
655
|
+
"sha512"),i=Pt.createDecipheriv(lf,n,r),a=t.slice(17),o=typeof a=="string"?Eo(a):a;return uf(af([i.update(o),i.final()]))}catch{}return t.toString()}_handleChange(t,r){let n=t();const i=()=>{const a=n,o=t();ud(o,a)||(n=o,r.call(this,o,a))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=t=>JSON.parse(t);_serialize=t=>JSON.stringify(t,void 0," ");_validate(t){if(!this.#n||this.#n(t)||!this.#n.errors)return;const n=this.#n.errors.map(({
|
|
656
|
+
instancePath:i,message:a=""})=>`\`${i.slice(1)}\` ${a}`);throw new Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){se.mkdirSync(ie.dirname(this.path),{recursive:!0})}_write(t){let r=this._serialize(t);if(this.#t){const n=Pt.randomBytes(16),i=Pt.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),a=Pt.createCipheriv(lf,i,n);r=af([n,Eo(":"),a.update(Eo(r)),a.final()])}if(me.env.SNAP)se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Ya(this.path,r,{mode:this.#e.configFileMode})}catch(n){
|
|
657
|
+
if(n?.code==="EXDEV"){se.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}throw n}}_watch(){this._ensureDirectory(),se.existsSync(this.path)||this._write(_t()),me.platform==="win32"?se.watch(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):se.watchFile(this.path,{persistent:!1},cl(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(t,r,n){let i=this._get(So,"0.0.0");const a=Object.keys(t).filter(s=>this._shouldPerformMigration(
|
|
658
|
+
s,i,r));let o={...this.store};for(const s of a)try{n&&n(this,{fromVersion:i,toVersion:s,finalVersion:r,versions:a});const u=t[s];u?.(this),this._set(So,s),i=s,o={...this.store}}catch(u){throw this.store=o,new Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${u}`)}(this._isVersionInRangeFormat(i)||!$t.eq(i,r))&&this._set(So,r)}_containsReservedKey(t){return typeof t=="object"&&Object.keys(t)[0]===ln?!0:typeof t!="string"?
|
|
659
|
+
!1:this.#e.accessPropertiesByDotNotation?!!t.startsWith(`${ln}.`):!1}_isVersionInRangeFormat(t){return $t.clean(t)===null}_shouldPerformMigration(t,r,n){return this._isVersionInRangeFormat(t)?r!=="0.0.0"&&$t.satisfies(r,t)?!1:$t.satisfies(n,t):!($t.lte(t,r)||$t.gt(t,n))}_get(t,r){return Op(this.store,t,r)}_set(t,r){const{store:n}=this;Ba(n,t,r),this.store=n}}class ff extends Error{response;request;options;constructor(t,r,n){const i=t.status||t.status===0?t.status:"",a=t.statusText||"",o=`${i} ${a}`.
|
|
660
|
+
trim(),s=o?`status code ${o}`:"an unknown error";super(`Request failed with ${s}: ${r.method} ${r.url}`),this.name="HTTPError",this.response=t,this.request=r,this.options=n}}class df extends Error{request;constructor(t){super(`Request timed out: ${t.method} ${t.url}`),this.name="TimeoutError",this.request=t}}const pf=(()=>{let e=!1,t=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.
|
|
660
661
|
ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported BodyInit type")return!1;throw i}return e&&!t})(),Ry=typeof globalThis.AbortController=="function",Ay=typeof globalThis.AbortSignal=="function"&&typeof globalThis.AbortSignal.any=="function",Py=typeof globalThis.ReadableStream=="function",Cy=typeof globalThis.FormData=="function",hf=["get","post","put","patch","head","delete"],ky={json:"application/j\
|
|
661
|
-
son",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Ro=2147483647,Ty=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,mf=Symbol("stop"),
|
|
662
|
+
son",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Ro=2147483647,Ty=new TextEncoder().encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,mf=Symbol("stop"),Oy={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0},Ny={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,
|
|
662
663
|
window:!0,dispatcher:!0,duplex:!0,priority:!0},Iy=e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,n]of e)t+=Ty,t+=new TextEncoder().encode(`Content-Disposition: form-data; name="${r}"`).length,t+=typeof n=="string"?new TextEncoder().encode(n).length:n.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if(typeof e=="string")return new TextEncoder().encode(e).length;if(e instanceof URLSearchParams)return new TextEncoder().encode(e.toString()).
|
|
663
|
-
length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},jy=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){const
|
|
664
|
-
transferredBytes:0,totalBytes:r},new Uint8Array);async function
|
|
665
|
-
"").body.getReader();async function
|
|
666
|
-
an object");return Ao({},...e)},yf=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[o
|
|
667
|
-
let t={},r={},n={};for(const i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(
|
|
668
|
-
POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Hy=(e={})=>{if(typeof e=="number")return{...vf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...vf,...e}};async function Uy(e,t,r,n){return new Promise((i,
|
|
669
|
-
()=>{clearTimeout(
|
|
664
|
+
length;if("byteLength"in e)return e.byteLength;if(typeof e=="object"&&e!==null)try{const t=JSON.stringify(e);return new TextEncoder().encode(t).length}catch{return 0}return 0},jy=(e,t)=>{const r=Number(e.headers.get("content-length"))||0;let n=0;return e.status===204?(t&&t({percent:1,totalBytes:r,transferredBytes:n},new Uint8Array),new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new Response(new ReadableStream({async start(i){const a=e.body.getReader();t&&t({percent:0,
|
|
665
|
+
transferredBytes:0,totalBytes:r},new Uint8Array);async function o(){const{done:s,value:u}=await a.read();if(s){i.close();return}if(t){n+=u.byteLength;const c=r===0?0:n/r;t({percent:c,transferredBytes:n,totalBytes:r},u)}i.enqueue(u),await o()}await o()}}),{status:e.status,statusText:e.statusText,headers:e.headers})},Ly=(e,t)=>{const r=Iy(e.body);let n=0;return new Request(e,{duplex:"half",body:new ReadableStream({async start(i){const a=e.body instanceof ReadableStream?e.body.getReader():new Response(
|
|
666
|
+
"").body.getReader();async function o(){const{done:s,value:u}=await a.read();if(s){t&&t({percent:1,transferredBytes:n,totalBytes:Math.max(r,n)},new Uint8Array),i.close();return}n+=u.byteLength;let c=r===0?0:n/r;(r<n||c===1)&&(c=.99),t&&t({percent:Number(c.toFixed(2)),transferredBytes:n,totalBytes:r},u),i.enqueue(u),await o()}await o()}})})},qt=e=>e!==null&&typeof e=="object",fn=(...e)=>{for(const t of e)if((!qt(t)||Array.isArray(t))&&t!==void 0)throw new TypeError("The `options` argument must be\
|
|
667
|
+
an object");return Ao({},...e)},yf=(e={},t={})=>{const r=new globalThis.Headers(e),n=t instanceof globalThis.Headers,i=new globalThis.Headers(t);for(const[a,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(a):r.set(a,o);return r};function dn(e,t,r){return Object.hasOwn(t,r)&&t[r]===void 0?[]:Ao(e[r]??[],t[r]??[])}const gf=(e={},t={})=>({beforeRequest:dn(e,t,"beforeRequest"),beforeRetry:dn(e,t,"beforeRetry"),afterResponse:dn(e,t,"afterResponse"),beforeError:dn(e,t,"beforeError")}),Ao=(...e)=>{
|
|
668
|
+
let t={},r={},n={};for(const i of e)if(Array.isArray(i))Array.isArray(t)||(t=[]),t=[...t,...i];else if(qt(i)){for(let[a,o]of Object.entries(i))qt(o)&&a in t&&(o=Ao(t[a],o)),t={...t,[a]:o};qt(i.hooks)&&(n=gf(n,i.hooks),t.hooks=n),qt(i.headers)&&(r=yf(r,i.headers),t.headers=r)}return t},Dy=e=>hf.includes(e)?e.toUpperCase():e,qy=["get","put","head","delete","options","trace"],xy=[408,413,429,500,502,503,504],My=[413,429,503],vf={limit:2,methods:qy,statusCodes:xy,afterStatusCodes:My,maxRetryAfter:Number.
|
|
669
|
+
POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Hy=(e={})=>{if(typeof e=="number")return{...vf,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...vf,...e}};async function Uy(e,t,r,n){return new Promise((i,a)=>{const o=setTimeout(()=>{r&&r.abort(),a(new df(e))},n.timeout);n.fetch(e,t).then(i).catch(a).then(
|
|
670
|
+
()=>{clearTimeout(o)})})}async function Fy(e,{signal:t}){return new Promise((r,n)=>{t&&(t.throwIfAborted(),t.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(a),n(t.reason)}const a=setTimeout(()=>{t?.removeEventListener("abort",i),r()},e)})}const Vy=(e,t)=>{const r={};for(const n in t)!(n in Ny)&&!(n in Oy)&&!(n in e)&&(r[n]=t[n]);return r};class hn{static create(t,r){const n=new hn(t,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Ro)throw new RangeError(
|
|
670
671
|
`The \`timeout\` option cannot be greater than ${Ro}`);await Promise.resolve();let s=await n._fetch();for(const u of n._options.hooks.afterResponse){const c=await u(n.request,n._options,n._decorateResponse(s.clone()));c instanceof globalThis.Response&&(s=c)}if(n._decorateResponse(s),!s.ok&&n._options.throwHttpErrors){let u=new ff(s,n.request,n._options);for(const c of n._options.hooks.beforeError)u=await c(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="fun\
|
|
671
|
-
ction")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Py)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return jy(s.clone(),n._options.onDownloadProgress)}return s},
|
|
672
|
-
get("accept")||u);const c=await
|
|
672
|
+
ction")throw new TypeError("The `onDownloadProgress` option must be a function");if(!Py)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return jy(s.clone(),n._options.onDownloadProgress)}return s},o=(n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i()).finally(async()=>{n.request.bodyUsed||await n.request.body?.cancel()});for(const[s,u]of Object.entries(ky))o[s]=async()=>{n.request.headers.set("accept",n.request.headers.
|
|
673
|
+
get("accept")||u);const c=await o;if(s==="json"){if(c.status===204||(await c.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await c.text())}return c[s]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(t,r={}){if(this._input=t,this._options={...r,headers:yf(this._input.headers,r.headers),hooks:gf({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:Dy(r.method??this._input.method??"GET"),prefixUrl:String(r.
|
|
673
674
|
prefixUrl||""),retry:Hy(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&typeof this._input=="string"){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.
|
|
674
675
|
endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(Ry&&Ay){const n=this._options.signal??this._input.signal;this.abortController=new globalThis.AbortController,this._options.signal=n?AbortSignal.any([n,this.abortController.signal]):this.abortController.signal}if(pf&&(this._options.duplex="half"),this._options.json!==void 0&&(this._options.body=this._options.stringifyJson?.(this._options.json)??JSON.stringify(this._options.json),this._options.headers.
|
|
675
|
-
set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),
|
|
676
|
-
headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(
|
|
676
|
+
set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const i="?"+(typeof this._options.searchParams=="string"?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),a=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(Cy&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.
|
|
677
|
+
headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(a,{...this.request}),this._options)}if(this._options.onUploadProgress){if(typeof this._options.onUploadProgress!="function")throw new TypeError("The `onUploadProgress` option must be a function");if(!pf)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request.body&&
|
|
677
678
|
(this.request=Ly(this.request,this._options.onUploadProgress))}}_calculateRetryDelay(t){if(this._retryCount++,this._retryCount>this._options.retry.limit||t instanceof df)throw t;if(t instanceof ff){if(!this._options.retry.statusCodes.includes(t.response.status))throw t;const n=t.response.headers.get("Retry-After")??t.response.headers.get("RateLimit-Reset")??t.response.headers.get("X-RateLimit-Reset")??t.response.headers.get("X-Rate-Limit-Reset");if(n&&this._options.retry.afterStatusCodes.includes(
|
|
678
|
-
t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const
|
|
679
|
+
t.response.status)){let i=Number(n)*1e3;Number.isNaN(i)?i=Date.parse(n)-Date.now():i>=Date.parse("2024-01-01")&&(i-=Date.now());const a=this._options.retry.maxRetryAfter??i;return i<a?i:a}if(t.response.status===413)throw t}const r=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,r)}_decorateResponse(t){return this._options.parseJson&&(t.json=async()=>this._options.parseJson(await t.text())),t}async _retry(t){try{return await t()}catch(r){const n=Math.min(
|
|
679
680
|
this._calculateRetryDelay(r),Ro);if(this._retryCount<1)throw r;await Fy(n,{signal:this._options.signal});for(const i of this._options.hooks.beforeRetry)if(await i({request:this.request,options:this._options,error:r,retryCount:this._retryCount})===mf)return;return this._retry(t)}}async _fetch(){for(const n of this._options.hooks.beforeRequest){const i=await n(this.request,this._options);if(i instanceof Request){this.request=i;break}if(i instanceof Response)return i}const t=Vy(this.request,this._options),
|
|
680
681
|
r=this.request;return this.request=r.clone(),this._options.timeout===!1?this._options.fetch(r,t):Uy(r,t,this.abortController,this._options)}}const Po=e=>{const t=(r,n)=>hn.create(r,fn(e,n));for(const r of hf)t[r]=(n,i)=>hn.create(n,fn(e,i,{method:r}));return t.create=r=>Po(fn(r)),t.extend=r=>(typeof r=="function"&&(r=r(e??{})),Po(fn(e,r))),t.stop=mf,t},zy=Po(),Co=new Sy({projectName:xf,serialize:e=>lt.stringify(e,null,2),deserialize:e=>lt.parse(e)}),Gy=1e3*60*60*24,$f="check-update";function By(){
|
|
681
|
-
if(Kf||Wf===$f)return;const e=Co.get("lastUpdateCheck"),t=Co.get("latestVersion");if(Mf(t)||Hf(e)||e+Gy<Date.now())try{
|
|
682
|
-
at),
|
|
683
|
-
const r=oe(t);if(r===e.workspace)return e.languageServices.projectsManager.ensureProjectId();if(He(r)&&Ff(r).isDirectory()){Ae.debug`Project path exists: ${r}`;const n=yn.file(r.endsWith(zo)?r:r+zo),i=e.languageServices.projects().find(
|
|
684
|
-
getProject(r);return e.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var _f=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wf=e=>{throw TypeError(e)},Yy=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&wf("Object expected");var n,i;n=t[_f("asyncDispose")],n===void 0&&(n=t[_f("dispose")],i=n),typeof n!="function"&&wf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(
|
|
685
|
-
push([r,n,t])}else e.push([r]);return t},Qy=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(
|
|
686
|
-
project:n}){var i=[];try{const u=it(
|
|
687
|
-
getChild(e)}),u.stopAndLog()}catch(u){var
|
|
688
|
-
{view:u.id,projectId:s});break;case pd(u):c=i.locate({deployment:u.id,projectId:s});break;case dd(u):case fd(u):c=i.locate({relation:u.id,projectId:s});break;default:An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(
|
|
689
|
-
isArray(u)?u:[u]);const m=qe(l);
|
|
690
|
-
async function tg(e,t,r){await xe(t,{recursive:!0}),r.info(`${
|
|
691
|
-
error(`error while generating ${s.id}`,{error:u})}
|
|
692
|
-
r,m),
|
|
693
|
-
no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await eg(
|
|
694
|
-
ispose")],i=n),typeof n!="function"&&Sf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
${
|
|
699
|
-
${Ue(
|
|
700
|
-
|
|
701
|
-
${
|
|
702
|
-
${
|
|
703
|
-
`).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var
|
|
704
|
-
`+Tn.banner,footer:Tn.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:In,lib:{entry:"react/likec4.tsx",fileName(o
|
|
705
|
-
l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(o
|
|
706
|
-
"function"&&Af("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(
|
|
707
|
-
i(u)}if(r)throw t};return
|
|
708
|
-
|
|
709
|
-
has extension "${f}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await ag({languageServices:m,outDir:
|
|
710
|
-
${
|
|
711
|
-
${Ue(
|
|
712
|
-
${Ue(
|
|
713
|
-
|
|
714
|
-
${
|
|
715
|
-
${
|
|
716
|
-
`),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var
|
|
717
|
-
[r]);return t},fg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(
|
|
718
|
-
const c=Te("c4:codegen"),l=it(c),m=lg(
|
|
719
|
-
id))});let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-views.js");if(i&&(g=_n(i)?i:oe(i),He(i)&&(await wn(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);tt.debug(`${
|
|
720
|
-
ated temp public")} ${f}`);const d=await ts({languageServices:m,outDir:f,filename:
|
|
721
|
-
${
|
|
722
|
-
${Ue(
|
|
723
|
-
|
|
724
|
-
${
|
|
725
|
-
${
|
|
726
|
-
`))}catch(c){var
|
|
727
|
-
Re).option("use-core-package",Qo),async r=>{await ug({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,useCorePackage:r.useCorePackage})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:r=>r.positional("path",be).option("project",
|
|
728
|
-
await dg({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,webcomponentPrefix:r.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:r=>r.positional("path",be).option("project",
|
|
729
|
-
useCorePackage,outfile:r.outfile,project:r.project})}}).command({command:"views-data [path]",aliases:["views"],describe:"{deprecated} use codegen model",deprecated:!0,builder:r=>r.positional("path",be).option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:ct}).option("use-dot",Re),handler:async r=>{await
|
|
730
|
-
positional("path",be).option("outdir",
|
|
731
|
-
"path",be).option("outdir",
|
|
732
|
-
4 config",builder:r=>r.positional("path",be).option("project",
|
|
682
|
+
if(Kf||Wf===$f)return;const e=Co.get("lastUpdateCheck"),t=Co.get("latestVersion");if(Mf(t)||Hf(e)||e+Gy<Date.now())try{No("likec4",["check-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:$f}}).catch(()=>{})}catch{}t&&bo.gt(t,at)&&Ke(["Update available: ",N.dim(at),N.reset(" \u2192 "),N.green(t)].join(""))}async function Ky(){try{const e=await Wy();Rn(e,"No version found in latest npm"),Co.set({lastUpdateCheck:Date.now(),latestVersion:e}),bo.gt(e,at)?Ke(["Update available: ",N.dim(
|
|
683
|
+
at),N.reset(" \u2192 "),N.green(e)].join("")):Ke(N.dim("Up to date: ")+" "+N.green(at))}catch(e){Ae.error(Ht(e))}}async function Wy(){return(await zy("https://registry.npmjs.org/likec4/latest",{headers:{accept:"application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*"},keepalive:!0}).json()).version}const Xy=e=>e.command({command:"check-update",describe:"Check for updates",handler:async()=>{await Ky()}});function Jy(e,t){if(!t)return e.languageServices.projectsManager.ensureProjectId();
|
|
684
|
+
const r=oe(t);if(r===e.workspace)return e.languageServices.projectsManager.ensureProjectId();if(He(r)&&Ff(r).isDirectory()){Ae.debug`Project path exists: ${r}`;const n=yn.file(r.endsWith(zo)?r:r+zo),i=e.languageServices.projects().find(a=>a.folder.fsPath===n.fsPath);if(i)return Ae.debug`Found project ${i.id} at path: ${r}`,i.id;Ae.debug`No project registered at path: ${r}`}return e.languageServices.projectsManager.ensureProjectId(t)}function pn(e,t){const r=Jy(e,t),n=e.languageServices.projectsManager.
|
|
685
|
+
getProject(r);return e.languageServices.projectsManager.defaultProjectId=r,{projectId:r,projectFolder:n.folderUri.fsPath,config:n.config}}var _f=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wf=e=>{throw TypeError(e)},Yy=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&wf("Object expected");var n,i;n=t[_f("asyncDispose")],n===void 0&&(n=t[_f("dispose")],i=n),typeof n!="function"&&wf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.
|
|
686
|
+
push([r,n,t])}else e.push([r]);return t},Qy=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(s).then(a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()};const xt=Ae.getChild("generator");async function bf({name:e,path:t,useDotBin:r,
|
|
687
|
+
project:n}){var i=[];try{const u=it(xt),c=Yy(i,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:l,config:m}=pn(c,n);n&&xt.info(`${N.dim("project")} ${N.green(l)}`);const y=m.generators?.[e];if(!y)throw xt.error(N.red(`generator ${e} does not exist in project config`)),new Error(`generator ${e} does not exist in project config`);xt.info(`${N.dim("generator")} ${N.green(e)}`);const _=await c.layoutedModel(l);await Zy({likec4:c,model:_,generator:y,logger:xt.
|
|
688
|
+
getChild(e)}),u.stopAndLog()}catch(u){var a=u,o=!0}finally{var s=Qy(i,a,o);s&&await s}}async function Zy({likec4:e,model:t,generator:r,logger:n}){const i=e.languageServices,a=new Set,o=i.project(t.project.id),s=t.project.id;n.debug(`${N.dim("runnig for project:")} ${N.green(o.id)}`),await Promise.resolve().then(()=>r({likec4model:t,ctx:{workspace:e.languageServices.workspaceUri,project:o,locate:u=>{let c=null;switch(!0){case md(u):c=i.locate({element:u.id,projectId:s});break;case hd(u):c=i.locate(
|
|
689
|
+
{view:u.id,projectId:s});break;case pd(u):c=i.locate({deployment:u.id,projectId:s});break;case dd(u):case fd(u):c=i.locate({relation:u.id,projectId:s});break;default:An(u)}if(!c)throw n.error(`Cannot locate ${u.id}`,{target:u}),new Error(`Cannot locate ${u.id}`);const l=yn.parse(c.uri);return{range:c.range,document:l,relativePath:gn.relative(o.folder,l),folder:gn.dirname(l).fsPath,filename:gn.basename(l)}},write:async({path:u,content:c})=>{let l;yn.isUri(u)?l=u.fsPath:l=oe(o.folder.fsPath,...Array.
|
|
690
|
+
isArray(u)?u:[u]);const m=qe(l);a.has(m)||(He(m)||(n.debug(`${N.dim("create directory")} ${m}`),await xe(m,{recursive:!0})),a.add(m)),n.debug(`${N.dim("write")} ${l}`),await We(l,c)},abort:u=>{throw n.error(u||"Generator aborted"),new Error(u||"Generator aborted")}}}))}async function eg(e,t,r){t=t??oe(e.workspace,"likec4.generated.ts"),St(t)!==".ts"&&(t=t+".ts"),await xe(qe(t),{recursive:!0});const n=await e.diagrams(),i=tp([...n]);await We(t,i),r.info(`${N.dim("generated")} ${Ue(process.cwd(),t)}`)}
|
|
691
|
+
async function tg(e,t,r){await xe(t,{recursive:!0}),r.info(`${N.dim("format")} ${N.green("dot")}`),r.info(`${N.dim("outdir")} ${t}`);const n=new Set,i=e.computedModel(),a=Uo(i.$data.views);let o=0;for(const s of a)try{const u=await e.viewsService.layouter.dot({view:s,styles:i.$styles});let c=".";s.sourcePath&&(c=qe(s.sourcePath)),c=oe(t,c),n.has(c)||(await xe(c,{recursive:!0}),n.add(c));const l=oe(c,s.id+".dot");await We(l,u),r.info(`${N.dim("generated")} ${Ue(process.cwd(),l)}`),o++}catch(u){Ae.
|
|
692
|
+
error(`error while generating ${s.id}`,{error:u})}o>0&&r.info(`${N.dim("total")} ${o} files`)}async function rg(e,t,r,n){await xe(r,{recursive:!0}),n.info(`${N.dim("format")} ${N.green(t)}`),n.info(`${N.dim("outdir")} ${r}`);let i,a;switch(t){case"d2":i=".d2",a=nd;break;case"mermaid":i=".mmd",a=rd;break;case"plantuml":i=".puml",a=td;break;default:An(t)}const o=new Set,s=await e.layoutedModel();let u=0;for(const c of s.views()){const l=c.$view;try{let m=".";l.sourcePath&&(m=qe(l.sourcePath)),m=oe(
|
|
693
|
+
r,m),o.has(m)||(await xe(m,{recursive:!0}),o.add(m));const y=oe(m,l.id+i),_=a(c);await We(y,_),n.info(`${N.dim("generated")} ${Ue(process.cwd(),y)}`),u++}catch(m){n.error(`error while generating ${l.id}`,{error:m})}}u>0&&n.info(`${N.dim("total")} ${u} files`)}async function Mt({path:e,useDotBin:t,...r}){const n=Te("c4:codegen"),i=it(n),a=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm"});if(a.ensureSingleProject(),(await a.viewsService.computedViews()).length===0)throw n.warn("\
|
|
694
|
+
no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await eg(a,r.outfile,n);break}case"dot":{await tg(a,r.outdir??e,n);break}case"d2":case"mermaid":case"plantuml":{await rg(a,r.format,r.outdir??e,n);break}default:An(r)}i.stopAndLog()}var Ef=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Sf=e=>{throw TypeError(e)},ng=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Sf("Object expected");var n,i;n=t[Ef("asyncDispose")],n===void 0&&(n=t[Ef("d\
|
|
695
|
+
ispose")],i=n),typeof n!="function"&&Sf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.push([r,n,t])}else e.push([r]);return t},sg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(s).then(
|
|
696
|
+
a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()};async function og({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var a=[];try{const c=Te("c4:codegen"),l=it(c),m=ng(a,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,i);i&&c.info(`${N.dim("project")} ${N.green(y)}`),c.info(`${N.dim("format")} ${N.green("model")}`);const S=await m.layoutedModel(y);for(const d of S.views())d.hasLayoutDrifts&&c.warn(N.yellow("lay\
|
|
697
|
+
out drift detected, view:")+" "+N.red(d.id));let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-model.ts");if(n&&(g=_n(n)?n:oe(n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const h=Ft(g);c.info(`${N.dim("filename")} ${h}`);const p=St(h).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(p))throw c.error(`output file ${n} has extension "${p}"`),new Error(`output file ${n} must be a .ts, .mts or .cts file`);const f=qe(g);c.info(`${N.
|
|
698
|
+
dim("outdir")} ${f}`),await xe(f,{recursive:!0}),await We(g,Zd(S,{useCorePackage:r}),{encoding:"utf-8"}),l.stopAndLog(),Ke(vn(`
|
|
699
|
+
${N.dim("Source generated:")}
|
|
700
|
+
${Ue(Ut(),g)}
|
|
701
|
+
|
|
702
|
+
${N.dim("How to use:")}
|
|
703
|
+
${N.underline("https://likec4.dev/tooling/code-generation/model/")}
|
|
704
|
+
`).trim(),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var o=c,s=!0}finally{var u=sg(a,o,s);u&&await u}}async function ag({languageServices:e,outDir:t,filename:r="likec4-react.mjs"}){const n=Te(["vite","react"]),i=On();return n.info(`${N.cyan("likec4 app root")} ${N.dim(i)}`),n.info(N.cyan("outDir")+" "+N.dim(t)),{customLogger:n,root:i,configFile:!1,clearScreen:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:jn()},esbuild:{banner:`'use client'
|
|
705
|
+
`+Tn.banner,footer:Tn.footer,jsx:"transform",jsxDev:!1,jsxSideEffects:!1,minifyIdentifiers:!1,minifySyntax:!1,minifyWhitespace:!1,tsconfigRaw:{compilerOptions:{target:"ES2022",useDefineForClassFields:!0,verbatimModuleSyntax:!0,jsx:"react-jsx"}}},build:{outDir:t,emptyOutDir:!1,sourcemap:!1,minify:!1,copyPublicDir:!1,chunkSizeWarningLimit:In,lib:{entry:"react/likec4.tsx",fileName(a,o){return r},formats:["es"]},rollupOptions:{output:{compact:!1,exports:"named"},external:["likec4/react","likec4/mode\
|
|
706
|
+
l","react","react-dom","react/jsx-runtime","react/jsx-dev-runtime","react-dom/client",/likec4\/icons\/.*/,/@likec4\/core.*/],onwarn(a,o){a.code!=="SOURCEMAP_ERROR"&&o(a)}}},plugins:[bn({}),Sn({languageServices:e.languageServices,useOverviewGraph:!1})]}}var Rf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Af=e=>{throw TypeError(e)},ig=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Af("Object expected");var n,i;n=t[Rf("asyncDispose")],n===void 0&&(n=t[Rf("dispose")],i=n),typeof n!=
|
|
707
|
+
"function"&&Af("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.push([r,n,t])}else e.push([r]);return t},cg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(s).then(a,u=>(i(u),a()))}catch(u){
|
|
708
|
+
i(u)}if(r)throw t};return a()};async function ug({path:e,useDotBin:t,useCorePackage:r,outfile:n,project:i}){var a=[];try{await kt();const c=Te("c4:codegen"),l=it(c),m=ig(a,await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,i);i&&c.info(`${N.dim("project")} ${N.green(y)}`),c.info(`${N.dim("format")} ${N.green("react")}`);const S=await m.diagrams(y);if(S.length===0)throw process.exitCode=1,new Error("no views found");S.forEach(w=>{if(w.
|
|
709
|
+
drifts&&w.drifts.length>0){c.info(N.yellow("layout drift detected, view:")+" "+N.red(w.id));return}if(w.hasLayoutDrift){c.warn(N.yellow("drift detected, manual layout can not be applied, view:")+" "+N.red(w.id));return}});let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-views.js");if(n&&(g=_n(n)?n:oe(n),He(n)&&(await wn(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);const h=qe(g);c.info(`${N.dim("outdir")} ${h}`);const p=Ft(g);c.info(`${N.dim("filena\
|
|
710
|
+
me")} ${p}`);const f=St(p).toLocaleLowerCase();if(![".js",".mjs",".jsx"].includes(f))throw c.error(`output file ${n} has extension "${f}"`),new Error(`output file ${n} must be a .js, .jsx or .mjs`);const d=await ag({languageServices:m,outDir:h,filename:p});await At({...d,logLevel:"warn"});const v=await m.layoutedModel(y),$=oe(h,Ft(g,f)+(f===".mjs"?".d.mts":".d.ts"));await We($,rp(v,{useCorePackage:r})),l.stopAndLog(),Ke(vn(`
|
|
711
|
+
${N.dim("Sources generated:")}
|
|
712
|
+
${Ue(Ut(),g)}
|
|
713
|
+
${Ue(Ut(),$)}
|
|
714
|
+
|
|
715
|
+
${N.dim("How to use:")}
|
|
716
|
+
${N.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
717
|
+
`),{padding:1,borderColor:"green",borderStyle:"round"})}catch(c){var o=c,s=!0}finally{var u=cg(a,o,s);u&&await u}}var Pf=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Cf=e=>{throw TypeError(e)},lg=(e,t,r)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Cf("Object expected");var n,i;n=t[Pf("asyncDispose")],n===void 0&&(n=t[Pf("dispose")],i=n),typeof n!="function"&&Cf("Object not disposable"),i&&(n=function(){try{i.call(this)}catch(a){return Promise.reject(a)}}),e.push([r,n,t])}else e.push(
|
|
718
|
+
[r]);return t},fg=(e,t,r)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(o,s,u,c){return c=Error(u),c.name="SuppressedError",c.error=o,c.suppressed=s,c},i=o=>t=r?new n(o,t,"An error was suppressed during disposal"):(r=!0,o),a=o=>{for(;o=e.pop();)try{var s=o[1]&&o[1].call(o[2]);if(o[0])return Promise.resolve(s).then(a,u=>(i(u),a()))}catch(u){i(u)}if(r)throw t};return a()};async function dg({project:e,path:t,useDotBin:r,webcomponentPrefix:n="likec4",outfile:i}){var a=[];try{await kt();
|
|
719
|
+
const c=Te("c4:codegen"),l=it(c),m=lg(a,await Pe.fromWorkspace(t,{logger:"vite",graphviz:r?"binary":"wasm",watch:!1}),!0),{projectId:y,projectFolder:_}=pn(m,e);e&&c.info(`${N.dim("project")} ${N.green(y)}`),c.info(`${N.dim("format")} ${N.green("webcomponent")}`);const S=await m.diagrams(y);if(!bt(S,1))throw c.warn("no views found"),process.exitCode=1,new Error("no views found");S.forEach($=>{$.hasLayoutDrift&&c.warn(N.yellow("drift detected, manual layout can not be applied, view:")+" "+N.red($.
|
|
720
|
+
id))});let g=oe(m.projectsManager.hasMultipleProjects()?_:m.workspace,"likec4-views.js");if(i&&(g=_n(i)?i:oe(i),He(i)&&(await wn(i)).isDirectory()))throw new Error(`output file is a directory: ${i}`);tt.debug(`${N.dim("outfilepath")} ${g}`);const h=Ft(g);tt.debug(`${N.dim("filename")} ${h}`);const p=St(h).toLocaleLowerCase();if(p!==".js"&&p!==".mjs")throw tt.warn(`output file ${i} has extension "${p}"`),new Error(`output file ${i} must be a .js or .mjs`);const f=await Nn();tt.debug(`${N.dim("cre\
|
|
721
|
+
ated temp public")} ${f}`);const d=await ts({languageServices:m,outDir:f,filename:h,webcomponentPrefix:n,base:"/"});tt.debug(`${N.dim("vite build webcomponent")}`),await At({...d,logLevel:"warn"});const v=oe(f,h);if(!He(v))throw new Error(`output file not found: ${v}`);await xe(qe(g),{recursive:!0}),await Qf(v,g),c.info(`${N.dim("generated")} ${g}`),tt.debug(`${N.dim("remove temp public")}`),await Zf(f,{recursive:!0,force:!0}),l.stopAndLog(),Ke(vn(`
|
|
722
|
+
${N.dim("Webcomponents generated to:")}
|
|
723
|
+
${Ue(Ut(),g)}
|
|
724
|
+
|
|
725
|
+
${N.dim("Setup and usage instructions:")}
|
|
726
|
+
${N.blue("https://likec4.dev/tooling/code-generation/webcomponent/")}
|
|
727
|
+
`))}catch(c){var o=c,s=!0}finally{var u=fg(a,o,s);u&&await u}}const pg=e=>e.command({command:"gen <command> [path]",aliases:["generate","codegen"],describe:"Generate various artifacts from LikeC4 sources",builder:t=>t.positional("path",be).command("react [path]","generate react component to render likec4 view",r=>r.positional("path",be).option("project",Ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.jsx, .mjs or .js)",normalize:!0,coerce:ct}).option("use-dot",
|
|
728
|
+
Re).option("use-core-package",Qo),async r=>{await ug({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,useCorePackage:r.useCorePackage})}).command({command:"webcomponent [path]",aliases:["wc","webcomp"],describe:"generate js with webcomponents",builder:r=>r.positional("path",be).option("project",Ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.mjs or .js)",normalize:!0,coerce:ct}).option("webcomponent-prefix",kn).option("use-dot",Re),handler:async r=>{
|
|
729
|
+
await dg({project:r.project,useDotBin:r.useDotBin,path:r.path,outfile:r.outfile,webcomponentPrefix:r.webcomponentPrefix})}}).command({command:"model [path]",aliases:["ts"],describe:"generate LikeC4Model (.ts)",builder:r=>r.positional("path",be).option("project",Ct).option("outfile",{alias:"o",type:"string",desc:"<file> path to output file (.ts)",normalize:!0,coerce:ct}).option("use-dot",Re).option("use-core-package",Qo),handler:async r=>{await og({path:r.path,useDotBin:r.useDotBin,useCorePackage:r.
|
|
730
|
+
useCorePackage,outfile:r.outfile,project:r.project})}}).command({command:"views-data [path]",aliases:["views"],describe:"{deprecated} use codegen model",deprecated:!0,builder:r=>r.positional("path",be).option("outfile",{alias:"o",type:"string",desc:"<file> output .ts file",normalize:!0,coerce:ct}).option("use-dot",Re),handler:async r=>{await Mt({format:"views",path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).command({command:"dot [path]",describe:"generate graphviz files (.dot)",builder:r=>r.
|
|
731
|
+
positional("path",be).option("outdir",Gt).option("use-dot",Re),handler:async r=>{await Mt({format:"dot",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"d2 [path]",describe:"generate D2 files (.d2)",builder:r=>r.positional("path",be).option("outdir",Gt).option("use-dot",Re),handler:async r=>{await Mt({format:"d2",path:r.path,useDotBin:r.useDotBin,outdir:r.outdir})}}).command({command:"mermaid [path]",aliases:["mmd"],describe:"generate Mermaid files (.mmd)",builder:r=>r.positional(
|
|
732
|
+
"path",be).option("outdir",Gt).option("use-dot",Re),handler:async r=>{await Mt({format:"mermaid",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"plantuml [path]",aliases:["puml"],describe:"generate PlantUML files (.puml)",builder:r=>r.positional("path",be).option("outdir",Gt).option("use-dot",Re),handler:async r=>{await Mt({format:"plantuml",useDotBin:r.useDotBin,path:r.path,outdir:r.outdir})}}).command({command:"<custom> [path]",describe:"run custom generator from likec\
|
|
733
|
+
4 config",builder:r=>r.positional("path",be).option("project",Ct).option("use-dot",Re),handler:async r=>{await bf({name:"custom",path:r.path,project:r.project,useDotBin:r.useDotBin})}}).epilog(`${N.bold("Examples:")}
|
|
733
734
|
likec4 gen react -o dist/likec4-views.mjs ./src/likec4
|
|
734
735
|
likec4 gen model -o likec4-model.ts
|
|
735
736
|
likec4 gen ts --outfile likec4-model.ts
|
|
@@ -737,39 +738,39 @@ positional("path",be).option("outdir",zt).option("use-dot",Re),handler:async r=>
|
|
|
737
738
|
likec4 gen mmd --outdir assets/
|
|
738
739
|
likec4 gen plantuml --outdir assets/
|
|
739
740
|
likec4 gen dot -o out .
|
|
740
|
-
`),handler:async t=>{await bf({name:t.command,path:t.path,project:t.project,useDotBin:t.useDotBin})}});async function hg({path:e,useDotBin:t,outfile:r}){const n=Te("c4:export"),i=it(n),
|
|
741
|
-
"\u2713 export in ")}const mg=e=>e.command({command:"export <format> [path]",describe:"Export to images or JSON",builder:t=>t.usage(`${
|
|
742
|
-
|
|
743
|
-
array:!0,string:!0,desc:`include views with ids matching given patterns
|
|
741
|
+
`),handler:async t=>{await bf({name:t.command,path:t.path,project:t.project,useDotBin:t.useDotBin})}});async function hg({path:e,useDotBin:t,outfile:r}){const n=Te("c4:export"),i=it(n),a=await Pe.fromWorkspace(e,{logger:"vite",graphviz:t?"binary":"wasm",watch:!1});a.ensureSingleProject();const o=await a.layoutedModel();St(r)!==".json"&&(r=r+".json"),await xe(qe(r),{recursive:!0});const s=JSON.stringify(o.$data,null,2);await We(r,s),n.info(`${N.dim("generated")} ${Ue(process.cwd(),r)}`),i.stopAndLog(
|
|
742
|
+
"\u2713 export in ")}const mg=e=>e.command({command:"export <format> [path]",describe:"Export to images or JSON",builder:t=>t.usage(`${N.bold("Usage:")} $0 export <format> [path]`).positional("path",be).command({command:"png [path]",describe:"export views to PNG",builder:r=>r.options({output:{alias:["o","outdir"],type:"string",desc:"output directory, if not specified, images are saved next to sources",normalize:!0,nargs:1,coerce:oe},project:Ct,theme:{choices:["light","dark"],desc:"color-scheme t\
|
|
743
|
+
o use, defaults to light",conflicts:["dark","light"],nargs:1},dark:{type:"boolean",desc:"use dark theme, shortcut for --theme=dark",conflicts:["theme","light"]},light:{type:"boolean",desc:"use light theme, shortcut for --theme=light",conflicts:["theme","dark"]},"use-dot":Re,seq:{boolean:!0,alias:["sequence"],type:"boolean",desc:"use sequence layout for dynamic views"},flat:{alias:["flatten"],boolean:!0,type:"boolean",desc:"flatten all images in output directory ignoring sources structure"},filter:{
|
|
744
|
+
alias:"f",array:!0,string:!0,desc:`include views with ids matching given patterns
|
|
744
745
|
multiple patterns are combined with OR`},ignore:{boolean:!0,alias:"i",desc:"continue if export fails for some views"},timeout:{type:"number",alias:"t",desc:"timeout for playwright (in seconds)",default:15,nargs:1},"max-attempts":{type:"number",desc:"max attempts to export failing view, 1 means no retry",default:3,nargs:1},"server-url":{type:"string",desc:"use this url instead of starting new likec4 server",nargs:1},"chromium-sandbox":{boolean:!0,desc:"enable chromium sandbox (see Playwright docs\
|
|
745
|
-
)",default:!1}}).epilog(`${
|
|
746
|
-
${
|
|
747
|
-
${
|
|
748
|
-
|
|
749
|
-
${
|
|
750
|
-
${
|
|
751
|
-
|
|
752
|
-
${
|
|
753
|
-
${
|
|
754
|
-
|
|
755
|
-
${
|
|
756
|
-
${
|
|
757
|
-
`),handler:async r=>{Rn(r.timeout>=1,"timeout must be >= 1"),Rn(r["max-attempts"]>=1,"max-attempts must be >= 1"),await
|
|
758
|
-
builder:r=>r.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:oe}).option("use-dot",Re).epilog(`${
|
|
759
|
-
${
|
|
760
|
-
${
|
|
761
|
-
|
|
762
|
-
${
|
|
763
|
-
${
|
|
764
|
-
`),handler:async r=>{await hg({path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).updateStrings({"Commands:":
|
|
765
|
-
stdio"}).option("port",{alias:"p",number:!0,description:"enables http transport and sets the port",conflicts:"stdio"}).option("use-dot",Re).epilog(`${
|
|
766
|
-
${
|
|
767
|
-
${
|
|
768
|
-
${
|
|
769
|
-
${
|
|
770
|
-
${
|
|
771
|
-
${
|
|
772
|
-
`),handler:async t=>{t.http||t.port?await gg(t.path,t.useDot,t.port):await vg(t.path,t.useDot)}});async function gg(e,t,r=33335){await Pe.fromWorkspace(e,{mcp:{port:r},watch:!0,graphviz:t?"binary":"wasm"}),
|
|
746
|
+
)",default:!1}}).epilog(`${N.bold("Examples:")}
|
|
747
|
+
${N.green("$0 export png")}
|
|
748
|
+
${N.gray("Search for likec4 files in current directory and output PNG next to sources")}
|
|
749
|
+
|
|
750
|
+
${N.green("$0 export png --theme dark -o ./png src/likec4")}
|
|
751
|
+
${N.gray("Search for likec4 files in src/likec4 and output PNG with dark theme to png folder")}
|
|
752
|
+
|
|
753
|
+
${N.green('$0 export png -f "team1*" -f "team2*" --flat -o ./png src/likec4')}
|
|
754
|
+
${N.gray("Export views matching team1* or team2* only")}
|
|
755
|
+
|
|
756
|
+
${N.green('$0 export png -f "use-case*" --sequence src/likec4')}
|
|
757
|
+
${N.gray("Export views matching use-case* using sequence layout")}
|
|
758
|
+
`),handler:async r=>{Rn(r.timeout>=1,"timeout must be >= 1"),Rn(r["max-attempts"]>=1,"max-attempts must be >= 1"),await kt();const n=r.theme??(r.dark?"dark":"light");await Ha({path:r.path,useDotBin:r["use-dot"],output:r.output,project:r.project,timeoutMs:r.timeout*1e3,maxAttempts:r.maxAttempts,ignore:r.ignore===!0,outputType:r.flat?"flat":"relative",serverUrl:r.serverUrl,theme:n,filter:r.filter,sequence:r.seq,chromiumSandbox:r["chromium-sandbox"]})}}).command({command:"json [path]",describe:"exp\
|
|
759
|
+
ort model to JSON",builder:r=>r.option("outfile",{alias:"o",type:"string",desc:"<file> output .json file",default:"likec4.json",normalize:!0,coerce:oe}).option("use-dot",Re).epilog(`${N.bold("Examples:")}
|
|
760
|
+
${N.green("$0 export json")}
|
|
761
|
+
${N.gray("Search for likec4 files in current directory and output JSON to likec4.json")}
|
|
762
|
+
|
|
763
|
+
${N.green("$0 export json -o ./generated/likec4.json src/likec4 ")}
|
|
764
|
+
${N.gray("Search for likec4 files in src/likec4 and output JSON to generated/likec4.json")}
|
|
765
|
+
`),handler:async r=>{await hg({path:r.path,useDotBin:r.useDotBin,outfile:r.outfile})}}).updateStrings({"Commands:":N.bold("Formats:")}),handler:()=>{}}),yg=e=>e.command({command:"mcp [path]",aliases:[],describe:"Start MCP server",builder:t=>t.usage(`${N.bold("Usage:")} $0 mcp [path]`).positional("path",be).option("stdio",{boolean:!0,description:"use stdio transport",conflicts:["http","port"]}).option("http",{boolean:!0,description:"use streamable http transport (use 33335 port by default)",conflicts:"\
|
|
766
|
+
stdio"}).option("port",{alias:"p",number:!0,description:"enables http transport and sets the port",conflicts:"stdio"}).option("use-dot",Re).epilog(`${N.bold("Examples:")}
|
|
767
|
+
${N.green("$0 mcp")}
|
|
768
|
+
${N.gray("Start MCP with default stdio transport")}
|
|
769
|
+
${N.green("$0 mcp --http ./src")}
|
|
770
|
+
${N.gray("Start MCP with streamable http transport on port 33335 at ./src folder")}
|
|
771
|
+
${N.green("$0 mcp -p 1234")}
|
|
772
|
+
${N.gray("Start MCP with streamable http transport on port 1234")}
|
|
773
|
+
`),handler:async t=>{t.http||t.port?await gg(t.path,t.useDot,t.port):await vg(t.path,t.useDot)}});async function gg(e,t,r=33335){await Pe.fromWorkspace(e,{mcp:{port:r},watch:!0,graphviz:t?"binary":"wasm"}),Ke([N.green("LikeC4 MCP served at:"),`
|
|
773
774
|
{
|
|
774
775
|
"mcpServers": {
|
|
775
776
|
"likec4": {
|
|
@@ -778,17 +779,17 @@ ${j.green("$0 mcp -p 1234")}
|
|
|
778
779
|
}
|
|
779
780
|
}
|
|
780
781
|
|
|
781
|
-
${
|
|
782
|
-
${
|
|
782
|
+
${N.dim("Documentation:")}
|
|
783
|
+
${N.underline("https://likec4.dev/tooling/mcp/#using-extension")}
|
|
783
784
|
`].join(`
|
|
784
|
-
`))}async function vg(e,t){await Pe.fromWorkspace(e,{mcp:"stdio",watch:!0,graphviz:t?"binary":"wasm"})}async function $g(e){const t=await es({...e,likec4AssetsDir:"",webcomponentPrefix:void 0}),r=await ss({port:Yt(62001,62010)}),n=e?.open??!1;return await od({...t,mode:"production",preview:{host:e.listen??"127.0.0.1",allowedHosts:!0,port:r,open:n}})}async function _g({path:e,output:t,base:r,listen:n}){const i=await Pe.fromWorkspace(e,{logger:"vite",watch:!1}),
|
|
785
|
-
outputDir:t,open:!
|
|
785
|
+
`))}async function vg(e,t){await Pe.fromWorkspace(e,{mcp:"stdio",watch:!0,graphviz:t?"binary":"wasm"})}async function $g(e){const t=await es({...e,likec4AssetsDir:"",webcomponentPrefix:void 0}),r=await ss({port:Yt(62001,62010)}),n=e?.open??!1;return await od({...t,mode:"production",preview:{host:e.listen??"127.0.0.1",allowedHosts:!0,port:r,open:n}})}async function _g({path:e,output:t,base:r,listen:n}){const i=await Pe.fromWorkspace(e,{logger:"vite",watch:!1}),a=await $g({base:r,languageServices:i,
|
|
786
|
+
outputDir:t,open:!Xe(),listen:n});Na(a)}const wg=e=>e.command({command:"preview [path]",describe:"Start local server to preview production build",builder:t=>t.positional("path",{type:"string",desc:`Directory with LikeC4 source files
|
|
786
787
|
if not specified search in current directory`,normalize:!0}).options({output:{alias:"o",type:"string",desc:"output directory from production build",normalize:!0},base:{type:"string",desc:"base url the app is being served from"},listen:{alias:"l",type:"string",desc:"ip address of the network interface to listen on"}}).coerce(["path","output"],ct).default("path",ct("."),".").default("listen","127.0.0.1","localhost"),handler:async t=>{await _g(t)}});async function bg({path:e,useDotBin:t,webcomponentPrefix:r,
|
|
787
|
-
title:n,useHashHistory:i,useOverview:
|
|
788
|
-
if(bt(S,1)){const g=Te("c4:export"),
|
|
788
|
+
title:n,useHashHistory:i,useOverview:a=!1,enableWebcomponent:o=!0,enableHMR:s=!0,base:u,listen:c,port:l}){s&&(process.env.NODE_ENV="development");const m=await Pe.fromWorkspace(e,{graphviz:t?"binary":"wasm",watch:s}),y=await Vt(Et(zt(),".likec4-assets-")),_=await Da({buildWebcomponent:o,hmr:s,base:u,webcomponentPrefix:r,title:n,languageServices:m,useHashHistory:i,useOverviewGraph:a,likec4AssetsDir:y,listen:c,port:l});if(_.config.logger.clearScreen("info"),Na(_),!a)return;const S=await m.diagrams();
|
|
789
|
+
if(bt(S,1)){const g=Te("c4:export"),h=Oa(_);if(!h){g.error("no preview server url");return}g.info(N.cyan("wait 5sec before generating previews")),await Yo(5e3);try{await Ma({serverUrl:h,logger:g,views:S,theme:"light",output:y,outputType:"flat"}),await Yo(1e3),g.info(N.yellow("Note: changes in sources do not trigger preview updates, restart is required"))}catch(p){g.error(N.red("Failed to generate previews")),g.error(p)}}else _.config.logger.warn("no views found, no previews generated")}const Eg=e=>e.
|
|
789
790
|
command({command:"start [path]",aliases:["serve","dev"],describe:"Start local dev server to preview LikeC4 views",builder:t=>t.positional("path",be).option("base",ta).option("webcomponent-prefix",kn).option("title",ea).option("use-hash-history",Zo).option("use-dot",Re).option("listen",Sd).option("port",Rd).options({"react-hmr":{type:"boolean",default:!0,describe:"Enable/Disable React HMR"},"build-webcomponent":{type:"boolean",default:!0,describe:"Enable/Disable Webcomponent build"}}),handler:async t=>{
|
|
790
|
-
await
|
|
791
|
-
const c=await s.diagrams();let l=!1;for(const m of c)m.hasLayoutDrift===!0&&(l=!0,u.error(
|
|
792
|
-
gnore-layout"]})}});qo({sinks:{console:xo()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:Xf?"debug":"info"}]});async function Ag(){!
|
|
793
|
-
global:!0}).demandCommand(1,"Please run with valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":
|
|
791
|
+
await kt(),await bg({path:t.path,useDotBin:t["use-dot"],base:t.base,webcomponentPrefix:t["webcomponent-prefix"],title:t.title,useHashHistory:t["use-hash-history"],listen:t.listen,port:t.port,enableHMR:t["react-hmr"],enableWebcomponent:t["build-webcomponent"]})}});async function Sg({path:e,ignoreLayout:t}){const r=await Pe.fromWorkspace(e,{logger:"vite",watch:!1}),n=Te("c4:views");let i=a(r);return i=i&&(t||await o(r,n)),i?0:Ho(1);function a(s){return s.getErrors().length===0}async function o(s,u){
|
|
792
|
+
const c=await s.diagrams();let l=!1;for(const m of c)m.hasLayoutDrift===!0&&(l=!0,u.error(N.red(`Layout drift detected on view '${m.id}' at ${oe(e,m.sourcePath??".")}`)));return!l}}const Rg=e=>e.command({command:"validate [path]",aliases:[],describe:"Validate model syntax and manual layout",builder:t=>t.positional("path",be).option("ignore-layout",{alias:["skip-layout"],boolean:!0,default:!1,description:"do not validate layout of views"}),handler:async t=>{await Sg({path:t.path,ignoreLayout:t["i\
|
|
793
|
+
gnore-layout"]})}});qo({sinks:{console:xo()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:Xf?"debug":"info"}]});async function Ag(){!Xe()&&By(),await Fo(Jf(Yf(zf)),Eg,kp,pg,mg,wg,Rg,yg,Xy,e=>e.command({command:"completion",describe:"Generate completion script",handler:()=>{e.showCompletionScript()}})).scriptName("likec4").usage("Usage: $0 <command>").version(at).alias("v","version").alias("h","help").help("help").option("verbose",{type:"boolean",default:!1,describe:"verbose logging",
|
|
794
|
+
global:!0}).demandCommand(1,"Please run with valid command").recommendCommands().showHelpOnFail(!0).updateStrings({"Options:":N.bold("Options:"),"Positionals:":N.bold("Arguments:"),"Commands:":N.bold("Commands:"),"Examples:":N.bold("Examples:")}).wrap(jo(Gf.columns-10,{min:80,max:150})).middleware(e=>{e.verbose&&qo({sinks:{console:xo()},loggers:[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]})}).parseAsync()}Ag().catch(()=>{Ho(1)}),process.on("unhandledRejection",e=>{console.error("U\
|
|
794
795
|
nhandled rejection",e)});
|