likec4 1.24.1 → 1.25.1
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__/index.html +1 -1
- package/__app__/src/chunks/{-index-overview-u7lEihT1.js → -index-overview-CKkCSnRi.js} +4 -4
- package/__app__/src/chunks/{likec4-DRDnYFvy.js → likec4-CyM7Z_P_.js} +255 -266
- package/__app__/src/chunks/{main-CSfHpw_A.js → main-BWk4fT0y.js} +7516 -7445
- package/__app__/src/chunks/{mantine-Z8I_Wyle.js → mantine-BYP9_27v.js} +99 -96
- package/__app__/src/chunks/{tanstack-router-MjA2OK6n.js → tanstack-router-x-0typxf.js} +1 -1
- package/__app__/src/main.js +1 -1
- package/__app__/src/style.css +1 -1
- package/dist/cli/index.mjs +159 -159
- package/dist/index.d.mts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.D4N3up-s.mjs → likec4.8R_NjvKs.mjs} +1328 -1327
- package/package.json +23 -23
- package/react/index.d.ts +34 -9
- package/react/index.js +903 -842
- package/react/style.css +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{c as pt,f as Ep,m as mt,g as
|
|
3
|
-
resolve as Qe,dirname as ts,normalize as qp,relative as Up,extname as Hp,basename as Vp}from"path";import{statSync as Ka,readdirSync as zp,readFileSync as rs,writeFile as Gp}from"fs";import Ya,{format as
|
|
4
|
-
writeFile as Kt,mkdir as $t,stat as ss,copyFile as
|
|
2
|
+
import{c as pt,f as Ep,m as mt,g as Xi,a as Dp,b as Ba,T as vp,N as xa,i as $p,n as Ji,C as _p,d as wp,e as Ma,h as qa,t as Ua,p as bp,u as K,l as Ap,w as Cp,j as Sp,k as Rp,o as zt,q as Ha,r as Va,L as gt,s as Op,v as yt,x as Ip,y as Fp,z as Pp,A as dr,B as za,D as Np,E as Sr,F as Qi,G as Ga,H as Tp,Q as Lp}from"../shared/likec4.8R_NjvKs.mjs";import Te,{hrtime as jp,cwd as Zi,exit as Wa,stdout as kp,argv as Bp}from"node:process";import{strictEqual as xp,notStrictEqual as Mp}from"assert";import es,{
|
|
3
|
+
resolve as Qe,dirname as ts,normalize as qp,relative as Up,extname as Hp,basename as Vp}from"path";import{statSync as Ka,readdirSync as zp,readFileSync as rs,writeFile as Gp}from"fs";import Ya,{format as Xa,inspect as Wp}from"util";import{fileURLToPath as Kp}from"url";import be,{resolve as De,dirname as Gt,join as Rr,relative as Wt,extname as Or,isAbsolute as ns,basename as on}from"node:path";import ge,{existsSync as Pt,copyFileSync as Ja,readdirSync as Yp,rmSync as is}from"node:fs";import{mkdtemp as an,
|
|
4
|
+
writeFile as Kt,mkdir as $t,stat as ss,copyFile as Xp,rm as Jp}from"node:fs/promises";import Ir,{tmpdir as un}from"node:os";import{fileURLToPath as Qa}from"node:url";import Za from"@vitejs/plugin-react";import{sortNaturalByFqn as eu,compareNatural as Qp,hasAtLeast as Zp,invariant as os,nonexhaustive as tu,delay as ru}from"@likec4/core";import{build as Fr,createServer as em,preview as tm}from"vite";import{chromium as nu}from"playwright";import rm from"node:net";import{setTimeout as nm}from"node:timers/promises";
|
|
5
5
|
import{promisify as Me,isDeepStrictEqual as im}from"node:util";import Pr from"node:crypto";import sm from"node:assert";import"tty";import"os";import"crypto";import"net";import"child_process";import"@likec4/core/types";import"events";import"buffer";import"@hpcc-js/wasm-graphviz";import"@likec4/core/compute-view";import"@likec4/core/utils";import"boxen";import"node:child_process";import"node:events";import"node:stream/promises";import"fs/promises";import"@likec4/core/model";const om={right:dm,center:hm},
|
|
6
6
|
am=0,cn=1,um=2,ln=3;class cm{constructor(e){var r;this.width=e.width,this.wrap=(r=e.wrap)!==null&&r!==void 0?r:!0,this.rows=[]}span(...e){const r=this.div(...e);r.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);const r=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(r),r}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.
|
|
7
7
|
test(e[0])}applyLayoutDSL(e){const r=e.split(`
|
|
@@ -26,7 +26,7 @@ P,f.keys.push(O))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(
|
|
|
26
26
|
O,V[1],i,V[2]):G(V[1],V[2],!0));else if(P.match(p)&&a["boolean-negation"])V=P.match(p),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],G(F,w(F,f.arrays)?[!1]:!1));else if(P.match(/^--.+/)||!a["short-option-groups"]&&P.match(/^-[^-]+/))V=P.match(/^--?(.+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],w(F,f.arrays)?O=U(O,F,i):w(F,f.nargs)!==!1?O=I(O,F,i):(ne=i[O+1],ne!==void 0&&(!ne.match(/^-/)||ne.match(g))&&!w(F,f.bools)&&!w(F,f.counts)||/^(true|false)$/.test(ne)?(G(F,ne),O++):G(F,ae(F))));else if(P.
|
|
27
27
|
match(/^-.\..+=/))V=P.match(/^-([^=]+)=([\s\S]*)$/),V!==null&&Array.isArray(V)&&V.length>=3&&G(V[1],V[2]);else if(P.match(/^-.\..+/)&&!P.match(g))ne=i[O+1],V=P.match(/^-(.\..+)/),V!==null&&Array.isArray(V)&&V.length>=2&&(F=V[1],ne!==void 0&&!ne.match(/^-/)&&!w(F,f.bools)&&!w(F,f.counts)?(G(F,ne),O++):G(F,ae(F)));else if(P.match(/^-[^-]+/)&&!P.match(g)){re=P.slice(1,-1).split(""),W=!1;for(let we=0;we<re.length;we++){if(ne=P.slice(we+2),re[we+1]&&re[we+1]==="="){fe=P.slice(we+3),F=re[we],w(F,f.arrays)?
|
|
28
28
|
O=U(O,F,i,fe):w(F,f.nargs)!==!1?O=I(O,F,i,fe):G(F,fe),W=!0;break}if(ne==="-"){G(re[we],ne);continue}if(/[A-Za-z]/.test(re[we])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ne)&&w(ne,f.bools)===!1){G(re[we],ne),W=!0;break}if(re[we+1]&&re[we+1].match(/\W/)){G(re[we],ne),W=!0;break}else G(re[we],ae(re[we]))}F=P.slice(-1)[0],!W&&F!=="-"&&(w(F,f.arrays)?O=U(O,F,i):w(F,f.nargs)!==!1?O=I(O,F,i):(ne=i[O+1],ne!==void 0&&(!/^(-|--)[^-]/.test(ne)||ne.match(g))&&!w(F,f.bools)&&!w(F,f.counts)||/^(true|false)$/.test(ne)?
|
|
29
|
-
(G(F,ne),O++):G(F,ae(F))))}else if(P.match(/^-[0-9]$/)&&P.match(g)&&w(P.slice(1),f.bools))F=P.slice(1),G(F,ae(F));else if(P==="--"){D=i.slice(O+1);break}else if(a["halt-at-non-option"]){D=i.slice(O);break}else b(P)}z(v,!0),z(v,!1),j(v),Y(),q(v,f.aliases,u,!0),
|
|
29
|
+
(G(F,ne),O++):G(F,ae(F))))}else if(P.match(/^-[0-9]$/)&&P.match(g)&&w(P.slice(1),f.bools))F=P.slice(1),G(F,ae(F));else if(P==="--"){D=i.slice(O+1);break}else if(a["halt-at-non-option"]){D=i.slice(O);break}else b(P)}z(v,!0),z(v,!1),j(v),Y(),q(v,f.aliases,u,!0),J(v),a["set-placeholder-key"]&&se(v),Object.keys(f.counts).forEach(function(O){C(v,O.split("."))||G(O,0)}),d&&D.length&&(v[h]=[]),D.forEach(function(O){v[h].push(O)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(v).filter(O=>O!==
|
|
30
30
|
"--"&&O.includes("-")).forEach(O=>{delete v[O]}),a["strip-aliased"]&&[].concat(...Object.keys(o).map(O=>o[O])).forEach(O=>{a["camel-case-expansion"]&&O.includes("-")&&delete v[O.split(".").map(P=>Nr(P)).join(".")],delete v[O]});function b(O){const P=N("_",O);(typeof P=="string"||typeof P=="number")&&v._.push(P)}function I(O,P,ee,W){let F,re=w(P,f.nargs);if(re=typeof re!="number"||isNaN(re)?1:re,re===0)return Q(W)||(m=Error(y("Argument unexpected for: %s",P))),G(P,ae(P)),O;let V=Q(W)?0:1;if(a["na\
|
|
31
31
|
rgs-eats-options"])ee.length-(O+1)+V<re&&(m=Error(y("Not enough arguments following: %s",P))),V=re;else{for(F=O+1;F<ee.length&&(!ee[F].match(/^-[^0-9]/)||ee[F].match(g)||Z(ee[F]));F++)V++;V<re&&(m=Error(y("Not enough arguments following: %s",P)))}let ne=Math.min(V,re);for(!Q(W)&&ne>0&&(G(P,W),ne--),F=O+1;F<ne+O+1;F++)G(P,ee[F]);return O+ne}function U(O,P,ee,W){let F=[],re=W||ee[O+1];const V=w(P,f.nargs);if(w(P,f.bools)&&!/^(true|false)$/.test(re))F.push(!0);else if(Q(re)||Q(W)&&/^-/.test(re)&&!g.
|
|
32
32
|
test(re)&&!Z(re)){if(u[P]!==void 0){const ne=u[P];F=Array.isArray(ne)?ne:[ne]}}else{Q(W)||F.push(B(P,W,!0));for(let ne=O+1;ne<ee.length&&!(!a["greedy-arrays"]&&F.length>0||V&&typeof V=="number"&&F.length>=V||(re=ee[ne],/^-/.test(re)&&!g.test(re)&&!Z(re)));ne++)O=ne,F.push(B(P,re,s))}return typeof V=="number"&&(V&&F.length<V||isNaN(V)&&F.length===0)&&(m=Error(y("Not enough arguments following: %s",P))),G(P,F),O}function G(O,P,ee=s){if(/-/.test(O)&&a["camel-case-expansion"]){const re=O.split(".").
|
|
@@ -34,18 +34,18 @@ map(function(V){return Nr(V)}).join(".");L(O,re)}const W=B(O,P,ee),F=O.split("."
|
|
|
34
34
|
set(ne){P=typeof ne=="string"?_t.normalize(ne):ne}})})}function L(O,P){f.aliases[O]&&f.aliases[O].length||(f.aliases[O]=[P],E[P]=!0),f.aliases[P]&&f.aliases[P].length||L(P,O)}function B(O,P,ee){ee&&(P=$m(P)),(w(O,f.bools)||w(O,f.counts))&&typeof P=="string"&&(P=P==="true");let W=Array.isArray(P)?P.map(function(F){return N(O,F)}):N(O,P);return w(O,f.counts)&&(Q(W)||typeof W=="boolean")&&(W=as()),w(O,f.normalize)&&w(O,f.arrays)&&(Array.isArray(P)?W=P.map(F=>_t.normalize(F)):W=_t.normalize(P)),W}function N(O,P){
|
|
35
35
|
return!a["parse-positional-numbers"]&&O==="_"||!w(O,f.strings)&&!w(O,f.bools)&&!Array.isArray(P)&&(uu(P)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${P}`)))||!Q(P)&&w(O,f.numbers))&&(P=Number(P)),P}function j(O){const P=Object.create(null);q(P,f.aliases,u),Object.keys(f.configs).forEach(function(ee){const W=O[ee]||P[ee];if(W)try{let F=null;const re=_t.resolve(_t.cwd(),W),V=f.configs[ee];if(typeof V=="function"){try{F=V(re)}catch(ne){F=ne}if(F instanceof Error){m=F;return}}else
|
|
36
36
|
F=_t.require(re);M(F)}catch(F){F.name==="PermissionDenied"?m=F:O[ee]&&(m=Error(y("Invalid JSON config file: %s",W)))}})}function M(O,P){Object.keys(O).forEach(function(ee){const W=O[ee],F=P?P+"."+ee:ee;typeof W=="object"&&W!==null&&!Array.isArray(W)&&a["dot-notation"]?M(W,F):(!C(v,F.split("."))||w(F,f.arrays)&&a["combine-arrays"])&&G(F,W)})}function Y(){typeof l<"u"&&l.forEach(function(O){M(O)})}function z(O,P){if(typeof c>"u")return;const ee=typeof c=="string"?c:"",W=_t.env();Object.keys(W).forEach(
|
|
37
|
-
function(F){if(ee===""||F.lastIndexOf(ee,0)===0){const re=F.split("__").map(function(V,ne){return ne===0&&(V=V.substring(ee.length)),Nr(V)});(P&&f.configs[re.join(".")]||!P)&&!C(O,re)&&G(re.join("."),W[F])}})}function
|
|
37
|
+
function(F){if(ee===""||F.lastIndexOf(ee,0)===0){const re=F.split("__").map(function(V,ne){return ne===0&&(V=V.substring(ee.length)),Nr(V)});(P&&f.configs[re.join(".")]||!P)&&!C(O,re)&&G(re.join("."),W[F])}})}function J(O){let P;const ee=new Set;Object.keys(O).forEach(function(W){if(!ee.has(W)&&(P=w(W,f.coercions),typeof P=="function"))try{const F=N(W,P(O[W]));[].concat(f.aliases[W]||[],W).forEach(re=>{ee.add(re),O[re]=F})}catch(F){m=F}})}function se(O){return f.keys.forEach(P=>{~P.indexOf(".")||
|
|
38
38
|
typeof O[P]>"u"&&(O[P]=void 0)}),O}function q(O,P,ee,W=!1){Object.keys(ee).forEach(function(F){C(O,F.split("."))||(H(O,F.split("."),ee[F]),W&&($[F]=!0),(P[F]||[]).forEach(function(re){C(O,re.split("."))||H(O,re.split("."),ee[F])}))})}function C(O,P){let ee=O;a["dot-notation"]||(P=[P.join(".")]),P.slice(0,-1).forEach(function(F){ee=ee[F]||{}});const W=P[P.length-1];return typeof ee!="object"?!1:W in ee}function H(O,P,ee){let W=O;a["dot-notation"]||(P=[P.join(".")]),P.slice(0,-1).forEach(function(fe){
|
|
39
39
|
fe=cu(fe),typeof W=="object"&&W[fe]===void 0&&(W[fe]={}),typeof W[fe]!="object"||Array.isArray(W[fe])?(Array.isArray(W[fe])?W[fe].push({}):W[fe]=[W[fe],{}],W=W[fe][W[fe].length-1]):W=W[fe]});const F=cu(P[P.length-1]),re=w(P.join("."),f.arrays),V=Array.isArray(ee);let ne=a["duplicate-arguments-array"];!ne&&w(F,f.nargs)&&(ne=!0,(!Q(W[F])&&f.nargs[F]===1||Array.isArray(W[F])&&W[F].length===f.nargs[F])&&(W[F]=void 0)),ee===as()?W[F]=as(W[F]):Array.isArray(W[F])?ne&&re&&V?W[F]=a["flatten-duplicate-ar\
|
|
40
40
|
rays"]?W[F].concat(ee):(Array.isArray(W[F][0])?W[F]:[W[F]]).concat([ee]):!ne&&!!re==!!V?W[F]=ee:W[F]=W[F].concat([ee]):W[F]===void 0&&re?W[F]=V?ee:[ee]:ne&&!(W[F]===void 0||w(F,f.counts)||w(F,f.bools))?W[F]=[W[F],ee]:W[F]=ee}function k(...O){O.forEach(function(P){Object.keys(P||{}).forEach(function(ee){f.aliases[ee]||(f.aliases[ee]=[].concat(o[ee]||[]),f.aliases[ee].concat(ee).forEach(function(W){if(/-/.test(W)&&a["camel-case-expansion"]){const F=Nr(W);F!==ee&&f.aliases[ee].indexOf(F)===-1&&(f.aliases[ee].
|
|
41
41
|
push(F),E[F]=!0)}}),f.aliases[ee].concat(ee).forEach(function(W){if(W.length>1&&/[A-Z]/.test(W)&&a["camel-case-expansion"]){const F=au(W,"-");F!==ee&&f.aliases[ee].indexOf(F)===-1&&(f.aliases[ee].push(F),E[F]=!0)}}),f.aliases[ee].forEach(function(W){f.aliases[W]=[ee].concat(f.aliases[ee].filter(function(F){return W!==F}))}))})})}function w(O,P){const ee=[].concat(f.aliases[O]||[],O),W=Object.keys(P),F=ee.find(re=>W.includes(re));return F?P[F]:!1}function A(O){const P=Object.keys(f);return[].concat(
|
|
42
|
-
P.map(W=>f[W])).some(function(W){return Array.isArray(W)?W.includes(O):W[O]})}function R(O,...P){return[].concat(...P).some(function(W){const F=O.match(W);return F&&A(F[1])})}function
|
|
43
|
-
unknown-options-as-args"]&&oe(O)}function oe(O){return O=O.replace(/^-{3,}/,"--"),O.match(g)||
|
|
42
|
+
P.map(W=>f[W])).some(function(W){return Array.isArray(W)?W.includes(O):W[O]})}function R(O,...P){return[].concat(...P).some(function(W){const F=O.match(W);return F&&A(F[1])})}function X(O){if(O.match(g)||!O.match(/^-[^-]+/))return!1;let P=!0,ee;const W=O.slice(1).split("");for(let F=0;F<W.length;F++){if(ee=O.slice(F+2),!A(W[F])){P=!1;break}if(W[F+1]&&W[F+1]==="="||ee==="-"||/[A-Za-z]/.test(W[F])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(ee)||W[F+1]&&W[F+1].match(/\W/))break}return P}function Z(O){return a["\
|
|
43
|
+
unknown-options-as-args"]&&oe(O)}function oe(O){return O=O.replace(/^-{3,}/,"--"),O.match(g)||X(O)?!1:!R(O,/^-+([^=]+?)=[\s\S]*$/,p,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function ae(O){return!w(O,f.bools)&&!w(O,f.counts)&&`${O}`in u?u[O]:T(x(O))}function T(O){return{[it.BOOLEAN]:!0,[it.STRING]:"",[it.NUMBER]:void 0,[it.ARRAY]:[]}[O]}function x(O){let P=it.BOOLEAN;return w(O,f.strings)?P=it.STRING:w(O,f.numbers)?P=it.NUMBER:w(O,f.bools)?P=it.BOOLEAN:w(O,f.arrays)&&
|
|
44
44
|
(P=it.ARRAY),P}function Q(O){return O===void 0}function ie(){Object.keys(f.counts).find(O=>w(O,f.arrays)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.array.",O)),!0):w(O,f.nargs)?(m=Error(y("Invalid configuration: %s, opts.count excludes opts.narg.",O)),!0):!1)}return{aliases:Object.assign({},f.aliases),argv:Object.assign(_,v),configuration:a,defaulted:Object.assign({},$),error:m,newAliases:Object.assign({},E)}}}function vm(t){const e=[],r=Object.create(null);let n=!0;for(Object.
|
|
45
45
|
keys(t).forEach(function(i){e.push([].concat(t[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,u){return u.indexOf(o)===a});const s=i.pop();s!==void 0&&typeof s=="string"&&(r[s]=i)}),r}function as(t){return t!==void 0?t+1:1}function cu(t){return t==="__proto__"?"___proto___":t}function $m(t){return typeof t==
|
|
46
46
|
"string"&&(t[0]==="'"||t[0]==='"')&&t[t.length-1]===t[0]?t.substring(1,t.length-1):t}var us,cs,ls;const lu=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,fu=(cs=(us=process==null?void 0:process.versions)===null||us===void 0?void 0:us.node)!==null&&cs!==void 0?cs:(ls=process==null?void 0:process.version)===null||ls===void 0?void 0:ls.slice(1);if(fu&&Number(fu.match(/^([^.]+)/)[1])<lu)throw Error(`yargs parser supports a minimum Node.js versi\
|
|
47
|
-
on of ${lu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const _m=process?process.env:{},du=new Dm({cwd:process.cwd,env:()=>_m,format:
|
|
48
|
-
Nr,Tr.decamelize=au,Tr.looksLikeNumber=uu;function hu(){return wm()?0:1}function wm(){return bm()&&!process.defaultApp}function bm(){return!!process.versions.electron}function Am(t){return t.slice(hu()+1)}function Cm(){return process.argv[hu()]}class je extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,je)}}const Sm={fs:{readFileSync:rs,writeFile:Gp},format:
|
|
47
|
+
on of ${lu}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const _m=process?process.env:{},du=new Dm({cwd:process.cwd,env:()=>_m,format:Xa,normalize:qp,resolve:Qe,require:t=>{if(typeof require<"u")return require(t);if(t.match(/\.json$/))return JSON.parse(rs(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),Tr=function(e,r){return du.parse(e.slice(),r).argv};Tr.detailed=function(t,e){return du.parse(t.slice(),e)},Tr.camelCase=
|
|
48
|
+
Nr,Tr.decamelize=au,Tr.looksLikeNumber=uu;function hu(){return wm()?0:1}function wm(){return bm()&&!process.defaultApp}function bm(){return!!process.versions.electron}function Am(t){return t.slice(hu()+1)}function Cm(){return process.argv[hu()]}class je extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,je)}}const Sm={fs:{readFileSync:rs,writeFile:Gp},format:Xa,resolve:Qe,exists:t=>{try{return Ka(t).isFile()}catch{return!1}}};
|
|
49
49
|
let st;class Rm{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);const r=e.shift();let n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||
|
|
50
50
|
function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]=r,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),st.format.apply(st.format,[this.cache[this.locale][r]||r].concat(e))}__n(){const e=Array.prototype.slice.call(arguments),r=e.shift(),n=e.shift(),i=e.shift();let s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?r:n;this.
|
|
51
51
|
cache[this.locale][r]&&(o=this.cache[this.locale][r][i===1?"one":"other"]),!this.cache[this.locale][r]&&this.updateFiles?(this.cache[this.locale][r]={one:r,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();const a=[o];return~o.indexOf("%d")&&a.push(i),st.format.apply(st.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(const r in e)Object.prototype.hasOwnProperty.call(
|
|
@@ -79,19 +79,19 @@ const e=this.frozens.pop();ot(e,void 0,this.shim),{handlers:this.handlers,aliasM
|
|
|
79
79
|
object"}function Hm(t){return typeof t=="object"&&!Array.isArray(t)}function xr(t={},e=()=>!0){const r={};return fn(t).forEach(n=>{e(n,t[n])&&(r[n]=t[n])}),r}function Mr(t){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{const r=e;r._handle&&r.isTTY&&typeof r._handle.setBlocking=="function"&&r._handle.setBlocking(t)})}function Vm(t){return typeof t=="boolean"}function zm(t,e){const r=e.y18n.__,n={},i=[];n.failFn=function(B){i.push(B)};let s=null,o=null,a=!0;n.showHelpOnFail=function(B=!0,N){
|
|
80
80
|
const[j,M]=typeof B=="string"?[!0,B]:[B,N];return t.getInternalMethods().isGlobalContext()&&(o=M),s=M,a=j,n};let u=!1;n.fail=function(B,N){const j=t.getInternalMethods().getLoggerInstance();if(i.length)for(let M=i.length-1;M>=0;--M){const Y=i[M];if(Vm(Y)){if(N)throw N;if(B)throw Error(B)}else Y(B,N,n)}else{if(t.getExitProcess()&&Mr(!0),!u){u=!0,a&&(t.showHelp("error"),j.error()),(B||N)&&j.error(B||N);const M=s||o;M&&((B||N)&&j.error(""),j.error(M))}if(N=N||new je(B),t.getExitProcess())return t.exit(
|
|
81
81
|
1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,N);throw N}};let l=[],c=!1;n.usage=(L,B)=>L===null?(c=!0,l=[],n):(c=!1,l.push([L,B||""]),n),n.getUsage=()=>l,n.getUsageDisabled=()=>c,n.getPositionalGroupName=()=>r("Positionals:");let d=[];n.example=(L,B)=>{d.push([L,B||""])};let h=[];n.command=function(B,N,j,M,Y=!1){j&&(h=h.map(z=>(z[2]=!1,z))),h.push([B,N||"",j,M,Y])},n.getCommands=()=>h;let E={};n.describe=function(B,N){Array.isArray(B)?B.forEach(j=>{n.describe(j,N)}):typeof B==
|
|
82
|
-
"object"?Object.keys(B).forEach(j=>{n.describe(j,B[j])}):E[B]=N},n.getDescriptions=()=>E;let $=[];n.epilog=L=>{$.push(L)};let y=!1,f;n.wrap=L=>{y=!0,f=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(f=I(),y=!0),f);const g="__yargsString__:";n.deferY18nLookup=L=>g+L,n.help=function(){if(D)return D;m();const B=t.customScriptName?t.$0:e.path.basename(t.$0),N=t.getDemandedOptions(),j=t.getDemandedCommands(),M=t.getDeprecatedOptions(),Y=t.getGroups(),z=t.getOptions();let
|
|
83
|
-
keys(E)),
|
|
82
|
+
"object"?Object.keys(B).forEach(j=>{n.describe(j,B[j])}):E[B]=N},n.getDescriptions=()=>E;let $=[];n.epilog=L=>{$.push(L)};let y=!1,f;n.wrap=L=>{y=!0,f=L},n.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(y||(f=I(),y=!0),f);const g="__yargsString__:";n.deferY18nLookup=L=>g+L,n.help=function(){if(D)return D;m();const B=t.customScriptName?t.$0:e.path.basename(t.$0),N=t.getDemandedOptions(),j=t.getDemandedCommands(),M=t.getDeprecatedOptions(),Y=t.getGroups(),z=t.getOptions();let J=[];J=J.concat(Object.
|
|
83
|
+
keys(E)),J=J.concat(Object.keys(N)),J=J.concat(Object.keys(j)),J=J.concat(Object.keys(z.default)),J=J.filter(_),J=Object.keys(J.reduce((R,X)=>(X!=="_"&&(R[X]=!0),R),{}));const se=n.getWrap(),q=e.cliui({width:se,wrap:!!se});if(!c){if(l.length)l.forEach(R=>{q.div({text:`${R[0].replace(/\$0/g,B)}`}),R[1]&&q.div({text:`${R[1]}`,padding:[1,0,0,0]})}),q.div();else if(h.length){let R=null;j._?R=`${B} <${r("command")}>
|
|
84
84
|
`:R=`${B} [${r("command")}]
|
|
85
|
-
`,q.div(`${R}`)}}if(h.length>1||h.length===1&&!h[0][2]){q.div(r("Commands:"));const R=t.getInternalMethods().getContext(),
|
|
86
|
-
oe[3].length&&T.push(`[${r("aliases:")} ${oe[3].join(", ")}]`),oe[4]&&(typeof oe[4]=="string"?T.push(`[${r("deprecated: %s",oe[4])}]`):T.push(`[${r("deprecated")}]`)),T.length?q.div({text:T.join(" "),padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}const C=(Object.keys(z.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);
|
|
87
|
-
w=Object.keys(Y).filter(R=>Y[R].length>0).map(R=>{const
|
|
88
|
-
(T,x)=>k(T)===k(x)?0:k(T)?1:-1).join(", "),oe),{});return{groupName:R,normalizedKeys:
|
|
85
|
+
`,q.div(`${R}`)}}if(h.length>1||h.length===1&&!h[0][2]){q.div(r("Commands:"));const R=t.getInternalMethods().getContext(),X=R.commands.length?`${R.commands.join(" ")} `:"";t.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(h=h.sort((oe,ae)=>oe[0].localeCompare(ae[0])));const Z=B?`${B} `:"";h.forEach(oe=>{const ae=`${Z}${X}${oe[0].replace(/^\$0 ?/,"")}`;q.span({text:ae,padding:[0,2,0,2],width:p(h,se,`${B}${X}`)+4},{text:oe[1]});const T=[];oe[2]&&T.push(`[${r("default")}]`),oe[3]&&
|
|
86
|
+
oe[3].length&&T.push(`[${r("aliases:")} ${oe[3].join(", ")}]`),oe[4]&&(typeof oe[4]=="string"?T.push(`[${r("deprecated: %s",oe[4])}]`):T.push(`[${r("deprecated")}]`)),T.length?q.div({text:T.join(" "),padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}const C=(Object.keys(z.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);J=J.filter(R=>!t.parsed.newAliases[R]&&C.every(X=>(z.alias[X]||[]).indexOf(R)===-1));const H=r("Options:");Y[H]||(Y[H]=[]),v(J,z.alias,Y,H);const k=R=>/^--/.test(dn(R)),
|
|
87
|
+
w=Object.keys(Y).filter(R=>Y[R].length>0).map(R=>{const X=Y[R].filter(_).map(Z=>{if(C.includes(Z))return Z;for(let oe=0,ae;(ae=C[oe])!==void 0;oe++)if((z.alias[ae]||[]).includes(Z))return ae;return Z});return{groupName:R,normalizedKeys:X}}).filter(({normalizedKeys:R})=>R.length>0).map(({groupName:R,normalizedKeys:X})=>{const Z=X.reduce((oe,ae)=>(oe[ae]=[ae].concat(z.alias[ae]||[]).map(T=>R===n.getPositionalGroupName()?T:(/^[0-9]$/.test(T)?z.boolean.includes(ae)?"-":"--":T.length>1?"--":"-")+T).sort(
|
|
88
|
+
(T,x)=>k(T)===k(x)?0:k(T)?1:-1).join(", "),oe),{});return{groupName:R,normalizedKeys:X,switches:Z}});if(w.filter(({groupName:R})=>R!==n.getPositionalGroupName()).some(({normalizedKeys:R,switches:X})=>!R.every(Z=>k(X[Z])))&&w.filter(({groupName:R})=>R!==n.getPositionalGroupName()).forEach(({normalizedKeys:R,switches:X})=>{R.forEach(Z=>{k(X[Z])&&(X[Z]=Gm(X[Z],4))})}),w.forEach(({groupName:R,normalizedKeys:X,switches:Z})=>{q.div(R),X.forEach(oe=>{const ae=Z[oe];let T=E[oe]||"",x=null;T.includes(g)&&
|
|
89
89
|
(T=r(T.substring(g.length))),z.boolean.includes(oe)&&(x=`[${r("boolean")}]`),z.count.includes(oe)&&(x=`[${r("count")}]`),z.string.includes(oe)&&(x=`[${r("string")}]`),z.normalize.includes(oe)&&(x=`[${r("string")}]`),z.array.includes(oe)&&(x=`[${r("array")}]`),z.number.includes(oe)&&(x=`[${r("number")}]`);const Q=P=>typeof P=="string"?`[${r("deprecated: %s",P)}]`:`[${r("deprecated")}]`,ie=[oe in M?Q(M[oe]):null,x,oe in N?`[${r("required")}]`:null,z.choices&&z.choices[oe]?`[${r("choices:")} ${n.stringifiedValues(
|
|
90
90
|
z.choices[oe])}]`:null,b(z.default[oe],z.defaultDescription[oe])].filter(Boolean).join(" ");q.span({text:dn(ae),padding:[0,2,0,2+Du(ae)],width:p(Z,se)+4},T);const O=t.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;ie&&!O?q.div({text:ie,padding:[0,0,0,2],align:"right"}):q.div()}),q.div()}),d.length&&(q.div(r("Examples:")),d.forEach(R=>{R[0]=R[0].replace(/\$0/g,B)}),d.forEach(R=>{R[1]===""?q.div({text:R[0],padding:[0,2,0,2]}):q.div({text:R[0],padding:[0,2,0,2],width:p(d,se)+4},{text:R[1]})}),
|
|
91
|
-
q.div()),$.length>0){const R=$.map(
|
|
91
|
+
q.div()),$.length>0){const R=$.map(X=>X.replace(/\$0/g,B)).join(`
|
|
92
92
|
`);q.div(`${R}
|
|
93
93
|
`)}return q.toString().replace(/\s*$/,"")};function p(L,B,N){let j=0;return Array.isArray(L)||(L=Object.values(L).map(M=>[M])),L.forEach(M=>{j=Math.max(e.stringWidth(N?`${N} ${dn(M[0])}`:dn(M[0]))+Du(M[0]),j)}),B&&(j=Math.min(j,parseInt((B*.5).toString(),10))),j}function m(){const L=t.getDemandedOptions(),B=t.getOptions();(Object.keys(B.alias)||[]).forEach(N=>{B.alias[N].forEach(j=>{E[j]&&n.describe(N,E[j]),j in L&&t.demandOption(N,L[j]),B.boolean.includes(j)&&t.boolean(N),B.count.includes(j)&&t.
|
|
94
|
-
count(N),B.string.includes(j)&&t.string(N),B.normalize.includes(j)&&t.normalize(N),B.array.includes(j)&&t.array(N),B.number.includes(j)&&t.number(N)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function v(L,B,N,j){let M=[],Y=null;return Object.keys(N).forEach(z=>{M=M.concat(N[z])}),L.forEach(z=>{Y=[z].concat(B[z]),Y.some(
|
|
94
|
+
count(N),B.string.includes(j)&&t.string(N),B.normalize.includes(j)&&t.normalize(N),B.array.includes(j)&&t.array(N),B.number.includes(j)&&t.number(N)})})}let D;n.cacheHelpMessage=function(){D=this.help()},n.clearCachedHelpMessage=function(){D=void 0},n.hasCachedHelpMessage=function(){return!!D};function v(L,B,N,j){let M=[],Y=null;return Object.keys(N).forEach(z=>{M=M.concat(N[z])}),L.forEach(z=>{Y=[z].concat(B[z]),Y.some(J=>M.indexOf(J)!==-1)||N[j].push(z)}),M}function _(L){return t.getOptions().
|
|
95
95
|
hiddenOptions.indexOf(L)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}n.showHelp=L=>{const B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(n.help())},n.functionDescription=L=>["(",L.name?e.Parser.decamelize(L.name,"-"):r("generated-value"),")"].join(""),n.stringifiedValues=function(B,N){let j="";const M=N||", ",Y=[].concat(B);return!B||!Y.length||Y.forEach(z=>{j.length&&(j+=M),j+=JSON.stringify(z)}),j};function b(L,B){let N=`[${r("default:")} `;if(L===
|
|
96
96
|
void 0&&!B)return null;if(B)N+=B;else switch(typeof L){case"string":N+=`"${L}"`;break;case"object":N+=JSON.stringify(L);break;default:N+=L}return`${N}]`}function I(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let U=null;n.version=L=>{U=L},n.showVersion=L=>{const B=t.getInternalMethods().getLoggerInstance();L||(L="error"),(typeof L=="function"?L:B[L])(U)},n.reset=function(B){return s=null,u=!1,l=[],c=!1,$=[],d=[],h=[],E=xr(E,N=>!B[N]),n};const G=[];return n.freeze=function(){
|
|
97
97
|
G.push({failMessage:s,failureOutput:u,usages:l,usageDisabled:c,epilogs:$,examples:d,commands:h,descriptions:E})},n.unfreeze=function(B=!1){const N=G.pop();N&&(B?(E={...N.descriptions,...E},h=[...N.commands,...h],l=[...N.usages,...l],d=[...N.examples,...d],$=[...N.epilogs,...$]):{failMessage:s,failureOutput:u,usages:l,usageDisabled:c,epilogs:$,examples:d,commands:h,descriptions:E}=N)},n}function ds(t){return typeof t=="object"}function Gm(t,e){return ds(t)?{text:t.text,indentation:t.indentation+e}:
|
|
@@ -149,8 +149,8 @@ includes(a)&&!this.argsContainKey(r,a,u)&&this.completeOptionKey(a,e,i,u&&!!s.de
|
|
|
149
149
|
getContext().commands.length+1),a=s[n._.length-o-1];if(!a)return;const u=this.yargs.getOptions().choices[a]||[];for(const l of u)l.startsWith(i)&&e.push(l.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let r=e[e.length-1],n="";if(!r.startsWith("-")&&e.length>1&&(n=r,r=e[e.length-2]),!r.startsWith("-"))return;const i=r.replace(/^-+/,""),s=this.yargs.getOptions(),o=[i,...this.yargs.getAliases()[i]||[]];let a;for(const u of o)if(Object.prototype.hasOwnProperty.call(s.key,u)&&Array.
|
|
150
150
|
isArray(s.choices[u])){a=s.choices[u];break}if(a)return a.filter(u=>!n||u.startsWith(n))}previousArgHasChoices(e){const r=this.getPreviousArgChoices(e);return r!==void 0&&r.length>0}argsContainKey(e,r,n){const i=s=>e.indexOf((/^[^0-9]$/.test(s)?"-":"--")+s)!==-1;if(i(r)||n&&i(`no-${r}`))return!0;if(this.aliases){for(const s of this.aliases[r])if(i(s))return!0}return!1}completeOptionKey(e,r,n,i){var s,o,a,u;let l=e;if(this.zshShell){const E=this.usage.getDescriptions(),$=(o=(s=this===null||this===
|
|
151
151
|
void 0?void 0:this.aliases)===null||s===void 0?void 0:s[e])===null||o===void 0?void 0:o.find(g=>{const p=E[g];return typeof p=="string"&&p.length>0}),y=$?E[$]:void 0,f=(u=(a=E[e])!==null&&a!==void 0?a:y)!==null&&u!==void 0?u:"";l=`${e.replace(/:/g,"\\:")}:${f.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const c=E=>/^--/.test(E),d=E=>/^[^0-9]$/.test(E),h=!c(n)&&d(e)?"-":"--";r.push(h+l),i&&r.push(h+"no-"+l)}customCompletion(e,r,n,i){if(ot(this.customCompletionFunction,null,this.
|
|
152
|
-
shim),
|
|
153
|
-
o=>this.customCompletion(e,o,n,r):o=>this.defaultCompletion(e,o,n,r);return Le(i)?i.then(s):s(i)}generateCompletionScript(e,r){let n=this.zshShell?Km:Wm;const i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function
|
|
152
|
+
shim),Jm(this.customCompletionFunction)){const s=this.customCompletionFunction(n,r);return Le(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Qm(this.customCompletionFunction)?this.customCompletionFunction(n,r,(s=i)=>this.defaultCompletion(e,r,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,r,s=>{i(null,s)})}getCompletion(e,r){const n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?
|
|
153
|
+
o=>this.customCompletion(e,o,n,r):o=>this.defaultCompletion(e,o,n,r);return Le(i)?i.then(s):s(i)}generateCompletionScript(e,r){let n=this.zshShell?Km:Wm;const i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,r),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function Xm(t,e,r,n){return new Ym(t,e,r,n)}function Jm(t){return t.length<3}function Qm(t){
|
|
154
154
|
return t.length>3}function Zm(t,e){if(t.length===0)return e.length;if(e.length===0)return t.length;const r=[];let n;for(n=0;n<=e.length;n++)r[n]=[n];let i;for(i=0;i<=t.length;i++)r[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?r[n][i]=r[n-1][i-1]:n>1&&i>1&&e.charAt(n-2)===t.charAt(i-1)&&e.charAt(n-1)===t.charAt(i-2)?r[n][i]=r[n-2][i-2]+1:r[n][i]=Math.min(r[n-1][i-1]+1,Math.min(r[n][i-1]+1,r[n-1][i]+1));return r[e.length][t.length]}const vu=["$0","--","_"];
|
|
155
155
|
function e0(t,e,r){const n=r.y18n.__,i=r.y18n.__n,s={};s.nonOptionCount=function(d){const h=t.getDemandedCommands(),$=d._.length+(d["--"]?d["--"].length:0)-t.getInternalMethods().getContext().commands.length;h._&&($<h._.min||$>h._.max)&&($<h._.min?h._.minMsg!==void 0?e.fail(h._.minMsg?h._.minMsg.replace(/\$0/g,$.toString()).replace(/\$1/,h._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",$,$.toString(),
|
|
156
156
|
h._.min.toString())):$>h._.max&&(h._.maxMsg!==void 0?e.fail(h._.maxMsg?h._.maxMsg.replace(/\$0/g,$.toString()).replace(/\$1/,h._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",$,$.toString(),h._.max.toString()))))},s.positionalCount=function(d,h){h<d&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",h,h+"",d+""))},s.requiredArguments=
|
|
@@ -167,10 +167,10 @@ getParserConfiguration()["strip-dashed"]&&Object.keys(u).forEach(h=>{u[h].forEac
|
|
|
167
167
|
freeze=function(){l.push({implied:o,conflicting:u})},s.unfreeze=function(){const d=l.pop();ot(d,void 0,r),{implied:o,conflicting:u}=d},s}let hs=[],qr;function ps(t,e,r,n){qr=n;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if(typeof t.extends!="string")return i;const s=/\.json|\..*rc$/.test(t.extends);let o=null;if(s)o=r0(e,t.extends);else try{o=require.resolve(t.extends)}catch{return t}t0(o),hs.push(o),i=s?JSON.parse(qr.readFileSync(o,"utf8")):require(t.extends),delete t.extends,
|
|
168
168
|
i=ps(i,qr.path.dirname(o),r,qr)}return hs=[],r?$u(i,t):Object.assign({},i,t)}function t0(t){if(hs.indexOf(t)>-1)throw new je(`Circular extended configurations: '${t}'.`)}function r0(t,e){return qr.path.resolve(t,e)}function $u(t,e){const r={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(r,t);for(const i of Object.keys(e))n(e[i])&&n(r[i])?r[i]=$u(t[i],e[i]):r[i]=e[i];return r}var ue=function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");
|
|
169
169
|
if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},S=function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class d\
|
|
170
|
-
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,Yt,Ur,Ze,We,hn,Nt,
|
|
170
|
+
id not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Fe,Yt,Ur,Ze,We,hn,Nt,Xt,pn,et,mn,tt,Et,Ke,rt,gn,pr,ke,le,yn,En,Ye,Jt,mr,Qt,Tt,Dn,de,Zt,er,tr,he,vn,Dt,Ie;function n0(t){return(e=[],r=t.process.cwd(),n)=>{const i=new i0(e,r,n,t);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const _u=Symbol("copyDoubleDash"),wu=Symbol("copyDoubleDash"),ms=Symbol("deleteFromParserHintObject"),bu=Symbol("emitWarning"),Au=Symbol("freeze"),Cu=Symbol(
|
|
171
171
|
"getDollarZero"),rr=Symbol("getParserConfiguration"),Su=Symbol("getUsageConfiguration"),gs=Symbol("guessLocale"),Ru=Symbol("guessVersion"),Ou=Symbol("parsePositionalNumbers"),ys=Symbol("pkgUp"),Lt=Symbol("populateParserHintArray"),gr=Symbol("populateParserHintSingleValueDictionary"),Es=Symbol("populateParserHintArrayDictionary"),Ds=Symbol("populateParserHintDictionary"),vs=Symbol("sanitizeKey"),$s=Symbol("setKey"),_s=Symbol("unfreeze"),Iu=Symbol("validateAsync"),Fu=Symbol("getCommandInstance"),Pu=Symbol(
|
|
172
172
|
"getContext"),Nu=Symbol("getHasOutput"),Tu=Symbol("getLoggerInstance"),Lu=Symbol("getParseContext"),ju=Symbol("getUsageInstance"),ku=Symbol("getValidationInstance"),$n=Symbol("hasParseCallback"),Bu=Symbol("isGlobalContext"),nr=Symbol("postProcess"),xu=Symbol("rebase"),ws=Symbol("reset"),Hr=Symbol("runYargsParserAndExecuteCommands"),bs=Symbol("runValidation"),Mu=Symbol("setHasOutput"),ir=Symbol("kTrackManuallySetKeys");class i0{constructor(e=[],r,n,i){this.customScriptName=!1,this.parsed=!1,Fe.set(
|
|
173
|
-
this,void 0),Yt.set(this,void 0),Ur.set(this,{commands:[],fullCommands:[]}),Ze.set(this,null),We.set(this,null),hn.set(this,"show-hidden"),Nt.set(this,null),
|
|
173
|
+
this,void 0),Yt.set(this,void 0),Ur.set(this,{commands:[],fullCommands:[]}),Ze.set(this,null),We.set(this,null),hn.set(this,"show-hidden"),Nt.set(this,null),Xt.set(this,!0),pn.set(this,{}),et.set(this,!0),mn.set(this,[]),tt.set(this,void 0),Et.set(this,{}),Ke.set(this,!1),rt.set(this,null),gn.set(this,!0),pr.set(this,void 0),ke.set(this,""),le.set(this,void 0),yn.set(this,void 0),En.set(this,{}),Ye.set(this,null),Jt.set(this,null),mr.set(this,{}),Qt.set(this,{}),Tt.set(this,void 0),Dn.set(this,!1),
|
|
174
174
|
de.set(this,void 0),Zt.set(this,!1),er.set(this,!1),tr.set(this,!1),he.set(this,void 0),vn.set(this,{}),Dt.set(this,null),Ie.set(this,void 0),ue(this,de,i,"f"),ue(this,Tt,e,"f"),ue(this,Yt,r,"f"),ue(this,yn,n,"f"),ue(this,tt,new Lm(this),"f"),this.$0=this[Cu](),this[ws](),ue(this,Fe,S(this,Fe,"f"),"f"),ue(this,he,S(this,he,"f"),"f"),ue(this,Ie,S(this,Ie,"f"),"f"),ue(this,le,S(this,le,"f"),"f"),S(this,le,"f").showHiddenOpt=S(this,hn,"f"),ue(this,pr,this[wu](),"f")}addHelpOpt(e,r){const n="help";return ce(
|
|
175
175
|
"[string|boolean] [string]",[e,r],arguments.length),S(this,rt,"f")&&(this[ms](S(this,rt,"f")),ue(this,rt,null,"f")),e===!1&&r===void 0?this:(ue(this,rt,typeof e=="string"?e:n,"f"),this.boolean(S(this,rt,"f")),this.describe(S(this,rt,"f"),r||S(this,he,"f").deferY18nLookup("Show help")),this)}help(e,r){return this.addHelpOpt(e,r)}addShowHiddenOpt(e,r){if(ce("[string|boolean] [string]",[e,r],arguments.length),e===!1&&r===void 0)return this;const n=typeof e=="string"?e:S(this,hn,"f");return this.boolean(
|
|
176
176
|
n),this.describe(n,r||S(this,he,"f").deferY18nLookup("Show hidden options")),S(this,le,"f").showHiddenOpt=n,this}showHidden(e,r){return this.addShowHiddenOpt(e,r)}alias(e,r){return ce("<object|string|array> [string|array]",[e,r],arguments.length),this[Es](this.alias.bind(this),"alias",e,r),this}array(e){return ce("<array|string>",[e],arguments.length),this[Lt]("array",e),this[ir](e),this}boolean(e){return ce("<array|string>",[e],arguments.length),this[Lt]("boolean",e),this[ir](e),this}check(e,r){
|
|
@@ -182,44 +182,44 @@ f")),S(this,le,"f").configObjects=(S(this,le,"f").configObjects||[]).concat(e),t
|
|
|
182
182
|
"f").getCallerFile(),r),this}count(e){return ce("<array|string>",[e],arguments.length),this[Lt]("count",e),this[ir](e),this}default(e,r,n){return ce("<object|string|array> [*] [string]",[e,r,n],arguments.length),n&&(mu(e,S(this,de,"f")),S(this,le,"f").defaultDescription[e]=n),typeof r=="function"&&(mu(e,S(this,de,"f")),S(this,le,"f").defaultDescription[e]||(S(this,le,"f").defaultDescription[e]=S(this,he,"f").functionDescription(r)),r=r.call()),this[gr](this.default.bind(this),"default",e,r),this}defaults(e,r,n){
|
|
183
183
|
return this.default(e,r,n)}demandCommand(e=1,r,n,i){return ce("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,r,n,i],arguments.length),typeof r!="number"&&(n=r,r=1/0),this.global("_",!1),S(this,le,"f").demandedCommands._={min:e,max:r,minMsg:n,maxMsg:i},this}demand(e,r,n){return Array.isArray(r)?(r.forEach(i=>{ot(n,!0,S(this,de,"f")),this.demandOption(i,n)}),r=1/0):typeof r!="number"&&(n=r,r=1/0),typeof e=="number"?(ot(n,!0,S(this,de,"f")),this.demandCommand(e,r,n,n)):
|
|
184
184
|
Array.isArray(e)?e.forEach(i=>{ot(n,!0,S(this,de,"f")),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,r){return ce("<object|string|array> [string]",[e,r],arguments.length),this[gr](this.demandOption.bind(this),"demandedOptions",e,r),this}deprecateOption(e,r){return ce("<string> [string|boolean]",[e,r],arguments.length),S(this,le,"f").deprecatedOptions[e]=r,this}describe(e,r){return ce("<object|string|array> [str\
|
|
185
|
-
ing]",[e,r],arguments.length),this[$s](e,!0),S(this,he,"f").describe(e,r),this}detectLocale(e){return ce("<boolean>",[e],arguments.length),ue(this,
|
|
185
|
+
ing]",[e,r],arguments.length),this[$s](e,!0),S(this,he,"f").describe(e,r),this}detectLocale(e){return ce("<boolean>",[e],arguments.length),ue(this,Xt,e,"f"),this}env(e){return ce("[string|boolean]",[e],arguments.length),e===!1?delete S(this,le,"f").envPrefix:S(this,le,"f").envPrefix=e||"",this}epilogue(e){return ce("<string>",[e],arguments.length),S(this,he,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,r){return ce("<string|array> [string]",[e,r],arguments.length),Array.isArray(
|
|
186
186
|
e)?e.forEach(n=>this.example(...n)):S(this,he,"f").example(e,r),this}exit(e,r){ue(this,Ke,!0,"f"),ue(this,Nt,r,"f"),S(this,et,"f")&&S(this,de,"f").process.exit(e)}exitProcess(e=!0){return ce("[boolean]",[e],arguments.length),ue(this,et,e,"f"),this}fail(e){if(ce("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new je("Invalid first argument. Expected function or boolean 'false'");return S(this,he,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,r){
|
|
187
|
-
return ce("<array> [function]",[e,r],arguments.length),r?S(this,Ze,"f").getCompletion(e,r):new Promise((n,i)=>{S(this,Ze,"f").getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return ce([],0),S(this,le,"f").demandedOptions}getDemandedCommands(){return ce([],0),S(this,le,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),S(this,le,"f").deprecatedOptions}getDetectLocale(){return S(this,
|
|
187
|
+
return ce("<array> [function]",[e,r],arguments.length),r?S(this,Ze,"f").getCompletion(e,r):new Promise((n,i)=>{S(this,Ze,"f").getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return ce([],0),S(this,le,"f").demandedOptions}getDemandedCommands(){return ce([],0),S(this,le,"f").demandedCommands}getDeprecatedOptions(){return ce([],0),S(this,le,"f").deprecatedOptions}getDetectLocale(){return S(this,Xt,"f")}getExitProcess(){return S(this,et,"f")}getGroups(){return Object.assign({},S(this,Et,
|
|
188
188
|
"f"),S(this,Qt,"f"))}getHelp(){if(ue(this,Ke,!0,"f"),!S(this,he,"f").hasCachedHelpMessage()){if(!this.parsed){const r=this[Hr](S(this,Tt,"f"),void 0,void 0,0,!0);if(Le(r))return r.then(()=>S(this,he,"f").help())}const e=S(this,Fe,"f").runDefaultBuilderOn(this);if(Le(e))return e.then(()=>S(this,he,"f").help())}return Promise.resolve(S(this,he,"f").help())}getOptions(){return S(this,le,"f")}getStrict(){return S(this,Zt,"f")}getStrictCommands(){return S(this,er,"f")}getStrictOptions(){return S(this,
|
|
189
189
|
tr,"f")}global(e,r){return ce("<string|array> [boolean]",[e,r],arguments.length),e=[].concat(e),r!==!1?S(this,le,"f").local=S(this,le,"f").local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{S(this,le,"f").local.includes(n)||S(this,le,"f").local.push(n)}),this}group(e,r){ce("<string|array> <string>",[e,r],arguments.length);const n=S(this,Qt,"f")[r]||S(this,Et,"f")[r];S(this,Qt,"f")[r]&&delete S(this,Qt,"f")[r];const i={};return S(this,Et,"f")[r]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){
|
|
190
|
-
return ce("<string>",[e],arguments.length),S(this,le,"f").hiddenOptions.push(e),this}implies(e,r){return ce("<string|object> [number|string|array]",[e,r],arguments.length),S(this,Ie,"f").implies(e,r),this}locale(e){return ce("[string]",[e],arguments.length),e===void 0?(this[gs](),S(this,de,"f").y18n.getLocale()):(ue(this,
|
|
190
|
+
return ce("<string>",[e],arguments.length),S(this,le,"f").hiddenOptions.push(e),this}implies(e,r){return ce("<string|object> [number|string|array]",[e,r],arguments.length),S(this,Ie,"f").implies(e,r),this}locale(e){return ce("[string]",[e],arguments.length),e===void 0?(this[gs](),S(this,de,"f").y18n.getLocale()):(ue(this,Xt,!1,"f"),S(this,de,"f").y18n.setLocale(e),this)}middleware(e,r,n){return S(this,tt,"f").addMiddleware(e,!!r,n)}nargs(e,r){return ce("<string|object|array> [number]",[e,r],arguments.
|
|
191
191
|
length),this[gr](this.nargs.bind(this),"narg",e,r),this}normalize(e){return ce("<array|string>",[e],arguments.length),this[Lt]("normalize",e),this}number(e){return ce("<array|string>",[e],arguments.length),this[Lt]("number",e),this[ir](e),this}option(e,r){if(ce("<string|object> [object]",[e,r],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof r!="object"&&(r={}),this[ir](e),S(this,Dt,"f")&&(e==="version"||r?.alias==="version")&&this[bu](['"version\
|
|
192
192
|
" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
|
|
193
193
|
`),void 0,"versionWarning"),S(this,le,"f").key[e]=!0,r.alias&&this.alias(e,r.alias);const n=r.deprecate||r.deprecated;n&&this.deprecateOption(e,n);const i=r.demand||r.required||r.require;i&&this.demand(e,i),r.demandOption&&this.demandOption(e,typeof r.demandOption=="string"?r.demandOption:void 0),r.conflicts&&this.conflicts(e,r.conflicts),"default"in r&&this.default(e,r.default),r.implies!==void 0&&this.implies(e,r.implies),r.nargs!==void 0&&this.nargs(e,r.nargs),r.config&&this.config(e,r.configParser),
|
|
194
194
|
r.normalize&&this.normalize(e),r.choices&&this.choices(e,r.choices),r.coerce&&this.coerce(e,r.coerce),r.group&&this.group(e,r.group),(r.boolean||r.type==="boolean")&&(this.boolean(e),r.alias&&this.boolean(r.alias)),(r.array||r.type==="array")&&(this.array(e),r.alias&&this.array(r.alias)),(r.number||r.type==="number")&&(this.number(e),r.alias&&this.number(r.alias)),(r.string||r.type==="string")&&(this.string(e),r.alias&&this.string(r.alias)),(r.count||r.type==="count")&&this.count(e),typeof r.global==
|
|
195
195
|
"boolean"&&this.global(e,r.global),r.defaultDescription&&(S(this,le,"f").defaultDescription[e]=r.defaultDescription),r.skipValidation&&this.skipValidation(e);const s=r.describe||r.description||r.desc,o=S(this,he,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(o,e)||typeof s=="string")&&this.describe(e,s),r.hidden&&this.hide(e),r.requiresArg&&this.requiresArg(e)}return this}options(e,r){return this.option(e,r)}parse(e,r,n){ce("[string|array] [function|boolean|object] [function]",[e,
|
|
196
|
-
r,n],arguments.length),this[Au](),typeof e>"u"&&(e=S(this,Tt,"f")),typeof r=="object"&&(ue(this,
|
|
196
|
+
r,n],arguments.length),this[Au](),typeof e>"u"&&(e=S(this,Tt,"f")),typeof r=="object"&&(ue(this,Jt,r,"f"),r=n),typeof r=="function"&&(ue(this,Ye,r,"f"),r=!1),r||ue(this,Tt,e,"f"),S(this,Ye,"f")&&ue(this,et,!1,"f");const i=this[Hr](e,!!r),s=this.parsed;return S(this,Ze,"f").setParsed(this.parsed),Le(i)?i.then(o=>(S(this,Ye,"f")&&S(this,Ye,"f").call(this,S(this,Nt,"f"),o,S(this,ke,"f")),o)).catch(o=>{throw S(this,Ye,"f")&&S(this,Ye,"f")(o,this.parsed.argv,S(this,ke,"f")),o}).finally(()=>{this[_s](),
|
|
197
197
|
this.parsed=s}):(S(this,Ye,"f")&&S(this,Ye,"f").call(this,S(this,Nt,"f"),i,S(this,ke,"f")),this[_s](),this.parsed=s,i)}parseAsync(e,r,n){const i=this.parse(e,r,n);return Le(i)?i:Promise.resolve(i)}parseSync(e,r,n){const i=this.parse(e,r,n);if(Le(i))throw new je(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,En,e,"f"),this}pkgConf(e,r){ce("<string> [string]",[e,r],arguments.length);
|
|
198
198
|
let n=null;const i=this[ys](r||S(this,Yt,"f"));return i[e]&&typeof i[e]=="object"&&(n=ps(i[e],r||S(this,Yt,"f"),this[rr]()["deep-merge-config"]||!1,S(this,de,"f")),S(this,le,"f").configObjects=(S(this,le,"f").configObjects||[]).concat(n)),this}positional(e,r){ce("<string> <object>",[e,r],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];r=xr(r,(o,a)=>o==="type"&&!["string","number","boole\
|
|
199
199
|
an"].includes(a)?!1:n.includes(o));const i=S(this,Ur,"f").fullCommands[S(this,Ur,"f").fullCommands.length-1],s=i?S(this,Fe,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return fn(s).forEach(o=>{const a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(r[o]=!0):a[e]&&!(o in r)&&(r[o]=a[e])}),this.group(e,S(this,he,"f").getPositionalGroupName()),this.option(e,r)}recommendCommands(e=!0){return ce("[boolean]",[e],arguments.length),ue(this,Dn,e,"f"),this}required(e,r,n){return this.demand(
|
|
200
200
|
e,r,n)}require(e,r,n){return this.demand(e,r,n)}requiresArg(e){return ce("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&S(this,le,"f").narg[e]?this:(this[gr](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,r){return ce("[string] [string]",[e,r],arguments.length),e=e||this.$0,S(this,pr,"f").log(S(this,Ze,"f").generateCompletionScript(e,r||S(this,We,"f")||"completion")),this}showHelp(e){if(ce("[string|function]",[e],arguments.length),ue(this,Ke,!0,
|
|
201
201
|
"f"),!S(this,he,"f").hasCachedHelpMessage()){if(!this.parsed){const n=this[Hr](S(this,Tt,"f"),void 0,void 0,0,!0);if(Le(n))return n.then(()=>{S(this,he,"f").showHelp(e)}),this}const r=S(this,Fe,"f").runDefaultBuilderOn(this);if(Le(r))return r.then(()=>{S(this,he,"f").showHelp(e)}),this}return S(this,he,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,r){return ce("[boolean|string] [string]",[e,r],arguments.length),S(this,he,"f").showHelpOnFail(e,
|
|
202
202
|
r),this}showVersion(e){return ce("[string|function]",[e],arguments.length),S(this,he,"f").showVersion(e),this}skipValidation(e){return ce("<array|string>",[e],arguments.length),this[Lt]("skipValidation",e),this}strict(e){return ce("[boolean]",[e],arguments.length),ue(this,Zt,e!==!1,"f"),this}strictCommands(e){return ce("[boolean]",[e],arguments.length),ue(this,er,e!==!1,"f"),this}strictOptions(e){return ce("[boolean]",[e],arguments.length),ue(this,tr,e!==!1,"f"),this}string(e){return ce("<array|\
|
|
203
|
-
string>",[e],arguments.length),this[Lt]("string",e),this[ir](e),this}terminalWidth(){return ce([],0),S(this,de,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return ce("<object>",[e],arguments.length),ue(this,
|
|
203
|
+
string>",[e],arguments.length),this[Lt]("string",e),this[ir](e),this}terminalWidth(){return ce([],0),S(this,de,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return ce("<object>",[e],arguments.length),ue(this,Xt,!1,"f"),S(this,de,"f").y18n.updateLocale(e),this}usage(e,r,n,i){if(ce("<string|null|undefined> [string|boolean] [function|object] [function]",[e,r,n,i],arguments.length),r!==void 0){if(ot(e,null,S(this,de,"f")),(e||"").match(/^\$0( |$)/))return this.
|
|
204
204
|
command(e,r,n,i);throw new je(".usage() description must start with $0 if being used as alias for .command()")}else return S(this,he,"f").usage(e),this}usageConfiguration(e){return ce("<object>",[e],arguments.length),ue(this,vn,e,"f"),this}version(e,r,n){const i="version";if(ce("[boolean|string] [string] [string]",[e,r,n],arguments.length),S(this,Dt,"f")&&(this[ms](S(this,Dt,"f")),S(this,he,"f").version(void 0),ue(this,Dt,null,"f")),arguments.length===0)n=this[Ru](),e=i;else if(arguments.length===
|
|
205
|
-
1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return ue(this,Dt,typeof e=="string"?e:i,"f"),r=r||S(this,he,"f").deferY18nLookup("Show version number"),S(this,he,"f").version(n||void 0),this.boolean(S(this,Dt,"f")),this.describe(S(this,Dt,"f"),r),this}wrap(e){return ce("<number|null|undefined>",[e],arguments.length),S(this,he,"f").wrap(e),this}[(Fe=new WeakMap,Yt=new WeakMap,Ur=new WeakMap,Ze=new WeakMap,We=new WeakMap,hn=new WeakMap,Nt=new WeakMap,
|
|
206
|
-
et=new WeakMap,mn=new WeakMap,tt=new WeakMap,Et=new WeakMap,Ke=new WeakMap,rt=new WeakMap,gn=new WeakMap,pr=new WeakMap,ke=new WeakMap,le=new WeakMap,yn=new WeakMap,En=new WeakMap,Ye=new WeakMap,
|
|
205
|
+
1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=r,r=void 0);return ue(this,Dt,typeof e=="string"?e:i,"f"),r=r||S(this,he,"f").deferY18nLookup("Show version number"),S(this,he,"f").version(n||void 0),this.boolean(S(this,Dt,"f")),this.describe(S(this,Dt,"f"),r),this}wrap(e){return ce("<number|null|undefined>",[e],arguments.length),S(this,he,"f").wrap(e),this}[(Fe=new WeakMap,Yt=new WeakMap,Ur=new WeakMap,Ze=new WeakMap,We=new WeakMap,hn=new WeakMap,Nt=new WeakMap,Xt=new WeakMap,pn=new WeakMap,
|
|
206
|
+
et=new WeakMap,mn=new WeakMap,tt=new WeakMap,Et=new WeakMap,Ke=new WeakMap,rt=new WeakMap,gn=new WeakMap,pr=new WeakMap,ke=new WeakMap,le=new WeakMap,yn=new WeakMap,En=new WeakMap,Ye=new WeakMap,Jt=new WeakMap,mr=new WeakMap,Qt=new WeakMap,Tt=new WeakMap,Dn=new WeakMap,de=new WeakMap,Zt=new WeakMap,er=new WeakMap,tr=new WeakMap,he=new WeakMap,vn=new WeakMap,Dt=new WeakMap,Ie=new WeakMap,_u)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[wu](){return{
|
|
207
207
|
log:(...e)=>{this[$n]()||console.log(...e),ue(this,Ke,!0,"f"),S(this,ke,"f").length&&ue(this,ke,S(this,ke,"f")+`
|
|
208
208
|
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")},error:(...e)=>{this[$n]()||console.error(...e),ue(this,Ke,!0,"f"),S(this,ke,"f").length&&ue(this,ke,S(this,ke,"f")+`
|
|
209
209
|
`,"f"),ue(this,ke,S(this,ke,"f")+e.join(" "),"f")}}}[ms](e){fn(S(this,le,"f")).forEach(r=>{if((i=>i==="configObjects")(r))return;const n=S(this,le,"f")[r];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete S(this,he,"f").getDescriptions()[e]}[bu](e,r,n){S(this,pn,"f")[n]||(S(this,de,"f").process.emitWarning(e,r),S(this,pn,"f")[n]=!0)}[Au](){S(this,mn,"f").push({options:S(this,le,"f"),configObjects:S(this,le,"f").configObjects.slice(0),exitProcess:S(
|
|
210
|
-
this,et,"f"),groups:S(this,Et,"f"),strict:S(this,Zt,"f"),strictCommands:S(this,er,"f"),strictOptions:S(this,tr,"f"),completionCommand:S(this,We,"f"),output:S(this,ke,"f"),exitError:S(this,Nt,"f"),hasOutput:S(this,Ke,"f"),parsed:this.parsed,parseFn:S(this,Ye,"f"),parseContext:S(this,
|
|
211
|
-
process.argv().slice(1,2):r=S(this,de,"f").process.argv().slice(0,1),e=r.map(n=>{const i=this[xu](S(this,Yt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),S(this,de,"f").getEnv("_")&&S(this,de,"f").getProcessArgvBin()===S(this,de,"f").getEnv("_")&&(e=S(this,de,"f").getEnv("_").replace(`${S(this,de,"f").path.dirname(S(this,de,"f").process.execPath())}/`,"")),e}[rr](){return S(this,En,"f")}[Su](){return S(this,vn,"f")}[gs](){if(!S(this,
|
|
210
|
+
this,et,"f"),groups:S(this,Et,"f"),strict:S(this,Zt,"f"),strictCommands:S(this,er,"f"),strictOptions:S(this,tr,"f"),completionCommand:S(this,We,"f"),output:S(this,ke,"f"),exitError:S(this,Nt,"f"),hasOutput:S(this,Ke,"f"),parsed:this.parsed,parseFn:S(this,Ye,"f"),parseContext:S(this,Jt,"f")}),S(this,he,"f").freeze(),S(this,Ie,"f").freeze(),S(this,Fe,"f").freeze(),S(this,tt,"f").freeze()}[Cu](){let e="",r;return/\b(node|iojs|electron)(\.exe)?$/.test(S(this,de,"f").process.argv()[0])?r=S(this,de,"f").
|
|
211
|
+
process.argv().slice(1,2):r=S(this,de,"f").process.argv().slice(0,1),e=r.map(n=>{const i=this[xu](S(this,Yt,"f"),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),S(this,de,"f").getEnv("_")&&S(this,de,"f").getProcessArgvBin()===S(this,de,"f").getEnv("_")&&(e=S(this,de,"f").getEnv("_").replace(`${S(this,de,"f").path.dirname(S(this,de,"f").process.execPath())}/`,"")),e}[rr](){return S(this,En,"f")}[Su](){return S(this,vn,"f")}[gs](){if(!S(this,Xt,"f"))return;const e=S(
|
|
212
212
|
this,de,"f").getEnv("LC_ALL")||S(this,de,"f").getEnv("LC_MESSAGES")||S(this,de,"f").getEnv("LANG")||S(this,de,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Ru](){return this[ys]().version||"unknown"}[Ou](e){const r=e["--"]?e["--"]:e._;for(let n=0,i;(i=r[n])!==void 0;n++)S(this,de,"f").Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(r[n]=Number(i));return e}[ys](e){const r=e||"*";if(S(this,mr,"f")[r])return S(this,mr,"f")[r];let n={};try{let i=e||
|
|
213
213
|
S(this,de,"f").mainFilename;!e&&S(this,de,"f").path.extname(i)&&(i=S(this,de,"f").path.dirname(i));const s=S(this,de,"f").findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});ot(s,void 0,S(this,de,"f")),n=JSON.parse(S(this,de,"f").readFileSync(s,"utf8"))}catch{}return S(this,mr,"f")[r]=n||{},S(this,mr,"f")[r]}[Lt](e,r){r=[].concat(r),r.forEach(n=>{n=this[vs](n),S(this,le,"f")[e].push(n)})}[gr](e,r,n,i){this[Ds](e,r,n,i,(s,o,a)=>{S(this,le,"f")[s][o]=a})}[Es](e,r,n,i){this[Ds](e,
|
|
214
214
|
r,n,i,(s,o,a)=>{S(this,le,"f")[s][o]=(S(this,le,"f")[s][o]||[]).concat(a)})}[Ds](e,r,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(const o of fn(n))e(o,n[o]);else s(r,this[vs](n),i)}[vs](e){return e==="__proto__"?"___proto___":e}[$s](e,r){return this[gr](this[$s].bind(this),"key",e,r),this}[_s](){var e,r,n,i,s,o,a,u,l,c,d,h;const E=S(this,mn,"f").pop();ot(E,void 0,S(this,de,"f"));let $;e=this,r=this,n=this,i=this,s=this,o=this,a=this,u=this,l=this,c=this,
|
|
215
215
|
d=this,h=this,{options:{set value(y){ue(e,le,y,"f")}}.value,configObjects:$,exitProcess:{set value(y){ue(r,et,y,"f")}}.value,groups:{set value(y){ue(n,Et,y,"f")}}.value,output:{set value(y){ue(i,ke,y,"f")}}.value,exitError:{set value(y){ue(s,Nt,y,"f")}}.value,hasOutput:{set value(y){ue(o,Ke,y,"f")}}.value,parsed:this.parsed,strict:{set value(y){ue(a,Zt,y,"f")}}.value,strictCommands:{set value(y){ue(u,er,y,"f")}}.value,strictOptions:{set value(y){ue(l,tr,y,"f")}}.value,completionCommand:{set value(y){
|
|
216
|
-
ue(c,We,y,"f")}}.value,parseFn:{set value(y){ue(d,Ye,y,"f")}}.value,parseContext:{set value(y){ue(h,
|
|
216
|
+
ue(c,We,y,"f")}}.value,parseFn:{set value(y){ue(d,Ye,y,"f")}}.value,parseContext:{set value(y){ue(h,Jt,y,"f")}}.value}=E,S(this,le,"f").configObjects=$,S(this,he,"f").unfreeze(),S(this,Ie,"f").unfreeze(),S(this,Fe,"f").unfreeze(),S(this,tt,"f").unfreeze()}[Iu](e,r){return Br(r,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Fu].bind(this),getContext:this[Pu].bind(this),getHasOutput:this[Nu].bind(this),getLoggerInstance:this[Tu].bind(this),getParseContext:this[Lu].bind(this),getParserConfiguration:this[rr].
|
|
217
217
|
bind(this),getUsageConfiguration:this[Su].bind(this),getUsageInstance:this[ju].bind(this),getValidationInstance:this[ku].bind(this),hasParseCallback:this[$n].bind(this),isGlobalContext:this[Bu].bind(this),postProcess:this[nr].bind(this),reset:this[ws].bind(this),runValidation:this[bs].bind(this),runYargsParserAndExecuteCommands:this[Hr].bind(this),setHasOutput:this[Mu].bind(this)}}[Fu](){return S(this,Fe,"f")}[Pu](){return S(this,Ur,"f")}[Nu](){return S(this,Ke,"f")}[Tu](){return S(this,pr,"f")}[Lu](){
|
|
218
|
-
return S(this,
|
|
218
|
+
return S(this,Jt,"f")||{}}[ju](){return S(this,he,"f")}[ku](){return S(this,Ie,"f")}[$n](){return!!S(this,Ye,"f")}[Bu](){return S(this,gn,"f")}[nr](e,r,n,i){return n||Le(e)||(r||(e=this[_u](e)),(this[rr]()["parse-positional-numbers"]||this[rr]()["parse-positional-numbers"]===void 0)&&(e=this[Ou](e)),i&&(e=kr(e,this,S(this,tt,"f").getMiddleware(),!1))),e}[ws](e={}){ue(this,le,S(this,le,"f")||{},"f");const r={};r.local=S(this,le,"f").local||[],r.configObjects=S(this,le,"f").configObjects||[];const n={};
|
|
219
219
|
r.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(S(this,Qt,"f"),Object.keys(S(this,Et,"f")).reduce((o,a)=>{const u=S(this,Et,"f")[a].filter(l=>!(l in n));return u.length>0&&(o[a]=u),o},{})),ue(this,Et,{},"f");const i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{r[o]=(S(this,
|
|
220
|
-
le,"f")[o]||[]).filter(a=>!n[a])}),s.forEach(o=>{r[o]=xr(S(this,le,"f")[o],a=>!n[a])}),r.envPrefix=S(this,le,"f").envPrefix,ue(this,le,r,"f"),ue(this,he,S(this,he,"f")?S(this,he,"f").reset(n):zm(this,S(this,de,"f")),"f"),ue(this,Ie,S(this,Ie,"f")?S(this,Ie,"f").reset(n):e0(this,S(this,he,"f"),S(this,de,"f")),"f"),ue(this,Fe,S(this,Fe,"f")?S(this,Fe,"f").reset():Mm(S(this,he,"f"),S(this,Ie,"f"),S(this,tt,"f"),S(this,de,"f")),"f"),S(this,Ze,"f")||ue(this,Ze,
|
|
220
|
+
le,"f")[o]||[]).filter(a=>!n[a])}),s.forEach(o=>{r[o]=xr(S(this,le,"f")[o],a=>!n[a])}),r.envPrefix=S(this,le,"f").envPrefix,ue(this,le,r,"f"),ue(this,he,S(this,he,"f")?S(this,he,"f").reset(n):zm(this,S(this,de,"f")),"f"),ue(this,Ie,S(this,Ie,"f")?S(this,Ie,"f").reset(n):e0(this,S(this,he,"f"),S(this,de,"f")),"f"),ue(this,Fe,S(this,Fe,"f")?S(this,Fe,"f").reset():Mm(S(this,he,"f"),S(this,Ie,"f"),S(this,tt,"f"),S(this,de,"f")),"f"),S(this,Ze,"f")||ue(this,Ze,Xm(this,S(this,he,"f"),S(this,Fe,"f"),S(
|
|
221
221
|
this,de,"f")),"f"),S(this,tt,"f").reset(),ue(this,We,null,"f"),ue(this,ke,"","f"),ue(this,Nt,null,"f"),ue(this,Ke,!1,"f"),this.parsed=!1,this}[xu](e,r){return S(this,de,"f").path.relative(e,r)}[Hr](e,r,n,i=0,s=!1){let o=!!n||s;e=e||S(this,Tt,"f"),S(this,le,"f").__=S(this,de,"f").y18n.__,S(this,le,"f").configuration=this[rr]();const a=!!S(this,le,"f").configuration["populate--"],u=Object.assign({},S(this,le,"f").configuration,{"populate--":!0}),l=S(this,de,"f").Parser.detailed(e,Object.assign({},
|
|
222
|
-
S(this,le,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,S(this,
|
|
222
|
+
S(this,le,"f"),{configuration:{"parse-positional-numbers":!1,...u}})),c=Object.assign(l.argv,S(this,Jt,"f"));let d;const h=l.aliases;let E=!1,$=!1;Object.keys(c).forEach(y=>{y===S(this,rt,"f")&&c[y]?E=!0:y===S(this,Dt,"f")&&c[y]&&($=!0)}),c.$0=this.$0,this.parsed=l,i===0&&S(this,he,"f").clearCachedHelpMessage();try{if(this[gs](),r)return this[nr](c,a,!!n,!1);S(this,rt,"f")&&[S(this,rt,"f")].concat(h[S(this,rt,"f")]||[]).filter(m=>m.length>1).includes(""+c._[c._.length-1])&&(c._.pop(),E=!0),ue(this,
|
|
223
223
|
gn,!1,"f");const y=S(this,Fe,"f").getCommands(),f=S(this,Ze,"f").completionKey in c,g=E||f||s;if(c._.length){if(y.length){let p;for(let m=i||0,D;c._[m]!==void 0;m++)if(D=String(c._[m]),y.includes(D)&&D!==S(this,We,"f")){const v=S(this,Fe,"f").runCommand(D,this,l,m+1,s,E||$||s);return this[nr](v,a,!!n,!1)}else if(!p&&D!==S(this,We,"f")){p=D;break}!S(this,Fe,"f").hasDefaultCommand()&&S(this,Dn,"f")&&p&&!g&&S(this,Ie,"f").recommendCommands(p,y)}S(this,We,"f")&&c._.includes(S(this,We,"f"))&&!f&&(S(this,
|
|
224
224
|
et,"f")&&Mr(!0),this.showCompletionScript(),this.exit(0))}if(S(this,Fe,"f").hasDefaultCommand()&&!g){const p=S(this,Fe,"f").runCommand(null,this,l,0,s,E||$||s);return this[nr](p,a,!!n,!1)}if(f){S(this,et,"f")&&Mr(!0),e=[].concat(e);const p=e.slice(e.indexOf(`--${S(this,Ze,"f").completionKey}`)+1);return S(this,Ze,"f").getCompletion(p,(m,D)=>{if(m)throw new je(m.message);(D||[]).forEach(v=>{S(this,pr,"f").log(v)}),this.exit(0)}),this[nr](c,!a,!!n,!1)}if(S(this,Ke,"f")||(E?(S(this,et,"f")&&Mr(!0),
|
|
225
225
|
o=!0,this.showHelp("log"),this.exit(0)):$&&(S(this,et,"f")&&Mr(!0),o=!0,S(this,he,"f").showVersion("log"),this.exit(0))),!o&&S(this,le,"f").skipValidation.length>0&&(o=Object.keys(c).some(p=>S(this,le,"f").skipValidation.indexOf(p)>=0&&c[p]===!0)),!o){if(l.error)throw new je(l.error.message);if(!f){const p=this[bs](h,{},l.error);n||(d=kr(c,this,S(this,tt,"f").getMiddleware(),!0)),d=this[Iu](p,d??c),Le(d)&&!n&&(d=d.then(()=>kr(c,this,S(this,tt,"f").getMiddleware(),!1)))}}}catch(y){if(y instanceof
|
|
@@ -243,22 +243,22 @@ r==="directory"&&a?.isDirectory())return o}catch{}i=be.dirname(i)}}function l0({
|
|
|
243
243
|
${e.join(`
|
|
244
244
|
`)}`),new Error("likec4 app root does not exist");return r}async function Os(){const t=await an(Rr(un(),".likec4-public-"));return await Kt(Rr(t,"likec4-views.js"),`// generated by likec4
|
|
245
245
|
`),t}const Is=1e4;function Fs(){const t=zu();return{"likec4/icons":De(t,"icons"),"likec4/react":De(t,"react"),"likec4/model":De(t,"dist/model")}}var Ps={},Gu;function Ns(){return Gu||(Gu=1,function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,i)=>i===!1||!t.isInteger(e)||!t.isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=i,t.escapeNode=(e,r=0,n)=>{const i=e.
|
|
246
|
-
nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"
|
|
247
|
-
(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(e),r}}(Ps)),Ps}var Ts,Wu;function Ls(){if(Wu)return Ts;Wu=1;const t=Ns();return Ts=(e,r={})=>{const n=(i,s={})=>{const o=r.escapeInvalid&&t.isInvalidBrace(s),a=i.invalid===!0&&r.escapeInvalid===!0;let u="";if(i.value)return(o||a)&&t.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const l of i.
|
|
246
|
+
nodes[r];i&&(n&&i.type===n||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0===0?(e.invalid=!0,!0):!1,t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0===0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type===
|
|
247
|
+
"range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){n(o);continue}o!==void 0&&r.push(o)}return r};return n(e),r}}(Ps)),Ps}var Ts,Wu;function Ls(){if(Wu)return Ts;Wu=1;const t=Ns();return Ts=(e,r={})=>{const n=(i,s={})=>{const o=r.escapeInvalid&&t.isInvalidBrace(s),a=i.invalid===!0&&r.escapeInvalid===!0;let u="";if(i.value)return(o||a)&&t.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(const l of i.
|
|
248
248
|
nodes)u+=n(l);return u};return n(e)},Ts}var js,Ku;function h0(){return Ku||(Ku=1,js=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1}),js}var ks,Yu;function p0(){if(Yu)return ks;Yu=1;const t=h0(),e=(f,g,p)=>{if(t(f)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(g===void 0||f===g)return String(f);if(t(g)===!1)throw new TypeError("toRegexRange: expected the second argument t\
|
|
249
249
|
o be a number.");let m={relaxZeros:!0,...p};typeof m.strictZeros=="boolean"&&(m.relaxZeros=m.strictZeros===!1);let D=String(m.relaxZeros),v=String(m.shorthand),_=String(m.capture),b=String(m.wrap),I=f+":"+g+"="+D+v+_+b;if(e.cache.hasOwnProperty(I))return e.cache[I].result;let U=Math.min(f,g),G=Math.max(f,g);if(Math.abs(U-G)===1){let M=f+"|"+g;return m.capture?`(${M})`:m.wrap===!1?M:`(?:${M})`}let L=$(f)||$(g),B={min:f,max:g,a:U,b:G},N=[],j=[];if(L&&(B.isPadded=L,B.maxLen=String(B.max).length),U<
|
|
250
250
|
0){let M=G<0?Math.abs(G):1;j=s(M,Math.abs(U),B,m),U=B.a=0}return G>=0&&(N=s(U,G,B,m)),B.negatives=j,B.positives=N,B.result=r(j,N),m.capture===!0?B.result=`(${B.result})`:m.wrap!==!1&&N.length+j.length>1&&(B.result=`(?:${B.result})`),e.cache[I]=B,B.result};function r(f,g,p){let m=o(f,g,"-",!1)||[],D=o(g,f,"",!1)||[],v=o(f,g,"-?",!0)||[];return m.concat(v).concat(D).join("|")}function n(f,g){let p=1,m=1,D=c(f,p),v=new Set([g]);for(;f<=D&&D<=g;)v.add(D),p+=1,D=c(f,p);for(D=d(g+1,m)-1;f<D&&D<=g;)v.add(
|
|
251
251
|
D),m+=1,D=d(g+1,m)-1;return v=[...v],v.sort(u),v}function i(f,g,p){if(f===g)return{pattern:f,count:[],digits:0};let m=a(f,g),D=m.length,v="",_=0;for(let b=0;b<D;b++){let[I,U]=m[b];I===U?v+=I:I!=="0"||U!=="9"?v+=E(I,U):_++}return _&&(v+=p.shorthand===!0?"\\d":"[0-9]"),{pattern:v,count:[_],digits:D}}function s(f,g,p,m){let D=n(f,g),v=[],_=f,b;for(let I=0;I<D.length;I++){let U=D[I],G=i(String(_),String(U),m),L="";if(!p.isPadded&&b&&b.pattern===G.pattern){b.count.length>1&&b.count.pop(),b.count.push(
|
|
252
252
|
G.count[0]),b.string=b.pattern+h(b.count),_=U+1;continue}p.isPadded&&(L=y(U,p,m)),G.string=L+G.pattern+h(G.count),v.push(G),_=U+1,b=G}return v}function o(f,g,p,m,D){let v=[];for(let _ of f){let{string:b}=_;!m&&!l(g,"string",b)&&v.push(p+b),m&&l(g,"string",b)&&v.push(p+b)}return v}function a(f,g){let p=[];for(let m=0;m<f.length;m++)p.push([f[m],g[m]]);return p}function u(f,g){return f>g?1:g>f?-1:0}function l(f,g,p){return f.some(m=>m[g]===p)}function c(f,g){return Number(String(f).slice(0,-g)+"9".
|
|
253
253
|
repeat(g))}function d(f,g){return f-f%Math.pow(10,g)}function h(f){let[g=0,p=""]=f;return p||g>1?`{${g+(p?","+p:"")}}`:""}function E(f,g,p){return`[${f}${g-f===1?"":"-"}${g}]`}function $(f){return/^-?(0+)\d/.test(f)}function y(f,g,p){if(!g.isPadded)return f;let m=Math.abs(g.maxLen-String(f).length),D=p.relaxZeros!==!1;switch(m){case 0:return"";case 1:return D?"0?":"0";case 2:return D?"0{0,2}":"00";default:return D?`0{0,${m}}`:`0{${m}}`}}return e.cache={},e.clearCache=()=>e.cache={},ks=e,ks}var Bs,
|
|
254
|
-
|
|
254
|
+
Xu;function Ju(){if(Xu)return Bs;Xu=1;const t=Ya,e=p0(),r=m=>m!==null&&typeof m=="object"&&!Array.isArray(m),n=m=>D=>m===!0?Number(D):String(D),i=m=>typeof m=="number"||typeof m=="string"&&m!=="",s=m=>Number.isInteger(+m),o=m=>{let D=`${m}`,v=-1;if(D[0]==="-"&&(D=D.slice(1)),D==="0")return!1;for(;D[++v]==="0";);return v>0},a=(m,D,v)=>typeof m=="string"||typeof D=="string"?!0:v.stringify===!0,u=(m,D,v)=>{if(D>0){let _=m[0]==="-"?"-":"";_&&(m=m.slice(1)),m=_+m.padStart(_?D-1:D,"0")}return v===!1?String(
|
|
255
255
|
m):m},l=(m,D)=>{let v=m[0]==="-"?"-":"";for(v&&(m=m.slice(1),D--);m.length<D;)m="0"+m;return v?"-"+m:m},c=(m,D,v)=>{m.negatives.sort((G,L)=>G<L?-1:G>L?1:0),m.positives.sort((G,L)=>G<L?-1:G>L?1:0);let _=D.capture?"":"?:",b="",I="",U;return m.positives.length&&(b=m.positives.map(G=>l(String(G),v)).join("|")),m.negatives.length&&(I=`-(${_}${m.negatives.map(G=>l(String(G),v)).join("|")})`),b&&I?U=`${b}|${I}`:U=b||I,D.wrap?`(${_}${U})`:U},d=(m,D,v,_)=>{if(v)return e(m,D,{wrap:!1,..._});let b=String.fromCharCode(
|
|
256
256
|
m);if(m===D)return b;let I=String.fromCharCode(D);return`[${b}-${I}]`},h=(m,D,v)=>{if(Array.isArray(m)){let _=v.wrap===!0,b=v.capture?"":"?:";return _?`(${b}${m.join("|")})`:m.join("|")}return e(m,D,v)},E=(...m)=>new RangeError("Invalid range arguments: "+t.inspect(...m)),$=(m,D,v)=>{if(v.strictRanges===!0)throw E([m,D]);return[]},y=(m,D)=>{if(D.strictRanges===!0)throw new TypeError(`Expected step "${m}" to be a number`);return[]},f=(m,D,v=1,_={})=>{let b=Number(m),I=Number(D);if(!Number.isInteger(
|
|
257
|
-
b)||!Number.isInteger(I)){if(_.strictRanges===!0)throw E([m,D]);return[]}b===0&&(b=0),I===0&&(I=0);let U=b>I,G=String(m),L=String(D),B=String(v);v=Math.max(Math.abs(v),1);let N=o(G)||o(L)||o(B),j=N?Math.max(G.length,L.length,B.length):0,M=N===!1&&a(m,D,_)===!1,Y=_.transform||n(M);if(_.toRegex&&v===1)return d(l(m,j),l(D,j),!0,_);let z={negatives:[],positives:[]},
|
|
257
|
+
b)||!Number.isInteger(I)){if(_.strictRanges===!0)throw E([m,D]);return[]}b===0&&(b=0),I===0&&(I=0);let U=b>I,G=String(m),L=String(D),B=String(v);v=Math.max(Math.abs(v),1);let N=o(G)||o(L)||o(B),j=N?Math.max(G.length,L.length,B.length):0,M=N===!1&&a(m,D,_)===!1,Y=_.transform||n(M);if(_.toRegex&&v===1)return d(l(m,j),l(D,j),!0,_);let z={negatives:[],positives:[]},J=C=>z[C<0?"negatives":"positives"].push(Math.abs(C)),se=[],q=0;for(;U?b>=I:b<=I;)_.toRegex===!0&&v>1?J(b):se.push(u(Y(b,q),j,M)),b=U?b-
|
|
258
258
|
v:b+v,q++;return _.toRegex===!0?v>1?c(z,_,j):h(se,null,{wrap:!1,..._}):se},g=(m,D,v=1,_={})=>{if(!s(m)&&m.length>1||!s(D)&&D.length>1)return $(m,D,_);let b=_.transform||(M=>String.fromCharCode(M)),I=`${m}`.charCodeAt(0),U=`${D}`.charCodeAt(0),G=I>U,L=Math.min(I,U),B=Math.max(I,U);if(_.toRegex&&v===1)return d(L,B,!1,_);let N=[],j=0;for(;G?I>=U:I<=U;)N.push(b(I,j)),I=G?I-v:I+v,j++;return _.toRegex===!0?h(N,null,{wrap:!1,options:_}):N},p=(m,D,v,_={})=>{if(D==null&&i(m))return[m];if(!i(m)||!i(D))return $(
|
|
259
|
-
m,D,_);if(typeof v=="function")return p(m,D,1,{transform:v});if(r(v))return p(m,D,0,v);let b={..._};return b.capture===!0&&(b.wrap=!0),v=v||b.step||1,s(v)?s(m)&&s(D)?f(m,D,v,b):g(m,D,Math.max(Math.abs(v),1),b):v!=null&&!r(v)?y(v,b):p(m,D,1,v)};return Bs=p,Bs}var xs,Qu;function m0(){if(Qu)return xs;Qu=1;const t=
|
|
259
|
+
m,D,_);if(typeof v=="function")return p(m,D,1,{transform:v});if(r(v))return p(m,D,0,v);let b={..._};return b.capture===!0&&(b.wrap=!0),v=v||b.step||1,s(v)?s(m)&&s(D)?f(m,D,v,b):g(m,D,Math.max(Math.abs(v),1),b):v!=null&&!r(v)?y(v,b):p(m,D,1,v)};return Bs=p,Bs}var xs,Qu;function m0(){if(Qu)return xs;Qu=1;const t=Ju(),e=Ns();return xs=(n,i={})=>{const s=(o,a={})=>{const u=e.isInvalidBrace(a),l=o.invalid===!0&&i.escapeInvalid===!0,c=u===!0||l===!0,d=i.escapeInvalid===!0?"\\":"";let h="";if(o.isOpen===
|
|
260
260
|
!0)return d+o.value;if(o.isClose===!0)return console.log("node.isClose",d,o.value),d+o.value;if(o.type==="open")return c?d+o.value:"(";if(o.type==="close")return c?d+o.value:")";if(o.type==="comma")return o.prev.type==="comma"?"":c?o.value:"|";if(o.value)return o.value;if(o.nodes&&o.ranges>0){const E=e.reduce(o.nodes),$=t(...E,{...i,wrap:!1,toRegex:!0,strictZeros:!0});if($.length!==0)return E.length>1&&$.length>1?`(${$})`:$}if(o.nodes)for(const E of o.nodes)h+=s(E,o);return h};return s(n)},xs}var Ms,
|
|
261
|
-
Zu;function g0(){if(Zu)return Ms;Zu=1;const t=
|
|
261
|
+
Zu;function g0(){if(Zu)return Ms;Zu=1;const t=Ju(),e=Ls(),r=Ns(),n=(s="",o="",a=!1)=>{const u=[];if(s=[].concat(s),o=[].concat(o),!o.length)return s;if(!s.length)return a?r.flatten(o).map(l=>`{${l}}`):o;for(const l of s)if(Array.isArray(l))for(const c of l)u.push(n(c,o,a));else for(let c of o)a===!0&&typeof c=="string"&&(c=`{${c}}`),u.push(Array.isArray(c)?n(l,c,a):l+c);return r.flatten(u)};return Ms=(s,o={})=>{const a=o.rangeLimit===void 0?1e3:o.rangeLimit,u=(l,c={})=>{l.queue=[];let d=c,h=c.queue;
|
|
262
262
|
for(;d.type!=="brace"&&d.type!=="root"&&d.parent;)d=d.parent,h=d.queue;if(l.invalid||l.dollar){h.push(n(h.pop(),e(l,o)));return}if(l.type==="brace"&&l.invalid!==!0&&l.nodes.length===2){h.push(n(h.pop(),["{}"]));return}if(l.nodes&&l.ranges>0){const f=r.reduce(l.nodes);if(r.exceedsLimit(...f,o.step,a))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=t(...f,o);g.length===0&&(g=e(l,o)),h.push(n(h.pop(),g)),l.nodes=[];return}
|
|
263
263
|
const E=r.encloseBrace(l);let $=l.queue,y=l;for(;y.type!=="brace"&&y.type!=="root"&&y.parent;)y=y.parent,$=y.queue;for(let f=0;f<l.nodes.length;f++){const g=l.nodes[f];if(g.type==="comma"&&l.type==="brace"){f===1&&$.push(""),$.push("");continue}if(g.type==="close"){h.push(n(h.pop(),$,E));continue}if(g.value&&g.type!=="open"){$.push(n($.pop(),g.value));continue}g.nodes&&u(g,l)}return $};return r.flatten(u(s))},Ms}var qs,ec;function y0(){return ec||(ec=1,qs={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"\
|
|
264
264
|
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:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"\
|
|
@@ -268,8 +268,8 @@ CHAR_LEFT_CURLY_BRACE:u,CHAR_RIGHT_CURLY_BRACE:l,CHAR_LEFT_SQUARE_BRACKET:c,CHAR
|
|
|
268
268
|
let b=v,I=v,U=0;const G=g.length;let L=0,B=0,N;const j=()=>g[L++],M=Y=>{if(Y.type==="text"&&I.type==="dot"&&(I.type="text"),I&&I.type==="text"&&Y.type==="text"){I.value+=Y.value;return}return b.nodes.push(Y),Y.parent=b,Y.prev=I,I=Y,Y};for(M({type:"bos"});L<G;)if(b=_[_.length-1],N=j(),!(N===y||N===$)){if(N===r){M({type:"text",value:(p.keepEscaping?N:"")+j()});continue}if(N===d){M({type:"text",value:"\\"+N});continue}if(N===c){U++;let Y;for(;L<G&&(Y=j());){if(N+=Y,Y===c){U++;continue}if(Y===r){N+=
|
|
269
269
|
j();continue}if(Y===d&&(U--,U===0))break}M({type:"text",value:N});continue}if(N===o){b=M({type:"paren",nodes:[]}),_.push(b),M({type:"text",value:N});continue}if(N===a){if(b.type!=="paren"){M({type:"text",value:N});continue}b=_.pop(),M({type:"text",value:N}),b=_[_.length-1];continue}if(N===h||N===E||N===n){const Y=N;let z;for(p.keepQuotes!==!0&&(N="");L<G&&(z=j());){if(z===r){N+=z+j();continue}if(z===Y){p.keepQuotes===!0&&(N+=z);break}N+=z}M({type:"text",value:N});continue}if(N===u){B++;const z={
|
|
270
270
|
type:"brace",open:!0,close:!1,dollar:I.value&&I.value.slice(-1)==="$"||b.dollar===!0,depth:B,commas:0,ranges:0,nodes:[]};b=M(z),_.push(b),M({type:"open",value:N});continue}if(N===l){if(b.type!=="brace"){M({type:"text",value:N});continue}const Y="close";b=_.pop(),b.close=!0,M({type:Y,value:N}),B--,b=_[_.length-1];continue}if(N===i&&B>0){if(b.ranges>0){b.ranges=0;const Y=b.nodes.shift();b.nodes=[Y,{type:"text",value:t(b)}]}M({type:"comma",value:N}),b.commas++;continue}if(N===s&&B>0&&b.commas===0){
|
|
271
|
-
const Y=b.nodes;if(B===0||Y.length===0){M({type:"text",value:N});continue}if(I.type==="dot"){if(b.range=[],I.value+=N,I.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,I.type="text";continue}b.ranges++,b.args=[];continue}if(I.type==="range"){Y.pop();const z=Y[Y.length-1];z.value+=I.value+N,I=z,b.ranges--;continue}M({type:"dot",value:N});continue}M({type:"text",value:N})}do if(b=_.pop(),b.type!=="root"){b.nodes.forEach(
|
|
272
|
-
"close"&&(
|
|
271
|
+
const Y=b.nodes;if(B===0||Y.length===0){M({type:"text",value:N});continue}if(I.type==="dot"){if(b.range=[],I.value+=N,I.type="range",b.nodes.length!==3&&b.nodes.length!==5){b.invalid=!0,b.ranges=0,I.type="text";continue}b.ranges++,b.args=[];continue}if(I.type==="range"){Y.pop();const z=Y[Y.length-1];z.value+=I.value+N,I=z,b.ranges--;continue}M({type:"dot",value:N});continue}M({type:"text",value:N})}do if(b=_.pop(),b.type!=="root"){b.nodes.forEach(J=>{J.nodes||(J.type==="open"&&(J.isOpen=!0),J.type===
|
|
272
|
+
"close"&&(J.isClose=!0),J.nodes||(J.type="text"),J.invalid=!0)});const Y=_[_.length-1],z=Y.nodes.indexOf(b);Y.nodes.splice(z,1,...b.nodes)}while(_.length>0);return M({type:"eos"}),v},Us}var Hs,rc;function D0(){if(rc)return Hs;rc=1;const t=Ls(),e=m0(),r=g0(),n=E0(),i=(s,o={})=>{let a=[];if(Array.isArray(s))for(const u of s){const l=i.create(u,o);Array.isArray(l)?a.push(...l):a.push(l)}else a=[].concat(i.create(s,o));return o&&o.expand===!0&&o.nodupes===!0&&(a=[...new Set(a)]),a};return i.parse=(s,o={})=>n(
|
|
273
273
|
s,o),i.stringify=(s,o={})=>t(typeof s=="string"?i.parse(s,o):s,o),i.compile=(s,o={})=>(typeof s=="string"&&(s=i.parse(s,o)),e(s,o)),i.expand=(s,o={})=>{typeof s=="string"&&(s=i.parse(s,o));let a=r(s,o);return o.noempty===!0&&(a=a.filter(Boolean)),o.nodupes===!0&&(a=[...new Set(a)]),a},i.create=(s,o={})=>s===""||s.length<3?[s]:o.expand!==!0?i.compile(s,o):i.expand(s,o),Hs=i,Hs}var Vs={},zs,nc;function bn(){if(nc)return zs;nc=1;const t=es,e="\\\\/",r=`[^${e}]`,n="\\.",i="\\+",s="\\?",o="\\/",a="(?\
|
|
274
274
|
=.)",u="[^/]",l=`(?:${o}|$)`,c=`(?:^|${o})`,d=`${n}{1,2}${l}`,h=`(?!${n})`,E=`(?!${c}${d})`,$=`(?!${n}{0,1}${l})`,y=`(?!${d})`,f=`[^.${o}]`,g=`${u}*?`,p={DOT_LITERAL:n,PLUS_LITERAL:i,QMARK_LITERAL:s,SLASH_LITERAL:o,ONE_CHAR:a,QMARK:u,END_ANCHOR:l,DOTS_SLASH:d,NO_DOT:h,NO_DOTS:E,NO_DOT_SLASH:$,NO_DOTS_SLASH:y,QMARK_NO_DOT:f,STAR:g,START_ANCHOR:c},m={...p,SLASH_LITERAL:`[${e}]`,QMARK:r,STAR:`${r}*?`,DOTS_SLASH:`${n}{1,2}(?:[${e}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${e}])${n}{1,2}(?:[${e}]|$))`,
|
|
275
275
|
NO_DOT_SLASH:`(?!${n}{0,1}(?:[${e}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${e}]|$))`,QMARK_NO_DOT:`[^.${e}]`,START_ANCHOR:`(?:^|[${e}])`,END_ANCHOR:`(?:[${e}]|$)`},D={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 zs={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:D,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,
|
|
@@ -279,18 +279,18 @@ CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:
|
|
|
279
279
|
platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:o}=bn();t.isObject=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),t.hasRegexChars=a=>s.test(a),t.isRegexChar=a=>a.length===1&&t.hasRegexChars(a),t.escapeRegex=a=>a.replace(o,"\\$1"),t.toPosixSlashes=a=>a.replace(n,"/"),t.removeBackslashes=a=>a.replace(i,u=>u==="\\"?"":u),t.supportsLookbehinds=()=>{const a=process.version.slice(1).split(".").map(Number);return a.length===3&&a[0]>=9||
|
|
280
280
|
a[0]===8&&a[1]>=10},t.isWindows=a=>a&&typeof a.windows=="boolean"?a.windows:r===!0||e.sep==="\\",t.escapeLast=(a,u,l)=>{const c=a.lastIndexOf(u,l);return c===-1?a:a[c-1]==="\\"?t.escapeLast(a,u,c-1):`${a.slice(0,c)}\\${a.slice(c)}`},t.removePrefix=(a,u={})=>{let l=a;return l.startsWith("./")&&(l=l.slice(2),u.prefix="./"),l},t.wrapOutput=(a,u={},l={})=>{const c=l.contains?"":"^",d=l.contains?"":"$";let h=`${c}(?:${a})${d}`;return u.negated===!0&&(h=`(?:^(?!${h}).*$)`),h}}(Vs)),Vs}var Gs,sc;function v0(){
|
|
281
281
|
if(sc)return Gs;sc=1;const t=An(),{CHAR_ASTERISK:e,CHAR_AT:r,CHAR_BACKWARD_SLASH:n,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:l,CHAR_LEFT_SQUARE_BRACKET:c,CHAR_PLUS:d,CHAR_QUESTION_MARK:h,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:$,CHAR_RIGHT_SQUARE_BRACKET:y}=bn(),f=m=>m===a||m===n,g=m=>{m.isPrefix!==!0&&(m.depth=m.isGlobstar?1/0:1)};return Gs=(m,D)=>{const v=D||{},_=m.length-1,b=v.parts===!0||v.scanToEnd===!0,I=[],U=[],
|
|
282
|
-
G=[];let L=m,B=-1,N=0,j=0,M=!1,Y=!1,z=!1,
|
|
283
|
-
!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(
|
|
284
|
-
break}if(
|
|
285
|
-
continue}break}if(z===!0){if(w=!0,b===!0)continue;break}}v.noext===!0&&(
|
|
286
|
-
if(v.tokens===!0&&(O.maxDepth=0,f(
|
|
282
|
+
G=[];let L=m,B=-1,N=0,j=0,M=!1,Y=!1,z=!1,J=!1,se=!1,q=!1,C=!1,H=!1,k=!1,w=!1,A=0,R,X,Z={value:"",depth:0,isGlob:!1};const oe=()=>B>=_,ae=()=>L.charCodeAt(B+1),T=()=>(R=X,L.charCodeAt(++B));for(;B<_;){X=T();let P;if(X===n){C=Z.backslashes=!0,X=T(),X===u&&(q=!0);continue}if(q===!0||X===u){for(A++;oe()!==!0&&(X=T());){if(X===n){C=Z.backslashes=!0,T();continue}if(X===u){A++;continue}if(q!==!0&&X===s&&(X=T())===s){if(M=Z.isBrace=!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(q!==!0&&X===i){if(M=Z.isBrace=
|
|
283
|
+
!0,z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(X===E&&(A--,A===0)){q=!1,M=Z.isBrace=!0,w=!0;break}}if(b===!0)continue;break}if(X===a){if(I.push(B),U.push(Z),Z={value:"",depth:0,isGlob:!1},w===!0)continue;if(R===s&&B===N+1){N+=2;continue}j=B+1;continue}if(v.noext!==!0&&(X===d||X===r||X===e||X===h||X===o)===!0&&ae()===l){if(z=Z.isGlob=!0,J=Z.isExtglob=!0,w=!0,X===o&&B===N&&(k=!0),b===!0){for(;oe()!==!0&&(X=T());){if(X===n){C=Z.backslashes=!0,X=T();continue}if(X===$){z=Z.isGlob=!0,w=!0;break}}continue}
|
|
284
|
+
break}if(X===e){if(R===e&&(se=Z.isGlobstar=!0),z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(X===h){if(z=Z.isGlob=!0,w=!0,b===!0)continue;break}if(X===c){for(;oe()!==!0&&(P=T());){if(P===n){C=Z.backslashes=!0,T();continue}if(P===y){Y=Z.isBracket=!0,z=Z.isGlob=!0,w=!0;break}}if(b===!0)continue;break}if(v.nonegate!==!0&&X===o&&B===N){H=Z.negated=!0,N++;continue}if(v.noparen!==!0&&X===l){if(z=Z.isGlob=!0,b===!0){for(;oe()!==!0&&(X=T());){if(X===l){C=Z.backslashes=!0,X=T();continue}if(X===$){w=!0;break}}
|
|
285
|
+
continue}break}if(z===!0){if(w=!0,b===!0)continue;break}}v.noext===!0&&(J=!1,z=!1);let x=L,Q="",ie="";N>0&&(Q=L.slice(0,N),L=L.slice(N),j-=N),x&&z===!0&&j>0?(x=L.slice(0,j),ie=L.slice(j)):z===!0?(x="",ie=L):x=L,x&&x!==""&&x!=="/"&&x!==L&&f(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),v.unescape===!0&&(ie&&(ie=t.removeBackslashes(ie)),x&&C===!0&&(x=t.removeBackslashes(x)));const O={prefix:Q,input:m,start:N,base:x,glob:ie,isBrace:M,isBracket:Y,isGlob:z,isExtglob:J,isGlobstar:se,negated:H,negatedExtglob:k};
|
|
286
|
+
if(v.tokens===!0&&(O.maxDepth=0,f(X)||U.push(Z),O.tokens=U),v.parts===!0||v.tokens===!0){let P;for(let ee=0;ee<I.length;ee++){const W=P?P+1:N,F=I[ee],re=m.slice(W,F);v.tokens&&(ee===0&&N!==0?(U[ee].isPrefix=!0,U[ee].value=Q):U[ee].value=re,g(U[ee]),O.maxDepth+=U[ee].depth),(ee!==0||re!=="")&&G.push(re),P=F}if(P&&P+1<m.length){const ee=m.slice(P+1);G.push(ee),v.tokens&&(U[U.length-1].value=ee,g(U[U.length-1]),O.maxDepth+=U[U.length-1].depth)}O.slashes=I,O.parts=G}return O},Gs}var Ws,oc;function $0(){
|
|
287
287
|
if(oc)return Ws;oc=1;const t=bn(),e=An(),{MAX_LENGTH:r,POSIX_REGEX_SOURCE:n,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(c,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...c,d);c.sort();const h=`[${c.join("-")}]`;try{new RegExp(h)}catch{return c.map($=>e.escapeRegex($)).join("..")}return h},u=(c,d)=>`Missing ${c}: "${d}" - use "\\\\${d}" to match literal characters`,l=(c,d)=>{if(typeof c!="string")throw new TypeError("Expected a string");c=o[c]||c;
|
|
288
288
|
const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r;let $=c.length;if($>E)throw new SyntaxError(`Input length: ${$}, exceeds maximum allowed length: ${E}`);const y={type:"bos",value:"",output:h.prepend||""},f=[y],g=h.capture?"":"?:",p=e.isWindows(d),m=t.globChars(p),D=t.extglobChars(m),{DOT_LITERAL:v,PLUS_LITERAL:_,SLASH_LITERAL:b,ONE_CHAR:I,DOTS_SLASH:U,NO_DOT:G,NO_DOT_SLASH:L,NO_DOTS_SLASH:B,QMARK:N,QMARK_NO_DOT:j,STAR:M,START_ANCHOR:Y}=m,z=F=>`(${g}(?:(?!${Y}${F.dot?U:v}).\
|
|
289
|
-
)*?)`,
|
|
289
|
+
)*?)`,J=h.dot?"":G,se=h.dot?N:j;let q=h.bash===!0?z(h):M;h.capture&&(q=`(${q})`),typeof h.noext=="boolean"&&(h.noextglob=h.noext);const C={input:c,index:-1,start:0,dot:h.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:f};c=e.removePrefix(c,C),$=c.length;const H=[],k=[],w=[];let A=y,R;const X=()=>C.index===$-1,Z=C.peek=(F=1)=>c[C.index+F],oe=C.advance=()=>c[++C.index]||"",ae=()=>c.slice(C.index+1),T=(F="",re=0)=>{C.consumed+=
|
|
290
290
|
F,C.index+=re},x=F=>{C.output+=F.output!=null?F.output:F.value,T(F.value)},Q=()=>{let F=1;for(;Z()==="!"&&(Z(2)!=="("||Z(3)==="?");)oe(),C.start++,F++;return F%2===0?!1:(C.negated=!0,C.start++,!0)},ie=F=>{C[F]++,w.push(F)},O=F=>{C[F]--,w.pop()},P=F=>{if(A.type==="globstar"){const re=C.braces>0&&(F.type==="comma"||F.type==="brace"),V=F.extglob===!0||H.length&&(F.type==="pipe"||F.type==="paren");F.type!=="slash"&&F.type!=="paren"&&!re&&!V&&(C.output=C.output.slice(0,-A.output.length),A.type="star",
|
|
291
291
|
A.value="*",A.output=q,C.output+=A.output)}if(H.length&&F.type!=="paren"&&(H[H.length-1].inner+=F.value),(F.value||F.output)&&x(F),A&&A.type==="text"&&F.type==="text"){A.value+=F.value,A.output=(A.output||"")+F.value;return}F.prev=A,f.push(F),A=F},ee=(F,re)=>{const V={...D[re],conditions:1,inner:""};V.prev=A,V.parens=C.parens,V.output=C.output;const ne=(h.capture?"(":"")+V.open;ie("parens"),P({type:F,value:re,output:C.output?"":I}),P({type:"paren",extglob:!0,value:oe(),output:ne}),H.push(V)},W=F=>{
|
|
292
|
-
let re=F.close+(h.capture?")":""),V;if(F.type==="negate"){let ne=q;if(F.inner&&F.inner.length>1&&F.inner.includes("/")&&(ne=z(h)),(ne!==q||
|
|
293
|
-
"\\"?(F=!0,V):we==="?"?ne?ne+we+(Oe?N.repeat(Oe.length):""):vt===0?se+(Oe?N.repeat(Oe.length):""):N.repeat(fe.length):we==="."?v.repeat(fe.length):we==="*"?ne?ne+we+(Oe?q:""):q:ne?V:`\\${V}`);return F===!0&&(h.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),re===c&&h.contains===!0?(C.output=c,C):(C.output=e.wrapOutput(re,C,d),C)}for(;!
|
|
292
|
+
let re=F.close+(h.capture?")":""),V;if(F.type==="negate"){let ne=q;if(F.inner&&F.inner.length>1&&F.inner.includes("/")&&(ne=z(h)),(ne!==q||X()||/^\)+$/.test(ae()))&&(re=F.close=`)$))${ne}`),F.inner.includes("*")&&(V=ae())&&/^\.[^\\/.]+$/.test(V)){const fe=l(V,{...d,fastpaths:!1}).output;re=F.close=`)${fe})${ne})`}F.prev.type==="bos"&&(C.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:R,output:re}),O("parens")};if(h.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(c)){let F=!1,re=c.replace(s,(V,ne,fe,we,Oe,vt)=>we===
|
|
293
|
+
"\\"?(F=!0,V):we==="?"?ne?ne+we+(Oe?N.repeat(Oe.length):""):vt===0?se+(Oe?N.repeat(Oe.length):""):N.repeat(fe.length):we==="."?v.repeat(fe.length):we==="*"?ne?ne+we+(Oe?q:""):q:ne?V:`\\${V}`);return F===!0&&(h.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,V=>V.length%2===0?"\\\\":V?"\\":"")),re===c&&h.contains===!0?(C.output=c,C):(C.output=e.wrapOutput(re,C,d),C)}for(;!X();){if(R=oe(),R==="\0")continue;if(R==="\\"){const V=Z();if(V==="/"&&h.bash!==!0||V==="."||V===";")continue;if(!V){
|
|
294
294
|
R+="\\",P({type:"text",value:R});continue}const ne=/^\\+/.exec(ae());let fe=0;if(ne&&ne[0].length>2&&(fe=ne[0].length,C.index+=fe,fe%2!==0&&(R+="\\")),h.unescape===!0?R=oe():R+=oe(),C.brackets===0){P({type:"text",value:R});continue}}if(C.brackets>0&&(R!=="]"||A.value==="["||A.value==="[^")){if(h.posix!==!1&&R===":"){const V=A.value.slice(1);if(V.includes("[")&&(A.posix=!0,V.includes(":"))){const ne=A.value.lastIndexOf("["),fe=A.value.slice(0,ne),we=A.value.slice(ne+2),Oe=n[we];if(Oe){A.value=fe+
|
|
295
295
|
Oe,C.backtrack=!0,oe(),!y.output&&f.indexOf(A)===1&&(y.output=I);continue}}}(R==="["&&Z()!==":"||R==="-"&&Z()==="]")&&(R=`\\${R}`),R==="]"&&(A.value==="["||A.value==="[^")&&(R=`\\${R}`),h.posix===!0&&R==="!"&&A.value==="["&&(R="^"),A.value+=R,x({value:R});continue}if(C.quotes===1&&R!=='"'){R=e.escapeRegex(R),A.value+=R,x({value:R});continue}if(R==='"'){C.quotes=C.quotes===1?0:1,h.keepQuotes===!0&&P({type:"text",value:R});continue}if(R==="("){ie("parens"),P({type:"paren",value:R});continue}if(R===
|
|
296
296
|
")"){if(C.parens===0&&h.strictBrackets===!0)throw new SyntaxError(u("opening","("));const V=H[H.length-1];if(V&&C.parens===V.parens+1){W(H.pop());continue}P({type:"paren",value:R,output:C.parens?")":"\\)"}),O("parens");continue}if(R==="["){if(h.nobracket===!0||!ae().includes("]")){if(h.nobracket!==!0&&h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));R=`\\${R}`}else ie("brackets");P({type:"bracket",value:R});continue}if(R==="]"){if(h.nobracket===!0||A&&A.type==="bracket"&&A.value.length===
|
|
@@ -301,30 +301,30 @@ if(A.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output
|
|
|
301
301
|
"("&&Z(2)!=="?"){ee("qmark",R);continue}if(A&&A.type==="paren"){const ne=Z();let fe=R;if(ne==="<"&&!e.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(A.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test(ae()))&&(fe=`\\${R}`),P({type:"text",value:R,output:fe});continue}if(h.dot!==!0&&(A.type==="slash"||A.type==="bos")){P({type:"qmark",value:R,output:j});continue}P({type:"qmark",value:R,output:N});continue}if(R==="!"){if(h.noextglob!==
|
|
302
302
|
!0&&Z()==="("&&(Z(2)!=="?"||!/[!=<:]/.test(Z(3)))){ee("negate",R);continue}if(h.nonegate!==!0&&C.index===0){Q();continue}}if(R==="+"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){ee("plus",R);continue}if(A&&A.value==="("||h.regex===!1){P({type:"plus",value:R,output:_});continue}if(A&&(A.type==="bracket"||A.type==="paren"||A.type==="brace")||C.parens>0){P({type:"plus",value:R});continue}P({type:"plus",value:_});continue}if(R==="@"){if(h.noextglob!==!0&&Z()==="("&&Z(2)!=="?"){P({type:"at",extglob:!0,
|
|
303
303
|
value:R,output:""});continue}P({type:"text",value:R});continue}if(R!=="*"){(R==="$"||R==="^")&&(R=`\\${R}`);const V=i.exec(ae());V&&(R+=V[0],C.index+=V[0].length),P({type:"text",value:R});continue}if(A&&(A.type==="globstar"||A.star===!0)){A.type="star",A.star=!0,A.value+=R,A.output=q,C.backtrack=!0,C.globstar=!0,T(R);continue}let F=ae();if(h.noextglob!==!0&&/^\([^?]/.test(F)){ee("star",R);continue}if(A.type==="star"){if(h.noglobstar===!0){T(R);continue}const V=A.prev,ne=V.prev,fe=V.type==="slash"||
|
|
304
|
-
V.type==="bos",we=ne&&(ne.type==="star"||ne.type==="globstar");if(h.bash===!0&&(!fe||F[0]&&F[0]!=="/")){P({type:"star",value:R,output:""});continue}const Oe=C.braces>0&&(V.type==="comma"||V.type==="brace"),vt=H.length&&(V.type==="pipe"||V.type==="paren");if(!fe&&V.type!=="paren"&&!Oe&&!vt){P({type:"star",value:R,output:""});continue}for(;F.slice(0,3)==="/**";){const Ft=c[C.index+4];if(Ft&&Ft!=="/")break;F=F.slice(3),T("/**",3)}if(V.type==="bos"&&
|
|
305
|
-
output=A.output,C.globstar=!0,T(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!we&&
|
|
304
|
+
V.type==="bos",we=ne&&(ne.type==="star"||ne.type==="globstar");if(h.bash===!0&&(!fe||F[0]&&F[0]!=="/")){P({type:"star",value:R,output:""});continue}const Oe=C.braces>0&&(V.type==="comma"||V.type==="brace"),vt=H.length&&(V.type==="pipe"||V.type==="paren");if(!fe&&V.type!=="paren"&&!Oe&&!vt){P({type:"star",value:R,output:""});continue}for(;F.slice(0,3)==="/**";){const Ft=c[C.index+4];if(Ft&&Ft!=="/")break;F=F.slice(3),T("/**",3)}if(V.type==="bos"&&X()){A.type="globstar",A.value+=R,A.output=z(h),C.
|
|
305
|
+
output=A.output,C.globstar=!0,T(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&!we&&X()){C.output=C.output.slice(0,-(V.output+A.output).length),V.output=`(?:${V.output}`,A.type="globstar",A.output=z(h)+(h.strictSlashes?")":"|$)"),A.value+=R,C.globstar=!0,C.output+=V.output+A.output,T(R);continue}if(V.type==="slash"&&V.prev.type!=="bos"&&F[0]==="/"){const Ft=F[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(V.output+A.output).length),V.output=`(?:${V.output}`,A.type="globstar",A.output=`${z(
|
|
306
306
|
h)}${b}|${b}${Ft})`,A.value+=R,C.output+=V.output+A.output,C.globstar=!0,T(R+oe()),P({type:"slash",value:"/",output:""});continue}if(V.type==="bos"&&F[0]==="/"){A.type="globstar",A.value+=R,A.output=`(?:^|${b}|${z(h)}${b})`,C.output=A.output,C.globstar=!0,T(R+oe()),P({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-A.output.length),A.type="globstar",A.output=z(h),A.value+=R,C.output+=A.output,C.globstar=!0,T(R);continue}const re={type:"star",value:R,output:q};if(h.bash===!0){
|
|
307
|
-
re.output=".*?",(A.type==="bos"||A.type==="slash")&&(re.output=
|
|
307
|
+
re.output=".*?",(A.type==="bos"||A.type==="slash")&&(re.output=J+re.output),P(re);continue}if(A&&(A.type==="bracket"||A.type==="paren")&&h.regex===!0){re.output=R,P(re);continue}(C.index===C.start||A.type==="slash"||A.type==="dot")&&(A.type==="dot"?(C.output+=L,A.output+=L):h.dot===!0?(C.output+=B,A.output+=B):(C.output+=J,A.output+=J),Z()!=="*"&&(C.output+=I,A.output+=I)),P(re)}for(;C.brackets>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C.output=e.escapeLast(C.output,"["),
|
|
308
308
|
O("brackets")}for(;C.parens>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing",")"));C.output=e.escapeLast(C.output,"("),O("parens")}for(;C.braces>0;){if(h.strictBrackets===!0)throw new SyntaxError(u("closing","}"));C.output=e.escapeLast(C.output,"{"),O("braces")}if(h.strictSlashes!==!0&&(A.type==="star"||A.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${b}?`}),C.backtrack===!0){C.output="";for(const F of C.tokens)C.output+=F.output!=null?F.output:F.value,F.suffix&&(C.output+=
|
|
309
|
-
F.suffix)}return C};return l.fastpaths=(c,d)=>{const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r,$=c.length;if($>E)throw new SyntaxError(`Input length: ${$}, exceeds maximum allowed length: ${E}`);c=o[c]||c;const y=e.isWindows(d),{DOT_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:D,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:b,START_ANCHOR:I}=t.globChars(y),U=h.dot?v:D,G=h.dot?_:D,L=h.capture?"":"?:",B={negated:!1,prefix:""};let N=h.bash===!0?".*?":b;h.capture&&(N=`(${N})`);const j=
|
|
310
|
-
noglobstar===!0?N:`(${L}(?:(?!${I}${
|
|
309
|
+
F.suffix)}return C};return l.fastpaths=(c,d)=>{const h={...d},E=typeof h.maxLength=="number"?Math.min(r,h.maxLength):r,$=c.length;if($>E)throw new SyntaxError(`Input length: ${$}, exceeds maximum allowed length: ${E}`);c=o[c]||c;const y=e.isWindows(d),{DOT_LITERAL:f,SLASH_LITERAL:g,ONE_CHAR:p,DOTS_SLASH:m,NO_DOT:D,NO_DOTS:v,NO_DOTS_SLASH:_,STAR:b,START_ANCHOR:I}=t.globChars(y),U=h.dot?v:D,G=h.dot?_:D,L=h.capture?"":"?:",B={negated:!1,prefix:""};let N=h.bash===!0?".*?":b;h.capture&&(N=`(${N})`);const j=J=>J.
|
|
310
|
+
noglobstar===!0?N:`(${L}(?:(?!${I}${J.dot?m:f}).)*?)`,M=J=>{switch(J){case"*":return`${U}${p}${N}`;case".*":return`${f}${p}${N}`;case"*.*":return`${U}${N}${f}${p}${N}`;case"*/*":return`${U}${N}${g}${p}${G}${N}`;case"**":return U+j(h);case"**/*":return`(?:${U}${j(h)}${g})?${G}${p}${N}`;case"**/*.*":return`(?:${U}${j(h)}${g})?${G}${N}${f}${p}${N}`;case"**/.*":return`(?:${U}${j(h)}${g})?${f}${p}${N}`;default:{const se=/^(.*?)\.(\w+)$/.exec(J);if(!se)return;const q=M(se[1]);return q?q+f+se[2]:void 0}}},
|
|
311
311
|
Y=e.removePrefix(c,B);let z=M(Y);return z&&h.strictSlashes!==!0&&(z+=`${g}?`),z},Ws=l,Ws}var Ks,ac;function _0(){if(ac)return Ks;ac=1;const t=es,e=v0(),r=$0(),n=An(),i=bn(),s=a=>a&&typeof a=="object"&&!Array.isArray(a),o=(a,u,l=!1)=>{if(Array.isArray(a)){const g=a.map(m=>o(m,u,l));return m=>{for(const D of g){const v=D(m);if(v)return v}return!1}}const c=s(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const d=u||{},h=n.isWindows(
|
|
312
312
|
u),E=c?o.compileRe(a,u):o.makeRe(a,u,!1,!0),$=E.state;delete E.state;let y=()=>!1;if(d.ignore){const g={...u,ignore:null,onMatch:null,onResult:null};y=o(d.ignore,g,l)}const f=(g,p=!1)=>{const{isMatch:m,match:D,output:v}=o.test(g,E,u,{glob:a,posix:h}),_={glob:a,state:$,regex:E,posix:h,input:g,output:v,match:D,isMatch:m};return typeof d.onResult=="function"&&d.onResult(_),m===!1?(_.isMatch=!1,p?_:!1):y(g)?(typeof d.onIgnore=="function"&&d.onIgnore(_),_.isMatch=!1,p?_:!1):(typeof d.onMatch=="functi\
|
|
313
313
|
on"&&d.onMatch(_),p?_:!0)};return l&&(f.state=$),f};return o.test=(a,u,l,{glob:c,posix:d}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const h=l||{},E=h.format||(d?n.toPosixSlashes:null);let $=a===c,y=$&&E?E(a):a;return $===!1&&(y=E?E(a):a,$=y===c),($===!1||h.capture===!0)&&(h.matchBase===!0||h.basename===!0?$=o.matchBase(a,u,l,d):$=u.exec(y)),{isMatch:!!$,match:$,output:y}},o.matchBase=(a,u,l,c=n.isWindows(l))=>(u instanceof
|
|
314
314
|
RegExp?u:o.makeRe(u,l)).test(t.basename(a)),o.isMatch=(a,u,l)=>o(u,l)(a),o.parse=(a,u)=>Array.isArray(a)?a.map(l=>o.parse(l,u)):r(a,{...u,fastpaths:!1}),o.scan=(a,u)=>e(a,u),o.compileRe=(a,u,l=!1,c=!1)=>{if(l===!0)return a.output;const d=u||{},h=d.contains?"":"^",E=d.contains?"":"$";let $=`${h}(?:${a.output})${E}`;a&&a.negated===!0&&($=`^(?!${$}).*$`);const y=o.toRegex($,u);return c===!0&&(y.state=a),y},o.makeRe=(a,u={},l=!1,c=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-e\
|
|
315
|
-
mpty string");let d={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(d.output=r.fastpaths(a,u)),d.output||(d=r(a,u)),o.compileRe(d,u,l,c)},o.toRegex=(a,u)=>{try{const l=u||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(u&&u.debug===!0)throw l;return/$^/}},o.constants=i,Ks=o,Ks}var Ys,uc;function w0(){return uc||(uc=1,Ys=_0()),Ys}var
|
|
315
|
+
mpty string");let d={negated:!1,fastpaths:!0};return u.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(d.output=r.fastpaths(a,u)),d.output||(d=r(a,u)),o.compileRe(d,u,l,c)},o.toRegex=(a,u)=>{try{const l=u||{};return new RegExp(a,l.flags||(l.nocase?"i":""))}catch(l){if(u&&u.debug===!0)throw l;return/$^/}},o.constants=i,Ks=o,Ks}var Ys,uc;function w0(){return uc||(uc=1,Ys=_0()),Ys}var Xs,cc;function b0(){if(cc)return Xs;cc=1;const t=Ya,e=D0(),r=w0(),n=An(),i=a=>a===""||a==="./",s=a=>{const u=a.indexOf("\
|
|
316
316
|
{");return u>-1&&a.indexOf("}",u)>-1},o=(a,u,l)=>{u=[].concat(u),a=[].concat(a);let c=new Set,d=new Set,h=new Set,E=0,$=g=>{h.add(g.output),l&&l.onResult&&l.onResult(g)};for(let g=0;g<u.length;g++){let p=r(String(u[g]),{...l,onResult:$},!0),m=p.state.negated||p.state.negatedExtglob;m&&E++;for(let D of a){let v=p(D,!0);(m?!v.isMatch:v.isMatch)&&(m?c.add(v.output):(c.delete(v.output),d.add(v.output)))}}let f=(E===u.length?[...h]:[...d]).filter(g=>!c.has(g));if(l&&f.length===0){if(l.failglob===!0)throw new Error(
|
|
317
317
|
`No matches found for "${u.join(", ")}"`);if(l.nonull===!0||l.nullglob===!0)return l.unescape?u.map(g=>g.replace(/\\/g,"")):u}return f};return o.match=o,o.matcher=(a,u)=>r(a,u),o.isMatch=(a,u,l)=>r(u,l)(a),o.any=o.isMatch,o.not=(a,u,l={})=>{u=[].concat(u).map(String);let c=new Set,d=[],h=$=>{l.onResult&&l.onResult($),d.push($.output)},E=new Set(o(a,u,{...l,onResult:h}));for(let $ of d)E.has($)||c.add($);return[...c]},o.contains=(a,u,l)=>{if(typeof a!="string")throw new TypeError(`Expected a stri\
|
|
318
318
|
ng: "${t.inspect(a)}"`);if(Array.isArray(u))return u.some(c=>o.contains(a,c,l));if(typeof u=="string"){if(i(a)||i(u))return!1;if(a.includes(u)||a.startsWith("./")&&a.slice(2).includes(u))return!0}return o.isMatch(a,u,{...l,contains:!0})},o.matchKeys=(a,u,l)=>{if(!n.isObject(a))throw new TypeError("Expected the first argument to be an object");let c=o(Object.keys(a),u,l),d={};for(let h of c)d[h]=a[h];return d},o.some=(a,u,l)=>{let c=[].concat(a);for(let d of[].concat(u)){let h=r(String(d),l);if(c.
|
|
319
319
|
some(E=>h(E)))return!0}return!1},o.every=(a,u,l)=>{let c=[].concat(a);for(let d of[].concat(u)){let h=r(String(d),l);if(!c.every(E=>h(E)))return!1}return!0},o.all=(a,u,l)=>{if(typeof a!="string")throw new TypeError(`Expected a string: "${t.inspect(a)}"`);return[].concat(u).every(c=>r(c,l)(a))},o.capture=(a,u,l)=>{let c=n.isWindows(l),h=r.makeRe(String(a),{...l,capture:!0}).exec(c?n.toPosixSlashes(u):u);if(h)return h.slice(1).map(E=>E===void 0?"":E)},o.makeRe=(...a)=>r.makeRe(...a),o.scan=(...a)=>r.
|
|
320
|
-
scan(...a),o.parse=(a,u)=>{let l=[];for(let c of[].concat(a||[]))for(let d of e(String(c),u))l.push(r.parse(d,u));return l},o.braces=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return u&&u.nobrace===!0||!s(a)?[a]:e(a,u)},o.braceExpand=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...u,expand:!0})},o.hasBraces=s,
|
|
320
|
+
scan(...a),o.parse=(a,u)=>{let l=[];for(let c of[].concat(a||[]))for(let d of e(String(c),u))l.push(r.parse(d,u));return l},o.braces=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return u&&u.nobrace===!0||!s(a)?[a]:e(a,u)},o.braceExpand=(a,u)=>{if(typeof a!="string")throw new TypeError("Expected a string");return o.braces(a,{...u,expand:!0})},o.hasBraces=s,Xs=o,Xs}var A0=b0();const lc=Xi(A0),C0={useRecommendedBuildConfig:!0,removeViteModuleLoader:!1,deleteInlinedFiles:!0};
|
|
321
321
|
function S0(t,e,r,n=!1){const i=new RegExp(`<script([^>]*?) src="[./]*${e}"([^>]*)></script>`),s=/"?__VITE_PRELOAD__"?/g,o=r.replace(s,"void 0").replace(/<(\/script>|!--)/g,"\\x3C$1"),a=t.replace(i,(u,l,c)=>`<script${l}${c}>${o.trim()}</script>`);return n?N0(a):a}function R0(t,e,r){const n=new RegExp(`<link([^>]*?) href="[./]*${e}"([^>]*?)>`),i=r.replace('@charset "UTF-8";',"");return t.replace(n,(o,a,u)=>`<style${a}${u}>${i.trim()}</style>`)}const O0=/\.[mc]?js$/,I0=/\.css$/,F0=/\.html?$/;function P0({
|
|
322
322
|
useRecommendedBuildConfig:t=!0,removeViteModuleLoader:e=!1,inlinePattern:r=[],deleteInlinedFiles:n=!0}=C0){function i(s){console.debug(`NOTE: asset not inlined: ${s}`)}return{name:"vite:singlefile",config:t?T0:void 0,enforce:"post",generateBundle:(s,o)=>{console.debug(`
|
|
323
323
|
`);const a={html:[],css:[],js:[],other:[]};for(const l of Object.keys(o))F0.test(l)?a.html.push(l):I0.test(l)?a.css.push(l):O0.test(l)?a.js.push(l):a.other.push(l);const u=[];for(const l of a.html){const c=o[l];let d=c.source;for(const h of a.js){if(r.length&&!lc.isMatch(h,r)){i(h);continue}const E=o[h];E.code!=null&&(console.debug(`Inlining: ${h}`),u.push(h),d=S0(d,E.fileName,E.code,e))}for(const h of a.css){if(r.length&&!lc.isMatch(h,r)){i(h);continue}const E=o[h];console.debug(`Inlining: ${h}`),
|
|
324
324
|
u.push(h),d=R0(d,E.fileName,E.source)}c.source=d}if(n)for(const l of u)delete o[l];for(const l of a.other)i(l)}}}const N0=t=>t.replace(/(<script type="module" crossorigin>\s*)\(function(?: polyfill)?\(\)\s*\{[\s\S]*?\}\)\(\);/,'<script type="module">'),T0=t=>{t.build||(t.build={}),t.build.assetsInlineLimit=()=>!0,t.build.chunkSizeWarningLimit=1e8,t.build.cssCodeSplit=!1,t.base="./",t.build.assetsDir="",t.build.rollupOptions||(t.build.rollupOptions={}),t.build.rollupOptions.output||(t.build.rollupOptions.
|
|
325
325
|
output={});const e=r=>{r.inlineDynamicImports=!0};if(Array.isArray(t.build.rollupOptions.output))for(const r of t.build.rollupOptions.output)e(r);else e(t.build.rollupOptions.output)};function L0(t){var e,r;if(t){if("astNode"in t)return B0(t);if(Array.isArray(t))return t.reduce(fc,void 0);{const n=t,i=j0(n)?k0((r=(e=n?.root)===null||e===void 0?void 0:e.astNode)!==null&&r!==void 0?r:n?.astNode):void 0;return yr(n,i)}}else return}function j0(t){return typeof t<"u"&&"element"in t&&"text"in t}function k0(t){
|
|
326
|
-
try{return Ba(t).uri.toString()}catch{return}}function B0(t){var e,r;const{astNode:n,property:i,index:s}=t??{},o=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||o===void 0)){if(i===void 0)return yr(o,
|
|
327
|
-
function
|
|
326
|
+
try{return Ba(t).uri.toString()}catch{return}}function B0(t){var e,r;const{astNode:n,property:i,index:s}=t??{},o=(e=n?.$cstNode)!==null&&e!==void 0?e:n?.$textRegion;if(!(n===void 0||o===void 0)){if(i===void 0)return yr(o,Js(n));{const a=u=>s!==void 0&&s>-1&&Array.isArray(n[i])?s<u.length?u[s]:void 0:u.reduce(fc,void 0);if(!((r=o.assignments)===null||r===void 0)&&r[i]){const u=a(o.assignments[i]);return u&&yr(u,Js(n))}else if(n.$cstNode){const u=a(Dp(n.$cstNode,i));return u&&yr(u,Js(n))}else return}}}
|
|
327
|
+
function Js(t){var e,r,n,i;return t.$cstNode?(r=(e=Ba(t))===null||e===void 0?void 0:e.uri)===null||r===void 0?void 0:r.toString():t.$textRegion?t.$textRegion.documentURI||((i=(n=new vp(t,s=>s.$container?[s.$container]:[]).find(s=>{var o;return(o=s.$textRegion)===null||o===void 0?void 0:o.documentURI}))===null||n===void 0?void 0:n.$textRegion)===null||i===void 0?void 0:i.documentURI):void 0}function yr(t,e){var r,n;const i={offset:t.offset,end:(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,length:(n=
|
|
328
328
|
t.length)!==null&&n!==void 0?n:t.end-t.offset};return t.range&&(i.range=t.range),e??(e=t.fileURI),e&&(i.fileURI=e),i}function fc(t,e){var r,n;if(t){if(!e)return t&&yr(t)}else return e&&yr(e);const i=(r=t.end)!==null&&r!==void 0?r:t.offset+t.length,s=(n=e.end)!==null&&n!==void 0?n:e.offset+e.length,o=Math.min(t.offset,e.offset),a=Math.max(i,s),u=a-o,l={offset:o,end:a,length:u};if(t.range&&e.range&&(l.range={start:e.range.start.line<t.range.start.line||e.range.start.line===t.range.start.line&&e.range.
|
|
329
329
|
start.character<t.range.start.character?e.range.start:t.range.start,end:e.range.end.line>t.range.end.line||e.range.end.line===t.range.end.line&&e.range.end.character>t.range.end.character?e.range.end:t.range.end}),t.fileURI||e.fileURI){const c=t.fileURI,d=e.fileURI,h=c&&d&&c!==d?`<unmergable text regions of ${c}, ${d}>`:c??d;l.fileURI=h}return l}class x0{constructor(e){this.defaultIndentation=" ",this.pendingIndent=!0,this.currentIndents=[],this.recentNonImmediateIndents=[],this.traceData=[],
|
|
330
330
|
this.lines=[[]],this.length=0,typeof e=="string"?this.defaultIndentation=e:typeof e=="number"&&(this.defaultIndentation="".padStart(e))}get content(){return this.lines.map(e=>e.join("")).join("")}get contentLength(){return this.length}get currentLineNumber(){return this.lines.length-1}get currentLineContent(){return this.lines[this.currentLineNumber].join("")}get currentPosition(){return{offset:this.contentLength,line:this.currentLineNumber,character:this.currentLineContent.length}}append(e,r){if(e.
|
|
@@ -335,10 +335,10 @@ targetStart.offset,end:i.offset,length:i.offset-n.targetStart.offset,range:{star
|
|
|
335
335
|
const i=n.children&&n.children.length===1?n.children[0]:void 0,s=i?.targetRegion,o=n.targetRegion;return s&&i.sourceRegion&&s.offset===o.offset&&s.length===o.length?{text:r.content,trace:i}:{text:r.content,trace:n}}function dc(t,e){typeof t=="string"?U0(t,e):t instanceof Zs?H0(t,e):t instanceof Ne?mc(t,e):t instanceof Gr&&V0(t,e)}function hc(t,e){return typeof t=="string"?t.length!==0:t instanceof Ne?t.contents.some(r=>hc(r,e)):t instanceof Gr?!(t.ifNotEmpty&&e.currentLineContent.length===0):!1}
|
|
336
336
|
function U0(t,e){t&&(e.pendingIndent&&pc(e,!1),e.append(t))}function pc(t,e){var r;let n="";for(const i of t.relevantIndents.filter(s=>s.indentEmptyLines||!e))n+=(r=i.indentation)!==null&&r!==void 0?r:t.defaultIndentation;t.append(n,!0),t.pendingIndent=!1}function mc(t,e){let r;const n=L0(t.tracedSource);n&&(r=e.pushTraceRegion(n));for(const i of t.contents)dc(i,e);if(r){e.popTraceRegion(r);const i=e.getParentTraceSourceFileURI();i&&n?.fileURI===i&&delete n.fileURI,r.complete&&r.complete(e.currentPosition)}}
|
|
337
337
|
function H0(t,e){var r;if(hc(t,e)){t.indentImmediately&&!e.pendingIndent&&e.append((r=t.indentation)!==null&&r!==void 0?r:e.defaultIndentation,!0);try{e.increaseIndent(t),mc(t,e)}finally{e.decreaseIndent()}}}function V0(t,e){t.ifNotEmpty&&!z0(e.currentLineContent)?e.resetCurrentLine():(e.pendingIndent&&pc(e,!0),e.append(t.lineDelimiter),e.addNewLine())}function z0(t){return t.trimStart()!==""}Object.freeze("__\xABSKIP^NEW^LINE^IF^EMPTY\xBB__");const G0=/\S|$/;function W0(t){const e=t.filter(n=>n.
|
|
338
|
-
length>0).map(n=>n.search(G0)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function jt(t,...e){const r=Y0(t),n=
|
|
339
|
-
e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(o=>o.length!==0);const s=W0(i);return{indentation:s,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<s||!e[e.length-1].startsWith(i[0].substring(0,s)))}}}function
|
|
340
|
-
Cn,h):(d,h,E)=>E===0?[h]:d.concat(Cn,h),[]).filter(d=>!(typeof d=="string"&&d.length===0)).concat(zr(e[c])?e[c]:e[c]!==void 0?{content:String(e[c])}:c<e.length?gc:[]))});const a=o.length,u=a!==0?o[a-1]:void 0;return(i||s)&&typeof u=="string"&&u.trim().length===0?n&&a!==1&&o[a-2]===Cn?o.slice(0,a-2):o.slice(0,a-1):o}const Cn={isNewLine:!0},gc={isUndefinedSegment:!0},yc=t=>t===Cn,Qs=t=>t===gc,
|
|
341
|
-
t[i-1]))||i>1&&typeof t[i-1]=="string"&&(Qs(t[i-2])||zr(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var s;const o=(i===0||yc(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=
|
|
338
|
+
length>0).map(n=>n.search(G0)),r=e.length===0?0:Math.min(...e);return Math.max(0,r)}function jt(t,...e){const r=Y0(t),n=X0(t,e,r);return Q0(n)}function K0(t,e,r){return(n,...i)=>eg(t,e,r)(jt(n,...i))}function Y0(t){const e=t.join("_").split(xa),r=e.length>1&&e[0].trim().length===0,n=r&&e.length>1&&e[e.length-1].trim().length===0;if(e.length===1||e.length!==0&&e[0].trim().length!==0||e.length===2&&e[1].trim().length===0)return{indentation:0,omitFirstLine:r,omitLastLine:n,trimLastLine:e.length!==1&&
|
|
339
|
+
e[e.length-1].trim().length===0};{let i=r?e.slice(1):e;i=n?i.slice(0,i.length-1):i,i=i.filter(o=>o.length!==0);const s=W0(i);return{indentation:s,omitFirstLine:r,omitLastLine:n&&(e[e.length-1].length<s||!e[e.length-1].startsWith(i[0].substring(0,s)))}}}function X0(t,e,{indentation:r,omitFirstLine:n,omitLastLine:i,trimLastLine:s}){const o=[];t.forEach((l,c)=>{o.push(...l.split(xa).map((d,h)=>h===0||d.length<r?d:d.substring(r)).reduce(c===0?(d,h,E)=>E===0?n?[]:[h]:E===1&&d.length===0?[h]:d.concat(
|
|
340
|
+
Cn,h):(d,h,E)=>E===0?[h]:d.concat(Cn,h),[]).filter(d=>!(typeof d=="string"&&d.length===0)).concat(zr(e[c])?e[c]:e[c]!==void 0?{content:String(e[c])}:c<e.length?gc:[]))});const a=o.length,u=a!==0?o[a-1]:void 0;return(i||s)&&typeof u=="string"&&u.trim().length===0?n&&a!==1&&o[a-2]===Cn?o.slice(0,a-2):o.slice(0,a-1):o}const Cn={isNewLine:!0},gc={isUndefinedSegment:!0},yc=t=>t===Cn,Qs=t=>t===gc,J0=t=>t.content!==void 0;function Q0(t){return t.reduce((r,n,i)=>Qs(n)?r:yc(n)?{node:i!==0&&(Qs(t[i-1])||zr(
|
|
341
|
+
t[i-1]))||i>1&&typeof t[i-1]=="string"&&(Qs(t[i-2])||zr(t[i-2]))?r.node.appendNewLineIfNotEmpty():r.node.appendNewLine()}:(()=>{var s;const o=(i===0||yc(t[i-1]))&&typeof n=="string"&&n.length!==0?"".padStart(n.length-n.trimStart().length):"",a=J0(n)?n.content:n;let u;return{node:r.indented?r.node:o.length!==0?r.node.indent({indentation:o,indentImmediately:!1,indentedChildren:l=>u=l.append(a)}):r.node.append(a),indented:u??((s=r.indented)===null||s===void 0?void 0:s.append(a))}})(),{node:new Ne}).
|
|
342
342
|
node}const Z0=typeof process>"u"?`
|
|
343
343
|
`:process.platform==="win32"?`\r
|
|
344
344
|
`:`
|
|
@@ -384,10 +384,10 @@ continue}p+=v}const m=l||Object.keys(f).reduce((D,v)=>f[D]<f[v]?D:v);return p=p.
|
|
|
384
384
|
`+s+D+`,
|
|
385
385
|
`+f+"]"}return i.pop(),s=f,p}};const hg={parse:og,stringify:dg};var Ct=hg;const pg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),mg=t=>t.split(".").map(pg).join(""),gg=t=>mg(t.parent?t.id.slice(t.parent.length+1):t.id),yg=({autoLayout:t})=>{switch(t.direction){case"TB":return"down";case"BT":return"up";case"LR":return"right";case"RL":return"left"}},Eg=({shape:t})=>{switch(t){case"queue":case"cylinder":case"rectangle":case"person":return t;case"storage":return"stored_data";case"mobile":case"browse\
|
|
386
386
|
r":return"rectangle"}};function _c(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const u=gg(o),l=(a?a+".":"")+u;n.set(o.id,l);const c=JSON.stringify(o.title),d=Eg(o);return new Ne().append(u,": {",ve).indent({indentedChildren:h=>h.append("label: ",c,ve).appendIf(d!=="rectangle","shape: ",d,ve).appendIf(o.children.length>0,ve,nt(e.filter(E=>E.parent===o.id),E=>i(E,l))),indentation:2}).append("}",ve)},s=o=>new Ne().append(n.get(o.source)," -> ",n.get(o.target)).append(a=>o.label&&a.append(": ",JSON.
|
|
387
|
-
stringify(o.label)));return kt(new Ne().append("direction: ",yg(t),ve,ve).append(nt(e.filter(o=>
|
|
387
|
+
stringify(o.label)));return kt(new Ne().append("direction: ",yg(t),ve,ve).append(nt(e.filter(o=>Ji(o.parent)),o=>i(o),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,ve,nt(r,o=>s(o),{appendNewLineIfNotEmpty:!0})))}const Dg=t=>t.charAt(0).toLocaleUpperCase()+t.slice(1),vg=t=>t.split(".").map(Dg).join(""),$g=t=>vg(t.parent?t.id.slice(t.parent.length+1):t.id),_g=({shape:t})=>{switch(t){case"queue":case"cylinder":return["[(",")]"];case"person":return["[fa:fa-user ","]"];case"storage":return["([",
|
|
388
388
|
"])"];case"mobile":case"browser":case"rectangle":return["[","]"]}};function wc(t){const{nodes:e,edges:r}=t,n=new Map,i=(o,a)=>{const u=$g(o),l=(a?a+".":"")+u;n.set(o.id,l);const c=o.title.replaceAll(`
|
|
389
389
|
`,"\\n"),d=_g(o),h=new Ne;return o.children.length>0?h.append("subgraph ",l,"[",JSON.stringify(o.title),"]",ve).indent({indentedChildren:[nt(e.filter(E=>E.parent===o.id),E=>i(E,l),{appendNewLineIfNotEmpty:!0})],indentation:2}).append("end",ve):h.append(l,d[0],c,d[1]),h},s=o=>new Ne().append(n.get(o.source)," -.",o.label?' "'+o.label.replaceAll(`
|
|
390
|
-
`,"\\n")+'" .-':"-","> ",n.get(o.target));return kt(new Ne().appendIf(t.title!==null&&t.title.length>0,"---",ve,`title: ${JSON.stringify(t.title)}`,ve,"---",ve).append("graph ",t.autoLayout.direction,ve).indent({indentedChildren:o=>{o.append(nt(e.filter(a=>
|
|
390
|
+
`,"\\n")+'" .-':"-","> ",n.get(o.target));return kt(new Ne().appendIf(t.title!==null&&t.title.length>0,"---",ve,`title: ${JSON.stringify(t.title)}`,ve,"---",ve).append("graph ",t.autoLayout.direction,ve).indent({indentedChildren:o=>{o.append(nt(e.filter(a=>Ji(a.parent)),a=>i(a),{appendNewLineIfNotEmpty:!0})).appendIf(r.length>0,nt(r,a=>s(a),{appendNewLineIfNotEmpty:!0}))},indentation:2}))}function wg(t){const e=new Ne;return e.appendTemplate`
|
|
391
391
|
/* prettier-ignore-start */
|
|
392
392
|
/* eslint-disable */
|
|
393
393
|
|
|
@@ -714,14 +714,14 @@ likec4AssetsDir:e,...r})=>{const n=r.customLogger??Cs,i=Rs(),s=r?.useOverviewGra
|
|
|
714
714
|
nv.NODE_ENV":'"production"'},build:{outDir:o,modulePreload:!1,emptyOutDir:!1,cssCodeSplit:!1,sourcemap:!1,cssMinify:!0,minify:!0,copyPublicDir:!0,chunkSizeWarningLimit:Is,rollupOptions:{treeshake:{preset:"recommended"},output:{hoistTransitiveImports:!1,compact:!0}}},customLogger:n,plugins:[Za(),ao({languageServices:t,useOverviewGraph:s})].concat(r.outputSingleFile?[P0()]:[])}};async function co({languageServices:t,outDir:e,base:r,webcomponentPrefix:n="likec4",filename:i="likec4-views.js"}){const s=Cs,
|
|
715
715
|
o=Rs();return s.info(K.cyan("outDir")+" "+K.dim(e)),{root:o,clearScreen:!1,base:r,configFile:!1,publicDir:!1,mode:"production",resolve:{conditions:["production"],alias:Fs()},define:{WEBCOMPONENT_PREFIX:JSON.stringify(n),"process.env.NODE_ENV":'"production"'},esbuild:{...Ss},build:{outDir:e,emptyOutDir:!1,sourcemap:!1,minify:!0,assetsInlineLimit:100*1024,chunkSizeWarningLimit:Is,lib:{entry:"webcomponent/webcomponent.js",fileName(a,u){return i},formats:["iife"],name:"LikeC4Views"},commonjsOptions:{
|
|
716
716
|
defaultIsModuleExports:a=>a.includes("react")?!0:"auto",requireReturnsDefault:"auto"},rollupOptions:{treeshake:{preset:"recommended"},output:{format:"iife",hoistTransitiveImports:!1,compact:!0}}},customLogger:s,plugins:[ao({languageServices:t,useOverviewGraph:!1})]}}const Mg=["favicon.ico","robots.txt"],qg=async({buildWebcomponent:t=!0,webcomponentPrefix:e="likec4",languageServices:r,likec4AssetsDir:n,outputSingleFile:i,...s})=>{n??=await an(Rr(un(),".likec4-assets-"));const{isDev:o,...a}=await uo(
|
|
717
|
-
{...s,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:i}),u=await Os();for(const d of Mg){const h=De(a.root,d);Pt(h)&&
|
|
718
|
-
views`)}`),c.forEach(d=>{d.hasLayoutDrift&&a.customLogger.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id))}),t){const d=await co({webcomponentPrefix:e,languageServices:r,outDir:u,base:a.base});await Fr(d)}if(await Fr({...a,publicDir:u,mode:"production"}),i)for(let d of Yp(De(a.build.outDir)).filter(h=>h!=="index.html"))is(De(a.build.outDir,d),{recursive:!0});else{const d=De(a.build.outDir,"index.html");Pt(d)&&
|
|
717
|
+
{...s,languageServices:r,likec4AssetsDir:n,webcomponentPrefix:e,outputSingleFile:i}),u=await Os();for(const d of Mg){const h=De(a.root,d);Pt(h)&&Ja(h,De(u,d))}const l=await r.viewsService.computedViews(),c=await r.diagrams();if(c.length===0)throw process.exitCode=1,new Error("no views found");if(c.length===l.length?a.customLogger.info(`${K.dim("workspace:")} ${K.green("\u2713 all views layouted")}`):a.customLogger.warn(`${K.dim("workspace:")} ${K.yellow(`\u2717 layouted ${c.length} of ${l.length}\
|
|
718
|
+
views`)}`),c.forEach(d=>{d.hasLayoutDrift&&a.customLogger.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id))}),t){const d=await co({webcomponentPrefix:e,languageServices:r,outDir:u,base:a.base});await Fr(d)}if(await Fr({...a,publicDir:u,mode:"production"}),i)for(let d of Yp(De(a.build.outDir)).filter(h=>h!=="index.html"))is(De(a.build.outDir,d),{recursive:!0});else{const d=De(a.build.outDir,"index.html");Pt(d)&&Ja(d,De(a.build.outDir,"404.html"))}};function Cc(t){
|
|
719
719
|
if(t.resolvedUrls)return Ha(t.resolvedUrls.network)??Ha(t.resolvedUrls.local)}function Sc(t){if(!t.resolvedUrls)throw new Error("Vite server is not ready, no resolvedUrls");zt([K.green("LikeC4 served at:"),"",K.dim("Local: ")+t.resolvedUrls.local.join(`
|
|
720
720
|
`+"".padEnd(9," ")),t.resolvedUrls.network.length?K.dim("Network: ")+t.resolvedUrls.network.join(`
|
|
721
721
|
`+"".padEnd(9," ")):void 0].filter(e=>Ua(e)).join(`
|
|
722
|
-
`))}class Rc extends Error{constructor(e){super(`${e} is locked`)}}const Er={old:new Set,young:new Set},Ug=1e3*15,In=1024,Fn=65535;let
|
|
722
|
+
`))}class Rc extends Error{constructor(e){super(`${e} is locked`)}}const Er={old:new Set,young:new Set},Ug=1e3*15,In=1024,Fn=65535;let Xr;const Hg=()=>{const t=Ir.networkInterfaces(),e=new Set([void 0,"0.0.0.0"]);for(const r of Object.values(t))for(const n of r)e.add(n.address);return e},Oc=t=>new Promise((e,r)=>{const n=rm.createServer();n.unref(),n.on("error",r),n.listen(t,()=>{const{port:i}=n.address();n.close(()=>{e(i)})})}),Ic=async(t,e)=>{if(t.host||t.port===0)return Oc(t);for(const r of e)
|
|
723
723
|
try{await Oc({port:t.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return t.port},Vg=function*(t){t&&(yield*t),yield 0};async function lo(t){let e,r=new Set;if(t&&(t.port&&(e=typeof t.port=="number"?[t.port]:t.port),t.exclude)){const i=t.exclude;if(typeof i[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(const s of i){if(typeof s!="number")throw new TypeError("Each item in the `exclude` option must be a number cor\
|
|
724
|
-
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}
|
|
724
|
+
responding to the port you want excluded.");if(!Number.isSafeInteger(s))throw new TypeError(`Number ${s} in the exclude option is not a safe integer and can't be used`)}r=new Set(i)}Xr===void 0&&(Xr=setTimeout(()=>{Xr=void 0,Er.old=Er.young,Er.young=new Set},Ug),Xr.unref&&Xr.unref());const n=Hg();for(const i of Vg(e))try{if(r.has(i))continue;let s=await Ic({...t,port:i},n);for(;Er.old.has(s)||Er.young.has(s);){if(i!==0)throw new Rc(i);s=await Ic({...t,port:i},n)}return Er.young.add(s),s}catch(s){
|
|
725
725
|
if(!["EADDRINUSE","EACCES"].includes(s.code)&&!(s instanceof Rc))throw s}throw new Error("No available ports found")}function Pn(t,e){if(!Number.isInteger(t)||!Number.isInteger(e))throw new TypeError("`from` and `to` must be integer numbers");if(t<In||t>Fn)throw new RangeError(`'from' must be between ${In} and ${Fn}`);if(e<In||e>Fn)throw new RangeError(`'to' must be between ${In} and ${Fn}`);if(t>e)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,i){for(let s=n;s<=
|
|
726
726
|
i;s++)yield s}(t,e)}async function Fc({buildWebcomponent:t=!0,hmr:e=!0,webcomponentPrefix:r="likec4",languageServices:n,likec4AssetsDir:i,openBrowser:s,listen:o,...a}){i??=await an(Rr(un(),".likec4-assets-"));const{isDev:u,...l}=await uo({...a,languageServices:n,likec4AssetsDir:i,webcomponentPrefix:r}),c=await lo({port:[5173,...Pn(61e3,61010),...Pn(62002,62010)]}),d=await lo({port:Pn(24678,24690)}),h=await Os();let E;if(t){const y=await co({webcomponentPrefix:r,languageServices:n,outDir:h,base:l.
|
|
727
727
|
base});E=Fr({...y,logLevel:"warn"}).catch(f=>(mt.warn("webcomponent build failed",{err:f}),mt.warn("Ignoring error and continuing"),Promise.resolve()))}const $=await em({...l,define:Object.assign({},l.define,e&&{"process.env.NODE_ENV":'"development"'}),mode:e?"development":l.mode,publicDir:h,server:{host:o??"127.0.0.1",allowedHosts:!0,port:c,hmr:e&&{overlay:!0,port:d},fs:{strict:!1},open:s??!u}});return await $.listen(),E&&await E,$}async function zg({browserContext:t,views:e,output:r,logger:n,timeout:i,
|
|
@@ -739,15 +739,15 @@ aliases:["bundle"],describe:"Build a static website",builder:t=>t.positional("pa
|
|
|
739
739
|
await Wg({path:t.path,output:t.output,base:t.base,useHashHistory:t["use-hash-history"],useDotBin:t["use-dot"],useOverview:t["use-overview"]??!1,webcomponentPrefix:t["webcomponent-prefix"],outputSingleFile:t["output-single-file"]??!1})}},ar=t=>{const e=typeof t;return t!==null&&(e==="object"||e==="function")},fo=new Set(["__proto__","prototype","constructor"]),Yg=new Set("0123456789");function Nn(t){const e=[];let r="",n="start",i=!1;for(const s of t)switch(s){case"\\":{if(n==="index")throw new Error(
|
|
740
740
|
"Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),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+=s;break}if(fo.has(r))return[];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(fo.has(r))return[];e.push(
|
|
741
741
|
r),r=""}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!Yg.has(s))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+=s}}switch(i&&(r+="\\"),n){case"property":{if(fo.has(r))return[];e.push(r);break}case"index":throw new Error("Index was not \
|
|
742
|
-
closed");case"start":{e.push("");break}}return e}function ho(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function jc(t,e){if(ho(t,e))throw new Error("Cannot use string index")}function
|
|
743
|
-
void 0?r:t}function kc(t,e,r){if(!ar(t)||typeof e!="string")return t;const n=t,i=Nn(e);for(let s=0;s<i.length;s++){const o=i[s];jc(t,o),s===i.length-1?t[o]=r:ar(t[o])||(t[o]=typeof i[s+1]=="number"?[]:{}),t=t[o]}return n}function
|
|
742
|
+
closed");case"start":{e.push("");break}}return e}function ho(t,e){if(typeof e!="number"&&Array.isArray(t)){const r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return!1}function jc(t,e){if(ho(t,e))throw new Error("Cannot use string index")}function Xg(t,e,r){if(!ar(t)||typeof e!="string")return r===void 0?t:r;const n=Nn(e);if(n.length===0)return r;for(let i=0;i<n.length;i++){const s=n[i];if(ho(t,s)?t=i===n.length-1?void 0:null:t=t[s],t==null){if(i!==n.length-1)return r;break}}return t===
|
|
743
|
+
void 0?r:t}function kc(t,e,r){if(!ar(t)||typeof e!="string")return t;const n=t,i=Nn(e);for(let s=0;s<i.length;s++){const o=i[s];jc(t,o),s===i.length-1?t[o]=r:ar(t[o])||(t[o]=typeof i[s+1]=="number"?[]:{}),t=t[o]}return n}function Jg(t,e){if(!ar(t)||typeof e!="string")return!1;const r=Nn(e);for(let n=0;n<r.length;n++){const i=r[n];if(jc(t,i),n===r.length-1)return delete t[i],!0;if(t=t[i],!ar(t))return!1}}function Qg(t,e){if(!ar(t)||typeof e!="string")return!1;const r=Nn(e);if(r.length===0)return!1;
|
|
744
744
|
for(const n of r){if(!ar(t)||!(n in t)||ho(t,n))return!1;t=t[n]}return!0}const xt=Ir.homedir(),po=Ir.tmpdir(),{env:Dr}=Te,Zg=t=>{const e=be.join(xt,"Library");return{data:be.join(e,"Application Support",t),config:be.join(e,"Preferences",t),cache:be.join(e,"Caches",t),log:be.join(e,"Logs",t),temp:be.join(po,t)}},ey=t=>{const e=Dr.APPDATA||be.join(xt,"AppData","Roaming"),r=Dr.LOCALAPPDATA||be.join(xt,"AppData","Local");return{data:be.join(r,t,"Data"),config:be.join(e,t,"Config"),cache:be.join(r,t,
|
|
745
745
|
"Cache"),log:be.join(r,t,"Log"),temp:be.join(po,t)}},ty=t=>{const e=be.basename(xt);return{data:be.join(Dr.XDG_DATA_HOME||be.join(xt,".local","share"),t),config:be.join(Dr.XDG_CONFIG_HOME||be.join(xt,".config"),t),cache:be.join(Dr.XDG_CACHE_HOME||be.join(xt,".cache"),t),log:be.join(Dr.XDG_STATE_HOME||be.join(xt,".local","state"),t),temp:be.join(po,e,t)}};function ry(t,{suffix:e="nodejs"}={}){if(typeof t!="string")throw new TypeError(`Expected a string, got ${typeof t}`);return e&&(t+=`-${e}`),Te.
|
|
746
|
-
platform==="darwin"?Zg(t):Te.platform==="win32"?ey(t):ty(t)}const Mt=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},St=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(i){return e(i)}},ny=Te.getuid?!Te.getuid():!1,iy=1e4,
|
|
746
|
+
platform==="darwin"?Zg(t):Te.platform==="win32"?ey(t):ty(t)}const Mt=(t,e)=>function(...n){return t.apply(void 0,n).catch(e)},St=(t,e)=>function(...n){try{return t.apply(void 0,n)}catch(i){return e(i)}},ny=Te.getuid?!Te.getuid():!1,iy=1e4,Xe=()=>{},Re={isChangeErrorOk:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="ENOSYS"||!ny&&(e==="EINVAL"||e==="EPERM")},isNodeError:t=>t instanceof Error,isRetriableError:t=>{if(!Re.isNodeError(t))return!1;const{code:e}=t;return e==="EMFILE"||e===
|
|
747
747
|
"ENFILE"||e==="EAGAIN"||e==="EBUSY"||e==="EACCESS"||e==="EACCES"||e==="EACCS"||e==="EPERM"},onChangeError:t=>{if(!Re.isNodeError(t))throw t;if(!Re.isChangeErrorOk(t))throw t}};class sy{constructor(){this.interval=25,this.intervalId=void 0,this.limit=iy,this.queueActive=new Set,this.queueWaiting=new Set,this.init=()=>{this.intervalId||(this.intervalId=setInterval(this.tick,this.interval))},this.reset=()=>{this.intervalId&&(clearInterval(this.intervalId),delete this.intervalId)},this.add=e=>{this.
|
|
748
748
|
queueWaiting.add(e),this.queueActive.size<this.limit/2?this.tick():this.init()},this.remove=e=>{this.queueWaiting.delete(e),this.queueActive.delete(e)},this.schedule=()=>new Promise(e=>{const r=()=>this.remove(n),n=()=>e(r);this.add(n)}),this.tick=()=>{if(!(this.queueActive.size>=this.limit)){if(!this.queueWaiting.size)return this.reset();for(const e of this.queueWaiting){if(this.queueActive.size>=this.limit)break;this.queueWaiting.delete(e),this.queueActive.add(e),e()}}}}}const oy=new sy,qt=(t,e)=>function(n){
|
|
749
749
|
return function i(...s){return oy.schedule().then(o=>{const a=l=>(o(),l),u=l=>{if(o(),Date.now()>=n)throw l;if(e(l)){const c=Math.round(100*Math.random());return new Promise(h=>setTimeout(h,c)).then(()=>i.apply(void 0,s))}throw l};return t.apply(void 0,s).then(a,u)})}},Ut=(t,e)=>function(n){return function i(...s){try{return t.apply(void 0,s)}catch(o){if(Date.now()>n)throw o;if(e(o))return i.apply(void 0,s);throw o}}},qe={attempt:{chmod:Mt(Me(ge.chmod),Re.onChangeError),chown:Mt(Me(ge.chown),Re.
|
|
750
|
-
onChangeError),close:Mt(Me(ge.close),
|
|
750
|
+
onChangeError),close:Mt(Me(ge.close),Xe),fsync:Mt(Me(ge.fsync),Xe),mkdir:Mt(Me(ge.mkdir),Xe),realpath:Mt(Me(ge.realpath),Xe),stat:Mt(Me(ge.stat),Xe),unlink:Mt(Me(ge.unlink),Xe),chmodSync:St(ge.chmodSync,Re.onChangeError),chownSync:St(ge.chownSync,Re.onChangeError),closeSync:St(ge.closeSync,Xe),existsSync:St(ge.existsSync,Xe),fsyncSync:St(ge.fsync,Xe),mkdirSync:St(ge.mkdirSync,Xe),realpathSync:St(ge.realpathSync,Xe),statSync:St(ge.statSync,Xe),unlinkSync:St(ge.unlinkSync,Xe)},retry:{close:qt(Me(ge.
|
|
751
751
|
close),Re.isRetriableError),fsync:qt(Me(ge.fsync),Re.isRetriableError),open:qt(Me(ge.open),Re.isRetriableError),readFile:qt(Me(ge.readFile),Re.isRetriableError),rename:qt(Me(ge.rename),Re.isRetriableError),stat:qt(Me(ge.stat),Re.isRetriableError),write:qt(Me(ge.write),Re.isRetriableError),writeFile:qt(Me(ge.writeFile),Re.isRetriableError),closeSync:Ut(ge.closeSync,Re.isRetriableError),fsyncSync:Ut(ge.fsyncSync,Re.isRetriableError),openSync:Ut(ge.openSync,Re.isRetriableError),readFileSync:Ut(ge.readFileSync,
|
|
752
752
|
Re.isRetriableError),renameSync:Ut(ge.renameSync,Re.isRetriableError),statSync:Ut(ge.statSync,Re.isRetriableError),writeSync:Ut(ge.writeSync,Re.isRetriableError),writeFileSync:Ut(ge.writeFileSync,Re.isRetriableError)}},ay="utf8",Bc=438,uy=511,cy={},ly=Ir.userInfo().uid,fy=Ir.userInfo().gid,dy=1e3,hy=!!Te.getuid;Te.getuid&&Te.getuid();const xc=128,py=t=>t instanceof Error&&"code"in t,Mc=t=>typeof t=="string",mo=t=>t===void 0,my=Te.platform==="linux",qc=Te.platform==="win32",go=["SIGABRT","SIGALRM",
|
|
753
753
|
"SIGHUP","SIGINT","SIGTERM"];qc||go.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),my&&go.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED");class gy{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=e=>{if(!this.exited){this.exited=!0;for(const r of this.callbacks)r();e&&(qc&&e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"?Te.kill(Te.pid,"SIGTERM"):Te.kill(Te.pid,e))}},this.hook=()=>{Te.once("exit",()=>this.exit());for(const e of go)try{Te.once(
|
|
@@ -768,27 +768,27 @@ _)`${l}${d.scopePath}`})}scopeCode(l=this._values,c,d){return this._reduceValues
|
|
|
768
768
|
opts._n}`;else throw new r(g);f.set(g,n.Completed)})}return E}}t.ValueScope=a}($o)),$o}var Gc;function pe(){return Gc||(Gc=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=Ln(),r=zc();var n=Ln();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,
|
|
769
769
|
get:function(){return n.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return n.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return n.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return n.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,
|
|
770
770
|
get:function(){return n.Name}});var i=zc();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e.
|
|
771
|
-
_Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(w,A){return this}}class o extends s{constructor(w,A,R){super(),this.varKind=w,this.name=A,this.rhs=R}render({es5:w,_n:A}){const R=w?r.varKinds.var:this.varKind,
|
|
772
|
-
return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(w,A,R){super(),this.lhs=w,this.rhs=A,this.sideEffects=R}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,A){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,w,A),this}get names(){const w=this.lhs instanceof e.Name?{}:{...this.lhs.names};return N(w,this.rhs)}}class u extends a{constructor(w,A,R,
|
|
771
|
+
_Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class s{optimizeNodes(){return this}optimizeNames(w,A){return this}}class o extends s{constructor(w,A,R){super(),this.varKind=w,this.name=A,this.rhs=R}render({es5:w,_n:A}){const R=w?r.varKinds.var:this.varKind,X=this.rhs===void 0?"":` = ${this.rhs}`;return`${R} ${this.name}${X};`+A}optimizeNames(w,A){if(w[this.name.str])return this.rhs&&(this.rhs=j(this.rhs,w,A)),this}get names(){
|
|
772
|
+
return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class a extends s{constructor(w,A,R){super(),this.lhs=w,this.rhs=A,this.sideEffects=R}render({_n:w}){return`${this.lhs} = ${this.rhs};`+w}optimizeNames(w,A){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=j(this.rhs,w,A),this}get names(){const w=this.lhs instanceof e.Name?{}:{...this.lhs.names};return N(w,this.rhs)}}class u extends a{constructor(w,A,R,X){super(w,R,X),this.op=A}render({_n:w}){return`${this.
|
|
773
773
|
lhs} ${this.op}= ${this.rhs};`+w}}class l extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`${this.label}:`+w}}class c extends s{constructor(w){super(),this.label=w,this.names={}}render({_n:w}){return`break${this.label?` ${this.label}`:""};`+w}}class d extends s{constructor(w){super(),this.error=w}render({_n:w}){return`throw ${this.error};`+w}get names(){return this.error.names}}class h extends s{constructor(w){super(),this.code=w}render({_n:w}){return`${this.code}\
|
|
774
774
|
;`+w}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(w,A){return this.code=j(this.code,w,A),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class E extends s{constructor(w=[]){super(),this.nodes=w}render(w){return this.nodes.reduce((A,R)=>A+R.render(w),"")}optimizeNodes(){const{nodes:w}=this;let A=w.length;for(;A--;){const R=w[A].optimizeNodes();Array.isArray(R)?w.splice(A,1,...R):R?w[A]=R:w.splice(A,1)}return w.length>0?this:void 0}optimizeNames(w,A){
|
|
775
|
-
const{nodes:R}=this;let
|
|
775
|
+
const{nodes:R}=this;let X=R.length;for(;X--;){const Z=R[X];Z.optimizeNames(w,A)||(M(w,Z.names),R.splice(X,1))}return R.length>0?this:void 0}get names(){return this.nodes.reduce((w,A)=>B(w,A.names),{})}}class $ extends E{render(w){return"{"+w._n+super.render(w)+"}"+w._n}}class y extends E{}class f extends ${}f.kind="else";class g extends ${constructor(w,A){super(A),this.condition=w}render(w){let A=`if(${this.condition})`+super.render(w);return this.else&&(A+="else "+this.else.render(w)),A}optimizeNodes(){
|
|
776
776
|
super.optimizeNodes();const w=this.condition;if(w===!0)return this.nodes;let A=this.else;if(A){const R=A.optimizeNodes();A=this.else=Array.isArray(R)?new f(R):R}if(A)return w===!1?A instanceof g?A:A.nodes:this.nodes.length?this:new g(Y(w),A instanceof g?[A]:A.nodes);if(!(w===!1||!this.nodes.length))return this}optimizeNames(w,A){var R;if(this.else=(R=this.else)===null||R===void 0?void 0:R.optimizeNames(w,A),!!(super.optimizeNames(w,A)||this.else))return this.condition=j(this.condition,w,A),this}get names(){
|
|
777
|
-
const w=super.names;return N(w,this.condition),this.else&&B(w,this.else.names),w}}g.kind="if";class p extends ${}p.kind="for";class m extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,A){if(super.optimizeNames(w,A))return this.iteration=j(this.iteration,w,A),this}get names(){return B(super.names,this.iteration.names)}}class D extends p{constructor(w,A,R,
|
|
778
|
-
es5?r.varKinds.var:this.varKind,{name:R,from:
|
|
777
|
+
const w=super.names;return N(w,this.condition),this.else&&B(w,this.else.names),w}}g.kind="if";class p extends ${}p.kind="for";class m extends p{constructor(w){super(),this.iteration=w}render(w){return`for(${this.iteration})`+super.render(w)}optimizeNames(w,A){if(super.optimizeNames(w,A))return this.iteration=j(this.iteration,w,A),this}get names(){return B(super.names,this.iteration.names)}}class D extends p{constructor(w,A,R,X){super(),this.varKind=w,this.name=A,this.from=R,this.to=X}render(w){const A=w.
|
|
778
|
+
es5?r.varKinds.var:this.varKind,{name:R,from:X,to:Z}=this;return`for(${A} ${R}=${X}; ${R}<${Z}; ${R}++)`+super.render(w)}get names(){const w=N(super.names,this.from);return N(w,this.to)}}class v extends p{constructor(w,A,R,X){super(),this.loop=w,this.varKind=A,this.name=R,this.iterable=X}render(w){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,A){if(super.optimizeNames(w,A))return this.iterable=j(this.iterable,w,A),this}get names(){return B(
|
|
779
779
|
super.names,this.iterable.names)}}class _ extends ${constructor(w,A,R){super(),this.name=w,this.args=A,this.async=R}render(w){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}}_.kind="func";class b extends E{render(w){return"return "+super.render(w)}}b.kind="return";class I extends ${render(w){let A="try"+super.render(w);return this.catch&&(A+=this.catch.render(w)),this.finally&&(A+=this.finally.render(w)),A}optimizeNodes(){var w,A;return super.optimizeNodes(),
|
|
780
|
-
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(A=this.finally)===null||A===void 0||A.optimizeNodes(),this}optimizeNames(w,A){var R,
|
|
780
|
+
(w=this.catch)===null||w===void 0||w.optimizeNodes(),(A=this.finally)===null||A===void 0||A.optimizeNodes(),this}optimizeNames(w,A){var R,X;return super.optimizeNames(w,A),(R=this.catch)===null||R===void 0||R.optimizeNames(w,A),(X=this.finally)===null||X===void 0||X.optimizeNames(w,A),this}get names(){const w=super.names;return this.catch&&B(w,this.catch.names),this.finally&&B(w,this.finally.names),w}}class U extends ${constructor(w){super(),this.error=w}render(w){return`catch(${this.error})`+super.
|
|
781
781
|
render(w)}}U.kind="catch";class G extends ${render(w){return"finally"+super.render(w)}}G.kind="finally";class L{constructor(w,A={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...A,_n:A.lines?`
|
|
782
|
-
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,A){const R=this._extScope.value(w,A);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(w,A){return this._extScope.getValue(w,A)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,A,R,
|
|
783
|
-
const Z=this._scope.toName(A);return R!==void 0&&
|
|
784
|
-
A.length>1&&A.push(","),A.push(R),(R!==
|
|
785
|
-
return this._for(new m(w),A)}forRange(w,A,R,
|
|
786
|
-
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${A})`,R);const Z=this._scope.toName(w);return this._for(new v("in",
|
|
787
|
-
atch" and "finally"');const
|
|
788
|
-
w!==void 0&&R!==w)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${w} expected`);return this._nodes.length=A,this}func(w,A=e.nil,R,
|
|
782
|
+
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,A){const R=this._extScope.value(w,A);return(this._values[R.prefix]||(this._values[R.prefix]=new Set)).add(R),R}getScopeValue(w,A){return this._extScope.getValue(w,A)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,A,R,X){
|
|
783
|
+
const Z=this._scope.toName(A);return R!==void 0&&X&&(this._constants[Z.str]=R),this._leafNode(new o(w,Z,R)),Z}const(w,A,R){return this._def(r.varKinds.const,w,A,R)}let(w,A,R){return this._def(r.varKinds.let,w,A,R)}var(w,A,R){return this._def(r.varKinds.var,w,A,R)}assign(w,A,R){return this._leafNode(new a(w,A,R))}add(w,A){return this._leafNode(new u(w,t.operators.ADD,A))}code(w){return typeof w=="function"?w():w!==e.nil&&this._leafNode(new h(w)),this}object(...w){const A=["{"];for(const[R,X]of w)
|
|
784
|
+
A.length>1&&A.push(","),A.push(R),(R!==X||this.opts.es5)&&(A.push(":"),(0,e.addCodeArg)(A,X));return A.push("}"),new e._Code(A)}if(w,A,R){if(this._blockNode(new g(w)),A&&R)this.code(A).else().code(R).endIf();else if(A)this.code(A).endIf();else if(R)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new g(w))}else(){return this._elseNode(new f)}endIf(){return this._endBlockNode(g,f)}_for(w,A){return this._blockNode(w),A&&this.code(A).endFor(),this}for(w,A){
|
|
785
|
+
return this._for(new m(w),A)}forRange(w,A,R,X,Z=this.opts.es5?r.varKinds.var:r.varKinds.let){const oe=this._scope.toName(w);return this._for(new D(Z,oe,A,R),()=>X(oe))}forOf(w,A,R,X=r.varKinds.const){const Z=this._scope.toName(w);if(this.opts.es5){const oe=A instanceof e.Name?A:this.var("_arr",A);return this.forRange("_i",0,(0,e._)`${oe}.length`,ae=>{this.var(Z,(0,e._)`${oe}[${ae}]`),R(Z)})}return this._for(new v("of",X,Z,A),()=>R(Z))}forIn(w,A,R,X=this.opts.es5?r.varKinds.var:r.varKinds.const){
|
|
786
|
+
if(this.opts.ownProperties)return this.forOf(w,(0,e._)`Object.keys(${A})`,R);const Z=this._scope.toName(w);return this._for(new v("in",X,Z,A),()=>R(Z))}endFor(){return this._endBlockNode(p)}label(w){return this._leafNode(new l(w))}break(w){return this._leafNode(new c(w))}return(w){const A=new b;if(this._blockNode(A),this.code(w),A.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(w,A,R){if(!A&&!R)throw new Error('CodeGen: "try" without "c\
|
|
787
|
+
atch" and "finally"');const X=new I;if(this._blockNode(X),this.code(w),A){const Z=this.name("e");this._currNode=X.catch=new U(Z),A(Z)}return R&&(this._currNode=X.finally=new G,this.code(R)),this._endBlockNode(U,G)}throw(w){return this._leafNode(new d(w))}block(w,A){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(A),this}endBlock(w){const A=this._blockStarts.pop();if(A===void 0)throw new Error("CodeGen: not in self-balancing block");const R=this._nodes.length-A;if(R<0||
|
|
788
|
+
w!==void 0&&R!==w)throw new Error(`CodeGen: wrong number of nodes: ${R} vs ${w} expected`);return this._nodes.length=A,this}func(w,A=e.nil,R,X){return this._blockNode(new _(w,A,R)),X&&this.code(X).endFunc(),this}endFunc(){return this._endBlockNode(_)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w)}_endBlockNode(w,A){
|
|
789
789
|
const R=this._currNode;if(R instanceof w||A&&R instanceof A)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${A?`${w.kind}/${A.kind}`:w.kind}"`)}_elseNode(w){const A=this._currNode;if(!(A instanceof g))throw new Error('CodeGen: "else" without "if"');return this._currNode=A.else=w,this}get _root(){return this._nodes[0]}get _currNode(){const w=this._nodes;return w[w.length-1]}set _currNode(w){const A=this._nodes;A[A.length-1]=w}}t.CodeGen=L;function B(k,w){for(const A in w)k[A]=
|
|
790
|
-
(k[A]||0)+(w[A]||0);return k}function N(k,w){return w instanceof e._CodeOrName?B(k,w.names):k}function j(k,w,A){if(k instanceof e.Name)return R(k);if(!
|
|
791
|
-
void 0)}}function M(k,w){for(const A in w)k[A]=(k[A]||0)-(w[A]||0)}function Y(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,e._)`!${H(k)}`}t.not=Y;const z=C(t.operators.AND);function
|
|
790
|
+
(k[A]||0)+(w[A]||0);return k}function N(k,w){return w instanceof e._CodeOrName?B(k,w.names):k}function j(k,w,A){if(k instanceof e.Name)return R(k);if(!X(k))return k;return new e._Code(k._items.reduce((Z,oe)=>(oe instanceof e.Name&&(oe=R(oe)),oe instanceof e._Code?Z.push(...oe._items):Z.push(oe),Z),[]));function R(Z){const oe=A[Z.str];return oe===void 0||w[Z.str]!==1?Z:(delete w[Z.str],oe)}function X(Z){return Z instanceof e._Code&&Z._items.some(oe=>oe instanceof e.Name&&w[oe.str]===1&&A[oe.str]!==
|
|
791
|
+
void 0)}}function M(k,w){for(const A in w)k[A]=(k[A]||0)-(w[A]||0)}function Y(k){return typeof k=="boolean"||typeof k=="number"||k===null?!k:(0,e._)`!${H(k)}`}t.not=Y;const z=C(t.operators.AND);function J(...k){return k.reduce(z)}t.and=J;const se=C(t.operators.OR);function q(...k){return k.reduce(se)}t.or=q;function C(k){return(w,A)=>w===e.nil?A:A===e.nil?w:(0,e._)`${H(w)} ${k} ${H(A)}`}function H(k){return k instanceof e.Name?k:(0,e._)`(${k})`}}(Do)),Do}var Ee={},Wc;function _e(){if(Wc)return Ee;
|
|
792
792
|
Wc=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.checkStrictMode=Ee.getErrorPath=Ee.Type=Ee.useFunc=Ee.setEvaluated=Ee.evaluatedPropsToName=Ee.mergeEvaluated=Ee.eachItem=Ee.unescapeJsonPointer=Ee.escapeJsonPointer=Ee.escapeFragment=Ee.unescapeFragment=Ee.schemaRefOrVal=Ee.schemaHasRulesButRef=Ee.schemaHasRules=Ee.checkUnknownRules=Ee.alwaysValidSchema=Ee.toHash=void 0;const t=pe(),e=Ln();function r(v){const _={};for(const b of v)_[b]=!0;return _}Ee.toHash=r;function n(v,_){return typeof _==
|
|
793
793
|
"boolean"?_:Object.keys(_).length===0?!0:(i(v,_),!s(_,v.self.RULES.all))}Ee.alwaysValidSchema=n;function i(v,_=v.schema){const{opts:b,self:I}=v;if(!b.strictSchema||typeof _=="boolean")return;const U=I.RULES.keywords;for(const G in _)U[G]||D(v,`unknown keyword: "${G}"`)}Ee.checkUnknownRules=i;function s(v,_){if(typeof v=="boolean")return!v;for(const b in v)if(_[b])return!0;return!1}Ee.schemaHasRules=s;function o(v,_){if(typeof v=="boolean")return!v;for(const b in v)if(b!=="$ref"&&_.all[b])return!0;
|
|
794
794
|
return!1}Ee.schemaHasRulesButRef=o;function a({topSchemaRef:v,schemaPath:_},b,I,U){if(!U){if(typeof b=="number"||typeof b=="boolean")return b;if(typeof b=="string")return(0,t._)`${b}`}return(0,t._)`${v}${_}${(0,t.getProperty)(I)}`}Ee.schemaRefOrVal=a;function u(v){return d(decodeURIComponent(v))}Ee.unescapeFragment=u;function l(v){return encodeURIComponent(c(v))}Ee.escapeFragment=l;function c(v){return typeof v=="number"?`${v}`:v.replace(/~/g,"~0").replace(/\//g,"~1")}Ee.escapeJsonPointer=c;function d(v){
|
|
@@ -803,8 +803,8 @@ keyword:f,schemaType:g})=>g?(0,e.str)`"${f}" keyword must be ${g} ($data)`:(0,e.
|
|
|
803
803
|
(0,e._)`${_}.schemaPath`,(0,e.str)`${v.errSchemaPath}/${g}`),v.opts.verbose&&(f.assign((0,e._)`${_}.schema`,p),f.assign((0,e._)`${_}.data`,m))})}t.extendErrors=a;function u(f,g){const p=f.const("err",g);f.if((0,e._)`${n.default.vErrors} === null`,()=>f.assign(n.default.vErrors,(0,e._)`[${p}]`),(0,e._)`${n.default.vErrors}.push(${p})`),f.code((0,e._)`${n.default.errors}++`)}function l(f,g){const{gen:p,validateName:m,schemaEnv:D}=f;D.$async?p.throw((0,e._)`new ${f.ValidationError}(${g})`):(p.assign(
|
|
804
804
|
(0,e._)`${m}.errors`,g),p.return(!1))}const c={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(f,g,p){const{createErrors:m}=f.it;return m===!1?(0,e._)`{}`:h(f,g,p)}function h(f,g,p={}){const{gen:m,it:D}=f,v=[E(D,p),$(f,p)];return y(f,g,v),m.object(...v)}function E({errorPath:f},{instancePath:g}){const p=g?
|
|
805
805
|
(0,e.str)`${f}${(0,r.getErrorPath)(g,r.Type.Str)}`:f;return[n.default.instancePath,(0,e.strConcat)(n.default.instancePath,p)]}function $({keyword:f,it:{errSchemaPath:g}},{schemaPath:p,parentSchema:m}){let D=m?g:(0,e.str)`${g}/${f}`;return p&&(D=(0,e.str)`${D}${(0,r.getErrorPath)(p,r.Type.Str)}`),[c.schemaPath,D]}function y(f,{params:g,message:p},m){const{keyword:D,data:v,schemaValue:_,it:b}=f,{opts:I,propertyName:U,topSchemaRef:G,schemaPath:L}=b;m.push([c.keyword,D],[c.params,typeof g=="function"?
|
|
806
|
-
g(f):g||(0,e._)`{}`]),I.messages&&m.push([c.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([c.schema,_],[c.parentSchema,(0,e._)`${G}${L}`],[n.default.data,v]),U&&m.push([c.propertyName,U])}}(Eo)),Eo}var
|
|
807
|
-
ct"&&l.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${c}.errors`,null),u.return(!0))}ur.topBoolOrEmptySchema=i;function s(a,u){const{gen:l,schema:c}=a;c===!1?(l.var(u,!1),o(a)):l.var(u,!0)}ur.boolOrEmptySchema=s;function o(a,u){const{gen:l,data:c}=a,d={gen:l,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(d,n,void 0,u)}return ur}var xe={},cr={},
|
|
806
|
+
g(f):g||(0,e._)`{}`]),I.messages&&m.push([c.message,typeof p=="function"?p(f):p]),I.verbose&&m.push([c.schema,_],[c.parentSchema,(0,e._)`${G}${L}`],[n.default.data,v]),U&&m.push([c.propertyName,U])}}(Eo)),Eo}var Xc;function Dy(){if(Xc)return ur;Xc=1,Object.defineProperty(ur,"__esModule",{value:!0}),ur.boolOrEmptySchema=ur.topBoolOrEmptySchema=void 0;const t=kn(),e=pe(),r=ct(),n={message:"boolean schema is false"};function i(a){const{gen:u,schema:l,validateName:c}=a;l===!1?o(a,!1):typeof l=="obje\
|
|
807
|
+
ct"&&l.$async===!0?u.return(r.default.data):(u.assign((0,e._)`${c}.errors`,null),u.return(!0))}ur.topBoolOrEmptySchema=i;function s(a,u){const{gen:l,schema:c}=a;c===!1?(l.var(u,!1),o(a)):l.var(u,!0)}ur.boolOrEmptySchema=s;function o(a,u){const{gen:l,data:c}=a,d={gen:l,keyword:"false schema",data:c,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:a};(0,t.reportError)(d,n,void 0,u)}return ur}var xe={},cr={},Jc;function Qc(){if(Jc)return cr;Jc=1,Object.defineProperty(cr,"__esModule",{value:!0}),
|
|
808
808
|
cr.getRules=cr.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function r(i){return typeof i=="string"&&e.has(i)}cr.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 cr.getRules=n,cr}var Ot={},
|
|
809
809
|
Zc;function el(){if(Zc)return Ot;Zc=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.shouldUseRule=Ot.shouldUseGroup=Ot.schemaHasRulesForType=void 0;function t({schema:n,self:i},s){const o=i.RULES.types[s];return o&&o!==!0&&e(n,o)}Ot.schemaHasRulesForType=t;function e(n,i){return i.rules.some(s=>r(n,s))}Ot.shouldUseGroup=e;function r(n,i){var s;return n[i.keyword]!==void 0||((s=i.definition.implements)===null||s===void 0?void 0:s.some(o=>n[o]!==void 0))}return Ot.shouldUseRule=r,Ot}var tl;
|
|
810
810
|
function Bn(){if(tl)return xe;tl=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.reportTypeError=xe.checkDataTypes=xe.checkDataType=xe.coerceAndCheckDataType=xe.getJSONTypes=xe.getSchemaTypes=xe.DataType=void 0;const t=Qc(),e=el(),r=kn(),n=pe(),i=_e();var s;(function(p){p[p.Correct=0]="Correct",p[p.Wrong=1]="Wrong"})(s||(xe.DataType=s={}));function o(p){const m=a(p.type);if(m.includes("null")){if(p.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!m.length&&
|
|
@@ -816,8 +816,8 @@ if($(m,_,b.strictNumbers),()=>v.assign(U,_))),v.if((0,n._)`${U} !== undefined`);
|
|
|
816
816
|
|| ${I} === "boolean" || ${_} === null`).assign(U,(0,n._)`[${_}]`)}}}function h({gen:p,parentData:m,parentDataProperty:D},v){p.if((0,n._)`${m} !== undefined`,()=>p.assign((0,n._)`${m}[${D}]`,v))}function E(p,m,D,v=s.Correct){const _=v===s.Correct?n.operators.EQ:n.operators.NEQ;let b;switch(p){case"null":return(0,n._)`${m} ${_} null`;case"array":b=(0,n._)`Array.isArray(${m})`;break;case"object":b=(0,n._)`${m} && typeof ${m} == "object" && !Array.isArray(${m})`;break;case"integer":b=
|
|
817
817
|
I((0,n._)`!(${m} % 1) && !isNaN(${m})`);break;case"number":b=I();break;default:return(0,n._)`typeof ${m} ${_} ${p}`}return v===s.Correct?b:(0,n.not)(b);function I(U=n.nil){return(0,n.and)((0,n._)`typeof ${m} == "number"`,U,D?(0,n._)`isFinite(${m})`:n.nil)}}xe.checkDataType=E;function $(p,m,D,v){if(p.length===1)return E(p[0],m,D,v);let _;const b=(0,i.toHash)(p);if(b.array&&b.object){const I=(0,n._)`typeof ${m} != "object"`;_=b.null?I:(0,n._)`!${m} || ${I}`,delete b.null,delete b.array,delete b.object}else
|
|
818
818
|
_=n.nil;b.number&&delete b.integer;for(const I in b)_=(0,n.and)(_,E(I,m,D,v));return _}xe.checkDataTypes=$;const y={message:({schema:p})=>`must be ${p}`,params:({schema:p,schemaValue:m})=>typeof p=="string"?(0,n._)`{type: ${p}}`:(0,n._)`{type: ${m}}`};function f(p){const m=g(p);(0,r.reportError)(m,y)}xe.reportTypeError=f;function g(p){const{gen:m,data:D,schema:v}=p,_=(0,i.schemaRefOrVal)(p,v,"type");return{gen:m,keyword:"type",data:D,schema:v.type,schemaCode:_,schemaValue:_,parentSchema:v,params:{},
|
|
819
|
-
it:p}}return xe}var
|
|
820
|
-
i,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;c.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),a.if(h,(0,t._)`${d} = ${(0,t.stringify)(o)}`)}return
|
|
819
|
+
it:p}}return xe}var Jr={},rl;function vy(){if(rl)return Jr;rl=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.assignDefaults=void 0;const t=pe(),e=_e();function r(i,s){const{properties:o,items:a}=i.schema;if(s==="object"&&o)for(const u in o)n(i,u,o[u].default);else s==="array"&&Array.isArray(a)&&a.forEach((u,l)=>n(i,l,u.default))}Jr.assignDefaults=r;function n(i,s,o){const{gen:a,compositeRule:u,data:l,opts:c}=i;if(o===void 0)return;const d=(0,t._)`${l}${(0,t.getProperty)(s)}`;if(u){(0,e.checkStrictMode)(
|
|
820
|
+
i,`default is ignored for: ${d}`);return}let h=(0,t._)`${d} === undefined`;c.useDefaults==="empty"&&(h=(0,t._)`${h} || ${d} === null || ${d} === ""`),a.if(h,(0,t._)`${d} = ${(0,t.stringify)(o)}`)}return Jr}var lt={},Ae={},nl;function ft(){if(nl)return Ae;nl=1,Object.defineProperty(Ae,"__esModule",{value:!0}),Ae.validateUnion=Ae.validateArray=Ae.usePattern=Ae.callValidateCode=Ae.schemaProperties=Ae.allSchemaProperties=Ae.noPropertyInData=Ae.propertyInData=Ae.isOwnProperty=Ae.hasPropFunc=Ae.reportMissingProp=
|
|
821
821
|
Ae.checkMissingProp=Ae.checkReportMissingProp=void 0;const t=pe(),e=_e(),r=ct(),n=_e();function i(p,m){const{gen:D,data:v,it:_}=p;D.if(c(D,v,m,_.opts.ownProperties),()=>{p.setParams({missingProperty:(0,t._)`${m}`},!0),p.error()})}Ae.checkReportMissingProp=i;function s({gen:p,data:m,it:{opts:D}},v,_){return(0,t.or)(...v.map(b=>(0,t.and)(c(p,m,b,D.ownProperties),(0,t._)`${_} = ${b}`)))}Ae.checkMissingProp=s;function o(p,m){p.setParams({missingProperty:m},!0),p.error()}Ae.reportMissingProp=o;function a(p){
|
|
822
822
|
return p.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}Ae.hasPropFunc=a;function u(p,m,D){return(0,t._)`${a(p)}.call(${m}, ${D})`}Ae.isOwnProperty=u;function l(p,m,D,v){const _=(0,t._)`${m}${(0,t.getProperty)(D)} !== undefined`;return v?(0,t._)`${_} && ${u(p,m,D)}`:_}Ae.propertyInData=l;function c(p,m,D,v){const _=(0,t._)`${m}${(0,t.getProperty)(D)} === undefined`;return v?(0,t.or)(_,(0,t.not)(u(p,m,D))):_}Ae.noPropertyInData=c;function d(p){
|
|
823
823
|
return p?Object.keys(p).filter(m=>m!=="__proto__"):[]}Ae.allSchemaProperties=d;function h(p,m){return d(m).filter(D=>!(0,e.alwaysValidSchema)(p,m[D]))}Ae.schemaProperties=h;function E({schemaCode:p,data:m,it:{gen:D,topSchemaRef:v,schemaPath:_,errorPath:b},it:I},U,G,L){const B=L?(0,t._)`${p}, ${m}, ${v}${_}`:m,N=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,b)],[r.default.parentData,I.parentData],[r.default.parentDataProperty,I.parentDataProperty],[r.default.rootData,r.default.rootData]];
|
|
@@ -840,8 +840,8 @@ exports:{}},ul;function wy(){if(ul)return wo.exports;ul=1;var t=wo.exports=funct
|
|
|
840
840
|
typeof $=="object")for(var f in $)e(n,i,s,$[f],a+"/"+E+"/"+r(f),u,a,E,o,f)}else(E in t.keywords||n.allKeys&&!(E in t.skipKeywords))&&e(n,i,s,$,a+"/"+E,u,a,E,o)}s(o,a,u,l,c,d,h)}}function r(n){return n.replace(/~/g,"~0").replace(/\//g,"~1")}return wo.exports}var cl;function xn(){if(cl)return Ve;cl=1,Object.defineProperty(Ve,"__esModule",{value:!0}),Ve.getSchemaRefs=Ve.resolveUrl=Ve.normalizeId=Ve._getFullPath=Ve.getFullPath=Ve.inlineRef=void 0;const t=_e(),e=al(),r=wy(),n=new Set(["type","format",
|
|
841
841
|
"pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(y,f=!0){return typeof y=="boolean"?!0:f===!0?!o(y):f?a(y)<=f:!1}Ve.inlineRef=i;const s=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function o(y){for(const f in y){if(s.has(f))return!0;const g=y[f];if(Array.isArray(g)&&g.some(o)||typeof g=="object"&&o(g))return!0}return!1}function a(y){
|
|
842
842
|
let f=0;for(const g in y){if(g==="$ref")return 1/0;if(f++,!n.has(g)&&(typeof y[g]=="object"&&(0,t.eachItem)(y[g],p=>f+=a(p)),f===1/0))return 1/0}return f}function u(y,f="",g){g!==!1&&(f=d(f));const p=y.parse(f);return l(y,p)}Ve.getFullPath=u;function l(y,f){return y.serialize(f).split("#")[0]+"#"}Ve._getFullPath=l;const c=/#\/?$/;function d(y){return y?y.replace(c,""):""}Ve.normalizeId=d;function h(y,f,g){return g=d(g),y.resolve(f,g)}Ve.resolveUrl=h;const E=/^[a-z_][-a-z0-9._]*$/i;function $(y,f){
|
|
843
|
-
if(typeof y=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=d(y[g]||f),D={"":m},v=u(p,m,!1),_={},b=new Set;return r(y,{allKeys:!0},(G,L,B,N)=>{if(N===void 0)return;const j=v+L;let M=D[N];typeof G[g]=="string"&&(M=Y.call(this,G[g])),z.call(this,G.$anchor),z.call(this,G.$dynamicAnchor),D[L]=M;function Y(
|
|
844
|
-
|
|
843
|
+
if(typeof y=="boolean")return{};const{schemaId:g,uriResolver:p}=this.opts,m=d(y[g]||f),D={"":m},v=u(p,m,!1),_={},b=new Set;return r(y,{allKeys:!0},(G,L,B,N)=>{if(N===void 0)return;const j=v+L;let M=D[N];typeof G[g]=="string"&&(M=Y.call(this,G[g])),z.call(this,G.$anchor),z.call(this,G.$dynamicAnchor),D[L]=M;function Y(J){const se=this.opts.uriResolver.resolve;if(J=d(M?se(M,J):J),b.has(J))throw U(J);b.add(J);let q=this.refs[J];return typeof q=="string"&&(q=this.refs[q]),typeof q=="object"?I(G,q.schema,
|
|
844
|
+
J):J!==d(j)&&(J[0]==="#"?(I(G,_[J],J),_[J]=G):this.refs[J]=j),J}function z(J){if(typeof J=="string"){if(!E.test(J))throw new Error(`invalid anchor "${J}"`);Y.call(this,`#${J}`)}}}),_;function I(G,L,B){if(L!==void 0&&!e(G,L))throw U(B)}function U(G){return new Error(`reference "${G}" resolves to more than one schema`)}}return Ve.getSchemaRefs=$,Ve}var ll;function Qr(){if(ll)return Rt;ll=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.getData=Rt.KeywordCxt=Rt.validateFunctionCode=void 0;const t=Dy(),
|
|
845
845
|
e=Bn(),r=el(),n=Bn(),i=vy(),s=$y(),o=_y(),a=pe(),u=ct(),l=xn(),c=_e(),d=kn();function h(T){if(v(T)&&(b(T),D(T))){f(T);return}E(T,()=>(0,t.topBoolOrEmptySchema)(T))}Rt.validateFunctionCode=h;function E({gen:T,validateName:x,schema:Q,schemaEnv:ie,opts:O},P){O.code.es5?T.func(x,(0,a._)`${u.default.data}, ${u.default.valCxt}`,ie.$async,()=>{T.code((0,a._)`"use strict"; ${p(Q,O)}`),y(T,O),T.code(P)}):T.func(x,(0,a._)`${u.default.data}, ${$(O)}`,ie.$async,()=>T.code(p(Q,O)).code(P))}function $(T){return(0,a.
|
|
846
846
|
_)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${T.dynamicRef?(0,a._)`, ${u.default.dynamicAnchors}={}`:a.nil}}={}`}function y(T,x){T.if(u.default.valCxt,()=>{T.var(u.default.instancePath,(0,a._)`${u.default.valCxt}.${u.default.instancePath}`),T.var(u.default.parentData,(0,a._)`${u.default.valCxt}.${u.default.parentData}`),T.var(u.default.parentDataProperty,(0,a._)`${u.default.valCxt}.${u.default.parentDataProperty}`),
|
|
847
847
|
T.var(u.default.rootData,(0,a._)`${u.default.valCxt}.${u.default.rootData}`),x.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{T.var(u.default.instancePath,(0,a._)`""`),T.var(u.default.parentData,(0,a._)`undefined`),T.var(u.default.parentDataProperty,(0,a._)`undefined`),T.var(u.default.rootData,u.default.data),x.dynamicRef&&T.var(u.default.dynamicAnchors,(0,a._)`{}`)})}function f(T){const{schema:x,opts:Q,gen:ie}=T;E(T,()=>{Q.$comment&&x.
|
|
@@ -850,8 +850,8 @@ x.code.process)?(0,a._)`/*# sourceURL=${Q} */`:a.nil}function m(T,x){if(v(T)&&(b
|
|
|
850
850
|
checkUnknownRules)(T),U(T)}function I(T,x){if(T.opts.jtd)return Y(T,[],!1,x);const Q=(0,e.getSchemaTypes)(T.schema),ie=(0,e.coerceAndCheckDataType)(T,Q);Y(T,Q,!ie,x)}function U(T){const{schema:x,errSchemaPath:Q,opts:ie,self:O}=T;x.$ref&&ie.ignoreKeywordsWithRef&&(0,c.schemaHasRulesButRef)(x,O.RULES)&&O.logger.warn(`$ref: keywords ignored in schema at path "${Q}"`)}function G(T){const{schema:x,opts:Q}=T;x.default!==void 0&&Q.useDefaults&&Q.strictSchema&&(0,c.checkStrictMode)(T,"default is ignored\
|
|
851
851
|
in the schema root")}function L(T){const x=T.schema[T.opts.schemaId];x&&(T.baseId=(0,l.resolveUrl)(T.opts.uriResolver,T.baseId,x))}function B(T){if(T.schema.$async&&!T.schemaEnv.$async)throw new Error("async schema in sync schema")}function N({gen:T,schemaEnv:x,schema:Q,errSchemaPath:ie,opts:O}){const P=Q.$comment;if(O.$comment===!0)T.code((0,a._)`${u.default.self}.logger.log(${P})`);else if(typeof O.$comment=="function"){const ee=(0,a.str)`${ie}/$comment`,W=T.scopeValue("root",{ref:x.root});T.
|
|
852
852
|
code((0,a._)`${u.default.self}.opts.$comment(${P}, ${ee}, ${W}.schema)`)}}function j(T){const{gen:x,schemaEnv:Q,validateName:ie,ValidationError:O,opts:P}=T;Q.$async?x.if((0,a._)`${u.default.errors} === 0`,()=>x.return(u.default.data),()=>x.throw((0,a._)`new ${O}(${u.default.vErrors})`)):(x.assign((0,a._)`${ie}.errors`,u.default.vErrors),P.unevaluated&&M(T),x.return((0,a._)`${u.default.errors} === 0`))}function M({gen:T,evaluated:x,props:Q,items:ie}){Q instanceof a.Name&&T.assign((0,a._)`${x}.props`,
|
|
853
|
-
Q),ie instanceof a.Name&&T.assign((0,a._)`${x}.items`,ie)}function Y(T,x,Q,ie){const{gen:O,schema:P,data:ee,allErrors:W,opts:F,self:re}=T,{RULES:V}=re;if(P.$ref&&(F.ignoreKeywordsWithRef||!(0,c.schemaHasRulesButRef)(P,V))){O.block(()=>
|
|
854
|
-
else(),(0,n.reportTypeError)(T)),O.endIf()):z(T,fe),W||O.if((0,a._)`${u.default.errors} === ${ie||0}`))}}function z(T,x){const{gen:Q,schema:ie,opts:{useDefaults:O}}=T;O&&(0,i.assignDefaults)(T,x.type),Q.block(()=>{for(const P of x.rules)(0,r.shouldUseRule)(ie,P)&&
|
|
853
|
+
Q),ie instanceof a.Name&&T.assign((0,a._)`${x}.items`,ie)}function Y(T,x,Q,ie){const{gen:O,schema:P,data:ee,allErrors:W,opts:F,self:re}=T,{RULES:V}=re;if(P.$ref&&(F.ignoreKeywordsWithRef||!(0,c.schemaHasRulesButRef)(P,V))){O.block(()=>X(T,"$ref",V.all.$ref.definition));return}F.jtd||J(T,x),O.block(()=>{for(const fe of V.rules)ne(fe);ne(V.post)});function ne(fe){(0,r.shouldUseGroup)(P,fe)&&(fe.type?(O.if((0,n.checkDataType)(fe.type,ee,F.strictNumbers)),z(T,fe),x.length===1&&x[0]===fe.type&&Q&&(O.
|
|
854
|
+
else(),(0,n.reportTypeError)(T)),O.endIf()):z(T,fe),W||O.if((0,a._)`${u.default.errors} === ${ie||0}`))}}function z(T,x){const{gen:Q,schema:ie,opts:{useDefaults:O}}=T;O&&(0,i.assignDefaults)(T,x.type),Q.block(()=>{for(const P of x.rules)(0,r.shouldUseRule)(ie,P)&&X(T,P.keyword,P.definition,x.type)})}function J(T,x){T.schemaEnv.meta||!T.opts.strictTypes||(se(T,x),T.opts.allowUnionTypes||q(T,x),C(T,T.dataTypes))}function se(T,x){if(x.length){if(!T.dataTypes.length){T.dataTypes=x;return}x.forEach(Q=>{
|
|
855
855
|
k(T.dataTypes,Q)||A(T,`type "${Q}" not allowed by context "${T.dataTypes.join(",")}"`)}),w(T,x)}}function q(T,x){x.length>1&&!(x.length===2&&x.includes("null"))&&A(T,"use allowUnionTypes to allow union type keyword")}function C(T,x){const Q=T.self.RULES.all;for(const ie in Q){const O=Q[ie];if(typeof O=="object"&&(0,r.shouldUseRule)(T.schema,O)){const{type:P}=O.definition;P.length&&!P.some(ee=>H(x,ee))&&A(T,`missing type "${P.join(",")}" for keyword "${ie}"`)}}}function H(T,x){return T.includes(x)||
|
|
856
856
|
x==="number"&&T.includes("integer")}function k(T,x){return T.includes(x)||x==="integer"&&T.includes("number")}function w(T,x){const Q=[];for(const ie of T.dataTypes)k(x,ie)?Q.push(ie):x.includes("integer")&&ie==="number"&&Q.push("integer");T.dataTypes=Q}function A(T,x){const Q=T.schemaEnv.baseId+T.errSchemaPath;x+=` at "${Q}" (strictTypes)`,(0,c.checkStrictMode)(T,x,T.opts.strictTypes)}class R{constructor(x,Q,ie){if((0,s.validateKeywordUsage)(x,Q,ie),this.gen=x.gen,this.allErrors=x.allErrors,this.
|
|
857
857
|
keyword=ie,this.data=x.data,this.schema=x.schema[ie],this.$data=Q.$data&&x.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,c.schemaRefOrVal)(x,this.schema,ie,this.$data),this.schemaType=Q.schemaType,this.parentSchema=x.schema,this.params={},this.it=x,this.def=Q,this.$data)this.schemaCode=x.gen.const("vSchema",ae(this.$data,x));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,Q.schemaType,Q.allowUndefined))throw new Error(`${ie} value must be ${JSON.stringify(
|
|
@@ -860,19 +860,19 @@ endIf():this.gen.else()}fail$data(x){if(!this.$data)return this.fail(x);const{sc
|
|
|
860
860
|
eyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(x){this.allErrors||this.gen.if(x)}setParams(x,Q){Q?Object.assign(this.params,x):this.params=x}block$data(x,Q,ie=a.nil){this.gen.block(()=>{this.check$data(x,ie),Q()})}check$data(x=a.nil,Q=a.nil){if(!this.$data)return;const{gen:ie,schemaCode:O,schemaType:P,def:ee}=this;ie.if((0,a.or)((0,a._)`${O} === undefined`,Q)),x!==a.nil&&ie.assign(x,!0),(P.length||ee.validateSchema)&&(ie.elseIf(this.invalid$data()),this.$dataError(),x!==a.
|
|
861
861
|
nil&&ie.assign(x,!1)),ie.else()}invalid$data(){const{gen:x,schemaCode:Q,schemaType:ie,def:O,it:P}=this;return(0,a.or)(ee(),W());function ee(){if(ie.length){if(!(Q instanceof a.Name))throw new Error("ajv implementation error");const F=Array.isArray(ie)?ie:[ie];return(0,a._)`${(0,n.checkDataTypes)(F,Q,P.opts.strictNumbers,n.DataType.Wrong)}`}return a.nil}function W(){if(O.validateSchema){const F=x.scopeValue("validate$data",{ref:O.validateSchema});return(0,a._)`!${F}(${Q})`}return a.nil}}subschema(x,Q){
|
|
862
862
|
const ie=(0,o.getSubschema)(this.it,x);(0,o.extendSubschemaData)(ie,this.it,x),(0,o.extendSubschemaMode)(ie,x);const O={...this.it,...ie,items:void 0,props:void 0};return m(O,Q),O}mergeEvaluated(x,Q){const{it:ie,gen:O}=this;ie.opts.unevaluated&&(ie.props!==!0&&x.props!==void 0&&(ie.props=c.mergeEvaluated.props(O,x.props,ie.props,Q)),ie.items!==!0&&x.items!==void 0&&(ie.items=c.mergeEvaluated.items(O,x.items,ie.items,Q)))}mergeValidEvaluated(x,Q){const{it:ie,gen:O}=this;if(ie.opts.unevaluated&&(ie.
|
|
863
|
-
props!==!0||ie.items!==!0))return O.if(Q,()=>this.mergeEvaluated(x,a.Name)),!0}}Rt.KeywordCxt=R;function
|
|
863
|
+
props!==!0||ie.items!==!0))return O.if(Q,()=>this.mergeEvaluated(x,a.Name)),!0}}Rt.KeywordCxt=R;function X(T,x,Q,ie){const O=new R(T,Q,x);"code"in Q?Q.code(O,ie):O.$data&&Q.validate?(0,s.funcKeywordCode)(O,Q):"macro"in Q?(0,s.macroKeywordCode)(O,Q):(Q.compile||Q.validate)&&(0,s.funcKeywordCode)(O,Q)}const Z=/^\/(?:[^~]|~0|~1)*$/,oe=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ae(T,{dataLevel:x,dataNames:Q,dataPathArr:ie}){let O,P;if(T==="")return u.default.rootData;if(T[0]==="/"){if(!Z.test(T))throw new Error(
|
|
864
864
|
`Invalid JSON-pointer: ${T}`);O=T,P=u.default.rootData}else{const re=oe.exec(T);if(!re)throw new Error(`Invalid JSON-pointer: ${T}`);const V=+re[1];if(O=re[2],O==="#"){if(V>=x)throw new Error(F("property/index",V));return ie[x-V]}if(V>x)throw new Error(F("data",V));if(P=Q[x-V],!O)return P}let ee=P;const W=O.split("/");for(const re of W)re&&(P=(0,a._)`${P}${(0,a.getProperty)((0,c.unescapeJsonPointer)(re))}`,ee=(0,a._)`${ee} && ${P}`);return ee;function F(re,V){return`Cannot access ${re} ${V} leve\
|
|
865
865
|
ls up, current level is ${x}`}}return Rt.getData=ae,Rt}var Mn={},fl;function qn(){if(fl)return Mn;fl=1,Object.defineProperty(Mn,"__esModule",{value:!0});class t extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=!0}}return Mn.default=t,Mn}var Un={},dl;function Zr(){if(dl)return Un;dl=1,Object.defineProperty(Un,"__esModule",{value:!0});const t=xn();class e extends Error{constructor(n,i,s,o){super(o||`can't resolve reference ${s} from id ${i}`),this.missingRef=
|
|
866
|
-
(0,t.resolveUrl)(n,i,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return Un.default=e,Un}var
|
|
867
|
-
g.schemaId,this.root=g.root||this,this.baseId=(p=g.baseId)!==null&&p!==void 0?p:(0,n.normalizeId)(m?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=m?.$async,this.refs={}}}
|
|
866
|
+
(0,t.resolveUrl)(n,i,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(n,this.missingRef))}}return Un.default=e,Un}var Je={},hl;function Hn(){if(hl)return Je;hl=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.resolveSchema=Je.getCompilingSchema=Je.resolveRef=Je.compileSchema=Je.SchemaEnv=void 0;const t=pe(),e=qn(),r=ct(),n=xn(),i=_e(),s=Qr();class o{constructor(g){var p;this.refs={},this.dynamicAnchors={};let m;typeof g.schema=="object"&&(m=g.schema),this.schema=g.schema,this.schemaId=
|
|
867
|
+
g.schemaId,this.root=g.root||this,this.baseId=(p=g.baseId)!==null&&p!==void 0?p:(0,n.normalizeId)(m?.[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=m?.$async,this.refs={}}}Je.SchemaEnv=o;function a(f){const g=c.call(this,f);if(g)return g;const p=(0,n.getFullPath)(this.opts.uriResolver,f.root.baseId),{es5:m,lines:D}=this.opts.code,{ownProperties:v}=this.opts,_=new t.CodeGen(this.scope,{es5:m,lines:D,ownProperties:v});let b;f.$async&&(b=_.
|
|
868
868
|
scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const I=_.scopeName("validate");f.validateName=I;const U={gen:_,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:_.scopeValue("schema",this.opts.code.source===!0?{ref:f.schema,code:(0,t.stringify)(f.schema)}:
|
|
869
869
|
{ref:f.schema}),validateName:I,ValidationError:b,schema:f.schema,schemaEnv:f,rootId:p,baseId:f.baseId||p,schemaPath:t.nil,errSchemaPath:f.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let G;try{this._compilations.add(f),(0,s.validateFunctionCode)(U),_.optimize(this.opts.code.optimize);const L=_.toString();G=`${_.scopeRefs(r.default.scope)}return ${L}`,this.opts.code.process&&(G=this.opts.code.process(G,f));const N=new Function(`${r.default.self}`,`${r.default.
|
|
870
870
|
scope}`,G)(this,this.scope.get());if(this.scope.value(I,{ref:N}),N.errors=null,N.schema=f.schema,N.schemaEnv=f,f.$async&&(N.$async=!0),this.opts.code.source===!0&&(N.source={validateName:I,validateCode:L,scopeValues:_._values}),this.opts.unevaluated){const{props:j,items:M}=U;N.evaluated={props:j instanceof t.Name?void 0:j,items:M instanceof t.Name?void 0:M,dynamicProps:j instanceof t.Name,dynamicItems:M instanceof t.Name},N.source&&(N.source.evaluated=(0,t.stringify)(N.evaluated))}return f.validate=
|
|
871
|
-
N,f}catch(L){throw delete f.validate,delete f.validateName,G&&this.logger.error("Error compiling schema, function code:",G),L}finally{this._compilations.delete(f)}}
|
|
872
|
-
resolveRef=u;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function c(f){for(const g of this._compilations)if(d(g,f))return g}
|
|
871
|
+
N,f}catch(L){throw delete f.validate,delete f.validateName,G&&this.logger.error("Error compiling schema, function code:",G),L}finally{this._compilations.delete(f)}}Je.compileSchema=a;function u(f,g,p){var m;p=(0,n.resolveUrl)(this.opts.uriResolver,g,p);const D=f.refs[p];if(D)return D;let v=h.call(this,f,p);if(v===void 0){const _=(m=f.localRefs)===null||m===void 0?void 0:m[p],{schemaId:b}=this.opts;_&&(v=new o({schema:_,schemaId:b,root:f,baseId:g}))}if(v!==void 0)return f.refs[p]=l.call(this,v)}Je.
|
|
872
|
+
resolveRef=u;function l(f){return(0,n.inlineRef)(f.schema,this.opts.inlineRefs)?f.schema:f.validate?f:a.call(this,f)}function c(f){for(const g of this._compilations)if(d(g,f))return g}Je.getCompilingSchema=c;function d(f,g){return f.schema===g.schema&&f.root===g.root&&f.baseId===g.baseId}function h(f,g){let p;for(;typeof(p=this.refs[g])=="string";)g=p;return p||this.schemas[g]||E.call(this,f,g)}function E(f,g){const p=this.opts.uriResolver.parse(g),m=(0,n._getFullPath)(this.opts.uriResolver,p);let D=(0,n.
|
|
873
873
|
getFullPath)(this.opts.uriResolver,f.baseId,void 0);if(Object.keys(f.schema).length>0&&m===D)return y.call(this,p,f);const v=(0,n.normalizeId)(m),_=this.refs[v]||this.schemas[v];if(typeof _=="string"){const b=E.call(this,f,_);return typeof b?.schema!="object"?void 0:y.call(this,p,b)}if(typeof _?.schema=="object"){if(_.validate||a.call(this,_),v===(0,n.normalizeId)(g)){const{schema:b}=_,{schemaId:I}=this.opts,U=b[I];return U&&(D=(0,n.resolveUrl)(this.opts.uriResolver,D,U)),new o({schema:b,schemaId:I,
|
|
874
|
-
root:f,baseId:D})}return y.call(this,p,_)}}
|
|
875
|
-
g,U))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,i.schemaHasRulesButRef)(p,this.RULES)){const b=(0,n.resolveUrl)(this.opts.uriResolver,g,p.$ref);v=E.call(this,m,b)}const{schemaId:_}=this.opts;if(v=v||new o({schema:p,schemaId:_,root:m,baseId:g}),v.schema!==v.root.schema)return v}return
|
|
874
|
+
root:f,baseId:D})}return y.call(this,p,_)}}Je.resolveSchema=E;const $=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(f,{baseId:g,schema:p,root:m}){var D;if(((D=f.fragment)===null||D===void 0?void 0:D[0])!=="/")return;for(const b of f.fragment.slice(1).split("/")){if(typeof p=="boolean")return;const I=p[(0,i.unescapeFragment)(b)];if(I===void 0)return;p=I;const U=typeof p=="object"&&p[this.opts.schemaId];!$.has(b)&&U&&(g=(0,n.resolveUrl)(this.opts.uriResolver,
|
|
875
|
+
g,U))}let v;if(typeof p!="boolean"&&p.$ref&&!(0,i.schemaHasRulesButRef)(p,this.RULES)){const b=(0,n.resolveUrl)(this.opts.uriResolver,g,p.$ref);v=E.call(this,m,b)}const{schemaId:_}=this.opts;if(v=v||new o({schema:p,schemaId:_,root:m,baseId:g}),v.schema!==v.root.schema)return v}return Je}const pl="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",ml="Meta-schema for $data reference (JSON AnySchema extension proposal)",gl="object",yl=["$data"],El={$data:{type:"string",
|
|
876
876
|
anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},Dl=!1,by={$id:pl,description:ml,type:gl,required:yl,properties:El,additionalProperties:Dl},Ay={__proto__:null,$id:pl,additionalProperties:Dl,default:by,description:ml,properties:El,required:yl,type:gl},Cy=yt(Ay);var Vn={},en={exports:{}},bo,vl;function Sy(){return vl||(vl=1,bo={HEX:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15}}),bo}var Ao,$l;function Ry(){if($l)return Ao;$l=
|
|
877
877
|
1;const{HEX:t}=Sy(),e=/^(?:(?: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(y){if(a(y,".")<3)return{host:y,isIPV4:!1};const f=y.match(e)||[],[g]=f;return g?{host:o(g,"."),isIPV4:!0}:{host:y,isIPV4:!1}}function n(y,f=!1){let g="",p=!0;for(const m of y){if(t[m]===void 0)return;m!=="0"&&p===!0&&(p=!1),p||(g+=m)}return f&&g.length===0&&(g="0"),g}function i(y){let f=0;const g={error:!1,address:"",zone:""},p=[],m=[];let D=!1,v=!1,_=!1;function b(){if(m.length){
|
|
878
878
|
if(D===!1){const I=n(m);if(I!==void 0)p.push(I);else return g.error=!0,!1}m.length=0}return!0}for(let I=0;I<y.length;I++){const U=y[I];if(!(U==="["||U==="]"))if(U===":"){if(v===!0&&(_=!0),!b())break;if(f++,p.push(":"),f>7){g.error=!0;break}I-1>=0&&y[I-1]===":"&&(v=!0);continue}else if(U==="%"){if(!b())break;D=!0}else{m.push(U);continue}}return m.length&&(D?g.zone=m.join(""):_?p.push(m.join("")):p.push(n(m))),g.address=p.join(""),g}function s(y){if(a(y,":")<2)return{host:y,isIPV6:!1};const f=i(y);
|
|
@@ -896,37 +896,37 @@ return t.code='require("ajv/dist/runtime/uri").default',Vn.default=t,Vn}var Al;f
|
|
|
896
896
|
defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});const n=qn(),i=Zr(),s=Qc(),o=Hn(),a=pe(),u=xn(),l=Bn(),c=_e(),d=Cy,h=Fy(),E=(q,C)=>new RegExp(q,C);E.code="new RegExp";const $=["removeAdditional","useDefaults","coerceTypes"],y=new Set(
|
|
897
897
|
["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),f={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code:\
|
|
898
898
|
{process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},
|
|
899
|
-
g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(q){var C,H,k,w,A,R,
|
|
900
|
-
vt)!==null&&R!==void 0?R:!0,strictNumbers:(Z=(
|
|
899
|
+
g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},p=200;function m(q){var C,H,k,w,A,R,X,Z,oe,ae,T,x,Q,ie,O,P,ee,W,F,re,V,ne,fe,we,Oe;const vt=q.strict,Ft=(C=q.code)===null||C===void 0?void 0:C.optimize,ja=Ft===!0||Ft===void 0?1:Ft||0,ka=(k=(H=q.code)===null||H===void 0?void 0:H.regExp)!==null&&k!==void 0?k:E,yp=(w=q.uriResolver)!==null&&w!==void 0?w:h.default;return{strictSchema:(R=(A=q.strictSchema)!==null&&A!==void 0?A:
|
|
900
|
+
vt)!==null&&R!==void 0?R:!0,strictNumbers:(Z=(X=q.strictNumbers)!==null&&X!==void 0?X:vt)!==null&&Z!==void 0?Z:!0,strictTypes:(ae=(oe=q.strictTypes)!==null&&oe!==void 0?oe:vt)!==null&&ae!==void 0?ae:"log",strictTuples:(x=(T=q.strictTuples)!==null&&T!==void 0?T:vt)!==null&&x!==void 0?x:"log",strictRequired:(ie=(Q=q.strictRequired)!==null&&Q!==void 0?Q:vt)!==null&&ie!==void 0?ie:!1,code:q.code?{...q.code,optimize:ja,regExp:ka}:{optimize:ja,regExp:ka},loopRequired:(O=q.loopRequired)!==null&&O!==void 0?
|
|
901
901
|
O:p,loopEnum:(P=q.loopEnum)!==null&&P!==void 0?P:p,meta:(ee=q.meta)!==null&&ee!==void 0?ee:!0,messages:(W=q.messages)!==null&&W!==void 0?W:!0,inlineRefs:(F=q.inlineRefs)!==null&&F!==void 0?F:!0,schemaId:(re=q.schemaId)!==null&&re!==void 0?re:"$id",addUsedSchema:(V=q.addUsedSchema)!==null&&V!==void 0?V:!0,validateSchema:(ne=q.validateSchema)!==null&&ne!==void 0?ne:!0,validateFormats:(fe=q.validateFormats)!==null&&fe!==void 0?fe:!0,unicodeRegExp:(we=q.unicodeRegExp)!==null&&we!==void 0?we:!0,int32range:(Oe=
|
|
902
902
|
q.int32range)!==null&&Oe!==void 0?Oe:!0,uriResolver:yp}}class D{constructor(C={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,C=this.opts={...C,...m(C)};const{es5:H,lines:k}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:y,es5:H,lines:k}),this.logger=B(C.logger);const w=C.validateFormats;C.validateFormats=!1,this.RULES=(0,s.getRules)(),v.call(this,f,C,"NOT SUPPORTED"),v.call(this,g,C,"DEPRECATED","warn"),this._metaOpts=
|
|
903
903
|
G.call(this),C.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),C.keywords&&U.call(this,C.keywords),typeof C.meta=="object"&&this.addMetaSchema(C.meta),b.call(this),C.validateFormats=w}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:C,meta:H,schemaId:k}=this.opts;let w=d;k==="id"&&(w={...d},w.id=w.$id,delete w.$id),H&&C&&this.addMetaSchema(w,w[k],!1)}defaultMeta(){const{meta:C,schemaId:H}=this.opts;return this.opts.defaultMeta=typeof C==
|
|
904
904
|
"object"?C[H]||C:void 0}validate(C,H){let k;if(typeof C=="string"){if(k=this.getSchema(C),!k)throw new Error(`no schema with key or ref "${C}"`)}else k=this.compile(C);const w=k(H);return"$async"in k||(this.errors=k.errors),w}compile(C,H){const k=this._addSchema(C,H);return k.validate||this._compileSchemaEnv(k)}compileAsync(C,H){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:k}=this.opts;return w.call(this,C,H);async function w(ae,T){
|
|
905
|
-
await A.call(this,ae.$schema);const x=this._addSchema(ae,T);return x.validate||R.call(this,x)}async function A(ae){ae&&!this.getSchema(ae)&&await w.call(this,{$ref:ae},!0)}async function R(ae){try{return this._compileSchemaEnv(ae)}catch(T){if(!(T instanceof i.default))throw T;return
|
|
905
|
+
await A.call(this,ae.$schema);const x=this._addSchema(ae,T);return x.validate||R.call(this,x)}async function A(ae){ae&&!this.getSchema(ae)&&await w.call(this,{$ref:ae},!0)}async function R(ae){try{return this._compileSchemaEnv(ae)}catch(T){if(!(T instanceof i.default))throw T;return X.call(this,T),await Z.call(this,T.missingSchema),R.call(this,ae)}}function X({missingSchema:ae,missingRef:T}){if(this.refs[ae])throw new Error(`AnySchema ${ae} is loaded but ${T} cannot be resolved`)}async function Z(ae){
|
|
906
906
|
const T=await oe.call(this,ae);this.refs[ae]||await A.call(this,T.$schema),this.refs[ae]||this.addSchema(T,ae,H)}async function oe(ae){const T=this._loading[ae];if(T)return T;try{return await(this._loading[ae]=k(ae))}finally{delete this._loading[ae]}}}addSchema(C,H,k,w=this.opts.validateSchema){if(Array.isArray(C)){for(const R of C)this.addSchema(R,void 0,k,w);return this}let A;if(typeof C=="object"){const{schemaId:R}=this.opts;if(A=C[R],A!==void 0&&typeof A!="string")throw new Error(`schema ${R}\
|
|
907
907
|
must be string`)}return H=(0,u.normalizeId)(H||A),this._checkUnique(H),this.schemas[H]=this._addSchema(C,k,H,w,!0),this}addMetaSchema(C,H,k=this.opts.validateSchema){return this.addSchema(C,H,!0,k),this}validateSchema(C,H){if(typeof C=="boolean")return!0;let k;if(k=C.$schema,k!==void 0&&typeof k!="string")throw new Error("$schema must be a string");if(k=k||this.opts.defaultMeta||this.defaultMeta(),!k)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const w=this.validate(
|
|
908
908
|
k,C);if(!w&&H){const A="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(A);else throw new Error(A)}return w}getSchema(C){let H;for(;typeof(H=_.call(this,C))=="string";)C=H;if(H===void 0){const{schemaId:k}=this.opts,w=new o.SchemaEnv({schema:{},schemaId:k});if(H=o.resolveSchema.call(this,w,C),!H)return;this.refs[C]=H}return H.validate||this._compileSchemaEnv(H)}removeSchema(C){if(C instanceof RegExp)return this._removeAllSchemas(this.schemas,C),this._removeAllSchemas(
|
|
909
909
|
this.refs,C),this;switch(typeof C){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const H=_.call(this,C);return typeof H=="object"&&this._cache.delete(H.schema),delete this.schemas[C],delete this.refs[C],this}case"object":{const H=C;this._cache.delete(H);let k=C[this.opts.schemaId];return k&&(k=(0,u.normalizeId)(k),delete this.schemas[k],delete this.refs[k]),this}default:throw new Error("ajv.removeSchema: inval\
|
|
910
910
|
id parameter")}}addVocabulary(C){for(const H of C)this.addKeyword(H);return this}addKeyword(C,H){let k;if(typeof C=="string")k=C,typeof H=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),H.keyword=k);else if(typeof C=="object"&&H===void 0){if(H=C,k=H.keyword,Array.isArray(k)&&!k.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(j.call(this,k,H),!H)return(0,c.eachItem)(
|
|
911
911
|
k,A=>M.call(this,A)),this;z.call(this,H);const w={...H,type:(0,l.getJSONTypes)(H.type),schemaType:(0,l.getJSONTypes)(H.schemaType)};return(0,c.eachItem)(k,w.type.length===0?A=>M.call(this,A,w):A=>w.type.forEach(R=>M.call(this,A,w,R))),this}getKeyword(C){const H=this.RULES.all[C];return typeof H=="object"?H.definition:!!H}removeKeyword(C){const{RULES:H}=this;delete H.keywords[C],delete H.all[C];for(const k of H.rules){const w=k.rules.findIndex(A=>A.keyword===C);w>=0&&k.rules.splice(w,1)}return this}addFormat(C,H){
|
|
912
|
-
return typeof H=="string"&&(H=new RegExp(H)),this.formats[C]=H,this}errorsText(C=this.errors,{separator:H=", ",dataVar:k="data"}={}){return!C||C.length===0?"No errors":C.map(w=>`${k}${w.instancePath} ${w.message}`).reduce((w,A)=>w+H+A)}$dataMetaSchema(C,H){const k=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(const w of H){const A=w.split("/").slice(1);let R=C;for(const
|
|
913
|
-
se(ae))}}return C}_removeAllSchemas(C,H){for(const k in C){const w=C[k];(!H||H.test(k))&&(typeof w=="string"?delete C[k]:w&&!w.meta&&(this._cache.delete(w.schema),delete C[k]))}}_addSchema(C,H,k,w=this.opts.validateSchema,A=this.opts.addUsedSchema){let R;const{schemaId:
|
|
914
|
-
(0,u.normalizeId)(R||k);const oe=u.getSchemaRefs.call(this,C,k);return Z=new o.SchemaEnv({schema:C,schemaId:
|
|
912
|
+
return typeof H=="string"&&(H=new RegExp(H)),this.formats[C]=H,this}errorsText(C=this.errors,{separator:H=", ",dataVar:k="data"}={}){return!C||C.length===0?"No errors":C.map(w=>`${k}${w.instancePath} ${w.message}`).reduce((w,A)=>w+H+A)}$dataMetaSchema(C,H){const k=this.RULES.all;C=JSON.parse(JSON.stringify(C));for(const w of H){const A=w.split("/").slice(1);let R=C;for(const X of A)R=R[X];for(const X in k){const Z=k[X];if(typeof Z!="object")continue;const{$data:oe}=Z.definition,ae=R[X];oe&&ae&&(R[X]=
|
|
913
|
+
se(ae))}}return C}_removeAllSchemas(C,H){for(const k in C){const w=C[k];(!H||H.test(k))&&(typeof w=="string"?delete C[k]:w&&!w.meta&&(this._cache.delete(w.schema),delete C[k]))}}_addSchema(C,H,k,w=this.opts.validateSchema,A=this.opts.addUsedSchema){let R;const{schemaId:X}=this.opts;if(typeof C=="object")R=C[X];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof C!="boolean")throw new Error("schema must be object or boolean")}let Z=this._cache.get(C);if(Z!==void 0)return Z;k=
|
|
914
|
+
(0,u.normalizeId)(R||k);const oe=u.getSchemaRefs.call(this,C,k);return Z=new o.SchemaEnv({schema:C,schemaId:X,meta:H,baseId:k,localRefs:oe}),this._cache.set(Z.schema,Z),A&&!k.startsWith("#")&&(k&&this._checkUnique(k),this.refs[k]=Z),w&&this.validateSchema(C,!0),Z}_checkUnique(C){if(this.schemas[C]||this.refs[C])throw new Error(`schema with key or id "${C}" already exists`)}_compileSchemaEnv(C){if(C.meta?this._compileMetaSchema(C):o.compileSchema.call(this,C),!C.validate)throw new Error("ajv impl\
|
|
915
915
|
ementation error");return C.validate}_compileMetaSchema(C){const H=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,C)}finally{this.opts=H}}}D.ValidationError=n.default,D.MissingRefError=i.default,t.default=D;function v(q,C,H,k="error"){for(const w in q){const A=w;A in C&&this.logger[k](`${H}: option ${w}. ${q[A]}`)}}function _(q){return q=(0,u.normalizeId)(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 C in q)
|
|
916
916
|
this.addSchema(q[C],C)}function I(){for(const q in this.opts.formats){const C=this.opts.formats[q];C&&this.addFormat(q,C)}}function U(q){if(Array.isArray(q)){this.addVocabulary(q);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const C in q){const H=q[C];H.keyword||(H.keyword=C),this.addKeyword(H)}}function G(){const q={...this.opts};for(const C of $)delete q[C];return q}const L={log(){},warn(){},error(){}};function B(q){if(q===!1)return L;if(q===void 0)return console;
|
|
917
917
|
if(q.log&&q.warn&&q.error)return q;throw new Error("logger must implement log, warn and error methods")}const N=/^[a-z_$][a-z0-9_$:-]*$/i;function j(q,C){const{RULES:H}=this;if((0,c.eachItem)(q,k=>{if(H.keywords[k])throw new Error(`Keyword ${k} is already defined`);if(!N.test(k))throw new Error(`Keyword ${k} has invalid name`)}),!!C&&C.$data&&!("code"in C||"validate"in C))throw new Error('$data keyword must have "code" or "validate" function')}function M(q,C,H){var k;const w=C?.post;if(H&&w)throw new Error(
|
|
918
|
-
'keyword with "post" flag cannot have "type"');const{RULES:A}=this;let R=w?A.post:A.rules.find(({type:Z})=>Z===H);if(R||(R={type:H,rules:[]},A.rules.push(R)),A.keywords[q]=!0,!C)return;const
|
|
919
|
-
rules.splice(k,0,C):(q.rules.push(C),this.logger.warn(`rule ${H} is not defined`))}function z(q){let{metaSchema:C}=q;C!==void 0&&(q.$data&&this.opts.$data&&(C=se(C)),q.validateSchema=this.compile(C,!0))}const
|
|
918
|
+
'keyword with "post" flag cannot have "type"');const{RULES:A}=this;let R=w?A.post:A.rules.find(({type:Z})=>Z===H);if(R||(R={type:H,rules:[]},A.rules.push(R)),A.keywords[q]=!0,!C)return;const X={keyword:q,definition:{...C,type:(0,l.getJSONTypes)(C.type),schemaType:(0,l.getJSONTypes)(C.schemaType)}};C.before?Y.call(this,R,X,C.before):R.rules.push(X),A.all[q]=X,(k=C.implements)===null||k===void 0||k.forEach(Z=>this.addKeyword(Z))}function Y(q,C,H){const k=q.rules.findIndex(w=>w.keyword===H);k>=0?q.
|
|
919
|
+
rules.splice(k,0,C):(q.rules.push(C),this.logger.warn(`rule ${H} is not defined`))}function z(q){let{metaSchema:C}=q;C!==void 0&&(q.$data&&this.opts.$data&&(C=se(C)),q.validateSchema=this.compile(C,!0))}const J={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function se(q){return{anyOf:[q,J]}}}(yo)),yo}var zn={},Gn={},Wn={},Sl;function Py(){if(Sl)return Wn;Sl=1,Object.defineProperty(Wn,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('\
|
|
920
920
|
NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return Wn.default=t,Wn}var Ht={},Rl;function So(){if(Rl)return Ht;Rl=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.callRef=Ht.getValidate=void 0;const t=Zr(),e=ft(),r=pe(),n=ct(),i=Hn(),s=_e(),o={keyword:"$ref",schemaType:"string",code(l){const{gen:c,schema:d,it:h}=l,{baseId:E,schemaEnv:$,validateName:y,opts:f,self:g}=h,{root:p}=$;if((d==="#"||d==="#/")&&E===p.baseId)return D();const m=i.resolveRef.call(g,p,E,d);if(m===void 0)throw new t.
|
|
921
921
|
default(h.opts.uriResolver,E,d);if(m instanceof i.SchemaEnv)return v(m);return _(m);function D(){if($===p)return u(l,y,$,$.$async);const b=c.scopeValue("root",{ref:p});return u(l,(0,r._)`${b}.validate`,p,p.$async)}function v(b){const I=a(l,b);u(l,I,b,b.$async)}function _(b){const I=c.scopeValue("schema",f.code.source===!0?{ref:b,code:(0,r.stringify)(b)}:{ref:b}),U=c.name("valid"),G=l.subschema({schema:b,dataTypes:[],schemaPath:r.nil,topSchemaRef:I,errSchemaPath:d},U);l.mergeEvaluated(G),l.ok(U)}}};
|
|
922
922
|
function a(l,c){const{gen:d}=l;return c.validate?d.scopeValue("validate",{ref:c.validate}):(0,r._)`${d.scopeValue("wrapper",{ref:c})}.validate`}Ht.getValidate=a;function u(l,c,d,h){const{gen:E,it:$}=l,{allErrors:y,schemaEnv:f,opts:g}=$,p=g.passContext?n.default.this:r.nil;h?m():D();function m(){if(!f.$async)throw new Error("async schema referenced by sync schema");const b=E.let("valid");E.try(()=>{E.code((0,r._)`await ${(0,e.callValidateCode)(l,c,p)}`),_(c),y||E.assign(b,!0)},I=>{E.if((0,r._)`!(${I} instanceof ${$.
|
|
923
923
|
ValidationError})`,()=>E.throw(I)),v(I),y||E.assign(b,!1)}),l.ok(b)}function D(){l.result((0,e.callValidateCode)(l,c,p),()=>_(c),()=>v(c))}function v(b){const I=(0,r._)`${b}.errors`;E.assign(n.default.vErrors,(0,r._)`${n.default.vErrors} === null ? ${I} : ${n.default.vErrors}.concat(${I})`),E.assign(n.default.errors,(0,r._)`${n.default.vErrors}.length`)}function _(b){var I;if(!$.opts.unevaluated)return;const U=(I=d?.validate)===null||I===void 0?void 0:I.evaluated;if($.props!==!0)if(U&&!U.dynamicProps)
|
|
924
924
|
U.props!==void 0&&($.props=s.mergeEvaluated.props(E,U.props,$.props));else{const G=E.var("props",(0,r._)`${b}.evaluated.props`);$.props=s.mergeEvaluated.props(E,G,$.props,r.Name)}if($.items!==!0)if(U&&!U.dynamicItems)U.items!==void 0&&($.items=s.mergeEvaluated.items(E,U.items,$.items));else{const G=E.var("items",(0,r._)`${b}.evaluated.items`);$.items=s.mergeEvaluated.items(E,G,$.items,r.Name)}}}return Ht.callRef=u,Ht.default=o,Ht}var Ol;function Il(){if(Ol)return Gn;Ol=1,Object.defineProperty(Gn,
|
|
925
925
|
"__esModule",{value:!0});const t=Py(),e=So(),r=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return Gn.default=r,Gn}var Kn={},Yn={},Fl;function Ny(){if(Fl)return Yn;Fl=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=pe(),e=t.operators,r={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},n={message:({keyword:s,schemaCode:o})=>(0,t.
|
|
926
|
-
str)`must be ${r[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0,t._)`{comparison: ${r[s].okStr}, limit: ${o}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:o,data:a,schemaCode:u}=s;s.fail$data((0,t._)`${a} ${r[o].fail} ${u} || isNaN(${a})`)}};return Yn.default=i,Yn}var
|
|
927
|
-
error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:s,schemaCode:o,it:a}=n,u=a.opts.multipleOfPrecision,l=i.let("res"),c=u?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${u}`:(0,t._)`${l} !== parseInt(${l})`;n.fail$data((0,t._)`(${o} === 0 || (${l} = ${s}/${o}, ${c}))`)}};return
|
|
928
|
-
const r=e.length;let n=0,i=0,s;for(;i<r;)n++,s=e.charCodeAt(i++),s>=55296&&s<=56319&&i<r&&(s=e.charCodeAt(i),(s&64512)===56320&&i++);return n}return Qn.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',Qn}var Tl;function jy(){if(Tl)return
|
|
929
|
-
return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){const{keyword:o,data:a,schemaCode:u,it:l}=s,c=o==="maxLength"?t.operators.GT:t.operators.LT,d=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(s.gen,r.default)}(${a})`;s.fail$data((0,t._)`${d} ${c} ${u}`)}};return
|
|
926
|
+
str)`must be ${r[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0,t._)`{comparison: ${r[s].okStr}, limit: ${o}}`},i={keyword:Object.keys(r),type:"number",schemaType:"number",$data:!0,error:n,code(s){const{keyword:o,data:a,schemaCode:u}=s;s.fail$data((0,t._)`${a} ${r[o].fail} ${u} || isNaN(${a})`)}};return Yn.default=i,Yn}var Xn={},Pl;function Ty(){if(Pl)return Xn;Pl=1,Object.defineProperty(Xn,"__esModule",{value:!0});const t=pe(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,
|
|
927
|
+
error:{message:({schemaCode:n})=>(0,t.str)`must be multiple of ${n}`,params:({schemaCode:n})=>(0,t._)`{multipleOf: ${n}}`},code(n){const{gen:i,data:s,schemaCode:o,it:a}=n,u=a.opts.multipleOfPrecision,l=i.let("res"),c=u?(0,t._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${u}`:(0,t._)`${l} !== parseInt(${l})`;n.fail$data((0,t._)`(${o} === 0 || (${l} = ${s}/${o}, ${c}))`)}};return Xn.default=r,Xn}var Jn={},Qn={},Nl;function Ly(){if(Nl)return Qn;Nl=1,Object.defineProperty(Qn,"__esModule",{value:!0});function t(e){
|
|
928
|
+
const r=e.length;let n=0,i=0,s;for(;i<r;)n++,s=e.charCodeAt(i++),s>=55296&&s<=56319&&i<r&&(s=e.charCodeAt(i),(s&64512)===56320&&i++);return n}return Qn.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',Qn}var Tl;function jy(){if(Tl)return Jn;Tl=1,Object.defineProperty(Jn,"__esModule",{value:!0});const t=pe(),e=_e(),r=Ly(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:o}){const a=s==="maxLength"?"more":"fewer";
|
|
929
|
+
return(0,t.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0,t._)`{limit: ${s}}`},code(s){const{keyword:o,data:a,schemaCode:u,it:l}=s,c=o==="maxLength"?t.operators.GT:t.operators.LT,d=l.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,e.useFunc)(s.gen,r.default)}(${a})`;s.fail$data((0,t._)`${d} ${c} ${u}`)}};return Jn.default=i,Jn}var Zn={},Ll;function ky(){if(Ll)return Zn;Ll=1,Object.defineProperty(Zn,"__esModule",{value:!0});const t=ft(),e=pe(),n={keyword:"pattern",
|
|
930
930
|
type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:i})=>(0,e.str)`must match pattern "${i}"`,params:({schemaCode:i})=>(0,e._)`{pattern: ${i}}`},code(i){const{data:s,$data:o,schema:a,schemaCode:u,it:l}=i,c=l.opts.unicodeRegExp?"u":"",d=o?(0,e._)`(new RegExp(${u}, ${c}))`:(0,t.usePattern)(i,a);i.fail$data((0,e._)`!${d}.test(${s})`)}};return Zn.default=n,Zn}var ei={},jl;function By(){if(jl)return ei;jl=1,Object.defineProperty(ei,"__esModule",{value:!0});const t=pe(),r={keyword:[
|
|
931
931
|
"maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:n,schemaCode:i}){const s=n==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${s} than ${i} properties`},params:({schemaCode:n})=>(0,t._)`{limit: ${n}}`},code(n){const{keyword:i,data:s,schemaCode:o}=n,a=i==="maxProperties"?t.operators.GT:t.operators.LT;n.fail$data((0,t._)`Object.keys(${s}).length ${a} ${o}`)}};return ei.default=r,ei}var ti={},kl;function xy(){if(kl)return ti;kl=1,Object.
|
|
932
932
|
defineProperty(ti,"__esModule",{value:!0});const t=ft(),e=pe(),r=_e(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>(0,e.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0,e._)`{missingProperty: ${s}}`},code(s){const{gen:o,schema:a,schemaCode:u,data:l,$data:c,it:d}=s,{opts:h}=d;if(!c&&a.length===0)return;const E=a.length>=h.loopRequired;if(d.allErrors?$():y(),h.strictRequired){const p=s.parentSchema.
|
|
@@ -944,8 +944,8 @@ const t=pe(),e=_e(),n={keyword:"additionalItems",type:"array",schemaType:["boole
|
|
|
944
944
|
!0;const h=a.const("len",(0,t._)`${l}.length`);if(u===!1)s.setParams({len:o.length}),s.pass((0,t._)`${h} <= ${o.length}`);else if(typeof u=="object"&&!(0,e.alwaysValidSchema)(d,u)){const $=a.var("valid",(0,t._)`${h} <= ${o.length}`);a.if((0,t.not)($),()=>E($)),s.ok($)}function E($){a.forRange("i",o.length,h,y=>{s.subschema({keyword:c,dataProp:y,dataPropType:e.Type.Num},$),d.allErrors||a.if((0,t.not)($),()=>a.break())})}}return vr.validateAdditionalItems=i,vr.default=n,vr}var ui={},$r={},Wl;function Kl(){
|
|
945
945
|
if(Wl)return $r;Wl=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.validateTuple=void 0;const t=pe(),e=_e(),r=ft(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(s){const{schema:o,it:a}=s;if(Array.isArray(o))return i(s,"additionalItems",o);a.items=!0,!(0,e.alwaysValidSchema)(a,o)&&s.ok((0,r.validateArray)(s))}};function i(s,o,a=s.schema){const{gen:u,parentSchema:l,data:c,keyword:d,it:h}=s;y(l),h.opts.unevaluated&&a.length&&h.items!==!0&&(h.
|
|
946
946
|
items=e.mergeEvaluated.items(u,a.length,h.items));const E=u.name("valid"),$=u.const("len",(0,t._)`${c}.length`);a.forEach((f,g)=>{(0,e.alwaysValidSchema)(h,f)||(u.if((0,t._)`${$} > ${g}`,()=>s.subschema({keyword:d,schemaProp:g,dataProp:g},E)),s.ok(E))});function y(f){const{opts:g,errSchemaPath:p}=h,m=a.length,D=m===f.minItems&&(m===f.maxItems||f[o]===!1);if(g.strictTuples&&!D){const v=`"${d}" is ${m}-tuple, but minItems or maxItems/${o} are not specified or different at path "${p}"`;(0,e.checkStrictMode)(
|
|
947
|
-
h,v,g.strictTuples)}}}return $r.validateTuple=i,$r.default=n,$r}var Yl;function Vy(){if(Yl)return ui;Yl=1,Object.defineProperty(ui,"__esModule",{value:!0});const t=Kl(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return ui.default=e,ui}var ci={},
|
|
948
|
-
olean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:u,it:l}=o,{prefixItems:c}=u;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(c?(0,n.validateAdditionalItems)(o,c):o.ok((0,r.validateArray)(o)))}};return ci.default=s,ci}var li={},
|
|
947
|
+
h,v,g.strictTuples)}}}return $r.validateTuple=i,$r.default=n,$r}var Yl;function Vy(){if(Yl)return ui;Yl=1,Object.defineProperty(ui,"__esModule",{value:!0});const t=Kl(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:r=>(0,t.validateTuple)(r,"items")};return ui.default=e,ui}var ci={},Xl;function zy(){if(Xl)return ci;Xl=1,Object.defineProperty(ci,"__esModule",{value:!0});const t=pe(),e=_e(),r=ft(),n=Gl(),s={keyword:"items",type:"array",schemaType:["object","bo\
|
|
948
|
+
olean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0,t.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0,t._)`{limit: ${o}}`},code(o){const{schema:a,parentSchema:u,it:l}=o,{prefixItems:c}=u;l.items=!0,!(0,e.alwaysValidSchema)(l,a)&&(c?(0,n.validateAdditionalItems)(o,c):o.ok((0,r.validateArray)(o)))}};return ci.default=s,ci}var li={},Jl;function Gy(){if(Jl)return li;Jl=1,Object.defineProperty(li,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"contains",
|
|
949
949
|
type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:s}})=>s===void 0?(0,t.str)`must contain at least ${i} valid item(s)`:(0,t.str)`must contain at least ${i} and no more than ${s} valid item(s)`,params:({params:{min:i,max:s}})=>s===void 0?(0,t._)`{minContains: ${i}}`:(0,t._)`{minContains: ${i}, maxContains: ${s}}`},code(i){const{gen:s,schema:o,parentSchema:a,data:u,it:l}=i;let c,d;const{minContains:h,maxContains:E}=a;l.opts.next?(c=
|
|
950
950
|
h===void 0?1:h,d=E):c=1;const $=s.const("len",(0,t._)`${u}.length`);if(i.setParams({min:c,max:d}),d===void 0&&c===0){(0,e.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&c>d){(0,e.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,e.alwaysValidSchema)(l,o)){let m=(0,t._)`${$} >= ${c}`;d!==void 0&&(m=(0,t._)`${m} && ${$} <= ${d}`),i.pass(m);return}l.items=!0;const y=s.name("valid");d===void 0&&
|
|
951
951
|
c===1?g(y,()=>s.if(y,()=>s.break())):c===0?(s.let(y,!0),d!==void 0&&s.if((0,t._)`${u}.length > 0`,f)):(s.let(y,!1),f()),i.result(y,()=>i.reset());function f(){const m=s.name("_valid"),D=s.let("count",0);g(m,()=>s.if(m,()=>p(D)))}function g(m,D){s.forRange("i",0,$,v=>{i.subschema({keyword:"contains",dataProp:v,dataPropType:e.Type.Num,compositeRule:!0},m),D()})}function p(m){s.code((0,t._)`${m}++`),d===void 0?s.if((0,t._)`${m} >= ${c}`,()=>s.assign(y,!0).break()):(s.if((0,t._)`${m} > ${d}`,()=>s.assign(
|
|
@@ -964,14 +964,14 @@ function Ky(){if(rf)return hi;rf=1,Object.defineProperty(hi,"__esModule",{value:
|
|
|
964
964
|
r.mergeEvaluated.props(o,(0,r.toHash)(d),c.props));const h=d.filter(f=>!(0,r.alwaysValidSchema)(c,a[f]));if(h.length===0)return;const E=o.name("valid");for(const f of h)$(f)?y(f):(o.if((0,e.propertyInData)(o,l,f,c.opts.ownProperties)),y(f),c.allErrors||o.else().var(E,!0),o.endIf()),s.it.definedProperties.add(f),s.ok(E);function $(f){return c.opts.useDefaults&&!c.compositeRule&&a[f].default!==void 0}function y(f){s.subschema({keyword:"properties",schemaProp:f,dataProp:f},E)}}};return hi.default=i,
|
|
965
965
|
hi}var pi={},nf;function Yy(){if(nf)return pi;nf=1,Object.defineProperty(pi,"__esModule",{value:!0});const t=ft(),e=pe(),r=_e(),n=_e(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(s){const{gen:o,schema:a,data:u,parentSchema:l,it:c}=s,{opts:d}=c,h=(0,t.allSchemaProperties)(a),E=h.filter(D=>(0,r.alwaysValidSchema)(c,a[D]));if(h.length===0||E.length===h.length&&(!c.opts.unevaluated||c.props===!0))return;const $=d.strictSchema&&!d.allowMatchingProperties&&l.properties,y=o.name(
|
|
966
966
|
"valid");c.props!==!0&&!(c.props instanceof e.Name)&&(c.props=(0,n.evaluatedPropsToName)(o,c.props));const{props:f}=c;g();function g(){for(const D of h)$&&p(D),c.allErrors?m(D):(o.var(y,!0),m(D),o.if(y))}function p(D){for(const v in $)new RegExp(D).test(v)&&(0,r.checkStrictMode)(c,`property ${v} matches pattern ${D} (use allowMatchingProperties)`)}function m(D){o.forIn("key",u,v=>{o.if((0,e._)`${(0,t.usePattern)(s,D)}.test(${v})`,()=>{const _=E.includes(D);_||s.subschema({keyword:"patternPropert\
|
|
967
|
-
ies",schemaProp:D,dataProp:v,dataPropType:n.Type.Str},y),c.opts.unevaluated&&f!==!0?o.assign((0,e._)`${f}[${v}]`,!0):!_&&!c.allErrors&&o.if((0,e.not)(y),()=>o.break())})})}}};return pi.default=i,pi}var mi={},sf;function
|
|
968
|
-
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return mi.default=e,mi}var gi={},of;function
|
|
967
|
+
ies",schemaProp:D,dataProp:v,dataPropType:n.Type.Str},y),c.opts.unevaluated&&f!==!0?o.assign((0,e._)`${f}[${v}]`,!0):!_&&!c.allErrors&&o.if((0,e.not)(y),()=>o.break())})})}}};return pi.default=i,pi}var mi={},sf;function Xy(){if(sf)return mi;sf=1,Object.defineProperty(mi,"__esModule",{value:!0});const t=_e(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(r){const{gen:n,schema:i,it:s}=r;if((0,t.alwaysValidSchema)(s,i)){r.fail();return}const o=n.name("valid");r.subschema({keyword:"\
|
|
968
|
+
not",compositeRule:!0,createErrors:!1,allErrors:!1},o),r.failResult(o,()=>r.reset(),()=>r.error())},error:{message:"must NOT be valid"}};return mi.default=e,mi}var gi={},of;function Jy(){if(of)return gi;of=1,Object.defineProperty(gi,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:ft().validateUnion,error:{message:"must match a schema in anyOf"}};return gi.default=e,gi}var yi={},af;function Qy(){if(af)return yi;af=1,Object.defineProperty(yi,"__esModule",{value:!0});
|
|
969
969
|
const t=pe(),e=_e(),n={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,t._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:s,schema:o,parentSchema:a,it:u}=i;if(!Array.isArray(o))throw new Error("ajv implementation error");if(u.opts.discriminator&&a.discriminator)return;const l=o,c=s.let("valid",!1),d=s.let("passing",null),h=s.name("_valid");i.setParams({passing:d}),s.block(E),i.result(c,()=>i.reset(),()=>i.error(
|
|
970
970
|
!0));function E(){l.forEach(($,y)=>{let f;(0,e.alwaysValidSchema)(u,$)?s.var(h,!0):f=i.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},h),y>0&&s.if((0,t._)`${h} && ${c}`).assign(c,!1).assign(d,(0,t._)`[${d}, ${y}]`).else(),s.if(h,()=>{s.assign(c,!0),s.assign(d,y),f&&i.mergeEvaluated(f,t.Name)})})}}};return yi.default=n,yi}var Ei={},uf;function Zy(){if(uf)return Ei;uf=1,Object.defineProperty(Ei,"__esModule",{value:!0});const t=_e(),e={keyword:"allOf",schemaType:"array",code(r){const{gen:n,
|
|
971
971
|
schema:i,it:s}=r;if(!Array.isArray(i))throw new Error("ajv implementation error");const o=n.name("valid");i.forEach((a,u)=>{if((0,t.alwaysValidSchema)(s,a))return;const l=r.subschema({keyword:"allOf",schemaProp:u},o);r.ok(o),r.mergeEvaluated(l)})}};return Ei.default=e,Ei}var Di={},cf;function eE(){if(cf)return Di;cf=1,Object.defineProperty(Di,"__esModule",{value:!0});const t=pe(),e=_e(),n={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>(0,t.str)`must match "${s.
|
|
972
972
|
ifClause}" schema`,params:({params:s})=>(0,t._)`{failingKeyword: ${s.ifClause}}`},code(s){const{gen:o,parentSchema:a,it:u}=s;a.then===void 0&&a.else===void 0&&(0,e.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const l=i(u,"then"),c=i(u,"else");if(!l&&!c)return;const d=o.let("valid",!0),h=o.name("_valid");if(E(),s.reset(),l&&c){const y=o.let("ifClause");s.setParams({ifClause:y}),o.if(h,$("then",y),$("else",y))}else l?o.if(h,$("then")):o.if((0,t.not)(h),$("else"));s.pass(d,()=>s.
|
|
973
973
|
error(!0));function E(){const y=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},h);s.mergeEvaluated(y)}function $(y,f){return()=>{const g=s.subschema({keyword:y},h);o.assign(d,h),s.mergeValidEvaluated(g,d),f?o.assign(f,(0,t._)`${y}`):s.setParams({ifClause:y})}}}};function i(s,o){const a=s.schema[o];return a!==void 0&&!(0,e.alwaysValidSchema)(s,a)}return Di.default=n,Di}var vi={},lf;function tE(){if(lf)return vi;lf=1,Object.defineProperty(vi,"__esModule",{value:!0});const t=_e(),
|
|
974
|
-
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return vi.default=e,vi}var ff;function df(){if(ff)return ai;ff=1,Object.defineProperty(ai,"__esModule",{value:!0});const t=Gl(),e=Vy(),r=Kl(),n=zy(),i=Gy(),s=Io(),o=Wy(),a=tf(),u=Ky(),l=Yy(),c=
|
|
974
|
+
e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:r,parentSchema:n,it:i}){n.if===void 0&&(0,t.checkStrictMode)(i,`"${r}" without "if" is ignored`)}};return vi.default=e,vi}var ff;function df(){if(ff)return ai;ff=1,Object.defineProperty(ai,"__esModule",{value:!0});const t=Gl(),e=Vy(),r=Kl(),n=zy(),i=Gy(),s=Io(),o=Wy(),a=tf(),u=Ky(),l=Yy(),c=Xy(),d=Jy(),h=Qy(),E=Zy(),$=eE(),y=tE();function f(g=!1){const p=[c.default,d.default,h.default,E.default,$.default,y.default,o.default,
|
|
975
975
|
a.default,s.default,u.default,l.default];return g?p.push(e.default,n.default):p.push(t.default,r.default),p.push(i.default),p}return ai.default=f,ai}var $i={},_r={},hf;function pf(){if(hf)return _r;hf=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.dynamicAnchor=void 0;const t=pe(),e=ct(),r=Hn(),n=So(),i={keyword:"$dynamicAnchor",schemaType:"string",code:a=>s(a,a.schema)};function s(a,u){const{gen:l,it:c}=a;c.schemaEnv.root.dynamicAnchors[u]=!0;const d=(0,t._)`${e.default.dynamicAnchors}${(0,t.
|
|
976
976
|
getProperty)(u)}`,h=c.errSchemaPath==="#"?c.validateName:o(a);l.if((0,t._)`!${d}`,()=>l.assign(d,h))}_r.dynamicAnchor=s;function o(a){const{schemaEnv:u,schema:l,self:c}=a.it,{root:d,baseId:h,localRefs:E,meta:$}=u.root,{schemaId:y}=c.opts,f=new r.SchemaEnv({schema:l,schemaId:y,root:d,baseId:h,localRefs:E,meta:$});return r.compileSchema.call(c,f),(0,n.getValidate)(a,f)}return _r.default=i,_r}var wr={},mf;function gf(){if(mf)return wr;mf=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.dynamicRef=
|
|
977
977
|
void 0;const t=pe(),e=ct(),r=So(),n={keyword:"$dynamicRef",schemaType:"string",code:s=>i(s,s.schema)};function i(s,o){const{gen:a,keyword:u,it:l}=s;if(o[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const c=o.slice(1);if(l.allErrors)d();else{const E=a.let("valid",!1);d(E),s.ok(E)}function d(E){if(l.schemaEnv.root.dynamicAnchors[c]){const $=a.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(c)}`);a.if($,h($,E),h(l.validateName,E))}else h(l.validateName,E)()}
|
|
@@ -997,9 +997,9 @@ default(h.opts.uriResolver,h.baseId,j)}const N=(D=B?.properties)===null||D===voi
|
|
|
997
997
|
s://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},xf="meta",Mf="Core and Validation specifications meta-schema",qf=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],Uf=["object","boolean"],
|
|
998
998
|
Hf="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",Vf={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 semantics.',type:"object",additionalProperties:{
|
|
999
999
|
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}},mE={$schema:jf,$id:kf,$vocabulary:Bf,$dynamicAnchor:xf,title:Mf,allOf:qf,type:Uf,$comment:Hf,properties:Vf},gE={__proto__:null,
|
|
1000
|
-
$comment:Hf,$dynamicAnchor:xf,$id:kf,$schema:jf,$vocabulary:Bf,allOf:qf,default:mE,properties:Vf,title:Mf,type:Uf},yE=yt(gE),zf="https://json-schema.org/draft/2020-12/schema",Gf="https://json-schema.org/draft/2020-12/meta/applicator",Wf={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Kf="meta",Yf="Applicator vocabulary meta-schema",
|
|
1000
|
+
$comment:Hf,$dynamicAnchor:xf,$id:kf,$schema:jf,$vocabulary:Bf,allOf:qf,default:mE,properties:Vf,title:Mf,type:Uf},yE=yt(gE),zf="https://json-schema.org/draft/2020-12/schema",Gf="https://json-schema.org/draft/2020-12/meta/applicator",Wf={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Kf="meta",Yf="Applicator vocabulary meta-schema",Xf=["object","boolean"],Jf={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"\
|
|
1001
1001
|
#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs\
|
|
1002
|
-
/schemaArray"},not:{$dynamicRef:"#meta"}},Qf={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},EE={$schema:zf,$id:Gf,$vocabulary:Wf,$dynamicAnchor:Kf,title:Yf,type:
|
|
1002
|
+
/schemaArray"},not:{$dynamicRef:"#meta"}},Qf={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},EE={$schema:zf,$id:Gf,$vocabulary:Wf,$dynamicAnchor:Kf,title:Yf,type:Xf,properties:Jf,$defs:Qf},DE={__proto__:null,$defs:Qf,$dynamicAnchor:Kf,$id:Gf,$schema:zf,$vocabulary:Wf,default:EE,properties:Jf,title:Yf,type:Xf},vE=yt(DE),Zf="https://json-schema.org/draft/2020-12/schema",ed="https://json-schema.org/draft/2020-12/meta/unevaluated",td={"https://json-schema.org/draft/2020-12/vocab/\
|
|
1003
1003
|
unevaluated":!0},rd="meta",nd="Unevaluated applicator vocabulary meta-schema",id=["object","boolean"],sd={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},$E={$schema:Zf,$id:ed,$vocabulary:td,$dynamicAnchor:rd,title:nd,type:id,properties:sd},_E={__proto__:null,$dynamicAnchor:rd,$id:ed,$schema:Zf,$vocabulary:td,default:$E,properties:sd,title:nd,type:id},wE=yt(_E),od="https://json-schema.org/draft/2020-12/schema",ad="https://json-schema.org/draft/2020-12/meta/con\
|
|
1004
1004
|
tent",ud={"https://json-schema.org/draft/2020-12/vocab/content":!0},cd="meta",ld="Content vocabulary meta-schema",fd=["object","boolean"],dd={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},bE={$schema:od,$id:ad,$vocabulary:ud,$dynamicAnchor:cd,title:ld,type:fd,properties:dd},AE={__proto__:null,$dynamicAnchor:cd,$id:ad,$schema:od,$vocabulary:ud,default:bE,properties:dd,title:ld,type:fd},CE=yt(AE),hd="https://json-schema.org/draft/2020-12/sche\
|
|
1005
1005
|
ma",pd="https://json-schema.org/draft/2020-12/meta/core",md={"https://json-schema.org/draft/2020-12/vocab/core":!0},gd="meta",yd="Core vocabulary meta-schema",Ed=["object","boolean"],Dd={$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:{$ref:"#/$defs/anchorString"},$vocabulary:{
|
|
@@ -1020,15 +1020,15 @@ email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0
|
|
|
1020
1020
|
regex:G,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:m,int32:{type:"number",validate:_},int64:{type:"number",validate:b},float:{type:"number",validate:I},double:{type:"number",validate:I},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,
|
|
1021
1021
|
o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\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,E),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,c),"iso-date-time":e(/^\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,$),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
|
|
1022
1022
|
email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(L){return L%4===0&&(L%100!==0||L%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 s(L){const B=n.exec(L);if(!B)return!1;const N=+B[1],j=+B[2],M=+B[3];return j>=1&&j<=12&&M>=1&&M<=(j===2&&r(N)?29:i[j])}function o(L,B){if(L&&B)return L>B?1:L<B?-1:0}const a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
|
|
1023
|
-
function u(L){return function(N){const j=a.exec(N);if(!j)return!1;const M=+j[1],Y=+j[2],z=+j[3],
|
|
1023
|
+
function u(L){return function(N){const j=a.exec(N);if(!j)return!1;const M=+j[1],Y=+j[2],z=+j[3],J=j[4],se=j[5]==="-"?-1:1,q=+(j[6]||0),C=+(j[7]||0);if(q>23||C>59||L&&!J)return!1;if(M<=23&&Y<=59&&z<60)return!0;const H=Y-C*se,k=M-q*se-(H<0?1:0);return(k===23||k===-1)&&(H===59||H===-1)&&z<61}}function l(L,B){if(!(L&&B))return;const N=new Date("2020-01-01T"+L).valueOf(),j=new Date("2020-01-01T"+B).valueOf();if(N&&j)return N-j}function c(L,B){if(!(L&&B))return;const N=a.exec(L),j=a.exec(B);if(N&&j)return L=
|
|
1024
1024
|
N[1]+N[2]+N[3],B=j[1]+j[2]+j[3],L>B?1:L<B?-1:0}const d=/t|\s/i;function h(L){const B=u(L);return function(j){const M=j.split(d);return M.length===2&&s(M[0])&&B(M[1])}}function E(L,B){if(!(L&&B))return;const N=new Date(L).valueOf(),j=new Date(B).valueOf();if(N&&j)return N-j}function $(L,B){if(!(L&&B))return;const[N,j]=L.split(d),[M,Y]=B.split(d),z=o(N,M);if(z!==void 0)return z||l(j,Y)}const y=/\/|:/,f=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
|
|
1025
1025
|
function g(L){return y.test(L)&&f.test(L)}const p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(L){return p.lastIndex=0,p.test(L)}const D=-2147483648,v=2**31-1;function _(L){return Number.isInteger(L)&&L<=v&&L>=D}function b(L){return Number.isInteger(L)}function I(){return!0}const U=/[^\\]\\Z/;function G(L){if(U.test(L))return!1;try{return new RegExp(L),!0}catch{return!1}}}(Fo)),Fo}var Po={},ji={exports:{}},ki={},Gd;function HE(){if(Gd)return ki;Gd=1,Object.defineProperty(
|
|
1026
|
-
ki,"__esModule",{value:!0});const t=Il(),e=Vl(),r=df(),n=Of(),i=Ff(),s=[t.default,e.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return ki.default=s,ki}const Wd="http://json-schema.org/draft-07/schema#",Kd="http://json-schema.org/draft-07/schema#",Yd="Core schema meta-schema",
|
|
1027
|
-
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},
|
|
1026
|
+
ki,"__esModule",{value:!0});const t=Il(),e=Vl(),r=df(),n=Of(),i=Ff(),s=[t.default,e.default,(0,r.default)(),n.default,i.metadataVocabulary,i.contentVocabulary];return ki.default=s,ki}const Wd="http://json-schema.org/draft-07/schema#",Kd="http://json-schema.org/draft-07/schema#",Yd="Core schema meta-schema",Xd={schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},
|
|
1027
|
+
simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Jd=["object","boolean"],Qd={$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},
|
|
1028
1028
|
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\
|
|
1029
1029
|
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:"\
|
|
1030
1030
|
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\
|
|
1031
|
-
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},VE={$schema:Wd,$id:Kd,title:Yd,definitions:
|
|
1031
|
+
initions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},VE={$schema:Wd,$id:Kd,title:Yd,definitions:Xd,type:Jd,properties:Qd,default:!0},zE={__proto__:null,$id:Kd,$schema:Wd,default:VE,definitions:Xd,properties:Qd,title:Yd,type:Jd},GE=yt(zE);var Zd;function WE(){return Zd||(Zd=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;const r=Cl(),n=HE(),i=Lf(),
|
|
1032
1032
|
s=GE,o=["/properties"],a="http://json-schema.org/draft-07/schema";class u extends r.default{_addVocabularies(){super._addVocabularies(),n.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const $=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema($,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||
|
|
1033
1033
|
(this.getSchema(a)?a:void 0)}}e.Ajv=u,t.exports=e=u,t.exports.Ajv=u,Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var l=Qr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var c=pe();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return c._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return c.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return c.stringify}}),Object.defineProperty(e,
|
|
1034
1034
|
"nil",{enumerable:!0,get:function(){return c.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return c.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return c.CodeGen}});var d=qn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var h=Zr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return h.default}})}(ji,ji.exports)),ji.exports}var eh;function KE(){return eh||(eh=1,function(t){Object.
|
|
@@ -1036,7 +1036,7 @@ defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;const e
|
|
|
1036
1036
|
{keyword:Object.keys(i),type:"string",schemaType:"string",$data:!0,error:s,code(a){const{gen:u,data:l,schemaCode:c,keyword:d,it:h}=a,{opts:E,self:$}=h;if(!E.validateFormats)return;const y=new e.KeywordCxt(h,$.RULES.all.format.definition,"format");y.$data?f():g();function f(){const m=u.scopeValue("formats",{ref:$.formats,code:E.code.formats}),D=u.const("fmt",(0,r._)`${m}[${y.schemaCode}]`);a.fail$data((0,r.or)((0,r._)`typeof ${D} != "object"`,(0,r._)`${D} instanceof RegExp`,(0,r._)`typeof ${D}.compare != "function"`,
|
|
1037
1037
|
p(D)))}function g(){const m=y.schema,D=$.formats[m];if(!D||D===!0)return;if(typeof D!="object"||D instanceof RegExp||typeof D.compare!="function")throw new Error(`"${d}": format "${m}" does not define "compare" function`);const v=u.scopeValue("formats",{key:m,ref:D,code:E.code.formats?(0,r._)`${E.code.formats}${(0,r.getProperty)(m)}`:void 0});a.fail$data(p(v))}function p(m){return(0,r._)`${m}.compare(${l}, ${c}) ${i[d].fail} 0`}},dependencies:["format"]};const o=a=>(a.addKeyword(t.formatLimitDefinition),
|
|
1038
1038
|
a);t.default=o}(Po)),Po}var th;function YE(){return th||(th=1,function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=UE(),n=KE(),i=pe(),s=new i.Name("fullFormats"),o=new i.Name("fastFormats"),a=(l,c={keywords:!0})=>{if(Array.isArray(c))return u(l,c,r.fullFormats,s),l;const[d,h]=c.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s],E=c.formats||r.formatNames;return u(l,E,d,h),c.keywords&&(0,n.default)(l),l};a.get=(l,c="full")=>{const h=(c==="fast"?r.fastFormats:r.fullFormats)[l];if(!h)
|
|
1039
|
-
throw new Error(`Unknown format "${l}"`);return h};function u(l,c,d,h){var E,$;(E=($=l.opts.code).formats)!==null&&E!==void 0||($.formats=(0,i._)`require("ajv-formats/dist/formats").${h}`);for(const y of c)l.addFormat(y,d[y])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(Li,Li.exports)),Li.exports}var
|
|
1039
|
+
throw new Error(`Unknown format "${l}"`);return h};function u(l,c,d,h){var E,$;(E=($=l.opts.code).formats)!==null&&E!==void 0||($.formats=(0,i._)`require("ajv-formats/dist/formats").${h}`);for(const y of c)l.addFormat(y,d[y])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}(Li,Li.exports)),Li.exports}var XE=YE();const JE=Xi(XE),QE=(t,e,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;const i=Object.getOwnPropertyDescriptor(t,r),s=Object.getOwnPropertyDescriptor(
|
|
1040
1040
|
e,r);!ZE(i,s)&&n||Object.defineProperty(t,r,s)},ZE=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},eD=(t,e)=>{const r=Object.getPrototypeOf(e);r!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,r)},tD=(t,e)=>`/* Wrapped ${t}*/
|
|
1041
1041
|
${e}`,rD=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),nD=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iD=(t,e,r)=>{const n=r===""?"":`with ${r.trim()}() `,i=tD.bind(null,n,e.toString());Object.defineProperty(i,"name",nD);const{writable:s,enumerable:o,configurable:a}=rD;Object.defineProperty(t,"toString",{value:i,writable:s,enumerable:o,configurable:a})};function sD(t,e,{ignoreNonConfigurable:r=!1}={}){const{name:n}=t;for(const i of Reflect.ownKeys(e))QE(t,
|
|
1042
1042
|
e,i,r);return eD(t,e),iD(t,e,n),t}const rh=(t,e={})=>{if(typeof t!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof t}\``);const{wait:r=0,maxWait:n=Number.POSITIVE_INFINITY,before:i=!1,after:s=!0}=e;if(r<0||n<0)throw new RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,u;const l=function(...c){const d=this,h=()=>{o=void 0,a&&(clearTimeout(a),a=
|
|
@@ -1061,22 +1061,22 @@ ady exists");this.prerelease.push(E)}}if(d){let $=[d,E];h===!1&&($=[d]),a(this.p
|
|
|
1061
1061
|
xo}var Mo,fh;function oD(){if(fh)return Mo;fh=1;const t=br();return Mo=(r,n)=>{const i=t(r,n);return i?i.version:null},Mo}var qo,dh;function aD(){if(dh)return qo;dh=1;const t=br();return qo=(r,n)=>{const i=t(r.trim().replace(/^[=v]+/,""),n);return i?i.version:null},qo}var Uo,hh;function uD(){if(hh)return Uo;hh=1;const t=ze();return Uo=(r,n,i,s,o)=>{typeof i=="string"&&(o=s,s=i,i=void 0);try{return new t(r instanceof t?r.version:r,i).inc(n,s,o).version}catch{return null}},Uo}var Ho,ph;function cD(){
|
|
1062
1062
|
if(ph)return Ho;ph=1;const t=br();return Ho=(r,n)=>{const i=t(r,null,!0),s=t(n,null,!0),o=i.compare(s);if(o===0)return null;const a=o>0,u=a?i:s,l=a?s:i,c=!!u.prerelease.length;if(!!l.prerelease.length&&!c){if(!l.patch&&!l.minor)return"major";if(l.compareMain(u)===0)return l.minor&&!l.patch?"minor":"patch"}const h=c?"pre":"";return i.major!==s.major?h+"major":i.minor!==s.minor?h+"minor":i.patch!==s.patch?h+"patch":"prerelease"},Ho}var Vo,mh;function lD(){if(mh)return Vo;mh=1;const t=ze();return Vo=
|
|
1063
1063
|
(r,n)=>new t(r,n).major,Vo}var zo,gh;function fD(){if(gh)return zo;gh=1;const t=ze();return zo=(r,n)=>new t(r,n).minor,zo}var Go,yh;function dD(){if(yh)return Go;yh=1;const t=ze();return Go=(r,n)=>new t(r,n).patch,Go}var Wo,Eh;function hD(){if(Eh)return Wo;Eh=1;const t=br();return Wo=(r,n)=>{const i=t(r,n);return i&&i.prerelease.length?i.prerelease:null},Wo}var Ko,Dh;function dt(){if(Dh)return Ko;Dh=1;const t=ze();return Ko=(r,n,i)=>new t(r,i).compare(new t(n,i)),Ko}var Yo,vh;function pD(){if(vh)
|
|
1064
|
-
return Yo;vh=1;const t=dt();return Yo=(r,n,i)=>t(n,r,i),Yo}var
|
|
1064
|
+
return Yo;vh=1;const t=dt();return Yo=(r,n,i)=>t(n,r,i),Yo}var Xo,$h;function mD(){if($h)return Xo;$h=1;const t=dt();return Xo=(r,n)=>t(r,n,!0),Xo}var Jo,_h;function Qo(){if(_h)return Jo;_h=1;const t=ze();return Jo=(r,n,i)=>{const s=new t(r,i),o=new t(n,i);return s.compare(o)||s.compareBuild(o)},Jo}var Zo,wh;function gD(){if(wh)return Zo;wh=1;const t=Qo();return Zo=(r,n)=>r.sort((i,s)=>t(i,s,n)),Zo}var ea,bh;function yD(){if(bh)return ea;bh=1;const t=Qo();return ea=(r,n)=>r.sort((i,s)=>t(s,i,n)),
|
|
1065
1065
|
ea}var ta,Ah;function qi(){if(Ah)return ta;Ah=1;const t=dt();return ta=(r,n,i)=>t(r,n,i)>0,ta}var ra,Ch;function na(){if(Ch)return ra;Ch=1;const t=dt();return ra=(r,n,i)=>t(r,n,i)<0,ra}var ia,Sh;function Rh(){if(Sh)return ia;Sh=1;const t=dt();return ia=(r,n,i)=>t(r,n,i)===0,ia}var sa,Oh;function Ih(){if(Oh)return sa;Oh=1;const t=dt();return sa=(r,n,i)=>t(r,n,i)!==0,sa}var oa,Fh;function aa(){if(Fh)return oa;Fh=1;const t=dt();return oa=(r,n,i)=>t(r,n,i)>=0,oa}var ua,Ph;function ca(){if(Ph)return ua;
|
|
1066
1066
|
Ph=1;const t=dt();return ua=(r,n,i)=>t(r,n,i)<=0,ua}var la,Nh;function Th(){if(Nh)return la;Nh=1;const t=Rh(),e=Ih(),r=qi(),n=aa(),i=na(),s=ca();return la=(a,u,l,c)=>{switch(u){case"===":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a===l;case"!==":return typeof a=="object"&&(a=a.version),typeof l=="object"&&(l=l.version),a!==l;case"":case"=":case"==":return t(a,l,c);case"!=":return e(a,l,c);case">":return r(a,l,c);case">=":return n(a,l,c);case"<":return i(a,l,c);case"\
|
|
1067
1067
|
<=":return s(a,l,c);default:throw new TypeError(`Invalid operator: ${u}`)}},la}var fa,Lh;function ED(){if(Lh)return fa;Lh=1;const t=ze(),e=br(),{safeRe:r,t:n}=rn();return fa=(s,o)=>{if(s instanceof t)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;o=o||{};let a=null;if(!o.rtl)a=s.match(o.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const E=o.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let $;for(;($=E.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||
|
|
1068
1068
|
$.index+$[0].length!==a.index+a[0].length)&&(a=$),E.lastIndex=$.index+$[1].length+$[2].length;E.lastIndex=-1}if(a===null)return null;const u=a[2],l=a[3]||"0",c=a[4]||"0",d=o.includePrerelease&&a[5]?`-${a[5]}`:"",h=o.includePrerelease&&a[6]?`+${a[6]}`:"";return e(`${u}.${l}.${c}${d}${h}`,o)},fa}var da,jh;function DD(){if(jh)return da;jh=1;class t{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.
|
|
1069
1069
|
map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return da=t,da}var ha,kh;function ht(){if(kh)return ha;kh=1;const t=/\s+/g;class e{constructor(M,Y){if(Y=i(Y),M instanceof e)return M.loose===!!Y.loose&&M.includePrerelease===!!Y.includePrerelease?M:new e(M.raw,Y);if(M instanceof s)return this.raw=M.value,this.set=[[M]],this.formatted=void 0,this;if(this.options=Y,this.loose=!!Y.loose,
|
|
1070
|
-
this.includePrerelease=!!Y.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(
|
|
1071
|
-
void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const Y=this.set[M];for(let z=0;z<Y.length;z++)z>0&&(this.formatted+=" "),this.formatted+=Y[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&E)|(this.options.loose&&$))+":"+M,
|
|
1070
|
+
this.includePrerelease=!!Y.includePrerelease,this.raw=M.trim().replace(t," "),this.set=this.raw.split("||").map(z=>this.parseRange(z.trim())).filter(z=>z.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const z=this.set[0];if(this.set=this.set.filter(J=>!y(J[0])),this.set.length===0)this.set=[z];else if(this.set.length>1){for(const J of this.set)if(J.length===1&&f(J[0])){this.set=[J];break}}}this.formatted=void 0}get range(){if(this.formatted===
|
|
1071
|
+
void 0){this.formatted="";for(let M=0;M<this.set.length;M++){M>0&&(this.formatted+="||");const Y=this.set[M];for(let z=0;z<Y.length;z++)z>0&&(this.formatted+=" "),this.formatted+=Y[z].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(M){const z=((this.options.includePrerelease&&E)|(this.options.loose&&$))+":"+M,J=n.get(z);if(J)return J;const se=this.options.loose,q=se?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];M=M.replace(q,B(this.options.includePrerelease)),
|
|
1072
1072
|
o("hyphen replace",M),M=M.replace(u[l.COMPARATORTRIM],c),o("comparator trim",M),M=M.replace(u[l.TILDETRIM],d),o("tilde trim",M),M=M.replace(u[l.CARETTRIM],h),o("caret trim",M);let C=M.split(" ").map(A=>p(A,this.options)).join(" ").split(/\s+/).map(A=>L(A,this.options));se&&(C=C.filter(A=>(o("loose invalid filter",A,this.options),!!A.match(u[l.COMPARATORLOOSE])))),o("range list",C);const H=new Map,k=C.map(A=>new s(A,this.options));for(const A of k){if(y(A))return[A];H.set(A.value,A)}H.size>1&&H.has(
|
|
1073
|
-
"")&&H.delete("");const w=[...H.values()];return n.set(z,w),w}intersects(M,Y){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(z=>g(z,Y)&&M.set.some(
|
|
1074
|
-
tildeTrimReplace:d,caretTrimReplace:h}=rn(),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:$}=xi(),y=j=>j.value==="<0.0.0-0",f=j=>j.value==="",g=(j,M)=>{let Y=!0;const z=j.slice();let
|
|
1075
|
-
TILDELOOSE]:u[l.TILDE];return j.replace(Y,(z,
|
|
1076
|
-
o("caret",j,
|
|
1077
|
-
.${C} <${+se+1}.0.0-0`),o("caret return",k),k})},I=(j,M)=>(o("replaceXRanges",j,M),j.split(/\s+/).map(Y=>U(Y,M)).join(" ")),U=(j,M)=>{j=j.trim();const Y=M.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return j.replace(Y,(z,
|
|
1078
|
-
(H="-0"),z=`${
|
|
1079
|
-
1}.0-0`:R?H=`<=${k}.${w}.${A}-${R}`:j?H=`<${k}.${w}.${+A+1}-0`:H=`<=${H}`,`${Y} ${H}`.trim()),N=(j,M,Y)=>{for(let z=0;z<j.length;z++)if(!j[z].test(M))return!1;if(M.prerelease.length&&!Y.includePrerelease){for(let z=0;z<j.length;z++)if(o(j[z].semver),j[z].semver!==s.ANY&&j[z].semver.prerelease.length>0){const
|
|
1073
|
+
"")&&H.delete("");const w=[...H.values()];return n.set(z,w),w}intersects(M,Y){if(!(M instanceof e))throw new TypeError("a Range is required");return this.set.some(z=>g(z,Y)&&M.set.some(J=>g(J,Y)&&z.every(se=>J.every(q=>se.intersects(q,Y)))))}test(M){if(!M)return!1;if(typeof M=="string")try{M=new a(M,this.options)}catch{return!1}for(let Y=0;Y<this.set.length;Y++)if(N(this.set[Y],M,this.options))return!0;return!1}}ha=e;const r=DD(),n=new r,i=jo(),s=Ui(),o=Mi(),a=ze(),{safeRe:u,t:l,comparatorTrimReplace:c,
|
|
1074
|
+
tildeTrimReplace:d,caretTrimReplace:h}=rn(),{FLAG_INCLUDE_PRERELEASE:E,FLAG_LOOSE:$}=xi(),y=j=>j.value==="<0.0.0-0",f=j=>j.value==="",g=(j,M)=>{let Y=!0;const z=j.slice();let J=z.pop();for(;Y&&z.length;)Y=z.every(se=>J.intersects(se,M)),J=z.pop();return Y},p=(j,M)=>(o("comp",j,M),j=_(j,M),o("caret",j),j=D(j,M),o("tildes",j),j=I(j,M),o("xrange",j),j=G(j,M),o("stars",j),j),m=j=>!j||j.toLowerCase()==="x"||j==="*",D=(j,M)=>j.trim().split(/\s+/).map(Y=>v(Y,M)).join(" "),v=(j,M)=>{const Y=M.loose?u[l.
|
|
1075
|
+
TILDELOOSE]:u[l.TILDE];return j.replace(Y,(z,J,se,q,C)=>{o("tilde",j,z,J,se,q,C);let H;return m(J)?H="":m(se)?H=`>=${J}.0.0 <${+J+1}.0.0-0`:m(q)?H=`>=${J}.${se}.0 <${J}.${+se+1}.0-0`:C?(o("replaceTilde pr",C),H=`>=${J}.${se}.${q}-${C} <${J}.${+se+1}.0-0`):H=`>=${J}.${se}.${q} <${J}.${+se+1}.0-0`,o("tilde return",H),H})},_=(j,M)=>j.trim().split(/\s+/).map(Y=>b(Y,M)).join(" "),b=(j,M)=>{o("caret",j,M);const Y=M.loose?u[l.CARETLOOSE]:u[l.CARET],z=M.includePrerelease?"-0":"";return j.replace(Y,(J,se,q,C,H)=>{
|
|
1076
|
+
o("caret",j,J,se,q,C,H);let k;return m(se)?k="":m(q)?k=`>=${se}.0.0${z} <${+se+1}.0.0-0`:m(C)?se==="0"?k=`>=${se}.${q}.0${z} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}.0${z} <${+se+1}.0.0-0`:H?(o("replaceCaret pr",H),se==="0"?q==="0"?k=`>=${se}.${q}.${C}-${H} <${se}.${q}.${+C+1}-0`:k=`>=${se}.${q}.${C}-${H} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}.${C}-${H} <${+se+1}.0.0-0`):(o("no pr"),se==="0"?q==="0"?k=`>=${se}.${q}.${C}${z} <${se}.${q}.${+C+1}-0`:k=`>=${se}.${q}.${C}${z} <${se}.${+q+1}.0-0`:k=`>=${se}.${q}\
|
|
1077
|
+
.${C} <${+se+1}.0.0-0`),o("caret return",k),k})},I=(j,M)=>(o("replaceXRanges",j,M),j.split(/\s+/).map(Y=>U(Y,M)).join(" ")),U=(j,M)=>{j=j.trim();const Y=M.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return j.replace(Y,(z,J,se,q,C,H)=>{o("xRange",j,z,J,se,q,C,H);const k=m(se),w=k||m(q),A=w||m(C),R=A;return J==="="&&R&&(J=""),H=M.includePrerelease?"-0":"",k?J===">"||J==="<"?z="<0.0.0-0":z="*":J&&R?(w&&(q=0),C=0,J===">"?(J=">=",w?(se=+se+1,q=0,C=0):(q=+q+1,C=0)):J==="<="&&(J="<",w?se=+se+1:q=+q+1),J==="<"&&
|
|
1078
|
+
(H="-0"),z=`${J+se}.${q}.${C}${H}`):w?z=`>=${se}.0.0${H} <${+se+1}.0.0-0`:A&&(z=`>=${se}.${q}.0${H} <${se}.${+q+1}.0-0`),o("xRange return",z),z})},G=(j,M)=>(o("replaceStars",j,M),j.trim().replace(u[l.STAR],"")),L=(j,M)=>(o("replaceGTE0",j,M),j.trim().replace(u[M.includePrerelease?l.GTE0PRE:l.GTE0],"")),B=j=>(M,Y,z,J,se,q,C,H,k,w,A,R)=>(m(z)?Y="":m(J)?Y=`>=${z}.0.0${j?"-0":""}`:m(se)?Y=`>=${z}.${J}.0${j?"-0":""}`:q?Y=`>=${Y}`:Y=`>=${Y}${j?"-0":""}`,m(k)?H="":m(w)?H=`<${+k+1}.0.0-0`:m(A)?H=`<${k}.${+w+
|
|
1079
|
+
1}.0-0`:R?H=`<=${k}.${w}.${A}-${R}`:j?H=`<${k}.${w}.${+A+1}-0`:H=`<=${H}`,`${Y} ${H}`.trim()),N=(j,M,Y)=>{for(let z=0;z<j.length;z++)if(!j[z].test(M))return!1;if(M.prerelease.length&&!Y.includePrerelease){for(let z=0;z<j.length;z++)if(o(j[z].semver),j[z].semver!==s.ANY&&j[z].semver.prerelease.length>0){const J=j[z].semver;if(J.major===M.major&&J.minor===M.minor&&J.patch===M.patch)return!0}return!1}return!0};return ha}var pa,Bh;function Ui(){if(Bh)return pa;Bh=1;const t=Symbol("SemVer ANY");class e{static get ANY(){
|
|
1080
1080
|
return t}constructor(c,d){if(d=r(d),c instanceof e){if(c.loose===!!d.loose)return c;c=c.value}c=c.trim().split(/\s+/).join(" "),o("comparator",c,d),this.options=d,this.loose=!!d.loose,this.parse(c),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(c){const d=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],h=c.match(d);if(!h)throw new TypeError(`Invalid comparator: ${c}`);this.operator=h[1]!==void 0?h[1]:"",this.operator==="="&&(this.operator=
|
|
1081
1081
|
""),h[2]?this.semver=new a(h[2],this.options.loose):this.semver=t}toString(){return this.value}test(c){if(o("Comparator.test",c,this.options.loose),this.semver===t||c===t)return!0;if(typeof c=="string")try{c=new a(c,this.options)}catch{return!1}return s(c,this.operator,this.semver,this.options)}intersects(c,d){if(!(c instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(c.value,d).test(this.value):c.operator===""?c.value===""?!0:new u(this.
|
|
1082
1082
|
value,d).test(c.semver):(d=r(d),d.includePrerelease&&(this.value==="<0.0.0-0"||c.value==="<0.0.0-0")||!d.includePrerelease&&(this.value.startsWith("<0.0.0")||c.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&c.operator.startsWith(">")||this.operator.startsWith("<")&&c.operator.startsWith("<")||this.semver.version===c.semver.version&&this.operator.includes("=")&&c.operator.includes("=")||s(this.semver,"<",c.semver,d)&&this.operator.startsWith(">")&&c.operator.startsWith("<")||s(this.
|
|
@@ -1086,37 +1086,37 @@ return ya=(n,i,s)=>{let o=null,a=null,u=null;try{u=new e(i,s)}catch{return null}
|
|
|
1086
1086
|
Vh=1;const t=ht();return va=(r,n)=>{try{return new t(r,n).range||"*"}catch{return null}},va}var $a,zh;function _a(){if(zh)return $a;zh=1;const t=ze(),e=Ui(),{ANY:r}=e,n=ht(),i=Hi(),s=qi(),o=na(),a=ca(),u=aa();return $a=(c,d,h,E)=>{c=new t(c,E),d=new n(d,E);let $,y,f,g,p;switch(h){case">":$=s,y=a,f=o,g=">",p=">=";break;case"<":$=o,y=u,f=s,g="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(c,d,E))return!1;for(let m=0;m<d.set.length;++m){const D=d.set[m];let v=null,
|
|
1087
1087
|
_=null;if(D.forEach(b=>{b.semver===r&&(b=new e(">=0.0.0")),v=v||b,_=_||b,$(b.semver,v.semver,E)?v=b:f(b.semver,_.semver,E)&&(_=b)}),v.operator===g||v.operator===p||(!_.operator||_.operator===g)&&y(c,_.semver))return!1;if(_.operator===p&&f(c,_.semver))return!1}return!0},$a}var wa,Gh;function AD(){if(Gh)return wa;Gh=1;const t=_a();return wa=(r,n,i)=>t(r,n,">",i),wa}var ba,Wh;function CD(){if(Wh)return ba;Wh=1;const t=_a();return ba=(r,n,i)=>t(r,n,"<",i),ba}var Aa,Kh;function SD(){if(Kh)return Aa;Kh=
|
|
1088
1088
|
1;const t=ht();return Aa=(r,n,i)=>(r=new t(r,i),n=new t(n,i),r.intersects(n,i)),Aa}var Ca,Yh;function RD(){if(Yh)return Ca;Yh=1;const t=Hi(),e=dt();return Ca=(r,n,i)=>{const s=[];let o=null,a=null;const u=r.sort((h,E)=>e(h,E,i));for(const h of u)t(h,n,i)?(a=h,o||(o=h)):(a&&s.push([o,a]),a=null,o=null);o&&s.push([o,null]);const l=[];for(const[h,E]of s)h===E?l.push(h):!E&&h===u[0]?l.push("*"):E?h===u[0]?l.push(`<=${E}`):l.push(`${h} - ${E}`):l.push(`>=${h}`);const c=l.join(" || "),d=typeof n.raw==
|
|
1089
|
-
"string"?n.raw:String(n);return c.length<d.length?c:n},Ca}var Sa,
|
|
1089
|
+
"string"?n.raw:String(n);return c.length<d.length?c:n},Ca}var Sa,Xh;function OD(){if(Xh)return Sa;Xh=1;const t=ht(),e=Ui(),{ANY:r}=e,n=Hi(),i=dt(),s=(d,h,E={})=>{if(d===h)return!0;d=new t(d,E),h=new t(h,E);let $=!1;e:for(const y of d.set){for(const f of h.set){const g=u(y,f,E);if($=$||g!==null,g)continue e}if($)return!1}return!0},o=[new e(">=0.0.0-0")],a=[new e(">=0.0.0")],u=(d,h,E)=>{if(d===h)return!0;if(d.length===1&&d[0].semver===r){if(h.length===1&&h[0].semver===r)return!0;E.includePrerelease?
|
|
1090
1090
|
d=o:d=a}if(h.length===1&&h[0].semver===r){if(E.includePrerelease)return!0;h=a}const $=new Set;let y,f;for(const I of d)I.operator===">"||I.operator===">="?y=l(y,I,E):I.operator==="<"||I.operator==="<="?f=c(f,I,E):$.add(I.semver);if($.size>1)return null;let g;if(y&&f){if(g=i(y.semver,f.semver,E),g>0)return null;if(g===0&&(y.operator!==">="||f.operator!=="<="))return null}for(const I of $){if(y&&!n(I,String(y),E)||f&&!n(I,String(f),E))return null;for(const U of h)if(!n(I,String(U),E))return!1;return!0}
|
|
1091
1091
|
let p,m,D,v,_=f&&!E.includePrerelease&&f.semver.prerelease.length?f.semver:!1,b=y&&!E.includePrerelease&&y.semver.prerelease.length?y.semver:!1;_&&_.prerelease.length===1&&f.operator==="<"&&_.prerelease[0]===0&&(_=!1);for(const I of h){if(v=v||I.operator===">"||I.operator===">=",D=D||I.operator==="<"||I.operator==="<=",y){if(b&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===b.major&&I.semver.minor===b.minor&&I.semver.patch===b.patch&&(b=!1),I.operator===">"||I.operator===">="){
|
|
1092
1092
|
if(p=l(y,I,E),p===I&&p!==y)return!1}else if(y.operator===">="&&!n(y.semver,String(I),E))return!1}if(f){if(_&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===_.major&&I.semver.minor===_.minor&&I.semver.patch===_.patch&&(_=!1),I.operator==="<"||I.operator==="<="){if(m=c(f,I,E),m===I&&m!==f)return!1}else if(f.operator==="<="&&!n(f.semver,String(I),E))return!1}if(!I.operator&&(f||y)&&g!==0)return!1}return!(y&&D&&!f&&g!==0||f&&v&&!y&&g!==0||b||_)},l=(d,h,E)=>{if(!d)return h;const $=i(
|
|
1093
|
-
d.semver,h.semver,E);return $>0?d:$<0||h.operator===">"&&d.operator===">="?h:d},c=(d,h,E)=>{if(!d)return h;const $=i(d.semver,h.semver,E);return $<0?d:$>0||h.operator==="<"&&d.operator==="<="?h:d};return Sa=s,Sa}var Ra,
|
|
1094
|
-
|
|
1095
|
-
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Ra}var Oa=ID();const Ar=
|
|
1093
|
+
d.semver,h.semver,E);return $>0?d:$<0||h.operator===">"&&d.operator===">="?h:d},c=(d,h,E)=>{if(!d)return h;const $=i(d.semver,h.semver,E);return $<0?d:$>0||h.operator==="<"&&d.operator==="<="?h:d};return Sa=s,Sa}var Ra,Jh;function ID(){if(Jh)return Ra;Jh=1;const t=rn(),e=xi(),r=ze(),n=uh(),i=br(),s=oD(),o=aD(),a=uD(),u=cD(),l=lD(),c=fD(),d=dD(),h=hD(),E=dt(),$=pD(),y=mD(),f=Qo(),g=gD(),p=yD(),m=qi(),D=na(),v=Rh(),_=Ih(),b=aa(),I=ca(),U=Th(),G=ED(),L=Ui(),B=ht(),N=Hi(),j=vD(),M=$D(),Y=_D(),z=wD(),
|
|
1094
|
+
J=bD(),se=_a(),q=AD(),C=CD(),H=SD(),k=RD(),w=OD();return Ra={parse:i,valid:s,clean:o,inc:a,diff:u,major:l,minor:c,patch:d,prerelease:h,compare:E,rcompare:$,compareLoose:y,compareBuild:f,sort:g,rsort:p,gt:m,lt:D,eq:v,neq:_,gte:b,lte:I,cmp:U,coerce:G,Comparator:L,Range:B,satisfies:N,toComparators:j,maxSatisfying:M,minSatisfying:Y,minVersion:z,validRange:J,outside:se,gtr:q,ltr:C,intersects:H,simplifyRange:k,subset:w,SemVer:r,re:t.re,src:t.src,tokens:t.t,SEMVER_SPEC_VERSION:e.SEMVER_SPEC_VERSION,RELEASE_TYPES:e.
|
|
1095
|
+
RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},Ra}var Oa=ID();const Ar=Xi(Oa),FD=Object.prototype.toString,PD="[object Uint8Array]",ND="[object ArrayBuffer]";function Qh(t,e,r){return t?t.constructor===e?!0:FD.call(t)===r:!1}function Zh(t){return Qh(t,Uint8Array,PD)}function TD(t){return Qh(t,ArrayBuffer,ND)}function LD(t){return Zh(t)||TD(t)}function jD(t){if(!Zh(t))throw new TypeError(`Expected \`Uint8Array\`, got \`${typeof t}\``)}function kD(t){
|
|
1096
1096
|
if(!LD(t))throw new TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof t}\``)}function ep(t,e){if(t.length===0)return new Uint8Array(0);e??=t.reduce((i,s)=>i+s.length,0);const r=new Uint8Array(e);let n=0;for(const i of t)jD(i),r.set(i,n),n+=i.length;return r}const tp={utf8:new globalThis.TextDecoder("utf8")};function rp(t,e="utf8"){return kD(t),tp[e]??=new globalThis.TextDecoder(e),tp[e].decode(t)}function BD(t){if(typeof t!="string")throw new TypeError(`Expected \`string\`, got\
|
|
1097
|
-
\`${typeof t}\``)}const xD=new globalThis.TextEncoder;function Ia(t){return BD(t),xD.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const MD=
|
|
1097
|
+
\`${typeof t}\``)}const xD=new globalThis.TextEncoder;function Ia(t){return BD(t),xD.encode(t)}Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));const MD=JE.default,np="aes-256-cbc",Cr=()=>Object.create(null),qD=t=>t!=null,UD=(t,e)=>{const r=new Set(["undefined","symbol","function"]),n=typeof e;if(r.has(n))throw new TypeError(`Setting a value of type \`${n}\` for key \`${t}\` is not allowed as it's not supported by JSON`)},Vi="__internal__",Fa=`${Vi}.migrations.version`;class HD{path;events;#n;#t;#e;#r={};constructor(e={}){
|
|
1098
1098
|
const r={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!r.cwd){if(!r.projectName)throw new Error("Please specify the `projectName` option.");r.cwd=ry(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("The `schema` option must be an object.");const o=new qE.Ajv2020({allErrors:!0,useDefaults:!0,
|
|
1099
1099
|
...r.ajvOptions});MD(o);const a={...r.rootSchema,type:"object",properties:r.schema};this.#n=o.compile(a);for(const[u,l]of Object.entries(r.schema??{}))l?.default&&(this.#r[u]=l.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.fileExtension}`:"";this.path=be.resolve(r.cwd,`${r.configName??"config"}${n}`);const i=this.
|
|
1100
1100
|
store,s=Object.assign(Cr(),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(s);try{sm.deepEqual(i,s)}catch{this.store=s}r.watch&&this._watch()}get(e,r){if(this.#e.accessPropertiesByDotNotation)return this._get(e,r);const{store:n}=this;return e in n?n[e]:r}set(e,r){if(typeof e!="string"&&typeof e!="object")throw new TypeError(`Expected \`key\` to be of \
|
|
1101
1101
|
type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!="object"&&r===void 0)throw new TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw new TypeError(`Please don't use the ${Vi} key, as it's used to manage this module internal operations.`);const{store:n}=this,i=(s,o)=>{UD(s,o),this.#e.accessPropertiesByDotNotation?kc(n,s,o):n[s]=o};if(typeof e=="object"){const s=e;for(const[o,a]of Object.entries(s))i(o,a)}else i(e,r);this.store=n}has(e){return this.#e.accessPropertiesByDotNotation?
|
|
1102
|
-
Qg(this.store,e):e in this.store}reset(...e){for(const r of e)qD(this.#r[r])&&this.set(r,this.#r[r])}delete(e){const{store:r}=this;this.#e.accessPropertiesByDotNotation?
|
|
1102
|
+
Qg(this.store,e):e in this.store}reset(...e){for(const r of e)qD(this.#r[r])&&this.set(r,this.#r[r])}delete(e){const{store:r}=this;this.#e.accessPropertiesByDotNotation?Jg(r,e):delete r[e],this.store=r}clear(){this.store=Cr();for(const e of Object.keys(this.#r))this.reset(e)}onDidChange(e,r){if(typeof e!="string")throw new TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof r!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof r}`);
|
|
1103
1103
|
return this._handleChange(()=>this.get(e),r)}onDidAnyChange(e){if(typeof e!="function")throw new TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{const e=ge.readFileSync(this.path,this.#t?null:"utf8"),r=this._encryptData(e),n=this._deserialize(r);return this._validate(n),Object.assign(Cr(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Cr();
|
|
1104
1104
|
if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Cr();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(const[e,r]of Object.entries(this.store))yield[e,r]}_encryptData(e){if(!this.#t)return typeof e=="string"?e:rp(e);try{const r=e.slice(0,16),n=Pr.pbkdf2Sync(this.#t,r.toString(),1e4,32,"sha512"),i=Pr.createDecipheriv(np,n,r),s=e.slice(17),o=typeof s=="string"?Ia(s):s;return rp(ep([i.update(
|
|
1105
1105
|
o),i.final()]))}catch{}return e.toString()}_handleChange(e,r){let n=e();const i=()=>{const s=n,o=e();im(o,s)||(n=o,r.call(this,o,s))};return this.events.addEventListener("change",i),()=>{this.events.removeEventListener("change",i)}}_deserialize=e=>JSON.parse(e);_serialize=e=>JSON.stringify(e,void 0," ");_validate(e){if(!this.#n||this.#n(e)||!this.#n.errors)return;const n=this.#n.errors.map(({instancePath:i,message:s=""})=>`\`${i.slice(1)}\` ${s}`);throw new Error("Config schema violation: "+n.join(
|
|
1106
1106
|
"; "))}_ensureDirectory(){ge.mkdirSync(be.dirname(this.path),{recursive:!0})}_write(e){let r=this._serialize(e);if(this.#t){const n=Pr.randomBytes(16),i=Pr.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),s=Pr.createCipheriv(np,i,n);r=ep([n,Ia(":"),s.update(Ia(r)),s.final()])}if(Te.env.SNAP)ge.writeFileSync(this.path,r,{mode:this.#e.configFileMode});else try{Uc(this.path,r,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){ge.writeFileSync(this.path,r,{mode:this.#e.configFileMode});return}
|
|
1107
1107
|
throw n}}_watch(){this._ensureDirectory(),ge.existsSync(this.path)||this._write(Cr()),Te.platform==="win32"?ge.watch(this.path,{persistent:!1},rh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100})):ge.watchFile(this.path,{persistent:!1},rh(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5e3}))}_migrate(e,r,n){let i=this._get(Fa,"0.0.0");const s=Object.keys(e).filter(a=>this._shouldPerformMigration(a,i,r));let o={...this.store};for(const a of s)try{n&&n(this,{fromVersion:i,
|
|
1108
1108
|
toVersion:a,finalVersion:r,versions:s});const u=e[a];u?.(this),this._set(Fa,a),i=a,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)||!Ar.eq(i,r))&&this._set(Fa,r)}_containsReservedKey(e){return typeof e=="object"&&Object.keys(e)[0]===Vi?!0:typeof e!="string"?!1:this.#e.accessPropertiesByDotNotation?!!e.startsWith(`${Vi}.`):!1}_isVersionInRangeFormat(e){
|
|
1109
|
-
return Ar.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Ar.satisfies(r,e)?!1:Ar.satisfies(n,e):!(Ar.lte(e,r)||Ar.gt(e,n))}_get(e,r){return
|
|
1109
|
+
return Ar.clean(e)===null}_shouldPerformMigration(e,r,n){return this._isVersionInRangeFormat(e)?r!=="0.0.0"&&Ar.satisfies(r,e)?!1:Ar.satisfies(n,e):!(Ar.lte(e,r)||Ar.gt(e,n))}_get(e,r){return Xg(this.store,e,r)}_set(e,r){const{store:n}=this;kc(n,e,r),this.store=n}}class ip extends Error{response;request;options;constructor(e,r,n){const i=e.status||e.status===0?e.status:"",s=e.statusText||"",o=`${i} ${s}`.trim(),a=o?`status code ${o}`:"an unknown error";super(`Request failed with ${a}: ${r.method}\
|
|
1110
1110
|
${r.url}`),this.name="HTTPError",this.response=e,this.request=r,this.options=n}}class sp extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}}const nn=t=>t!==null&&typeof t=="object",zi=(...t)=>{for(const e of t)if((!nn(e)||Array.isArray(e))&&e!==void 0)throw new TypeError("The `options` argument must be an object");return Pa({},...t)},op=(t={},e={})=>{const r=new globalThis.Headers(t),n=e instanceof globalThis.Headers,i=new globalThis.
|
|
1111
1111
|
Headers(e);for(const[s,o]of i.entries())n&&o==="undefined"||o===void 0?r.delete(s):r.set(s,o);return r};function Gi(t,e,r){return Object.hasOwn(e,r)&&e[r]===void 0?[]:Pa(t[r]??[],e[r]??[])}const ap=(t={},e={})=>({beforeRequest:Gi(t,e,"beforeRequest"),beforeRetry:Gi(t,e,"beforeRetry"),afterResponse:Gi(t,e,"afterResponse"),beforeError:Gi(t,e,"beforeError")}),Pa=(...t)=>{let e={},r={},n={};for(const i of t)if(Array.isArray(i))Array.isArray(e)||(e=[]),e=[...e,...i];else if(nn(i)){for(let[s,o]of Object.
|
|
1112
1112
|
entries(i))nn(o)&&s in e&&(o=Pa(e[s],o)),e={...e,[s]:o};nn(i.hooks)&&(n=ap(n,i.hooks),e.hooks=n),nn(i.headers)&&(r=op(r,i.headers),e.headers=r)}return e},VD=(()=>{let t=!1,e=!1;const r=typeof globalThis.ReadableStream=="function",n=typeof globalThis.Request=="function";if(r&&n)try{e=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type")}catch(i){if(i instanceof Error&&i.message==="unsupported\
|
|
1113
1113
|
BodyInit type")return!1;throw i}return t&&!e})(),zD=typeof globalThis.AbortController=="function",GD=typeof globalThis.ReadableStream=="function",WD=typeof globalThis.FormData=="function",up=["get","post","put","patch","head","delete"],KD={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Na=2147483647,cp=Symbol("stop"),YD={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,
|
|
1114
|
-
fetch:!0},
|
|
1114
|
+
fetch:!0},XD={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},JD=t=>up.includes(t)?t.toUpperCase():t,QD=["get","put","head","delete","options","trace"],ZD=[408,413,429,500,502,503,504],ev=[413,429,503],lp={limit:2,methods:QD,statusCodes:ZD,afterStatusCodes:ev,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:t=>.3*2**(t-1)*1e3},
|
|
1115
1115
|
tv=(t={})=>{if(typeof t=="number")return{...lp,limit:t};if(t.methods&&!Array.isArray(t.methods))throw new Error("retry.methods must be an array");if(t.statusCodes&&!Array.isArray(t.statusCodes))throw new Error("retry.statusCodes must be an array");return{...lp,...t}};async function rv(t,e,r,n){return new Promise((i,s)=>{const o=setTimeout(()=>{r&&r.abort(),s(new sp(t))},n.timeout);n.fetch(t,e).then(i).catch(s).then(()=>{clearTimeout(o)})})}async function nv(t,{signal:e}){return new Promise((r,n)=>{
|
|
1116
|
-
e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(s),n(e.reason)}const s=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}const iv=(t,e)=>{const r={};for(const n in e)!(n in
|
|
1116
|
+
e&&(e.throwIfAborted(),e.addEventListener("abort",i,{once:!0}));function i(){clearTimeout(s),n(e.reason)}const s=setTimeout(()=>{e?.removeEventListener("abort",i),r()},t)})}const iv=(t,e)=>{const r={};for(const n in e)!(n in XD)&&!(n in YD)&&!(n in t)&&(r[n]=e[n]);return r};class Yi{static create(e,r){const n=new Yi(e,r),i=async()=>{if(typeof n._options.timeout=="number"&&n._options.timeout>Na)throw new RangeError(`The \`timeout\` option cannot be greater than ${Na}`);await Promise.resolve();let a=await n.
|
|
1117
1117
|
_fetch();for(const u of n._options.hooks.afterResponse){const l=await u(n.request,n._options,n._decorateResponse(a.clone()));l instanceof globalThis.Response&&(a=l)}if(n._decorateResponse(a),!a.ok&&n._options.throwHttpErrors){let u=new ip(a,n.request,n._options);for(const l of n._options.hooks.beforeError)u=await l(u);throw u}if(n._options.onDownloadProgress){if(typeof n._options.onDownloadProgress!="function")throw new TypeError("The `onDownloadProgress` option must be a function");if(!GD)throw new Error(
|
|
1118
1118
|
"Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(a.clone(),n._options.onDownloadProgress)}return a},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(i):i();for(const[a,u]of Object.entries(KD))o[a]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||u);const l=await o;if(a==="json"){if(l.status===204||(await l.clone().arrayBuffer()).byteLength===0)return"";if(r.parseJson)return r.parseJson(await l.text())}
|
|
1119
|
-
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:op(this._input.headers,r.headers),hooks:ap({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:
|
|
1119
|
+
return l[a]()};return o}request;abortController;_retryCount=0;_input;_options;constructor(e,r={}){if(this._input=e,this._options={...r,headers:op(this._input.headers,r.headers),hooks:ap({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:JD(r.method??this._input.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:tv(r.retry),throwHttpErrors:r.throwHttpErrors!==!1,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis)},typeof this._input!="string"&&
|
|
1120
1120
|
!(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.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(zD){this.abortController=new globalThis.AbortController;const n=this._options.
|
|
1121
1121
|
signal??this._input.signal;n?.aborted&&this.abortController.abort(n?.reason),n?.addEventListener("abort",()=>{this.abortController.abort(n.reason)}),this._options.signal=this.abortController.signal}if(VD&&(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.set("content-type",this._options.headers.get("content-type")??"application/json")),this.request=new globalThis.
|
|
1122
1122
|
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()),s=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,i);(WD&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)&&!(this._options.headers&&this._options.headers["content-type"])&&this.request.headers.delete("content-type"),this.request=
|
|
@@ -1128,17 +1128,17 @@ r({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array);async function a()
|
|
|
1128
1128
|
on"&&(r=r(t??{})),Ta(zi(t,r))),e.stop=cp,e},sv=Ta(),Wi=Object.create(null),sn=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Wi:globalThis),Vt=new Proxy(Wi,{get(t,e){return sn()[e]??Wi[e]},has(t,e){const r=sn();return e in r||e in Wi},set(t,e,r){const n=sn(!0);return n[e]=r,!0},deleteProperty(t,e){if(!e)return!1;const r=sn(!0);return delete r[e],!0},ownKeys(){const t=sn(!0);return Object.keys(t)}}),fp=typeof process<"u"&&process.env&&process.
|
|
1129
1129
|
env.NODE_ENV||"",ov=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRON\
|
|
1130
1130
|
E"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCE\
|
|
1131
|
-
L_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function av(){if(globalThis.process?.env)for(const t of ov){const e=t[1]||t[0];if(globalThis.process?.env[e])return{
|
|
1132
|
-
process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const dp=av();dp.name;function fr(t){return t?t!=="false":!1}const uv=globalThis.process?.platform||"",hp=fr(Vt.CI)||dp.ci!==!1,pp=fr(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);fr(Vt.DEBUG);const cv=fp==="test"||fr(Vt.TEST),lv=fr(Vt.MINIMAL)||hp||cv||!pp,fv=/^win/i.test(uv);!fr(Vt.NO_COLOR)&&(fr(Vt.FORCE_COLOR)||
|
|
1133
|
-
versions?.node||"").replace(/^v/,"")||null;Number(dv?.split(".")[0]);const hv=globalThis.process||Object.create(null),mp={versions:{}};new Proxy(hv,{get(t,e){if(e==="env")return Vt;if(e in t)return t[e];if(e in mp)return mp[e]}});const pv=globalThis.process?.release?.name==="node",mv=!!globalThis.Bun||!!globalThis.process?.versions?.bun,gv=!!globalThis.Deno,yv=!!globalThis.fastly,Ev=!!globalThis.Netlify,Dv=!!globalThis.EdgeRuntime,vv=globalThis.navigator?.
|
|
1134
|
-
"netlify"],[Dv,"edge-light"],[vv,"workerd"],[yv,"fastly"],[gv,"deno"],[mv,"bun"],[pv,"node"]];function _v(){const t=$v.find(e=>e[0]);if(t)return{name:t[1]}}const wv=_v();wv?.name;const La=new HD({projectName:Ip,serialize:t=>Ct.stringify(t,null,2),deserialize:t=>Ct.parse(t)}),bv=1e3*60*60*24,gp="check-update";function Av(){if(lv||fp===gp)return;const t=La.get("lastUpdateCheck"),e=La.get("latestVersion");if(Fp(e)||
|
|
1135
|
-
detached:!0,env:{NODE_ENV:gp}}).catch(()=>{})}catch{}e&&Oa.gt(e,dr)&&zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(e)].join(""))}async function Cv(){try{const t=await Sv();os(t,"No version found in latest npm"),La.set({lastUpdateCheck:Date.now(),latestVersion:t}),Oa.gt(t,dr)?zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(t)].join("")):zt(K.dim("Up to date: ")+" "+K.green(dr))}catch(t){za.error(Np(t))}}async function Sv(){
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
dim("format")} ${K.green(e)}`),n.info(`${K.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=_c;break;case"mermaid":i=".mmd",s=wc;break;default:tu(e)}const o=new Set,a=await t.diagrams();let u=0;for(const l of a)try{let c=l.relativePath??".";c.includes("/")?c=c.slice(0,c.lastIndexOf("/")):c=".",c!==""&&!o.has(c)&&(await $t(De(r,c),{recursive:!0}),o.add(c));const d=De(r,c,l.id+i),h=s(l);await Kt(d,h),n.info(`${K.dim("generated")} ${Wt(process.cwd(),
|
|
1139
|
-
generating ${l.id}`,{error:c})}u>0&&n.info(`${K.dim("total")} ${u} files`)}async function Ki({path:t,useDotBin:e,...r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if((await s.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await Rv(s,r.outfile,n);break}case"dot":{await Ov(s,r.outdir??t,n);break}case"
|
|
1140
|
-
r.outdir??t,n);break}default:tu(r)}i.stopAndLog()}async function Fv({path:t,useDotBin:e,outfile:r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${K.dim("format")} ${K.green("model")}`);const o=await s.layoutedModel();for(const d of o.views())d.$view.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id));let a=De(s.workspace,"likec4-model
|
|
1141
|
-
r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const u=on(a);n.info(`${K.dim("filename")} ${u}`);const l=Or(u).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${r} has extension "${l}"`),new Error(`output file ${r} must be a .ts, .mts or .cts file`);const c=Gt(a);n.info(`${K.dim("outdir")} ${c}`),await $t(c,{recursive:!0}),await Kt(a,wg(o),{encoding:"utf-8"}),zt(Qi(`
|
|
1131
|
+
L_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["CODESANDBOX","CODESANDBOX_HOST",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function av(){if(globalThis.process?.env)for(const t of ov){const e=t[1]||t[0];if(globalThis.process?.env[e])return{
|
|
1132
|
+
name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const dp=av();dp.name;function fr(t){return t?t!=="false":!1}const uv=globalThis.process?.platform||"",hp=fr(Vt.CI)||dp.ci!==!1,pp=fr(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);fr(Vt.DEBUG);const cv=fp==="test"||fr(Vt.TEST),lv=fr(Vt.MINIMAL)||hp||cv||!pp,fv=/^win/i.test(uv);!fr(Vt.NO_COLOR)&&(fr(Vt.FORCE_COLOR)||
|
|
1133
|
+
(pp||fv)&&Vt.TERM);const dv=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(dv?.split(".")[0]);const hv=globalThis.process||Object.create(null),mp={versions:{}};new Proxy(hv,{get(t,e){if(e==="env")return Vt;if(e in t)return t[e];if(e in mp)return mp[e]}});const pv=globalThis.process?.release?.name==="node",mv=!!globalThis.Bun||!!globalThis.process?.versions?.bun,gv=!!globalThis.Deno,yv=!!globalThis.fastly,Ev=!!globalThis.Netlify,Dv=!!globalThis.EdgeRuntime,vv=globalThis.navigator?.
|
|
1134
|
+
userAgent==="Cloudflare-Workers",$v=[[Ev,"netlify"],[Dv,"edge-light"],[vv,"workerd"],[yv,"fastly"],[gv,"deno"],[mv,"bun"],[pv,"node"]];function _v(){const t=$v.find(e=>e[0]);if(t)return{name:t[1]}}const wv=_v();wv?.name;const La=new HD({projectName:Ip,serialize:t=>Ct.stringify(t,null,2),deserialize:t=>Ct.parse(t)}),bv=1e3*60*60*24,gp="check-update";function Av(){if(lv||fp===gp)return;const t=La.get("lastUpdateCheck"),e=La.get("latestVersion");if(Fp(e)||Ji(t)||t+bv<Date.now())try{Pp("likec4",["ch\
|
|
1135
|
+
eck-update"],{stdio:"ignore",preferLocal:!0,detached:!0,env:{NODE_ENV:gp}}).catch(()=>{})}catch{}e&&Oa.gt(e,dr)&&zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(e)].join(""))}async function Cv(){try{const t=await Sv();os(t,"No version found in latest npm"),La.set({lastUpdateCheck:Date.now(),latestVersion:t}),Oa.gt(t,dr)?zt(["Update available: ",K.dim(dr),K.reset(" \u2192 "),K.green(t)].join("")):zt(K.dim("Up to date: ")+" "+K.green(dr))}catch(t){za.error(Np(t))}}async function Sv(){
|
|
1136
|
+
return(await sv("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}async function Rv(t,e,r){const n=".ts";e=e??De(t.workspace,"likec4.generated"+n),Or(e)!==n&&(e=e+n),await $t(Gt(e),{recursive:!0});const i=await t.diagrams(),s=Ag([...i]);await Kt(e,s),r.info(`${K.dim("generated")} ${Wt(process.cwd(),e)}`)}async function Ov(t,e,r){await $t(e,{recursive:!0}),r.info(`${K.dim("format")}\
|
|
1137
|
+
${K.green("dot")}`),r.info(`${K.dim("outdir")} ${e}`);const n=new Set,i=await t.viewsService.computedViews();let s=0;for(const o of i)try{const a=await t.viewsService.layouter.dot(o),u=o.relativePath??"";u!==""&&!n.has(u)&&(await $t(De(e,u),{recursive:!0}),n.add(u));const l=De(e,u,o.id+".dot");await Kt(l,a),r.info(`${K.dim("generated")} ${Wt(process.cwd(),l)}`),s++}catch(a){za.error(`error while generating ${o.id}`,{error:a})}s>0&&r.info(`${K.dim("total")} ${s} files`)}async function Iv(t,e,r,n){
|
|
1138
|
+
await $t(r,{recursive:!0}),n.info(`${K.dim("format")} ${K.green(e)}`),n.info(`${K.dim("outdir")} ${r}`);let i,s;switch(e){case"d2":i=".d2",s=_c;break;case"mermaid":i=".mmd",s=wc;break;default:tu(e)}const o=new Set,a=await t.diagrams();let u=0;for(const l of a)try{let c=l.relativePath??".";c.includes("/")?c=c.slice(0,c.lastIndexOf("/")):c=".",c!==""&&!o.has(c)&&(await $t(De(r,c),{recursive:!0}),o.add(c));const d=De(r,c,l.id+i),h=s(l);await Kt(d,h),n.info(`${K.dim("generated")} ${Wt(process.cwd(),
|
|
1139
|
+
d)}`),u++}catch(c){n.error(`error while generating ${l.id}`,{error:c})}u>0&&n.info(`${K.dim("total")} ${u} files`)}async function Ki({path:t,useDotBin:e,...r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});if((await s.viewsService.computedViews()).length===0)throw n.warn("no views found"),process.exitCode=1,new Error("no views found");switch(r.format){case"views":{await Rv(s,r.outfile,n);break}case"dot":{await Ov(s,r.outdir??t,n);break}case"\
|
|
1140
|
+
d2":case"mermaid":{await Iv(s,r.format,r.outdir??t,n);break}default:tu(r)}i.stopAndLog()}async function Fv({path:t,useDotBin:e,outfile:r}){const n=pt("c4:codegen"),i=Sr(n),s=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});n.info(`${K.dim("format")} ${K.green("model")}`);const o=await s.layoutedModel();for(const d of o.views())d.$view.hasLayoutDrift&&n.warn(K.yellow("drift detected, manual layout can not be applied, view:")+" "+K.red(d.id));let a=De(s.workspace,"likec4-model.\
|
|
1141
|
+
ts");if(r&&(a=ns(r)?r:De(r),Pt(r)&&(await ss(r)).isDirectory()))throw new Error(`output file is a directory: ${r}`);const u=on(a);n.info(`${K.dim("filename")} ${u}`);const l=Or(u).toLocaleLowerCase();if(![".ts",".mts",".cts"].includes(l))throw n.error(`output file ${r} has extension "${l}"`),new Error(`output file ${r} must be a .ts, .mts or .cts file`);const c=Gt(a);n.info(`${K.dim("outdir")} ${c}`),await $t(c,{recursive:!0}),await Kt(a,wg(o),{encoding:"utf-8"}),zt(Qi(`
|
|
1142
1142
|
${K.dim("Source with LikeC4Model generated:")}
|
|
1143
1143
|
${Wt(Zi(),a)}
|
|
1144
1144
|
|
|
@@ -1156,7 +1156,7 @@ ile ${r} has extension "${c}"`),new Error(`output file ${r} must be a .js, .jsx
|
|
|
1156
1156
|
${K.underline("https://likec4.dev/tooling/code-generation/react/")}
|
|
1157
1157
|
`),{padding:2,borderColor:"green",borderStyle:"round"}),i.stopAndLog()}async function Tv({path:t,useDotBin:e,webcomponentPrefix:r="likec4",outfile:n}){const i=pt("c4:codegen"),s=Sr(i),o=await gt.fromWorkspace(t,{logger:"vite",graphviz:e?"binary":"wasm"});i.info(`${K.dim("format")} ${K.green("webcomponent")}`);const a=await o.diagrams();if(!Ga(a,1))throw i.warn("no views found"),process.exitCode=1,new Error("no views found");a.forEach($=>{$.hasLayoutDrift&&i.warn(K.yellow("drift detected, manua\
|
|
1158
1158
|
l layout can not be applied, view:")+" "+K.red($.id))});let u=De(o.workspace,"likec4-views.js");if(n&&(u=ns(n)?n:De(n),Pt(n)&&(await ss(n)).isDirectory()))throw new Error(`output file is a directory: ${n}`);mt.debug(`${K.dim("outfilepath")} ${u}`);const l=on(u);mt.debug(`${K.dim("filename")} ${l}`);const c=Or(l).toLocaleLowerCase();if(c!==".js"&&c!==".mjs")throw mt.warn(`output file ${n} has extension "${c}"`),new Error(`output file ${n} must be a .js or .mjs`);const d=await Os();mt.debug(`${K.dim(
|
|
1159
|
-
"created temp public")} ${d}`);const h=await co({languageServices:o,outDir:d,filename:l,webcomponentPrefix:r,base:"/"});mt.debug(`${K.dim("vite build webcomponent")}`),await Fr({...h,logLevel:"warn"});const E=De(d,l);if(!Pt(E))throw new Error(`output file not found: ${E}`);await $t(Gt(u),{recursive:!0}),await
|
|
1159
|
+
"created temp public")} ${d}`);const h=await co({languageServices:o,outDir:d,filename:l,webcomponentPrefix:r,base:"/"});mt.debug(`${K.dim("vite build webcomponent")}`),await Fr({...h,logLevel:"warn"});const E=De(d,l);if(!Pt(E))throw new Error(`output file not found: ${E}`);await $t(Gt(u),{recursive:!0}),await Xp(E,u),i.info(`${K.dim("generated")} ${u}`),mt.debug(`${K.dim("remove temp public")}`),await Jp(d,{recursive:!0,force:!0}),zt(Qi(`
|
|
1160
1160
|
${K.dim("Webcomponents generated to:")}
|
|
1161
1161
|
${Wt(Zi(),u)}
|
|
1162
1162
|
|